upstart-1.13.2/0000775000175000017500000000000012402042421010272 500000000000000upstart-1.13.2/m4/0000775000175000017500000000000012402042411010611 500000000000000upstart-1.13.2/m4/lib-link.m40000644000175000017500000007205512373101360012511 00000000000000# lib-link.m4 serial 13 (gettext-0.17) dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.54) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Autoconf >= 2.61 supports dots in --with options. define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], [ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` LIB[]NAME[]_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) upstart-1.13.2/m4/nls.m40000644000175000017500000000226612373101360011601 00000000000000# nls.m4 serial 3 (gettext-0.15) dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) upstart-1.13.2/m4/lt~obsolete.m40000644000175000017500000001375612373101364013371 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) upstart-1.13.2/m4/progtest.m40000644000175000017500000000555012373101360012653 00000000000000# progtest.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. AC_PREREQ(2.50) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) upstart-1.13.2/m4/intlmacosx.m40000644000175000017500000000456512373101360013172 00000000000000# intlmacosx.m4 serial 1 (gettext-0.17) dnl Copyright (C) 2004-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on MacOS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], gt_cv_func_CFPreferencesCopyAppValue, [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) upstart-1.13.2/m4/ltversion.m40000644000175000017500000000126212373101364013031 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) upstart-1.13.2/m4/libnih.m40000644000175000017500000001725112373101363012255 00000000000000# libnih # # libnih.m4 - autoconf macros # # Copyright © 2010 Scott James Remnant . # Copyright © 2010 Canonical Ltd. # # This file is free software; the author gives unlimited permission to # copy and/or distribute it, with or without modifications, as long as # this notice is preserved. # This MUST be incremented for any changes to this file, otherwise aclocal # may overwrite the local copy in the libnih source tree with any installed # version. # serial 2 libnih.m4 # NIH_COMPILER_WARNINGS # --------------------- # Add configure option to enable additional compiler warnings and treat # them as errors. AC_DEFUN([NIH_COMPILER_WARNINGS], [AC_ARG_ENABLE(compiler-warnings, AS_HELP_STRING([--enable-compiler-warnings], [Enable additional compiler warnings]), [AS_IF([test "x$enable_compiler_warnings" = "xyes"], [AS_IF([test "x$GCC" = "xyes"], [CFLAGS="-Wall -Wextra -Wno-empty-body -Wno-missing-field-initializers -Wno-unused-parameter -Wformat-security -Werror -D_FORTIFY_SOURCE=2 $CFLAGS"]) AS_IF([test "x$GXX" = "xyes"], [CXXFLAGS="-Wall -Wextra -Wno-empty-body -Wno-missing-field-initializers -Wno-unused-parameter -Wformat-security -Werror -D_FORTIFY_SOURCE=2 $CXXFLAGS"])]) ])dnl ])# NIH_COMPILER_WARNINGS # NIH_COMPILER_OPTIMISATIONS # -------------------------- # Add configure option to disable optimisations. AC_DEFUN([NIH_COMPILER_OPTIMISATIONS], [AC_ARG_ENABLE(compiler-optimisations, AS_HELP_STRING([--disable-compiler-optimisations], [Disable compiler optimisations]), [AS_IF([test "x$enable_compiler_optimisations" = "xno"], [[CFLAGS=`echo "$CFLAGS" | sed -e "s/ -O[1-9s]*\b/ -O0/g"` CXXFLAGS=`echo "$CXXFLAGS" | sed -e "s/ -O[1-9s]*\b/ -O0/g"`]]) ])dnl ])# NIH_COMPILER_OPTIMISATIONS # NIH_LINKER_OPTIMISATIONS # ------------------------ # Add configure option to disable linker optimisations. AC_DEFUN([NIH_LINKER_OPTIMISATIONS], [AC_ARG_ENABLE(linker-optimisations, AS_HELP_STRING([--disable-linker-optimisations], [Disable linker optimisations]), [AS_IF([test "x$enable_linker_optimisations" = "xno"], [LDFLAGS=`echo "$LDFLAGS" | sed -e "s/ -Wl,-O[0-9]*\b//g"`], [LDFLAGS="$LDFLAGS -Wl,-O1"]) ])dnl ])# NIH_LINKER_OPTIMISATIONS # NIH_COMPILER_COVERAGE # --------------------- # Add configure option to enable coverage data. AC_DEFUN([NIH_COMPILER_COVERAGE], [AC_ARG_ENABLE(compiler-coverage, AS_HELP_STRING([--enable-compiler-coverage], [Enable generation of coverage data]), [AS_IF([test "x$enable_compiler_coverage" = "xyes"], [AS_IF([test "x$GCC" = "xyes"], [CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"]) AS_IF([test "x$GXX" = "xyes"], [CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"])]) ])dnl ])# NIH_COMPILER_COVERAGE # NIH_LINKER_VERSION_SCRIPT # ------------------------- # Detect whether the linker supports version scripts AC_DEFUN([NIH_LINKER_VERSION_SCRIPT], [AC_CACHE_CHECK([for linker version script argument], [nih_cv_version_script], [nih_cv_version_script=none for nih_try_arg in "-Wl,--version-script"; do nih_old_libs="$LIBS" LIBS="$LIBS $nih_try_arg=conftest.ver" cat >conftest.ver < #include #include /* Variadic macro arguments */ #define variadic_macro(foo, ...) printf(foo, __VA_ARGS__) ], [ /* Compound initialisers */ struct { int a, b; } foo = { .a = 1, .b = 2 }; /* Boolean type */ bool bar = false; /* Specific size type */ uint32_t baz = 0; /* C99-style for-loop declarations */ for (int i = 0; i < 10; i++) continue; /* Magic __func__ variable */ printf("%s", __func__); ], [$1], [$2])dnl ])# NIH_TRY_C99 # NIH_C_C99 # --------- # Check whether the compiler can do C99, adding a compiler flag if # necessary. AC_DEFUN([NIH_C_C99], [AC_CACHE_CHECK([whether compiler supports C99 features], [nih_cv_c99], [NIH_TRY_C99([nih_cv_c99=yes], [nih_cv_c99=no])]) AS_IF([test "x$nih_cv_c99" = "xyes"], [AC_DEFINE([HAVE_C99], 1, [Define to 1 if the compiler supports C99.])], [AC_CACHE_CHECK([what argument makes compiler support C99 features], [nih_cv_c99_arg], [nih_cv_c99_arg=none nih_save_CC="$CC" for arg in "-std=gnu99" "-std=c99" "-c99"; do CC="$nih_save_CC $arg" NIH_TRY_C99([nih_arg_worked=yes], [nih_arg_worked=no]) CC="$nih_save_CC" AS_IF([test "x$nih_arg_worked" = "xyes"], [nih_cv_c99_arg="$arg"; break]) done]) AS_IF([test "x$nih_cv_c99_arg" != "xnone"], [CC="$CC $nih_cv_c99_arg" AC_DEFINE([HAVE_C99], 1)])])[]dnl ])# NIH_C_C99 # NIH_C_THREAD # ------------ # Check whether compiler supports __thread. AC_DEFUN([NIH_C_THREAD], [AC_ARG_ENABLE(threading, AS_HELP_STRING([--enable-threading], [Enable support for multi-threading]), [], [enable_threading=no])dnl AS_IF([test "x$enable_threading" != "xno" ], [AC_CACHE_CHECK([whether compiler supports __thread], [nih_cv_c_thread], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int __thread a;]], [])], [nih_cv_c_thread=yes], [nih_cv_c_thread=no])]) AS_IF([test "x$nih_cv_c_thread" = "xno"], [AC_DEFINE([__thread],, [Define to empty if `__thread' is not supported.])])], [AC_DEFINE([__thread], )])dnl ])# NIH_C_THREAD # NIH_COPYRIGHT # -------------- # Wraps the Autoconf AC_COPYRIGHT but also defines PACKAGE_COPYRIGHT, # required for nih_main_init AC_DEFUN([NIH_COPYRIGHT], [AC_COPYRIGHT([$1]) m4_ifndef([NIH_PACKAGE_COPYRIGHT], [m4_bmatch([$1], [ ], [], [ m4_define([NIH_PACKAGE_COPYRIGHT], ["m4_bpatsubst([AS_ESCAPE([$1])], [©], [(C)])"]) AC_DEFINE([PACKAGE_COPYRIGHT], [NIH_PACKAGE_COPYRIGHT], [Define to the copyright message of this package.])])])dnl AC_SUBST([PACKAGE_COPYRIGHT], ["$1"]) ])# AC_COPYRIGHT # NIH_WITH_LOCAL_LIBNIH # --------------------- # Adds a configure option to build with a local libnih. AC_DEFUN([NIH_WITH_LOCAL_LIBNIH], [AC_ARG_WITH(local-libnih, AS_HELP_STRING([[[--with-local-libnih[=DIR]]]], [Use libnih from source tree DIR]), [AS_IF([test "x$with_local_libnih" != "xno"], [AS_IF([! test -f "$withval/nih/alloc.c"], [AC_MSG_ERROR([$withval doesn't look like a libnih source tree])]) nih_dir="`cd $withval && pwd`" NIH_CFLAGS="-I\"$nih_dir\"" NIH_LIBS="\"$nih_dir/nih/libnih.la\"" NIH_DBUS_CFLAGS="-I\"$nih_dir\"" NIH_DBUS_LIBS="\"$nih_dir/nih-dbus/libnih-dbus.la\"" NIH_DBUS_TOOL="\"$nih_dir/nih-dbus-tool/nih-dbus-tool\""])]) ])# NIH_WITH_LOCAL_LIBNIH upstart-1.13.2/m4/libtool.m40000644000175000017500000106011112373101364012447 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS upstart-1.13.2/m4/iconv.m40000644000175000017500000001375312373101360012126 00000000000000# iconv.m4 serial AM6 (gettext-0.17) dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_TRY_RUN([ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) upstart-1.13.2/m4/lib-prefix.m40000644000175000017500000001503612373101360013045 00000000000000# lib-prefix.m4 serial 5 (gettext-0.15) dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing dnl the basename of the libdir, either "lib" or "lib64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. The current dnl practice is that on a system supporting 32-bit and 64-bit instruction dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit dnl libraries go under $prefix/lib. We determine the compiler's default dnl mode by looking at the compiler's library search path. If at least dnl of its elements ends in /lib64 or points to a directory whose absolute dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the dnl default, namely "lib". acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ]) upstart-1.13.2/m4/ltoptions.m40000644000175000017500000003007312373101364013041 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) upstart-1.13.2/m4/ltsugar.m40000644000175000017500000001042412373101364012465 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) upstart-1.13.2/m4/po.m40000644000175000017500000004460612373101360011427 00000000000000# po.m4 serial 15 (gettext-0.17) dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.17]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # PKG_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable pkgconfigdir as the location where a module # should install pkg-config .pc files. By default the directory is # $libdir/pkgconfig, but the default can be changed by passing # DIRECTORY. The user can override through the --with-pkgconfigdir # parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_INSTALLDIR # PKG_NOARCH_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable noarch_pkgconfigdir as the location where a # module should install arch-independent pkg-config .pc files. By # default the directory is $datadir/pkgconfig, but the default can be # changed by passing DIRECTORY. The user can override through the # --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_NOARCH_INSTALLDIR # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------- # Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR upstart-1.13.2/m4/lib-ld.m40000644000175000017500000000653112373101360012147 00000000000000# lib-ld.m4 serial 3 (gettext-0.13) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) upstart-1.13.2/m4/gettext.m40000644000175000017500000003457012373101360012474 00000000000000# gettext.m4 serial 60 (gettext-0.17) dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) upstart-1.13.2/test-driver0000755000175000017500000001027712373101367012431 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: upstart-1.13.2/ChangeLog0000664000175000017500000173725612402042256012017 000000000000002014-09-04 James Hunt * NEWS: Release 1.13.2 2014-08-29 James Hunt * init/cgroup.c: - Removed nih_debug() and nih_warn() calls since, although useful, this output pollutes job logs when running in debug mode. - cgroup_clear(): New function to request cgroups be removed. - cgroup_create(): Don't mark cgroups 'remove-on-empty' since Upstart can race with cgmanager. * init/job.c: job_last_process(): New helper function. * init/job_process.c: - job_process_spawn_with_fd(): Request that the cgroup manager destroy all job cgroups after upstart has created required cgroups for last job process which avoids the 'remove-on-empty' race (LP: #1357252). - job_process_error_handler(): Added handling for new JOB_PROCESS_ERROR_CGROUP_CLEAR error. * init/job_process.h: JobProcessErrorType: Added new JOB_PROCESS_ERROR_CGROUP_CLEAR error. * init/tests/test_job.c: test_job_last_process(): New test for job_last_process(). 2014-08-14 James Hunt * init/control.c: Disallow modifying system jobs via SetEnv, UnsetEnv or ResetEnv calls (LP: #1356824). 2014-07-16 James Hunt * NEWS: Release 1.13.1 2014-07-16 James Hunt * init/environ.c: environ_remove(): - Ensure removed entry is deref'd (LP: #1222705). - Avoid recreating array. * init/tests/test_environ.c: test_remove(): Add checks to ensure removed entry freed as expected. 2014-07-11 James Hunt * NEWS: Release 1.13 2014-07-09 James Hunt * init/job_process.c: Unhide job_process_error_abort() to allow it to be called by the tests. * init/tests/test_job_process.c: RESILIENT_TEST_CHILD(): New macro to work around a bug in NIH's TEST_CHILD() where it doesn't handle EINTR. * init/tests/test_job_process.c: test_handler(): New tests to ensure async handling can cope with both 'waitid() before select()' and vice versa: - "with child exit notification before child setup success notification" - "with child exit notification before child setup failure notification" - "with child setup success notification before child exit notification" - "with child setup failure notification before child exit notification" 2014-07-08 James Hunt * init/main.c: main(): - Only create inotify watches if not restarting or if performing a stateless re-exec (LP: #1338637). * init/job_process.c: - job_process_data_serialise(): - Unconditionally toggle CLOEXEC for job_process_fd (LP: #1338968). - Disregard valid flag when toggling CLOEXEC for script_fd since if the JobProcessData still exists, we need the fd to persist across the re-exec. - job_process_data_deserialise(): As above. 2014-07-07 James Hunt * init/tests/test_job_process.c: test_handler(): - Remove logs generated by PROCESS_MAIN. This wasn't necessary before due to the manifestation of LP: #1302117 not restoring the correct umask. 2014-07-03 James Hunt * init/job_process.c: - job_process_data_serialise(): Serialise status. - job_process_data_deserialise(): Deserialise status. * init/tests/data/upstart-1.13.json: Add missing JobProcessData->status. * init/tests/test_state.c: test_cgroup_and_process_data_state(): - Ensure JobProcessData recreated in expected form. 2014-07-02 James Hunt * init/tests/data/upstart-1.13.json: Updated with new content containing both more cgroup stanza jobs and a job with a job process whose child setup is "in-flight", representing the JobProcessData in the JSON as 'process_data'. * init/tests/test_state.c: test_cgroup_and_process_data_state(): - Renamed from test_cgroup_state(). - Made cgroup guards more fine-grainded to ensure this test always runs, but only tests cgroup content if built with cgroup support. - Pre-process the JSON to pass a valid fd to allow the deserialisation of the JobProcessData to succeed. 2014-06-04 James Hunt * dbus/com.ubuntu.Upstart.xml: Renamed SetEnvMulti to SetEnvList and UnsetEnvMulti to UnsetEnvList for clarity. * init/control.c: - control_set_env_list(): Renamed from control_set_env_multi(). - control_unset_env_list(): Renamed from control_unset_env_multi(). - control_unset_env(): Actually make it call control_unset_env_list(). * util/initctl.c: Updated to call renamed functions. 2014-06-02 James Hunt * dbus/com.ubuntu.Upstart.xml: Added 'SetEnvMulti' and 'UnsetEnvMulti' methods to allow multiple job environment variables to be set/unset simultaneously (LP: #1324096). * init/control.c: - control_set_env_multi(): Implementation for 'SetEnvMulti'. - control_set_env(): Retained 'SetEnv' implementation that now calls control_set_env_multi(). - control_unset_env_multi(): Implementation for 'UnSetEnvMulti'. * util/initctl.c: - set_env_action(): Updated to call set_env_multi_sync(). - unset_env_action(): Updated to call unset_env_multi_sync(). * util/man/initctl.8: Updated to document ability for 'set-env' and 'unset-env' to set and unset multiple variables simultaneously. * util/tests/test_initctl.c: Added new tests: - "multiple set-env in 'name=value' form" - "multiple set-env in 'name=' form" - "multiple set-env in 'name' form" - "set-env for multiple already set variables" - "set-env with multiple variables, some already set" - "set-env with multiple variables in different forms" - "set-env --retain with multiple variables, some already set" 2014-05-21 James Hunt * init/main.c: Add support for '--prepend-confdir'. * init/man/init.8: Add '--prepend-confdir'. * init/tests/test_main.c: Add tests for '--prepend-confdir'. 2014-05-09 James Hunt * init/main.c: add '--append-confdir' command-line option (LP: #1315060). * init/man/init.8: - Document '--append-confdir'. - Add init(5) reference for '--confdir'. * init/tests/test_main.c: New Session and System init tests for '--append-confdir'. 2014-05-09 Dimitri John Ledkov * util/reboot.c: only use rebootcommand code path in runlevels 0, 6 or when force is specified as per intended documented behavior in the manpage. This corrects the bug when rebootcommand mode was used in error whenever an argument to reboot was passed. (LP: #1174272) 2014-05-07 James Hunt * Convert calls to deprecated json_object_object_get() to json_object_object_get_ex(). 2014-05-02 James Hunt * init/main.c: main(): Allow System Init read from multiple configuration to directories like a Session Init (LP: #1315060). * init/man/init.5: Clarify default directory. * init/man/init.8: Explain new behaviour. * init/tests/test_main.c: test_confdir(): Update tests for new '--confdir' behaviour of System init. 2014-04-24 James Hunt * init/man/init.5: - Clarify default behaviour of 'respawn' stanza. - Add missing 'respawn limit unlimited' details. 2014-04-10 James Hunt * init/log.c: log_file_open(): Restore umask after opening log file (LP: #1302117). * util/tests/test_initctl.c: test_reexec(): New test: - "ensure re-exec does not disrupt umask". 2014-03-11 James Hunt * NEWS: Release 1.12.1 2014-03-07 James Hunt * NEWS: Release 1.12 2014-03-06 James Hunt * lib/tests/test_libupstart.c: Revert to looking for 'init' rather than 'test_init'. * test/test_util_common.c: _start_upstart(): Don't modify argv[0] to make the tests inits appear as "test_init" since it breaks the re-exec tests (LP: #1288243). * util/tests/test_initctl.c: Revert to looking for "init' rather than 'test_init'. * init/job_process.c: job_process_spawn(): Comments. * init/main.c: main(): Enable the debug stanza when booting with '--debug' (switching log-level will not work). * init/parse_job.c: stanza_debug(): Conditionally disable the debug stanza. * init/control.c: - control_serialise_bus_address(), control_deserialise_bus_address(): New functions to handle carrying the control bus address across a re-exec (LP: #1258098). * init/state.c: - state_to_string(): Handle control bus address serialisation. - state_from_string(): Handle control bus address deserialisation. * util/tests/test_initctl.c: test_dbus_connection(): New test: - "ensure Session Init retains D-Bus address across a re-exec" 2014-03-06 James Hunt * lib/tests/test_libupstart.c: test_libupstart(): Another init => test_init fix. 2014-03-05 James Hunt * doc/states.dot: Added missing security state. * init/control.c: - control_set_env(): - Check permissions before anything else. - Explicit check on @var rather than an assert. - control_unset_env(): Explicit check on @name rather than an assert. - control_get_env(): Explicit check on @name. - control_reset_env(): Check permissions before anything else. * init/control.h: control_get_job(): - Pass @job_name to job_find() rather than hard-coded NULL. - Handle instance being NULL when raising NIH D-Bus error. * init/job.c: job_find(): Handle NULL job_name. * init/tests/test_control.c: - Typo. - New functions: - test_list_env(). - test_list_env(). - test_get_env(). - test_set_env(). - test_unset_env(). - test_reset_env(). * init/tests/test_job.c: test_job_find(): New function. * scripts/init-checkconf.sh: - Don't rely on D-Bus any more: spawn a Session Init instead since this is simpler and allows the two major limitations to be dropped. * scripts/man/init-checkconf.8: Updated date and limitations section. * init/job_class.c: job_class_stop(): Copy env rather than referencing a local variable (LP: #1222705). * init/tests/test_job_class.c: test_start(), test_stop(), test_restart(): Check job->env, job->start_env and job->stop-env. 2014-02-04 Cameron Norman * extra/upstart-socket-bridge.c: - epoll_watcher(): Fix missing breaks in a switch, move buffer and remove its nih_local usage. - job_add_socket(): added case for name_len being a AF_INET6 address. 2014-02-04 James Hunt * extra/man/socket-event.7: Environment variable is UPSTART_EVENTS, not UPSTART_JOB (LP: #1275308). 2014-01-22 James Hunt * init/main.c: logger_kmsg(): Use open(2) rather than fopen(3) to avoid stealing the console in an container: fopen(3) may not specify O_NOCTTY and Upstart should not own the console (LP: #1263738). 2014-01-20 Cameron Norman * extra/upstart-socket-bridge.c: Fixed indentation, used nih_local. * extra/man/socket-event.7: Added inet6 example. 2014-01-19 Kai Mast * extra/upstart-socket-bridge.c: Added IPv6 support (LP: #942955). 2014-01-17 James Hunt * init/conf.c: - conf_file_serialise(): Handle ConfFile's without an associated JobClass, resulting from an unparseable job configuration file (LP: #1269731). - conf_file_deserialise(): Comments. * init/job_class.c: job_class_deserialise_all(): Comments. * init/tests/test_conf.c: test_source_reload_file(): Add new tests: - "Invalid .conf file does not stop ConfFile being serialised". - "ConfFile with no JobClass can be deserialised". * scripts/pyupstart.py: - JobInstance:destroy(): Whitespace. - SessionInit::reexec(): Add a log message. * scripts/tests/test_pyupstart_session_init.py: - TestSessionUpstart: Add pid to ps output. - TestSessionInitReExec::test_session_init_reexec(): - Create an invalid job to ensure re-exec can handle it. - Use 'with' for handling re-exec exception. * scripts/tests/test_pyupstart_system_init.py: - TestSystemInitReExec::test_pid1_reexec(): - Create an invalid job to ensure re-exec can handle it. 2014-01-15 James Hunt * util/telinit.c: upstart_open(): Connect using private socket for systems without D-Bus. 2014-01-08 James Hunt * init/man/init.5: Explain valid syntax for stanzas accepting a signal (such as 'kill signal'). 2014-01-02 James Hunt * extra/man/upstart-udev-bridge.8: Corrected example event name (LP: #1265359). 2013-12-23 James Hunt * init/man/init.5: Comma-separate and sort SEE ALSO entries. * init/man/init.8: - Expand SEE ALSO section (debian bug#732128). - Removed duplicated Job States and Job Lifecycle sections. 2013-12-20 James Hunt * init/man/init.8: - Added Job States and Job Lifecycle sections (taken from Ubuntu+Debian specific upstart-events(7) since this information is distro-agnostic) (debian bug#732125). - Updated date+copyright. * util/man/initctl.8: - Added reference to Job States section in init(8). - Updated date+copyright. - Refer to job goals in start/stop/restart commands. - Explain actual semantics of restart (debian bug#732126). * init/man/init.5: Provide additional detail on start/stop on stanzas with respect to how Upstart deals with complex conditions containing multiple events (debian bug#732122). 2013-12-19 James Hunt * init/man/init.5: Provide more detail on setuid and setgid stanzas (debian bug#732127). 2013-11-23 Steve Langasek * init/tests/test_state.c: fix test case to not assume SIGUSR1 == 10; the numeric value may vary between platforms, what we actually care about is making sure that the deserialization output matches what was in the json - so check the numeric value, NOT the symbolic signal name. * init/tests/test_log.c: don't assume the root filesystem is not writable. If we want to make sure log data stays in the buffer instead of being flushed to disk, create a log file that we control and know can't be written to. 2013-11-16 Dmitrijs Ledkovs * init/xdg.c, util/Makefile.am, test/Makefile.am, init/conf.c: - juggle user_mode & session_file from xdg.c to conf.c - remove INITCTL_BUILD conditional compilation - make it possible to use the same xdg.o in both init & initctl - this is in preparation to handle subdir-objects automake option 2013-11-15 Steve Langasek * init/tests/test_state.c: test_log_serialise(): - simplify the test for unflushed logs; there's no need to let any writes to the logfile succeed before serializing, we only need one synchronization point to make sure we have a non-empty log buffer. - drop a spurious check of nih_io_watches at a point where its content cannot possibly have changed. * test/test_util_common.h: drop TIMED_BLOCK() macro, no longer used. 2013-11-14 James Hunt * test/test_util_common.c: _start_upstart(): Set name to "test_init" for consistency with TEST_DBUS() and to make it easier to avoid killing non-test Session Inits when developing new tests. 2013-11-14 James Hunt * NEWS: Release 1.11 2013-11-13 James Hunt * init/tests/test_state.c: test_log_serialise(): - Added extra checks on nih_io_watches. - Need to wait for logfile to be written to handle case where NIH encounters EAGAIN. * test/test_util_common.h: - Removed unused macros: - TEST_FORCE_WATCH_UPDATE_TIMEOUT() - TEST_FORCE_WATCH_UPDATE_TIMEOUT_SECS() - Added TIMED_BLOCK() macro. 2013-11-12 James Hunt * extra/man/socket-event.7: PATH => SOCKET_PATH. * init/Makefile.am: - Unset DBUS_SYSTEM_BUS_ADDRESS - Explain unsetting vars. - test_xdg: link to libtest_util_common. * init/tests/test_main.c: - Include config.h to avoid local NIH test run failure. - Remove test-specific XDG_CONFIG_HOME/XDG_RUNTIME_DIR handling and call test_common_setup() and test_common_cleanup() instead. * init/tests/test_xdg.c: Remove test-specific XDG_CONFIG_HOME/XDG_RUNTIME_DIR handling and call test_common_setup() and test_common_cleanup() instead. * test/test_util_common.c: Added test_common_setup() and test_common_cleanup(). * util/Makefile.am: - Unset DBUS_SYSTEM_BUS_ADDRESS - Explain unsetting vars. * util/tests/test_initctl.c: Remove test-specific XDG_CONFIG_HOME/XDG_RUNTIME_DIR handling and call test_common_setup() and test_common_cleanup() instead. 2013-11-04 James Hunt * test/test_util_common.h: WAIT_FOR_FILE(): Check @path not logfile. * util/tests/test_initctl.c: test_reexec(): Fixed behaviour and comments for test "ensure 'set-env --global' persists across session-init re-exec". 2013-11-03 James Hunt * init/job_class.c: - job_class_new(): Set umask for job to current value for Session Init by default (LP: #1240686). * init/job_process.c: Comments. * init/main.c: main(): Save current umask. * test/test_util_common.c: - start_upstart_common(): Add extra param for inheriting environment rather than hard-coding '--no-inherit-env'. - start_upstart(: Updated call to start_upstart_common(). * init/tests/test_main.c: Updated calls to start_upstart_common(). * test/test_util_common.h: START_UPSTART(): Updated call to start_upstart_common(). * util/tests/test_initctl.c: - Updated calls to start_upstart_common(). - test_umask(): New tests: - "ensure Session Init inherits umask by default" - "ensure Session Init defaults umask with '--no-inherit-env'" 2013-11-03 James Hunt * scripts/pyupstart.py: - dbus_encode(): Comments. - Upstart::_idle_create_job_cb(): Pass retain option. - Upstart::job_create(): Allow specification of retain option to keep job configuration file on object destruction. - Upstart::job_recreate(): New method to vivify a Job object using an existing job configuration file. - Job::__init__(): New 'retain' and 'reuse_path' options. - Job::get_instance(): New method to obtain a Jobs JobInstance. - Job::get_dbus_instance(): Renamed from get_instance(). - JobInstance::destroy(): NOP for 'retain'ed jobs. * scripts/tests/test_pyupstart_system_init.py: - test_pid1_reexec(): - Retain the job configuration to allow the object to be recreated after re-exec. * scripts/tests/test_pyupstart_session_init.py: - test_session_init_reexec: Add job creation for parity with test_pid1_reexec(). 2013-11-03 James Hunt * extra/upstart-file-bridge.c: - create_handler(): Use original_file() for directories (LP: #1221466, #1222702). - watched_dir_new(): Additional assert. - watched_file_new(): - Additional assert. - Store original directory path in file object to ensure reliable matching for directories. * scripts/tests/test_pyupstart_session_init.py: Added file bridge tests for directory creation, modification and deletion. 2013-10-25 James Hunt * dbus/com.ubuntu.Upstart.xml: Added 'NotifyDBusAddress' method. * init/control.c: - control_bus_open(): Connect to the D-Bus bus specified by control_bus_address when running as a Session Init (LP: #1203595, #1235649). - control_disconnected(): Display calculated bus type rather than hard-coding. - control_handle_bus_type(): Removed. - control_get_bus_type(): Determine type of D-Bus bus that will be used. - control_notify_dbus_address(): Implementation of D-Bus 'NotifyDBusAddress' method that sets control_bus_address. * init/main.c: - main(): - Just check USE_SESSION_BUS_ENV variable rather than calling control_handle_bus_type(). - Don't register SIGUSR1 handler for Session Init. - usr1_handler(): Display calculated bus type rather than hard-coding. * init/test_control.c: Updated strings used by tests which check error messages to include 'D-Bus'. * util/initctl.c: Added new 'notify-dbus-address' command. * util/man/initctl.8: - Documentation for new 'notify-dbus-address' command. - reset-env: Troff fix. - Explain '--user' implicit in user mode. * util/tests/test_initctl.c: test_dbus_connection(): New function providing the following new tests: - "ensure non-priv non-Session Init connects to D-Bus session bus on startup". - "ensure Session Init does not connect to D-Bus session bus on startup". - "ensure Session Init connects to D-Bus session bus when notified". - "ensure Session Init does not connect to another bus when notified twice". 2013-10-25 Steve Langasek * init/main.c, init/system.c, init/system.h: allow mount options to be passed to system_mount(), and pass the right options when mounting /dev/pts to match the permissions set by either initramfs-tools or mountall. LP: #1244763. 2013-10-24 James Hunt * init/environ.c: Comment. * init/job_process.c: Formatting. * init/test_environ.c: - test_add(): New test: - "using bare word with no corresponding variable set in environment" - test_remove(): New function ("the missing test") containing 8 new tests: - "remove name=value pair with empty table" - "remove bare name with empty table" - "remove name=value from table of size 1" - "remove bare name from table of size 1" - "remove first name=value entry from table of size 2" - "remove first bare name entry from table of size 2" - "remove last name=value entry from table of size 2" - "remove last bare name entry from table of size 2" * init/tests/test_state.c: Removed some redundant JSON upgrade tests and renamed some existing data files to reflect the serialisation format version they encapsulate. * test/test_util_common.c: get_initctl(): Added environment checks. 2013-10-23 Dmitrijs Ledkovs * extra/upstart-socket-bridge.c: use SOCKET_PATH in our event environment, instead of clobbering PATH. (LP: #1235480) 2013-10-23 James Hunt * util/initctl.h: IS_INIT_EVENT(): Ignore session end event when running in user mode (for 'check-config'). 2013-10-17 James Hunt * test/tests/test_util_check_env.c: - check_for_overlayfs(): Only consider temporary work area. 2013-10-16 James Hunt * test/tests/test_util_check_env.c: New test to look for overlayfs filesystems which could cause tests to fail. * test/Makefile.am: Added test_util_check_env meta-test. * test/test_util_common.c: Formatting. 2013-10-14 James Hunt * init/job_class.c: job_class_environment_clear(): Utility function exposed primarily to allow tests to invalidate job_environ. * init/tests/test_state.c: - Added appropriate calls to job_class_environment_clear(). - New JSON data tests added: - upstart-no-job-environ.json - upstart-with-job-environ.json - session-init-no-job-environ.json - session-init-with-job-environ.json - session-init-with-modified-job-environ.json 2013-10-11 James Hunt * init/job_class.c: - job_class_serialise_job_environ(): New function to serialise global job environment table. - job_class_deserialise_job_environ(): New function to deserialise global job environment table. * init/state.c: - state_to_string(): Serialise global job environment table (LP: #1238078). - state_from_string(): Deserialise global job environment table. - _state_deserialise_str_array(): Don't attempt to free array if type check fails. * test/test_util_common.c: - session_init_reexec(): New. - set_upstart_session(): Whitespace. * test/test_util_common.h: REEXEC_UPSTART(): Update to handle Session Inits too. * util/man/initctl.8: Clarify 'set-env' behaviour. * util/tests/test_initctl.c: New tests: - "ensure 'set-env' persists across session-init re-exec". - "ensure 'set-env --global' persists across session-init re-exec". 2013-10-04 Steve Langasek * extra/upstart-local-bridge.c: use SOCKET_PATH in our event environment, instead of clobbering PATH. (LP: #1235480) * extra/conf/upstart-file-bridge.conf: fix the start condition to comply with the intent, that we start the file bridge only once the filesystem is up. (LP: #1235387) 2013-10-04 James Hunt * extra/upstart-local-bridge.c: - socket_reader(): - Handle event emission in new function emit_event(). - Check that data is printable. - Allow input to be a set of pairs (LP: #1234898). 2013-10-03 James Hunt * util/tests/test_utmp.c: Update remaining tests to pause between writing utmp(x) records and reading them back to allow tests to detect whether the expected new records have replaced the artificially created original ones (LP: #1089159). 2013-10-02 James Hunt * test/test_util_common.c: - set_upstart_session(): Call get_initctl_binary() rather than using define value. - get_initctl(): As above. - get_initctl_binary(): Check that file exists for parity with get_upstart_binary(). 2013-10-01 James Hunt * extra/upstart-file-bridge.c: - upstart_job_added(): Make quieter in manner consistent with the other bridges (only display output in debug mode). - upstart_job_removed(): As above. 2013-09-26 James Hunt * init/event.c: event_pending_handle_jobs(): Don't re-iterate job classes unless quiescing. 2013-09-26 James Hunt * init/event.c: event_pending_handle_jobs(): Force quiesce when all job instances have finished to speed session shutdown. * init/job_process.c: job_process_jobs_running(): Only consider job instances with associated pids to avoid abstract jobs confusing the shutdown. * init/quiesce.c: - quiesce(): Optimise session shutdown - Skip wait phase if no jobs care about the 'session-end' event (LP: #1227212). - Stop already running instances if other jobs care about 'session-end' to allow the already-running jobs to shut down in parallel with the newly-started session-end jobs. - quiesce_wait_callback(): - Simplify logic. - Improve wait phase checks to detect earliest time to finalise. - quiesce_finalise(): Display time to shutdown. - quiesce_complete(): New function to force final shutdown phase. - quiesce_event_match(): New function to determine if any jobs 'start on' contains a particular event. - quiesce_in_progress(): Determine if shutdown is being handled. * test/test_util_common.c: - _start_upstart(): Call get_upstart_binary() rather than relying on UPSTART_BINARY define. - start_upstart_common(): Remove '--no-startup-event' as this is now needed by a test. - get_upstart_binary(): Assert that file exists. - file_exists(): New helper function. * test/test_util_common.h: Typo and prototype. * util/tests/test_initctl.c: test_quiesce(): - New test "session shutdown: one long-running job which starts on startup". - Adjusted expected shutdown times. 2013-09-19 James Hunt * init/control.c: Typo. * init/main.c: Add '--no-dbus' command-line option. init/man/init.8: Added '--no-dbus' option. * util/tests/test_initctl.c: test_no_dbus(): New test to test '--no-dbus' option. 2013-09-12 Steve Langasek * configure.ac: - correct the copyright notice. * extra/Makefile.am: - don't pass cflags from unrelated libraries when building, only pass them to those bridges which use the relevant libraries. * init/tests/test_job_process.c: adjust test case to not key on the text of error messages which will vary depending on whether /bin/sh is dash or bash; and use TEST_STR_MATCH so that in the event of future failures, we know why it's failing. 2013-09-05 James Hunt * util/tests/test_initctl.c: test_quiesce(): - Improve kill checks on job processes. - Assert precisely which job processes are expected to be running after the Session Init has exited (particularly important for jobs that 'start on session-end' since they may be running in a System Shutdown scenario). 2013-08-28 James Hunt * util/tests/test_initctl.c: test_quiesce(): Clean up any processes that the Session Init couldn't before it shut down. 2013-08-23 James Hunt * NEWS: Release 1.10 2013-08-15 James Hunt * configure.ac: - Allow udev bridge to be disabled. * extra/Makefile.am: - Ensure source for upstart-udev-bridge is distributed, regardless of whether the local system is able to build it, or has disabled building it. - Add missing DCONF_CFLAGS. - Ensure upstart-dconf-bridge sources are always distributed, regardless of whether the local system is able to build it, or has disabled building it. 2013-08-06 James Hunt * README.tests: Explanation of the tests and how to run them. * Makefile.am: Ensure README.tests gets distributed. * scripts/tests/__init__.py: Empty file to allow python3's unittest module to auto-discover tests. * scripts/Makefile.am: Ensure __init__.py gets distributed. * scripts/tests/test_pyupstart_session_init.py: TestSessionUpstart.setUp(): Created XDG_RUNTIME_DIR if necessary (for example if running as root). * scripts/tests/test_pyupstart_system_init.py: TestSystemUpstart.setUp(): Skip test if not running as root rather than asserting. 2013-07-31 James Hunt * init/quiesce.c: quiesce_finalise(): Move cleanup to main() since the NIH main loop may be iterated once more before shutdown. 2013-07-30 James Hunt * scripts/Makefile.am: Distribute python module and tests, but don't install them. * scripts/pyupstart.py: - Renamed from python-upstart.py. - Upstart:connect(): Added a force parameter to reconnect even if already connected. - Upstart.reconnect(): Utility method. - Upstart.polling_connect(): Call version() to ensure the connection is usable. - New methods to query internal Upstart state. * scripts/tests/test_pyupstart_session_init.py: Session tests extracted from python-upstart.py. * scripts/tests/test_pyupstart_system_init.py: New PID 1 tests. * extra/man/dconf-event.7: New man page. * extra/man/upstart-dconf-bridge.8: New man page. * extra/upstart-dconf-bridge.c: Bridge will now only emit events on dconf changes if any jobs care about them (unless --always is specified). * extra/conf-session/upstart-dconf-bridge.conf: Sample conf file for dconf bridge. * extra/Makefile.am: Added dconf bridge man pages and sample conf to distribution. 2013-07-25 James Hunt * extra/Makefile.am: Renamed to upstart-local-bridge. * extra/man/upstart-local-bridge.8: Removed inet type details. * extra/upstart-local-bridge.c: - Removed inet socket handling. - General clean-up. 2013-07-24 James Hunt * extra/man/upstart-text-bridge.8: Added extra variables. * extra/upstart-text-bridge.c: socket_reader(): - Fixed assertion failure caused by passing invalid address of fd. - Added new standard environment variables to event. 2013-07-24 James Hunt * extra/upstart-dbus-bridge.c: signal_filter(): Use inttype macros to ensure portability. 2013-07-23 James Hunt * extra/upstart-text-bridge.c: New bridge. * extra/Makefile.am: Updated for new bridge. * extra/man/upstart-text-bridge.8: New man page. * extra/Makefile.am: Added man page for text-bridge. 2013-07-19 Dmitrijs Ledkovs * init/session.c: fix a bug in session_from_index to handle more than one session. * init/tests/test_state.c: add a test_sesion_upgrade_stale with 2 stale chroot sessions. 2013-07-19 James Hunt * init/main.c: main(): Don't set debug log prioirity when running as a non-priv user by default (LP: #1201865). 2013-07-19 James Hunt * scripts/python-upstart.py: Updates for XDG_RUNTIME_DIR based on review comments. 2013-07-18 James Hunt * extra/conf-session/: Addition of example jobs for Session Inits. 2013-07-17 James Hunt * init/tests/test_state.c: - test_session_serialise(): Added new test "Ensure session deserialisation does not create JobClasses" to assert new session deserialisation behaviour. - test_session_upgrade2(): Finished writing this test - it now creates a fake chroot path, updates the JSON so that all references to the chroot session refer to the temporary chroot path, creates 2 jobs and then performs the serialisation/deserialisation. * init/tests/test_util.c: - ensure_env_clean(): - Comments. - Added log_unflushed_files. - clean_env(): New function that re-initialises the common data structures. * test/test_util_common.c: search_and_replace(): New function. 2013-07-16 Colin Watson * configure.ac: Use json-c rather than json if available. 2013-07-16 James Hunt * init/tests/data/upstart-session2.json: New JSON used by test_session_upgrade2(). * init/Makefile.am: Added upstart-session.json and upstart-session2.json to TEST_DATA_FILES. * init/conf.c: conf_source_deserialise_all(): Assert that no conf sources have yet been deserialised since now session deserialisation avoids creating chroot conf sources (see below). * init/job_class.c: job_class_deserialise_all(): Formatting. * init/session.c: session_deserialise_all(): Don't create ConfSources for each Session (since they are not actually used). * init/tests/test_state.c: - test_upgrade(): Call ensure_env_clean() both before each test and after the last test to ensure it left the environment clean. - test_session_upgrade(): Clear up sessions. - test_session_upgrade2(): New test. * init/tests/test_util.c: ensure_env_clean(): New function abstracted from code in test_upgrade(). 2013-07-15 James Hunt * init/state.c: - state_deserialise_resolve_deps(): Look up class conventionally using name and session since existing indexing code unreliable as referencing a hash. - state_index_to_job_class(): Removed. * init/tests/test_state.c: test_session_upgrade(): Add check to ensure session job with same name as NULL session job does not stop latter being deserialised. 2013-07-12 Dmitrijs Ledkovs * init/tests/data: upstart-session.json: add stateful re-exec tests with chroot session. (LP: #1200264) * init/state.c: state_deserialise_resolve_deps(): properly account at dependency resolution stage for skipped job_classes from chroot sessions when those got deserialised. Fixes above unit test. 2013-07-11 James Hunt * init/conf.c: conf_source_deserialise_all(): Assert that any existing ConfSources relate to chroot sessions, created as part of the earlier Session deserialisation. (LP: #1199778) * init/state.c: Formatting. 2013-07-09 James Hunt * {configure.ac,Makefile.am}: Allow upstart-dconf-bridge to be disabled even if dependencies are available (--disable-dconf-bridge). * extra/upstart-dconf-bridge.c: Changed event name to simply 'dconf' with fixed first argument of 'TYPE=changed' for consistency with other bridge events and to accommodate future dconf API changes. 2013-07-08 James Hunt * extra/upstart-dconf-bridge.c: dconf_changed(): - Simplified logic after desrt clarified 'changed' signal behaviour. 2013-07-05 James Hunt * extra/upstart-dconf-bridge.c: - Added DCONF_EVENT. - Reformatted to be more consistent with other bridges. - main(): - Connect to UPSTART_SESSION rather than D-Bus session bus. - Handle generation of pidfile name. - dconf_changed(): - Correct path logic and ensure that if the changes array contains values that they are separated correctly from the prefix. 2013-07-04 James Hunt * NEWS: Release 1.9.1 2013-07-04 James Hunt * Perform 2-pass generation of libupstart.pc to ensure library version specified correctly. 2013-07-03 James Hunt * extra/upstart-dbus-bridge.c: main(): Check nih_str_split() return. * extra/upstart-event-bridge.c: main(): Check nih_str_split() return. * extra/upstart-file-bridge.c: main(): - Check nih_str_split() return. - Only attempt to extract PID from UPSTART_SESSION in user mode (LP: #1197225). * Makefile.am: Remove intl directory. * configure.ac: Use external gettext library. 2013-07-02 James Hunt * lib/Makefile.am: Make nih-dbus-tool generate code into the upstart/ directory as we need it there to allow the tests to run against a simulated installed header directory. * lib/tests/test_libupstart.c: Remove unecessary include (which is now included automatically by upstart.h). 2013-07-01 James Hunt * lib/Makefile.am: - Install client library headers. - Add missing backslash. * lib/upstart.h: Look in upstart/ sub-directory for auto-generated header files. 2013-06-28 James Hunt * NEWS: Release 1.9 2013-06-28 James Hunt * init/Makefile.am: - Avoid defining test list twice. - Append $(EXEEXT) where appropriate to appease automake. 2013-06-27 James Hunt * lib/Makefile.am: Added dependency on libtest_util_common. * lib/tests/test_libupstart.c: - Use test_util_common. - test_libupstart(): - Start a private D-Bus server and Session Init to handle possibility of building on systems not using Upstart as PID 1. - Ensure XDG_RUNTIME_DIR is available, required for 'initctl list-sessions'. - main(): Disable tests if required environment not available (as done for test_initctl). * test/test_util_common.c: - wait_for_upstart(): Pass pid of session init to pass to set_upstart_session(). - set_upstart_session(): Now accepts a session init pid to allow filtering of sessions and remove limitations of this function. * test/test_util_common.h: - REEXEC_UPSTART(): Updated for changed wait_for_upstart() parameter. * util/tests/test_initctl.c: - Moved in_chroot() and dbus_configured() to test_util_common.c. 2013-06-26 James Hunt * extra/Makefile.am: Add man pages and conf file. * extra/upstart-dbus-bridge.c: Only emit events if any jobs care about them. * extra/conf/upstart-dbus-bridge.conf: New configuration file. * extra/man/dbus-event.7: New man page. * extra/man/upstart-dbus-bridge.8: New man page. * extra/upstart-dbus-bridge.c: - Comments and formatting. - main(): Default to an appropriate bus. - signal_filter(): Display signal details when run with --debug. * init/log.c: log_clear_unflushed(): Remove log->io assertions as the state cannot be reliably determined when remote_closed is set (LP: #1188642). 2013-06-24 James Hunt * init/Makefile.am: Added missing json file to TEST_DATA_FILES. 2013-06-21 James Hunt * init/quiesce.c: quiesce_show_slow_jobs(): Change message log level to ensure it is displayed by default. 2013-06-20 James Hunt * init/quiesce.c: quiesce_show_slow_jobs(): Don't free static string (LP: #1190526). 2013-06-05 James Hunt * init/tests/data/upstart-1.8+apparmor.json: New test data file. * init/tests/data/upstart-1.8+full_serialisation-apparmor.json: New test data file. * init/tests/data/upstart-1.8+full_serialisation+apparmor.json: New test data file. * init/tests/test_state.c: - test_upgrade(): Re-initialise lists and hashes as a convenience to the tests. - test_upstart_with_apparmor_upgrade(): New test to ensure Upstart can parse the current 1.8 format JSON with the addition of the AppArmor serialisation (but crucially *without* the full serialisation data (EventOperator, etc). - test_upstart_full_serialise_without_apparmor_upgrade(): New test to ensure Upstart can parse the current 1.8 format JSON with the addition of the full serialisation data (EventOperator, etc), but _without_ the AppArmor serialisation. - test_upstart_full_serialise_with_apparmor_upgrade(): New test to ensure Upstart can parse the current 1.8 format JSON with the addition of the full serialisation data (EventOperator, etc), and the AppArmor serialisation. * init/state.c: state_from_string(): Check if ConfSources exist in the serialisation data to allow distinction between ConfSources not present and failing to deserialise them. 2013-06-04 James Hunt * init/event.c: event_deserialise(): Revert to checking JSON for blockers to avoid reliance on JSON serialisation data format version. * init/event_operator.h: Fix misplacement of NIH_END_EXTERN. * init/state.c: Remove serialisation version code since the autoconf approach of detecting the format of the JSON is safer. * init/state.h: Remove STATE_VERSION. 2013-06-03 James Hunt * util/tests/test_initctl.c: - test_no_inherit_job_env(): New function to test --no-inherit-env. - test_job_env(): - Move code that sets HOME+PATH if not set from test_default_job_env() so that test_no_inherit_job_env() can make use of it. - Session file cleanup tweaks to work with test_no_inherit_job_env(). 2013-05-31 James Hunt * init/job_class.c: job_class_environment_init(): Copy inits environment to the default job class environment for user mode where appropriate. (LP: #1159895). * init/job_process.c: job_process_run(): Don't copy inits environment into the job instances environment table as those values are now already in the table. * util/tests/test_initctl.c: Updates for new behaviour (where 'list-env' will now contain the entire environment of the init process, not just those variables explicitly set via set-env). * util/man/initctl.8: Update on behaviour. [ Eric S. Raymond ] * init/man/init.5: Fix unliftable markup (LP: #1185108). 2013-05-30 James Hunt * lib/Makefile.am: - Use plain-text ABI dump, rather than .tar.gz version to allow changes to be easily diff'ed. - Pass path to official ABI to script to avoid script determining it. * lib/run_abi_checker.sh.in: Use provided official ABI path. * Renamed lib/abi_dumps/ to lib/abi/. 2013-05-27 Marc Deslauriers * init/job.c: Don't check for user mode when trying to load an AppArmor profile. User mode is supported as root, and upstart can be run as a user without being in user mode. * init/man/init.5: Adjust man page. 2013-05-24 Marc Deslauriers * init/job_process.c: Allow environment variables in apparmor switch stanzas. * init/apparmor.[ch]: Use a profile name instead of a Job so we can use environment variables. [ James Hunt ] * init/log.c: - log_clear_unflushed(): Expand assertion to handle scenario where the NihIo is still valid but empty (since the data now exists on the unflushed list). - log_read_watch(): Handle EINTR. * configure.ac: Add --disable-abi-check option to allow ABI check to be skipped. 2013-05-23 Marc Deslauriers * init/tests/test_state.c: An unused process is actually supposed to be NULL. Fix test. * init/process.c: Adjust to leave unused process as NULL. [ James Hunt ] * lib/Makefile.am: - Fix library LDFLAGS. - Added test program. * lib/tests/test_libupstart.c: Basic library test. 2013-05-22 James Hunt * Added libupstart library, built from auto-generated D-Bus bindings. To avoid ABI breakage, build calls abi-compliance-checker(1), if available. 2013-05-17 Marc Deslauriers * init/process.c: Fix deserialising with PROCESS_SECURITY. * init/tests/data/upstart-pre-security.json: Added new file to test importing serialisation data without security elements. * init/tests/test_state.c: Added new data format test. 2013-05-15 Marc Deslauriers * init/apparmor.[ch]: AppArmor profile helper. * init/Makefile.am: Added AppArmor profile helper. * init/errors.h: Added SECURITY_ERROR. * init/job.c: - Added new JOB_SECURITY state and PROCESS_SECURITY process. - Fix job_deserialise() for new PROCESS_SECURITY process. * init/job.h: Added new JOB_SECURITY state. * init/job_class.[ch]: Added apparmor_switch to hold the new "apparmor switch" stanza. * init/job_process.c: - Switch to new AppArmor profile. - Handle PROCESS_SECURITY process. * init/job_process.h: Added JOB_PROCESS_ERROR_SECURITY. * init/man/init.5: Document new AppArmor stanzas. * init/parse_job.c: Parse new "apparmor" stanzas. * init/process.[ch]: Add PROCESS_SECURITY. * init/tests/test_job.c: Add new tests, and adjust existing ones. * init/tests/test_job_class.c: Added apparmor_switch. * init/tests/test_parse_job.c: Test new AppArmor stanza parsing. * init/tests/test_process.c: Added PROCESS_SECURITY tests. * init/tests/test_state.c: Test apparmor_switch and PROCESS_SECURITY. 2013-05-13 James Hunt * init/state.c: stateful_reexec(): Specify all values for array initialiser. 2013-05-10 James Hunt Revert to not supporting deserialisation of JobClasses with associated user/chroot sessions to avoid behavioural change for now. * init/job_class.c: - job_class_deserialise(): Revert to failing if associated session is non-NULL. - job_class_deserialise_all(): Revert to ignoring failure to deserialise a JobClass iff it has a non-NULL associated session. * init/state.c: - state_to_string(): Provide some diagnostics if serialisation fails. - state_from_string(): Provide some diagnostics if deserialisation fails. - state_deserialise_resolve_deps(): Ignore failure to lookup JobClass iff it has an associated user/chroot session. - state_deserialise_blocking(): Revert to ignoring failure to deserialise a Blocked object that is associated with a Job whose JobClass has a non-NULL session. * init/tests/test_state.c: test_blocking(): Revert test to assert that blocked job with non-NULL session is ignored. 2013-05-09 James Hunt * init/job.c: job_serialise(): Corrected logic for handling 'stop on' condition. * init/job_class.c: job_class_deserialise(): Only check type after JSON queried (thanks Coverity). 2013-05-08 James Hunt * init/Makefile.am: Link test_util to test_event_operator. * init/conf.c: conf_source_deserialise_all(): Assert conf_sources is empty. * init/control.h: control_get_job(): Use job_class_get_registered() rather than redundant job_class_find(). * init/event_operator.c: - Typos and formatting. - event_operator_serialise(): Conditionally encode name and env. - event_operator_deserialise(): Treat env as a string array, not an environ array to ensure values are not discarded unless they contain '='. * init/job.c: - job_deserialise(): Check JSON type for 'stop on' prior to attempting value extraction. - job_find(): - Make job_class const. - Use job_class_get_registered() rather than job_class_find(). * init/job_class.c: - job_class_get_registered(): Rework. - job_class_add_safe(): Re-add since required to support old serialisation formats that do not encode ConfSource and ConfFile objects. - job_class_deserialise(): - Take care to only associate ConfFile with JobClass if JSON encodes ConfFile objects. - Check JSON type for 'start/stop on' prior to attempting value extraction. - job_class_find(): Remove (redundant due to job_class_get_registered()). * init/state.c: - Set serialisation_version to an invalid value to detect if it was never set (to handle old serialisation formats). - state_from_string(): - Make failure to read header and ConfSources warnings only, to support old serialisation formats that do not encode this information. - state_deserialise_blocked(): Fix bug where event blocker was being incremented twice. Now, just assert it is set. - state_deserialise_blocking(): Failure to deserialise a Blocked object is no longer ignored since sessions are supported. * init/state.h: STATE_VERSION history and notes. * init/tests/test_conf.c: Replace calls to job_class_find() with job_class_get_registered(). * init/tests/test_event_operator.c: - test_operator_serialisation(): Check both the original string serialisation format and the new full EventOperator serialisation. type. * init/tests/test_job.c: - test_deserialise_ptrace(): - Comments and more checks. - Create ConfSource, ConfFile and JobClass manually. - Call job_class_consider() as we now have a backing ConfFile. - Wait for childs child. * init/tests/test_state.c: - Simplify TestDataFile. - Ensure files passed to conf_file_new() provide expected suffix. - job_class_diff(): Add event_operator_diff() call. - conf_source_diff(): New function. - conf_file_diff(): New function. - test_blocking(): - Extra checks. - Expect ConfFiles to be recreated on re-exec. - test_upgrade(): Check environment is clean before running the next test. - test_upstart1_8_upgrade(): New Upstart-1.8 serialisation format test. - conf_source_from_path(): New utility function. * init/tests/test_util.c: - event_operator_diff(): New function. - session_from_chroot(): New function. * init/tests/data/upstart-1.8.json: New test file. 2013-05-08 James Hunt * init/conf.c: - conf_source_serialise_all(): Make failures fatal. * init/event_operator.c: event_operator_collapse(): Unhide but mark as unused (it's still used by the tests). * init/job.c: - job_serialise(): Remove unused variable. - job_deserialise(): Check the type of the start/stop on condition in the json, not the json passed to the function. * init/job_class.c: job_class_deserialise(): Check the type of the start/stop on condition in the json, not the json passed to the function. * init/state.c: - Comments. - state_read_header(): Extract header from JSON before checking for serialisation version. 2013-05-07 James Hunt * util/man/shutdown.8: Specify default action is to bring system down to single-user mode (LP: #1065851). 2013-05-02 James Hunt * init/event.c: event_deserialise(): Only set blockers if EventOperators are serialised. * init/event_operator.c: event_operator_collapse(): Now only needed for DEBUG. * init/job.c: - job_deserialise(): Support old string format for 'stop_on' EventOperator as well as new array format. * init/job_class.c: * init/state.c: Create a meta-header containing a serialisation version number. 2013-05-02 James Hunt * init/conf.c: - New serialisation and support functions: - conf_source_serialise() - conf_source_serialise_all() - conf_source_deserialise() - conf_source_deserialise_all() - conf_source_type_enum_to_str() - conf_source_type_str_to_enum() - conf_file_serialise() - conf_file_deserialise() - conf_file_deserialise_all() - conf_source_get_index() - conf_file_find() - debug_show_event_operator() - debug_show_event_operators() * init/event_operator.c: - event_deserialise(): - Fix leaked env array. - Deserialise blockers count now EventOperators are also serialised. - event_operator_type_enum_to_str() - event_operator_type_str_to_enum() - event_operator_serialise() - event_operator_serialise_all() - event_operator_deserialise() - event_operator_deserialise_all() * init/job_class.c: - job_class_add_safe(): Remove as no longer required. - job_class_get(): Must call job_class_init(). - job_class_serialise(): - Remove error case if chroot session specified now that ConfSources are serialised. - Serialise start/stop on fully (as EventOperators) rather than just the original string condition (LP: #1103881). - job_class_deserialise(): - Remove error case if chroot session specified now that ConfSources are serialised. - Associate the JobClass with its ConfFile. - job_class_serialise_all(): - Comments. - Failure to serialise a JobClass is now a hard error since we now serialise all JobClasses. - job_class_deserialise(): - Deserialise start/stop on conditions as EventOperators rather than as a string condition. - Since ConfFiles are now serialised, call job_class_consider() rather than job_class_add_safe(). - job_class_deserialise_all(): - Failure to deserialise a JobClass is now a hard error since we now serialise all JobClasses. - job_class_get_index(): New function. * init/state.c: - state_to_string(): Serialise ConfSources and ConfFiles. - state_from_string(): Deserialise ConfSources and ConfFiles. - state_deserialise_resolve_deps(): Allow chroot sessions to be handled now we serialise ConfSources and ConfFiles. 2013-04-30 James Hunt * init/Makefile.am: Added test_main. * init/tests/test_main.c: New test. * init/tests/test_job_process.c: strcmp_compar() moved to test_util.c. * util/tests/test_initctl.c: strcmp_compar() removed. * init/xdg.c: Disable loading of jobs from SYSTEM_USERCONFDIR if "UPSTART_NO_SYSTEM_USERCONFDIR" envvar set (required for testing). * test/test_util.c: Added strcmp_compar() and get_session_file(). * util/tests/test_initctl.c: Use get_session_file(). 2013-04-30 James Hunt * Makefile.am: Added 'test'. * configure.ac: Added 'test/Makefile'. * init/Makefile.am: Depend on test_util archive rather than source files. * init/state.c: Added missing config.h include. * util/Makefile.am: Depend on test_util archive rather than source files. * util/tests/test_initctl.c: Moved common utility code to test/test_util.c and replaced INITCTL_BINARY by get_initctl_binary(). * test/test_util.[ch]: New location for init/tests/test_util.[ch] to allow all tests access to common functionality. 2013-04-30 James Hunt * init/job.c: job_serialise_all(): Really serialise all JobClasses, * init/main.c: Add 'write-state-file' command-line option. regardless of whether they have associated Jobs. * init/paths.h: Added STATE_FILE_ENV. * init/state.c: - state_read_objects(): Write state file if 'write-state-file' specified or STATE_FILE_ENV set. - event_deserialise(): - Preserve the pre-reexec blockers count until JobClasses are deserialised and reverse-dependencies resolved. - Fix incorrect calls for failed and blockers Event attributes. * init/state.h: Comments. * init/tests/test_state.c: - test_job_class_serialise(): Ensure that all JobClasses get serialised, regardless of whether they have any associated Jobs. - test_event_serialise(): New "with failed" test. * init/event.c: event_deserialise(): Don't deserialise Event->blockers - there is no point until we serialise EventOperators. 2013-04-29 James Hunt * init/conf.c: - conf_reload(): Explanation of how reload works. - conf_reload_path(): Defer destruction of original ConfFile until newly-loaded .conf file has a chance to reference any events its 'start on' condition requires (LP: 1124384). - debug_show_jobs(): Return if no instances. - debug_show_events(): New function. * init/event.c: Comments. * init/job.c: Comment. * init/job_class.c: - job_class_get_registered(): New function resulting from refactor of job_class_consider() and job_class_reconsider(). - job_class_consider(): - Use job_class_get_registered(). - Call job_class_event_block() to avoid premature event destruction. - job_class_reconsider(): Use job_class_get_registered(). - job_class_event_block(): New function to increase reference count for events new JobClass specifies in its 'start on' condition that old JobClass has also referenced (second part of LP: #1124384). * init/tests/test_conf.c: - test_source_reload(): New tests: - "ensure reload does not destroy a blocked event used by another job" - "ensure .conf reload causes waiting job to run when 'start on' matches" * init/tests/test_conf.h: TEST_ENSURE_CLEAN_ENV(): Check nih_child_watches too. 2013-04-22 James Hunt * Typo and doc changes. 2013-04-17 James Hunt * init/Makefile.am: Build wrap_inotify library and run test_conf via test_conf_preload.sh. * init/tests/test_conf.c: Communicate with wrap_inotify library by setting INOTIFY_DISABLE to reliably disable inotify rather than trying to exhaust inotify instances (LP: #1157713). * init/tests/test_conf_preload.sh.in: Script to run test_conf within LD_PRELOAD environment. * init/tests/wrap_inotify.c: Wrapper library that provides the inotify API and allows test_conf to believe inotify is disabled by conditionally failing all inotify calls, depending on whether INOTIFY_DISABLE is set. 2013-04-16 James Hunt * scripts/python-upstart.py: Update based on review comments. 2013-04-08 James Hunt * scripts/python-upstart.py: - Upstart::polling_connect(): New method used to connect after a re-exec. - SystemInit::reexec(): Check proxy connection before attempting re-exec. - TestUpstart:test_session_init_reexec(): Re-connect post re-exec to prove instance still usable. - TestUpstart:test_session_init_reexec_when_pid1_does(): Re-connect post re-exec to prove instance still usable. 2013-04-07 James Hunt * scripts/Makefile.am: Added python-upstart.py. * scripts/python-upstart.py: Python3 Upstart interface incorporating a minimal set of Python unittest tests. 2013-04-02 James Hunt * init/main.c: - main(): Allow Session Init to accept multiple --confdir values, which replace all built-in values (behaviour required for testing). - handle_confdir(): Operate on conf_dirs array rather than single conf_dir value. - conf_dir_setter(): Command-line setter function to add configuration file directories to conf_dirs array. * init/man/init.8: Update on --confdir behaviour. * extra/man/file-event.7: Correct EVENT values in examples. * extra/man/upstart-event-bridge.8: - Corrected bridge name. - Explain that blocking semantics of system jobs not retained. 2013-03-28 James Hunt * scripts/upstart-monitor.py: on_button_press_event(): Handle path_info being None (LP: #1161098). * extra/upstart-event-bridge.c: main(): - Handle daemon pidfile as the upstart-event-bridge does. - Write to stdout, not syslog. * init/job_process.[ch]: Removed now unused JOB_PROCESS_ERROR_OPENPT_MASTER. 2013-03-25 James Hunt * extra/man/socket-event.7: Correct section number. * init/man/init.5: Correct section number. 2013-03-22 James Hunt * scripts/Makefile.am: Added missing entry for man/upstart-monitor.8. 2013-03-22 James Hunt * NEWS: Release 1.8 2013-03-22 James Hunt * scripts/initctl2dot.py: - footer(): Add details of session. - sanitise(): Handle jobs in sub-directories. - main(): Add --user and --system options and determine correct session to connect to. * scripts/man/initctl2dot.8: - Added --user and --system options. - Escape dashes in options. - Update date. 2013-03-21 James Hunt * po/POTFILES.in: - Added missing entries for init/quiesce.c and init/state.c. - Added upstart-monitor.py. * scripts/upstart-monitor.py: UpstartEventsGui(): Removed class attributes and added explicit instance ones in __init__(). 2013-03-18 James Hunt * configure.ac: Added scripts/data/Makefile. * scripts/Makefile.am: Added SUBDIRS=data. * scripts/data/Makefile.am: New Makefile. * scripts/data/upstart-monitor.desktop: Desktop file for upstart-monitor. 2013-03-15 James Hunt * extra/upstart-file-bridge.c: - main(): String safety for home_dir. - job_add_file(): - Initialise events. - Use nih_strdup() rather than arrays for paths. - Removed unecessary error label. - {create_handler,modify_handler,delete_handler}(): Remove strcpy(). - watched_dir_new(): Use nih_strdup() rather than arrays for path. - find_first_parent(): Replace strcpy with strncpy(). 2013-03-15 James Hunt * extra/man/file-event.7: Simplify language. * extra/upstart-file-bridge.c: - skip_slashes(): New macro to make path matching more reliable. - file_filter(): Call skip_slashes(). - create_handler(): Call skip_slashes(). - modify_handler(): Call skip_slashes(). - delete_handler(): Call skip_slashes(). - watched_dir_new(): Special case watching the root directory. * extra/conf/upstart-file-bridge.conf: Change start on condition to ensure all filesystems are mounted before it starts. 2013-03-13 James Hunt * scripts/man/upstart-monitor.8: New manpage. * scripts/upstart-monitor.py: New cli+gui tool to monitor Upstart events. * scripts/Makefile.am: Updated for upstart-monitor. 2013-03-11 James Hunt * extra/Makefile.am: Add file bridge and conf file. * extra/upstart-file-bridge.c: Inotify file bridge. * extra/conf/upstart-file-bridge.conf: Conf file for file bridge. * extra/man/file-event.7: New man page. * extra/man/upstart-file-bridge.8: New man page. 2013-03-04 James Hunt * init/session.c: session_from_dbus(): Fixed off-by-one readlink error. * configure.ac: Only add sbin to path if exec_prefix specified (LP: #1122510). * NEWS: Release 1.7 * configure.ac (NIH_COPYRIGHT): Update 2013-02-27 James Hunt * Removal of gcc 'malloc' function attribute resulting from a clarification in its description which makes its use invalid. (LP: #1123588). 2013-02-26 James Hunt * util/tests/test_initctl.c: test_upstart_open(): Unset UPSTART_SESSION to avoid session-init environment affecting test run. 2013-02-15 James Hunt * util/tests/test_initctl.c: - timed_waitpid(): Back off if no status change. - test_quiesce(): - Set XDG_RUNTIME_DIR to a temporary value. - Remove stale session files. - test_job_env(): Remove stale session files. 2013-02-15 James Hunt * init/event_operator.c: Typo. * init/job_class.c: - job_class_environment_reset(): Comments. - job_class_environment_set(): Apply to all running job objects too. - job_class_environment_unset(): Apply to all running job objects too. * util/man/initctl.8: Updated on environment command semantics. * util/tests/test_initctl.c: test_global_and_local_job_env(): Modified test for new semantics. 2013-02-15 James Hunt * init/job_process.c: job_process_run(): Invert meaning. * init/main.c: Change '--inherit-env' to '--no-inherit-env' such that inheriting inits environment is now the default for Session Inits. * init/man/init.8: Update for '--no-inherit-env'. 2013-02-14 James Hunt * util/tests/test_initctl.c: - wait_for_upstart(): Functional replacement of WAIT_FOR_UPSTART() macro. Now accepts @user. - set_upstart_session(): Poll to ensure we give Upstart time to initialise and write the session file. - _start_upstart(): Extra @user parameter. 2013-02-14 James Hunt * init/Makefile.am: Added quiesce.o, now required by control.o. * init/main.c: main(): - SIGHUP+SIGUSR1 handling now applies however you run init (since it should react to these signals when run as a Session Init). - Qualified sessions message to avoid confusion. * util/initctl.c: upstart_open(): Better handling for user_mode. * util/tests/test_initctl.c: - WAIT_FOR_UPSTART(): Made session-aware. - KILL_UPSTART(): Reset user mode flag (taken from STOP_UPSTART()). - set_upstart_session(): New function. - self_pipe_write(): New Function. - self_pipe_setup(): New Function. - timed_waitpid(): New function. - _start_upstart(): - Signal handling and extra checks. - Discard init output (unless UPSTART_TEST_VERBOSE set) for saner logs. - test_list_sessions(): - Removed need for a dbus-daemon. - Added required initctl reset. - test_quiesce(): Tests for Session Init shutdown (both system-initiated and end-session request). - test_usage(): Added extra checks and tidyup. - main(): Added call to test_quiesce(). 2013-02-11 James Hunt * init/log.c: log_serialise(): Handle re-exec scenario where jobs producing output have finished but where log data cannot be persisted (for example where disk is full or log directory is inaccessible). (LP: #1120660) 2013-02-08 James Hunt * dbus/com.ubuntu.Upstart.xml: Added 'EndSession' method. * init/Makefile.am: Updated for quiesce.[ch]. * init/conf.c: conf_destroy(): Cleanup function. * init/conf.h: Prototype. * init/control.c: control_end_session(): 'EndSession' implemenation. * init/control.h: Include. * init/events.h: Added SESSION_END_EVENT. * init/job_class.c: job_class_max_kill_timeout(): New function. * init/job_class.h: Prototype. * init/job_process.c: - Added disable_respawn to disallow respawns. - job_process_jobs_running(): New function. - job_process_stop_all(): New function. - job_process_terminated(): Honours disable_respawn. * init/job_process.h: Prototypes. * init/main.c: - Typos. - term_handler(): Quiesce rather than re-exec on receipt of SIGTERM when running as a Session Init. - main(): Make quiesce() handle cleanup. * init/man/init.8: Update for Session Init SIGTERM handling. * init/man/startup.7: Update for Session Init. * init/session.c: session_destroy(): New function. * init/session.h: Prototype. * init/man/session-end.7: New man page. * init/quiesce.[ch]: New files. 2013-02-08 James Hunt * init/job_process.c: job_process_run(): Copy parent environment if inherit_env in operation for a Session Init. * init/main.c: Added 'inherit-env' command-line option. * init/man/init.8: Documented --inherit-env. 2013-02-02 James Hunt * util/initctl.c: Remove ability to specify explicitly job and/or job instance values to the job environment commands. * util/man/initctl.8: Remove job and job instance value command-line options. * util/tests/test_initctl.c: test_global_and_local_job_env(): Remove tests for --job/--instance. 2013-01-31 James Hunt * init/control.c: - Use control_check_permission() rather than control_get_origin_uid() directly. * init/control.h: Prototypes. * init/job_class.c: Change calls to job_class_environment_init() to asserts as the former only needs to be called once. * init/main.c: main(): Make job_class_environment_init() call as early as possible. * init/tests/test_event.c: main(): Call job_class_environment_init(). * util/tests/test_initctl.c: - test_default_job_env(): - Set TERM and PATH if not set. - Check line counts before checking expected output. - test_clear_job_env(): - Make use of TEST_INITCTL_DEFAULT_PATH. 2013-01-30 James Hunt * TESTING.sessions: Removed as basic sessions have now gone. 2013-01-30 James Hunt * init/control.c: - Typos. - Improved uid checks. - Replaced direct call to control_get_origin_uid() with call to new control_check_permission() (as early as possible) for clarity and to confine policy to one location. - control_set_log_prioity(): Added missing call to control_check_permission(). - control_get_origin_uid(): Check message contents before allowing D-Bus calls. 2013-01-29 James Hunt * init/control.c: More careful uid checking. 2013-01-28 James Hunt * init/xdg.c: - get_subdir(): Remove double-check on @dir. - xdg_get_runtime_dir(): - Don't attempt to create as unlikely to be able to if it doesn't already exist. - Simplify logic. 2013-01-28 James Hunt * util/initctl.c: list_session_action(): - Test for stale session earlier. - Simplify checks on "UPSTART_SESSION". * util/tests/test_initctl.c: test_list_sessions(): - Added test with XDG_RUNTIME_DIR explicitly unset. - Changed "with no instances" test to set XDG_RUNTIME_DIR to a temporary value. - Revert XDG_RUNTIME_DIR on cleanup. 2013-01-28 James Hunt * init/control.c: - control_get_env(): Allow PID 1 environment to be queried for consistency with control_list_env(). * init/man/initctl.8: - Added --job, --instance, --global options for list-env, set-env, get-env, unset-env, reset-env. - Explain PID 1 limitation for set-env, unset-env, reset-env. * util/initctl.c: - get_job_details(): Fix order in which arguments are checked. * util/Makefile.am: Define INITCTL_BINARY and UPSTART_BINARY to ensure full path available to tests. * util/tests/test_initctl.c: - New macros: - _TEST_STR_ARRAY_CONTAINS() - TEST_STR_ARRAY_CONTAINS() - TEST_STR_ARRAY_NOT_CONTAINS() - _TEST_FILE_CONTAINS() - TEST_FILE_CONTAINS() - TEST_FILE_NOT_CONTAINS() - get_initctl(): Function to replace original INITCTL_BINARY define. - test_global_and_local_job_env(): New function to test initctl '--global', '--job' and '--instance' options from within and without a job. 2013-01-25 James Hunt * init/control.c: control_session_file_create(): Simplified. * init/xdg.c: Added check for INITCTL_BUILD to hide certain symbols when building with initctl. * util/Makefile.am: - Define INITCTL_BUILD. - Make use of xdg.[ch] in build of initctl and its test. * util/initctl.c: - list_session_action(): Implementation of 'list-sessions' command. * util/man/initctl.8: Updated for 'list-sessions' command. * util/tests/test_initctl.c: - _start_upstart(): Replacement for _START_UPSTART() macro. - start_upstart_common(): Start an instance with common options. - start_upstart(): Simplest way to start an instance. - START_UPSTART(): Now calls start_upstart_common(). - test_list_sessions(): Test 'list-sessions' command. 2013-01-25 James Hunt * dbus/com.ubuntu.Upstart.xml: - Added 'job_details' string array as first parameter for GetEnv, SetEnv, UnsetEnv, ListEnv and ResetEnv to allow methods to either act globally or on a specific job environment. * init/control.c: - control_set_env(): - control_unset_env(): - control_get_env(): - control_list_env(): - control_reset_env(): - Disallow setting for PID 1. - Operate globally or on specified job. * init/control.h: control_get_job(): Macro to simplify extracting job from provided job details. * init/job.c: job_find(): New function. * init/job_class.c: - job_class_environment_set(): Delimiter handling now moved to control_set_env() so it can be shared by job and global logic. - job_class_find(): New function. * init/state.c: - Removed state_get_job() and replaced calls with job_find(). * util/initctl.c: - Updated *_action() functions for new D-Bus parameters and made use of new function get_job_details(). 2013-01-25 James Hunt * init/tests/test_xdg.c: Added test_get_session_dir(). * init/xdg.c: get_home_subdir(): Handle unset 'HOME' immediately. * init/control.c: Make use of SESSION_EXT. * init/man/init.5: Added session files. * init/paths.h: - Comments. - Added SESSION_EXT. 2013-01-25 James Hunt * init/control.c: - control_reload_configuration(): Added missing permission checks. - control_emit_event_with_file(): Added missing permission checks. - Added calls to new function control_get_origin_uid() to allow D-Bus methods to be policed by filtering on uid, rather than relying on the same information that used to be stored in the old Session object. * init/job.c: Typo. * init/job_class.c: - job_class_new(): Removed user elements from session code. - job_class_serialise(): Comments. - job_class_deserialise(): Comments. * init/job_process.c: job_process_spawn(): Removed user session handling. * init/session.c: Removed user session handling since it is about to be replaced by the ability to run Upstart as a non-privileged user (aka a 'Session Init'). * init/session.h: Updated prototypes. * init/state.h: Comments. * init/tests/test_conf.c: test_source_reload_job_dir(): Added missing check. * init/tests/test_state.c: - session_diff(): Removed user check. - Updated all calls to session_new(). * util/tests/test_initctl.c: test_notify_disk_writeable(): Ensure this test is not run as root. * util/tests/test_user_sessions.sh: Removed. * init/man/init.5: Updated to reflect removal of user jobs. 2013-01-24 James Hunt * init/control.c: - control_init(): Create session file in user mode. - control_cleanup(): New function for cleanup activities. - control_session_file_create(): Create session file containing UPSTART_SESSION details. - control_session_file_remove(): Delete the session file. * init/main.c: Call control_cleanup() to remove session file. * init/paths.h: Added INIT_XDG_SESSION_SUBDIR and SESSION_ENV. * init/xdg.c: - get_subdir(): Refactor of get_home_subdir(). - get_home_subdir(): Now calls get_subdir(). - Replaced mkdir mode values with INIT_XDG_PATH_MODE. - xdg_get_runtime_dir(): Obtain XDG_RUNTIME_DIR value. - get_session_dir(): Obtain path to session directory. * init/xdg.h: Added INIT_XDG_PATH_MODE. 2013-01-21 Dmitrijs Ledkovs * init/xdg.[ch]: add xdg_get_cache_home and get_user_log_dir functions. These retrieve XDG_CACHE_HOME and a subdir inside it for upstart. * init/tests/test_xdg.c: reuse test_get_config_home to test both xdg_get_cache_home and xdg_get_config_home. Add test for get_user_log_dir. * init/main.c: use get_user_log_dir to setup logging directory in user_mode. For now, command line argument is honoured, while the environment override is not. 2013-01-21 James Hunt * init/log.c:log_clear_unflushed(): Simplify asserts. 2013-01-15 James Hunt * init/log.c: - log_clear_unflushed(): Correct remote_closed assertion to handle early-job-logging scenario where a job satisfies both of the following conditions: - ends before the log directory becomes writeable. - has spawned one or more processes that continue to run after the job itself has exited and which produce output before the log directory becomes writeable. (LP: #1096531). 2013-01-14 James Hunt * util/initctl.c: - Grouped all environment commands in usage output. - Added --global, --job and --instance options for all environment commands. These are currently dummies, but --global will soon be required to make changes to the global job environment table when initctl is invoked from within a job. 2013-01-11 James Hunt * util/tests/test_initctl.c: - Lots of new job environment table tests. 2013-01-10 James Hunt * init/man/init.5: Define job environment table. * init/tests/test_job_class.c(): test_environment(): Added call to job_class_environment_init() which is now required to avoid confusing TEST_ALLOC_FAIL(). * util/man/initctl.8: - Further details in list-env section. - Escape dashes in command names. * util/tests/test_initctl.c: - New utility macros: _WAIT_FOR_FILE(), WAIT_FOR_FILE() and TEST_STR_MATCH(). - Initial tests for testing job environment table commands. 2013-01-09 James Hunt * scripts/init-checkconf.sh: - Check copy is successful. - Auto-start dbus-launch if not running and command is available (for example in non-desktop environments) (LP: #881885). - Auto-stop dbus-daemon if we started it. * init/man/init.5: - Overhauled 'Job environment' section. * util/initctl.c: - Added 'unset-env' and 'reset-env' commands. - Added missing periods in usage text. - list_env_qsort_compar(): Renamed from list_env_strcmp_compar(). Now uses strcoll(3) for locale-awareness. * init/job_class.c: - job_class_environment_set(): - Comments. - Handle scenario where user specifies a variable without an equals. * util/man/initctl.8: - Added details for 'get-env', 'set-env', 'unset-env', 'list-env' and 'reset-env'. - Tidied up 'usage' stanza section. 2013-01-08 James Hunt * dbus/com.ubuntu.Upstart.xml: - Added UnsetEnv and ResetEnv methods. * init/control.c: - control_set_env(): Now uses job_class_environment_set() rather than directly manipulating job_environ array. - control_unset_env(): New function. - control_get_env(): Now calls job_class_environment_get(). - control_list_env(): Now calls job_class_environment_get_all(). Comments. - control_reset_env(): New function. * init/environ.c: - environ_remove(): New function. * init/job_class.c: - job_environ now static. - job_class_environment_reset(): New function. - job_class_environment_set(): New function. - job_class_environment_unset(): New function. - job_class_environment_get(): Simplified. - job_class_environment_get_all(): New function. * util/initctl.c: - Added following new commands: - 'get-env' - 'set-env' - 'list-env' 2013-01-04 Dmitrijs Ledkovs * init/conf.c: add ability to apply override files from higher priority configuration sources. * init/tests/test_conf.c: test that multiple override files are correctly applied and removed. * init/tests/test_conf_static.c: test override file detection. 2012-12-19 James Hunt * dbus/com.ubuntu.Upstart.xml: Added ListEnv method. * init/control.c: - Fixed comments. - control_list_end(): New function. * init/control.h: - Added missing prototypes for control_set_env() and control_get_env(). - Added control_list_env(). * init/job_class.c: - job_class_environment_get(): New function. * init/job_class.h: Added job_class_environment_get(). 2012-12-17 James Hunt * init/man/init.5: Document that User Jobs are not supported within a chroot environment. * dbus/com.ubuntu.Upstart.xml: Added "GetEnv" and "SetEnv" methods. * init/control.c: - control_set_env(): Implementation of "SetEnv" D-Bus method. - control_get_env(): Implementation of "GetEnv" D-Bus method. * init/job_class.c: - Added job_environ environment table. - job_class_environ_init(): Initialise job_environ. - job_class_environment: Use job_environ. * init/main.c: main(): Call job_class_environ_init(). 2012-12-14 Steve Langasek * init/job_class.[ch]: instead of assuming a fixed value (0) as the default nice value for job processes, use whatever the nice value of the current process is. This will be important later for user sessions where an entire session may be started with a higher nice value; and it fixes running the test suite as part of a nice'd build. * init/tests/test_job_class.c: update test suite to match. 2012-12-11 James Hunt * init/Makefile.am: Add explicit -lrt for tests (LP: #1088863) * dbus/com.ubuntu.Upstart.xml: Added "GetEnv" and "SetEnv" methods. * init/control.c: - control_set_env(): Implementation of "SetEnv" D-Bus method. - control_get_env(): Implementation of "GetEnv" D-Bus method. * init/job_class.c: - Added job_environ environment table. - job_class_environ_init(): Initialise job_environ. - job_class_environment: Use job_environ. * init/main.c: main(): Call job_class_environ_init(). 2012-12-07 James Hunt * NEWS: Release 1.6.1 * configure.ac: Change version to 1.6.1 2012-12-07 James Hunt * init/Makefile.am: - TEST_DATA_DIR: use $srcdir, not $PWD. - TEST_DATA_FILES: Corrected filename. * dbus/com.ubuntu.Upstart.xml: Restart: Add annotation to make it manifest this is an async call. * util/telinit.c: restart_upstart(): Use the async call to avoid the client-side complaining if it detects that Upstart has severed all D-Bus connections in preparation for the re-exec. 2012-12-06 James Hunt * init/job_class.c: - job_class_add_safe(): Don't assert on name collisions for jobs associated with a different session. (LP: #1079715). - job_class_serialise(): Explicitly disallow user and chroot sessions from being serialised since this scenario is not supported (due to our not serialising ConfSource objects yet). - job_class_deserialise(): Assert that we do not have user and chroot sessions to deal with, and fix potential invalid free if error occurs before JobClass is created. - job_class_deserialise_all(): Explicitly ignore attempted deserialisation of user and chroot sessions. * init/state.c: - state_deserialise_resolve_deps(): Ignore classes associated with a user or chroot session. Specify new session parameter to state_get_job(). - state_serialise_blocked(): Encode session index for BLOCKED_JOB. Make function non-static for testing. - state_deserialise_blocked(): Extract session from index index for BLOCKED_JOB to pass to state_get_job(). Default session to NULL to handle upstart 1.6 serialization. Make function non-static for testing. - state_get_job(): Add @session parameter to allow exact job match. - state_read_objects(): Attempt to write the state to file STATE_FILE if deserialisation fails as an aid to diagnosing the cause of the failure. * init/tests/test_state.c: test_blocking(): Additional tests to check that it is possible to deserialise Upstart 1.6 JSON format (which does not include the "session" JSON attribute for blocked objects. Add infrastructure for testing deserialization of reference json files from disk. New tests: - "BLOCKED_JOB serialisation and deserialisation". - "BLOCKED_EVENT serialisation and deserialisation". - "BLOCKED_JOB with JSON session object". - "ensure BLOCKED_JOB with non-NULL session is ignored". * dbus/com.ubuntu.Upstart.xml: Added 'GetState' method that returns internal state in JSON format. * init/Makefile.am: - Added TEST_DATA_DIR to allow tests to find data files. - Added test data files to distribution. * init/control.c: control_get_state(): Implementation for D-Bus 'GetState' method. * init/tests/data/upstart-1.6.json: Test data used by test_state.c for upgrade testing the upstart 1.6 serialization format. * dbus/com.ubuntu.Upstart.xml: New 'Restart' method. * init/control.c: control_restart(): New function to request Upstart restart itself. * util/telinit.c: use the new dbus interface for restarts; 'telinit u' now fails with an error when PID 1 is not upstart, instead of sending it a signal with undefined behavior. (LP: #1083723) * util/man/telinit.8: Update for 'telinit u' behaviour if PID 1 is not Upstart. 2012-11-23 James Hunt [ Colin King ] * init/log.c: log_serialise(): smatch-found issue where additional checks required for log->unflushed to avoid any possibility of NULL dereference. * init/state.c: state_read_objects(): smatch-found issue to correct read size and ensure optimal throughput. 2012-11-18 Steve Langasek * init/tests/test_job_process.c: fix test which was accidentally relying on a variable persisting after it's gone out of scope. * init/tests/test_job_process.c: don't test the blocked/ignored signal list in a spawned job; this is not testing the upstart code but the characteristics of the system, and the test is wrong because it assumes the signal lists in /proc/self/status fit in an unsigned long int - patently untrue on mips, where we have 128 signals for historical reasons. 2012-11-17 Steve Langasek * init/Makefile.am: set TERM=xterm, so that tests which rely on TERM being set in the environment don't give different results and gratuitously fail. 2012-11-15 James Hunt * NEWS: Release 1.6 * configure.ac: Bump version to 1.7 * NEWS: Begin new release 2012-11-07 James Hunt * Added stateful re-exec support such that when Upstart is asked to restart itself using 'telinit u', the new instance of PID 1 will retain knowledge of all system jobs and running instances. 2012-09-10 James Hunt * Merged lp:~jconti/upstart/fix_empty_chroot. 2012-05-23 James Hunt * init/main.c: Add in "bare" re-exec handling from Ubuntu branch. * init/main.c: Unhide "restart" option. 2012-10-22 James Hunt * init/parse_job.c: stanza_kill(): Actually save parsed value to avoid crash if kill signal given as a numeric (LP: #1049820). * init/tests/test_parse_job.c: test_stanza_kill(): New test: "with signal and single numeric argument". * init/Makefile.am: test_job_process must now be linked to the 'util' library for pty helper functionality. * init/tests/test_job_process.c: - Compiler appeasement. - Conditionally run tests in a pty for build environments such as modern versions of sbuild(1) that do not provide a controlling terminal (sbuild) (LP: #888910). 2012-08-31 Steve Langasek [ A. Costa ] * init/man/init.5, util/man/runlevel.7, util/man/initctl.8: fix a number of typos. 2012-08-07 James Hunt * init/main.c: main(): Remove checks for /dev/kmsg, /dev/null, /dev/console and /dev/tty since some environments use different major/minor numbers to the norm (for example on LXC, /dev/console is not (5,1), but (136,*)). Do not attempt to create /dev/console again, due to LXC numbering difference. 2012-08-03 James Hunt * init/main.c:main(): Handle hostile initramfs-less environments by calling umask and creating required device nodes as early as possible. * init/system.c: New functions to simplify code: - system_mknod() - system_check_file() 2012-07-31 James Hunt [ Eric S. Raymond ] * extra/man/socket-event.7: Fixed incorrect troff (LP: #1018925). 2012-03-22 James Hunt * NEWS: Begin new release. * configure.ac: Bump version to 1.6. 2012-03-22 James Hunt * Changelog: Release entry. * configure.ac: Bump year. * NEWS: Release 1.5. 2012-03-16 James Hunt * init/tests/test_job_process: - Fixed multiple TEST_FAILED() typos ("unexpected" => unexpectedly"). * job_process_spawn(): Only display single message if pty setup fails. * init/man/init.5: Typo. * init/tests/test_job_process: - child(): New TEST_OUTPUT_WITH_STOP test. - test_run(): New test "with multiple processes and log". - test_spawn(): - umask reset. - New test "ensure multi processes output logged". * dbus/com.ubuntu.Upstart.xml: - added 'NotifyDiskWriteable' method. * init/control.c: - control_notify_disk_writeable(): New function to flush early job log. * init/job_process.c: - job_process_terminated(): Call log_handle_unflushed() to potentially add log object to unflushed list (the early job log) in certain scenarios. * init/log.c: - log_flushed: bool indicating successful flush of early job log. - log_unflushed_files: The "early job log" list. - log_new(): Call log_unflushed_init() and initialize new log members. - log_flush(): Only call log_read_watch() conditionally now. - log_io_reader(): More careful consideration of errno by using saved value from log member. - log_io_error_handler(): Set remote_closed for the benefit of log_flushed() (to avoid flushing multiple times). - log_file_open: Now saves errno value from open(2). - log_read_watch(): Removed log->unflushed->len assert since it was erroneous: even if unflushed data exists, it will be written in order when log_io_reader() calls log_file_write(). - log_unflushed_init(): New function to initialise the log_unflushed_files list. - log_handle_unflushed(): New function that potentially adds log object to the log_unflushed_files list to allow the data to be flushed _after_ the parent object has been destroyed. - log_clear_unflushed(): New function to clear the log_unflushed_files list by attempting to flush the data to disk. - log_read_watch(): Set remote_closed for scenarios where error handler never called. (LP: #935585) * init/log.h: - Added new Log members: detached, remote_closed and open_errno. - Updated documentation. - extern for log_unflushed_files. - Added prototypes for new functions: log_handle_unflushed(), log_clear_unflushed() and log_unflushed_init(). * init/tests/test_job_process.c: - test_run(): - Call log_unflushed_init(). - Corrected grammar in error messages for "ensure sane fds" tests. - "with single line command writing fast and exiting": Call nih_child_add_watch(). - added waitid() calls to ensure log data not added to unflushed list. - test_spawn(): - Call log_unflushed_init(). - Corrected grammar in error messages for "ensure sane fds" tests. - Added TEST_ALLOC_SAFE() to "simple test" to ensure destructors run correctly. - "read single null byte with 'console log'": Call log_handle_unflushed() and added missing free. - "read data from forked process": Call log_handle_unflushed(). * init/tests/test_log.c: - Updated documentation. - Added calls to log_unflushed_init(). - "ensure logger flushes cached data on request": New test for log_handle_unflushed(). * util/initctl.c: - notify_disk_writeable_action(): New function to notify Upstart that the disk is writeable. - commands: Added new command "notify-disk-writeable". * util/man/initctl.8: Updated for new notify-disk-writeable command. * util/tests/test_initctl.c: - STOP_UPSTART(): Check return from kill(2). - test_show_config(): Adding missing rmdir(2). - test_check_config(): Adding missing rmdir(2). - test_notify_disk_writeable(): New function embodying new test "with job ending before log disk writeable". [ Steve Langasek ] * init/tests/test_job_process: - close_all_files(): New function to ensure test environment has only expected fds open. - main(): Call close_all_files(). 2012-03-07 James Hunt * init/job.c: job_new(): Initialize log array. * init/job.h: Change Log element to an array to handle scenario where job has multiple simultaneous processes running (LP: #940290). * init/job_process.c: - job_process_run(): pass ProcessType to job_process_spawn(). - job_process_spawn(): - Now accepts a ProcessType. - Ensure existing matching process type log is destroyed before creating a new one. - job_process_terminated(): Update for log array. * init/job_process.h: Updated prototype for job_process_spawn(). * init/tests/test_job.c: test_new(): Updated logic for log array. * init/tests/test_job_process.c: test_run(): - Updated logic for log array. - Added ProcessType to job_process_spawn() calls. 2012-03-05 James Hunt * init/job_process.c: job_process_spawn(): If pty setup fails, log message and disable logging for job. * init/man/init.5: Explain new behaviour should pty setup fail. * init/tests/test_job_process.c: Updated disabled test "when no free ptys" for new behaviour. 2012-03-01 James Hunt * init/job_class.c: - job_class_get_instance(): - Use nih_local to avoid memory leak should nih_strcat_sprintf() fail. - Formatting. - job_class_start(): - Use nih_local to avoid memory leak should nih_strcat_sprintf() fail. - Formatting. * init/man/init.5: Add further pty details. 2012-02-13 James Hunt * init/log.c: - log_flush(): Comments. - log_read_watch(): - Improved comments. - Don't re-attempt read on EAGAIN/EWOULDBLOCK since those errors are nominally impossible due to the remote end of the pty already having ended (LP: #926468). - Added a debug-mode warning when 'badly-behaved' application detected that leaks fds to its children, as this is generally a bug. * init/tests/test_job_process.c: - test_run(): - "with single line command writing fast and exiting": added waitpid() to ensure no EAGAIN. - test_spawn(): - "with no such file, no shell and console log": added waitpid() to ensure no EAGAIN. 2012-02-03 James Hunt * init/job_process.c: job_process_spawn(): - Set close-on-exec for pty_master. - Ensure stdio buffers flushed prior to forking to ensure no data leakage to child (should init be run with '--debug', or the tests be run with redirected output, for example). - Free log object if child process fails to exec(3) rather than just closing fd. This ensures io watch is removed correctly. (LP: #922754) - Only need to remap pty_master if CONSOLE_LOG in operation. * init/tests/test_job_process: - fd_valid(): New helper function to determine if specified fd is valid. - child(): Added new 'TEST_FDS' test to ensure no fd leakage to child processes. - test_run(): - New tests: - "ensure sane fds with no console, no script" - "ensure sane fds with no console, and script" - "ensure sane fds with console log, no script" - "ensure sane fds with console log, and script" - "with single-line command running an invalid command, \ then a 1-line post-stop script" - "with single-line command running an invalid command, \ then a 2-line post-stop script" - "with single-line command running an invalid command, \ then a post-stop command" - "with single-line command running an invalid command, \ then an invalid post-stop command" - "with single-line command running a valid command, \ then a 1-line invalid post-stop command" - Test "with single-line command running an invalid command": - now diverts stderr output for less chatty test-run experience. - Improved checking. - Test "with setuid me" now diverts stderr output for less chatty test-run experience. - test_spawn(): - New tests: - "with no such file, no shell and console log" - "ensure sane fds with no console" - "ensure sane fds with console log" * init/tests/test_log.c: test_log_destroy(): - New test "ensure watch freed when log destroyed" 2012-01-27 James Hunt * init/tests/test_job_process.c: test_run(): Fixed typo in test "with setuid me" where uid value was being set to gid. 2012-01-25 James Hunt * init/job_process.c: job_process_terminated(): Free log to ensure data written as soon as _any_ process ends (consider respawn jobs). * init/log.c: - log_destroy(): - Improved documentation. - Now calls new function log_flush(). - log_flush(): New function to ensure no lingering buffered job data remains. Now considers EBADF (LP: #912558). - log_io_reader(): - Added missing assert for @len. - Simplified ENOSPC handling. - Ensure log->io set to NULL to allow other routines to detect it really has gone. - log_file_write(): Added @len checks. - log_read_watch(): New function to drain data from a watch descriptor (which also must consider EBADF). * init/log.h: Added define for LOG_READ_SIZE. * init/tests/test_job_process.c: - test_run(): - Added some extra pointer checks. - Free class *before* checking file to ensure destructor invoked at correct point. - Added test "with single-line command running an invalid command" (for scenario bug 912558 exposed). - Added test "with single-line command writing fast and exiting". * init/tests/test_log.c: Changed all tests to use openpty(3) rather than pipe(2) for semantic parity with actual code. * util/tests/test_user_sessions.sh: - ensure_no_output(): Now calls check_job_output() and delete_job() to simplify logic. - delete_job(): Call get_job_file() rather than doing it long-hand. - check_job_output(): New function. - start_job(): Added allow_failure parameter. - test_ensure_no_unexpected_output(): New test "ensure command job does not create log file with invalid command". 2012-01-05 James Hunt * init/man/init.5: Explain that all job processes affected by 'setuid' and 'setgid' stanzas. 2011-12-22 James Hunt * init/job_process.c: job_process_spawn(): - Set child handler to default rather than explicit ignore to avoid test failures in environments that disallow ignoring SIGCHLD. * init/tests/test_job_process.c: test_run(): - Changed timeout for test feature "ensure that no log file written for CONSOLE_NONE". 2011-12-15 James Hunt * Makefile.am: Add missing TESTING.sessions to distribution. * contrib/vim/syntax/upstart.vim: Meta-data update and addition of more standard (Ubuntu Upstart) events. * extra/man/upstart-udev-bridge.8: Ensure literal dashes used for all command-line options. * extra/upstart-udev-bridge.c: - udev_monitor_watcher(): Fix leak when obtaining udev value. - make_safe_string(): Don't realloc since overhead too high considering size of strings. * init/job_class.c: Typo. * init/job_process.c: job_process_spawn(): - Correct ignoring of SIGCHLD prior to grantpt(3) call. - Removed redundant close(2) calls. - Move declarations to top of block for getpwnam(3)/getgrnam(3). * init/log.c: - log_file_open(): Comments. - log_file_write(): Added missing cast on nih_io_buffer_shrink() call. * init/main.c: console_type_setter(): NihOptionSetter's should return 0 on success. * init/man/init.5: lower-case all references to system jobs and user jobs. * init/tests/test_job_process.c: Add missing include for fnmatch.h. 2011-12-15 James Hunt * init/tests/test_job_process.c: test_run(): - Ensure process group killed for multi-process shell scripts. - Change 'command-not-found' tests to use regex matching rather than literal to allow for minor differences in /bin/sh variants error output. 2011-12-13 James Hunt * configure.ac: Bump version to 1.5 * NEWS: Begin new release 2011-12-13 James Hunt * NEWS: Release 1.4 * configure.ac (NIH_COPYRIGHT): Update 2011-12-12 James Hunt Simplify logfile name encoding. * init/job_process.c: job_process_log_path(): Ditch D-Bus job name encoding in path names for saner approach that simply remaps slash characters (minimal surprises for users). * init/job_process.h: Addition of macros: - JOB_PROCESS_LOG_FILE_EXT - JOB_PROCESS_LOG_REMAP_FROM_CHAR - JOB_PROCESS_LOG_REMAP_TO_CHAR * init/man/init.5: Update console section for simplified log filename encoding approach. * init/test_job_process.c: test_log_path(): Updates for simplified logfile name encoding. * util/tests/test_user_sessions.sh: Updates for simplified logfile name encoding: removed dbus_encode() and replaced with upstart_encode(). 2011-12-12 James Hunt * extra/man/upstart-udev-bridge.8: - Added new '--no-strip' option. - Added missing '--daemon', '--debug' and '--help' options. * extra/upstart-udev-bridge.c: XXX: Behavioural change: non-printable bytes are now removed by default from all udev message data to handle buggy hardware devices which expose this data to userland (the kernel simply passes it through verbatim). To revert to old behaviour (where no udev message data is modified), specify the new '--no-strip' option (LP: #829980). - make_safe_string(): New function to cleanse udev data. - udev_monitor_watcher(): - Cleanse udev data unless '--no-strip' specified. - Fixed possible crash should 'action' not be set. - Fixed possible crash should 'devname' not be set and '--debug' specified. 2011-12-09 James Hunt * Merge of 'setuid' + 'setgid' stanzas from Evan Broder (lp:~broder/upstart/drop-privileges). 2011-12-09 James Hunt Introduction of 'log' argument to 'console' stanza allowing system job output only to be captured. * contrib/vim/syntax/upstart.vim: Added 'log' and missing 'none'. * init/Makefile.am: Update for log.c, log.h and test_log.c. * init/job.c: job_new(): Initialize log. * init/job.h: Add Log pointer to Job. * init/job_class.c: - XXX: behaviour change: Default for 'console' is now CONSOLE_LOG rather than CONSOLE_NONE. Rationale is that if a job does produce output, you want to see it since the chances are it will contain useful error details. - Added default_console variable. - job_class_console_type(): New function to parse console type string. * init/job_class.h: - Added CONSOLE_LOG to ConsoleType and updated documentation for ConsoleType. - Added prototype for job_class_console_type(). * init/job_process.c: - New log_dir and disable_job_logging variables. - job_process_run(): Updated to reflect new parameter for job_process_spawn(). - job_process_spawn(): Now accepts a Job rather than a JobClass to allow job->log and class->console to be handled appropriately. Now creates pty master and slave fds for console logging. Simplified code for file descriptor switching by using new job_process_remap_fd(). - job_process_error_read(): Added entries for: - JOB_PROCESS_ERROR_OPENPT_MASTER - JOB_PROCESS_ERROR_OPENPT_UNLOCKPT - JOB_PROCESS_ERROR_PTSNAME - JOB_PROCESS_ERROR_OPENPT_SLAVE - job_process_log_path(): New function that returns full path to log file for specified Job. - job_process_remap_fd(): New function to ensure file descriptors do not collide. * init/job_process.h: - Updated JobProcessErrorType with new entries: - JOB_PROCESS_ERROR_OPENPT_MASTER - JOB_PROCESS_ERROR_OPENPT_UNLOCKPT - JOB_PROCESS_ERROR_PTSNAME - JOB_PROCESS_ERROR_OPENPT_SLAVE - job_process_spawn(): Updated prototype. - job_process_log_path(): Added prototype. * init/main.c: - handle_logdir(): New function for overriding log directory. - console_type_setter(): New Function to handle selection of default console value. - Added following command-line options: - '--default-console' - '--logdir' - '--no-log' * init/man/init.5: - Update and restructure of section on 'console' stanza. - Added a FILES section. * init/man/init.8: Updated with details of new options: - '--default-console' - '--logdir' - '--no-log' * init/parse_job.c: stanza_console(): Updated for "log". * init/paths.h: Added defines for JOB_LOGDIR and LOGDIR_ENV. * init/session.c: - Added missing function headers. * init/system.c: system_setup_console(): Update for CONSOLE_LOG. * init/test_conf.c: - TEST_FORCE_WATCH_UPDATE(): Removed debug. - test_override(): Removed erroneous comment. - test_select_job(): Added variable attributes to keep gcc 4.6 happy. * init/test_event.c: Explicitly set console type to CONSOLE_NONE to retain behaviour of existing tests. * init/test_job.c: - test_job_new(): Ensure log object not created on Job instantiation. - test_change_state(): Explicitly set console type to CONSOLE_NONE to retain behaviour of existing tests. * init/test_job_class.c: - test_new(): Ensure console type now defaults to CONSOLE_LOG. - Explicitly set console type to CONSOLE_NONE to retain behaviour of existing tests. * init/test_job_process.c: - Added various new macros to simplify test code. - child(): New child_tests added for TEST_OUTPUT and TEST_SIGNALS. - get_available_pty_count(): New function. - Explicitly set console type to CONSOLE_NONE to retain behaviour of existing tests. - test_run(): Added new tests for CONSOLE_LOG. - test_spawn(): Added new tests for CONSOLE_LOG. - test_log_path(): New function. - test_handler(): Added UPSTART_LOGDIR support to - main(): - Update to allow number of forks to be specified when run as a child process. - Added call to test_log_path(). - initialize various subsystems since before, functions run from main() had to be run in the order specified and exactly as listed (certain tests relied on previous tests initializing a subsystem which gives unexpected results and thus confusing behaviour if the order of tests is changed). * init/test_parse_job.c: Added new test to test_stanza_console() for "console log". * util/tests/test_user_sessions.sh: Added tests for job logging to ensure no unexpected output recorded for user jobs. 2011-11-16 Petr Lautrbach * init/parse_job.c, init/job_class.c, init/job_class.h: Added "usage" stanza which is used by initctl command. * init/tests/test_parse_job.c: Tests for "usage" stanza * init/man/init.5: "usage" stanza documentation. * util/initctl.c, util/man/initctl.8: Added "inictl usage" command. * util/tests/test_initctl.c: Tests for ""inictl usage" command. 2011-08-11 Scott James Remnant * init/job_process.c (job_process_spawn): Can't return on dup2() error, we're in the child. Return an error back to the child properly. * init/job_process.c (job_process_spawn), init/main.c: error should be ENOENT * init/job_class.c, init/job_class.h: Move constants into the header file so they can be found from other source files. * init/job_process.c (job_process_spawn): Only adjust the OOM score if it isn't the default * init/main.c: Apply the default OOM score to the init process itself. * init/main.c: Deal with failure to setup the system console by falling back to /dev/null, so we don't end up without default fds and castrate the process. 2011-08-10 Scott James Remnant * init/job_class.c (job_class_new): nit, use #defines for the default nice level and oom score adjustment. 2011-07-25 James Hunt * init/job_process.c: job_process_spawn(): - Added dup2() return check. * TESTING.sessions: Updated with information on user sessions. * init/job_process.c: - job_process_spawn(): - Change group before user and do it as early as possible. - Ensure non-priv user is able to read script fd. Default system behaviour is seemingly not consistent/defined, so force it to be (LP: #813052) - Ensure cwd for user job is home directory by default. - job_process_error_read(): - Added handling for JOB_PROCESS_ERROR_SETUID and JOB_PROCESS_ERROR_SETGID (LP: #807293). - Added new entry for JOB_PROCESS_ERROR_CHOWN. * init/job_process.h: - Added entry for JOB_PROCESS_ERROR_CHOWN in JobProcessErrorType. * init/man/init.5: Update for user jobs explaining behaviour of stanzas which manipulate system resource limits and when the init daemon reads the users job directory. * util/tests/test_user_sessions.sh: New script for testing user sessions (NOTE: this is *NOT* run automatically). * init/session.c: session_from_dbus(): Handle case where a users home directory is changed or where a uid is re-used for a different username. * init/session.h: Updated comments for Session object. * init/man/init.5: Explain that symbolic links are not supported. 2011-07-22 James Hunt * util/man/initctl.8: Clarify semantics of restart(8) command (LP: #731225). 2011-07-20 James Hunt * util/tests/test_initctl.c: - test_show_config(): /* fall through :) */ - test_check_config(): Manually start and stop dbus-daemon to work around change in dbus autostart behaviour which causes issues when running the tests in a chroot and non-X11 environment (see dbus commit cea055514a9dfc74e7f0515cf4a256da10a891bc). 2011-06-14 James Hunt * NEWS: Release 1.3 2011-06-14 James Hunt * contrib/vim/syntax/upstart.vim: Updates for kill, oom, expect and limit. 2011-06-07 Scott James Remnant * init/job_process.c (job_process_spawn): Make sure we don't close our own file descriptor if it already has the right value. 2011-06-06 James Hunt Add override file support. * init/conf.c: - conf_reload_path(): Now takes an extra override_path parameter. - is_conf_file() / is_conf_file_std() / is_conf_file_override(): New functions to determine type of given file path. - toggle_conf_name(): New function which convert a conf file name to an override name and vice versa. - majority of remaining functions updated to handle override files. * init/conf.h: Prototypes. * init/job_class.c: Whitespace. * init/man/init.5: Updated to document override file support. * init/man/init.8: Added reference to control-alt-delete(7) man page. * init/paths.h: New macros CONF_EXT_OVERRIDE, CONF_EXT_STD, IS_CONF_FILE_OVERRIDE and IS_CONF_FILE_STD. * init/parse_conf.c: Added assertion to remind us forcibly to add override-handling code for directories if we ever allow content in 'init.conf'. * init/parse_job.c (parse_job): Additional parameter 'update' to allow override files to replace existing Job details. * init/parse_job.h: Updated parse_job() prototype. * init/test_conf.c - New macros TEST_ENSURE_CLEAN_ENV() and TEST_FORCE_WATCH_UPDATE(). - test_override(): New function. - test_toggle_conf_name(): New function. * init/test_parse_job.c: - Updated for extra parse_job() parameter. - added a test feature to test_parse_job() to exercise new parameter to parse_job(). * util/man/initctl.8: Clarified what it means to restart a job. Add udev and socket bridges. * Makefile.am: Added extra directory. * New files: - extra/Makefile.am - extra/conf/upstart-socket-bridge.conf - extra/conf/upstart-udev-bridge.conf - extra/man/socket-event.7 - extra/man/upstart-socket-bridge.8 - extra/man/upstart-udev-bridge.8 - extra/upstart-socket-bridge.c - extra/upstart-udev-bridge.c * configure.ac: - Check for udev (for upstart-udev-bridge). - Add extra/Makefile to AC_CONFIG_FILES. * dbus/com.ubuntu.Upstart.xml: Add EmitEventWithFile method. * init/control.c: - control_emit_event(): Now a wrapper for control_emit_event_with_file. - control_emit_event_with_file(): New function that operates on an fd. * init/control.h: Prototype for control_emit_event_with_file(). * init/event.c: - event_new(): Initialize event fd. - event_pending_handle_jobs(): Now calls event_operator_fds(). * init/event.c: Add fd to Event struct. * init/event_operator.c: event_operator_fds(): New function. * init/event_operator.h: Prototype for event_operator_fds(). * init/job.c: job_new(): Initialize fd members. * init/job.h: Add fds and num_fds to Job struct. 2011-06-03 James Hunt Add session support. Note that there are no automatically runnable and explicit tests yet. However, see TESTING.sessions. * TESTING.sessions: ASCII (reStructuredText) document explaining how to run manual tests for session support (for chroots). * dbus/Upstart.conf: Simplified to support allowing users to invoke all methods (since Upstart now isolates commands by user). * init/Makefile.am: Added session.[ch] files. * init/session.c: New file. Note that session_from_dbus() will disable sessions (by returning the NULL session) if environment variable "UPSTART_NO_SESSIONS" is set to any value (used by tests). * init/session.h: New file. * init/parse_job.h: parse_job(): Add session pointer to prototype. * init/parse_job.c: - parse_job(): Add session parameter. - Update calls to job_class_new() to pass session pointer. * init/job.c: job_new(): Crucial change to ensure chroot sessions have a unique D-Bus name (LP:#728531). * init/job_class.c: - job_class_new(): Add session parameter and session support. - job_class_remove(): Add session parameter to prototype. - job_class_consider(): Only consider jobs from the appropriate session. - job_class_reconsider(): Only consider jobs from the appropriate session. - job_class_start(): Disallow out-of-session modification. - job_class_stop(): Disallow out-of-session modification. - job_class_restart(): Disallow out-of-session modification. * init/main.c: Add "--no-sessions" command-line option to disable sessions and revert to traditional behaviour. * init/job_class.h: - job_class_new(): Add session pointer to prototype. - JobClass: Add session member. * init/job_process.c: job_process_spawn(): - Call chroot(2) for chroot sessions. - Call setuid(2) for user session jobs. * init/job.c: - job_emit_event(): Set session for event. - job_start(): Disallow out-of-session modification. - job_stop(): Disallow out-of-session modification. - job_restart(): Disallow out-of-session modification. * init/event.h: Event: Add session member. * init/event.c: - event_new(): initialize session to NULL. - event_pending_handle_jobs(): Add session handling. - event_finished(): Set session for failure event. * init/control.c: - control_get_job_by_name(): Add session handling. - control_get_all_jobs(): Add session handling. - control_emit_event(): Add session handling. * init/conf.c: - conf_source_new(): Initialise session to NULL. - conf_reload_path(): Pass session to parse_job(). - conf_select_job(): Add session parameter. * init/conf.h: - ConfSource: Add session member. - conf_select_job(): Add session parameter to prototype. * All tests updated to set "UPSTART_NO_SESSIONS" (to disable sessions). 2011-06-02 James Hunt * contrib/bash_completion/upstart: - Made function names more meaningful: - _upstart_jobs: Now returns a unique list - _upstart_events (nee _upstart_named_events ) now considers all "emits" tokens. - Updates for "check-config" and "show-config". - Added "--session" option. - Added "--no-wait" for emit, reload and restart. Man page updates. * init/man/init.5: - Quoted dashes. - Explain handling of duplicated stanzas. - "respawn": Document default count and interval. - "emits": Reference "initctl check-config". - Added BUGS section. - Added copyright. * init/man/init.8: - Quoted dashes. - See Also: Added control-alt-delete(7). * util/man/initctl.8: - Quoted dashes. - "restart": Clarified meaning. - "list": Explained "stop/waiting" jobs. 2011-06-01 James Hunt Add D-Bus session support to initctl. * util/initctl.c: - Added "--session" command-line option. - dbus_bus_type_setter(): New function used by option parser to distinguish system/session D-Bus bus type. - system_bus variable now replaced by two others: use_dbus (boolean) and dbus_bus_type. - upstart_open(): Updated to handle multiple D-Bus bus types. * util/man/initctl.8: Update for "--session" option. * util/tests/test_initctl.c: Updated to make use of use_dbus and dbus_bus_type rather than system_bus. Add "show-config" command to initctl. * util/initctl.c: - New functions: - job_class_condition_handler(): Handler function to retrieve job conditions. - job_class_condition_err_handler(): Handler error function for job_class_condition_handler(). - job_class_parse_events(): Convert RPN "start on" and "stop on" conditions to human-readable format. - job_class_show_emits(): Display events which job emits. - job_class_show_conditions(): Make D-Bus calls to retrieve "start on" and "stop on" conditions. - show_config_action: Handle "show-config" command.. * util/initctl.h: New file providing stack-handling functionality for RPN parsing for "show-config" command. * util/Makefile.am: Added initctl.h to initctl_SOURCES. * util/man/initctl.8: Updated for "show-config" command and associated options. * util/tests/test_initctl.c: - New macros START_UPSTART, STOP_UPSTART, RUN_COMMAND, CREATE_FILE and DELETE_FILE. These are required since due to the introduction of the "show-config" initctl command, initctl is no longer solely a proxy to Upstart: it now has some intelligence (it parses the "emits", "start on" and "stop on" conditions) and thus must be tested directly. - test_show_config(): New function to test "initctl show-config". - in_chroot(): New function to detect if tests are being run from within a chroot environment. - dbus_configured(): New function which performs a basic check to establish if D-Bus is configured correctly. - main(): Added call to test_show_config(), conditional on a non-chroot environment and a working D-Bus system. Add "check-config" command to initctl. * util/initctl.c: - New functions: - allow_event(): Determine if specified event is erroneous or not. Handles globbing. - allow_job(): Determine if specified job is erroneous or not. Handles variables (such as instance variables). - check_condition(): High-level function to handle checking start on/stop on conditions. - check_config_action: Handler for "check-config" command. - display_check_errors(): Display errors from expression tree nodes that are in error. - eval_expr_tree(): Evaluate expression tree. - ignored_events_setter(): handler for '--ignore-events' command-line option for "check-config" command. - tree_filter(): Used for filtering expression tree nodes. - show_config_action(): Update for check-config mode. - job_class_parse_events(): Update for check-config mode. - job_class_show_emits(): Update for check-config mode. * util/initctl.h: - Added structs for JobCondition, CheckConfigData and ExprNode. - New macros: MAKE_EXPR_NODE() and MAKE_JOB_CONDITION(). * util/tests/test_initctl.c: - test_check_config(): New function to test "initctl check-config". - main(): Added call to test_check_config(), conditional on a non-chroot environment and a working D-Bus system. * util/man/initctl.8: Updated for "check-config" command and associated options. * conf/rc-sysinit.conf: Added "emits" stanza, required by "check-config". Addition of initctl2dot script for visualisation. * Makefile.am: Added scripts directory. * configure.ac: Updated AC_CONFIG_FILES for scripts/Makefile. * scripts/Makefile.am: Makefile for scripts. * scripts/initctl2dot.py: Python script to produce dot(1) graphs of "initctl show-config" output. * scripts/man/initctl2dot.8: Man page for initctl2dot.py script. Addition of init-checkconf script. * scripts/init-checkconf.sh: Script to determine if specified job config file is valid or not. * scripts/man/init-checkconf.8: Man page for init-checkconf.sh. * scripts/Makefile.am: Added init-checkconf script and man page. 2011-05-31 James Hunt Add command-line option to use D-Bus session bus (for testing). * init/control.c: - Added new boolean use_session_bus. - Updated comments. - control_handle_bus_type(): New function to allow selection of session bus via env var "UPSTART_USE_SESSION_BUS". Also logs use of session bus if use_session_bus set. - control_bus_open(): Now connects to either D-Bus system bus or session bus. * init/control.h: New define for USE_SESSION_BUS_ENV. * init/main.c: Addition of "--session" command-line option. * init/man/init.8: Update for new "--session" command-line option. * Corrected copyright notices. Add option to allow alternate location for job config files. * init/main.c: - Added "--confdir " command-line option. - handle_confdir(): New function to select alternate confdir using env var "UPSTART_CONFDIR" or command-line option (for testing). * init/paths.h: Added define for CONFDIR_ENV. * init/man/init.8: Update for new "--confdir" command-line option. Add ability to suppress initial event and/or change its name. * init/main.c: New command-line options: "--no-startup-event" and "--startup-event". If "--no-startup-event" specified, log message as a debug aid. * init/man/init.8: Documentation for new command-line options: "--no-startup-event" and "--startup-event". 2011-05-12 Marc - A. Dahlhaus * init/job_class.h (JobClass): Add kill signal member * init/job_class.c (job_class_new): Initialise kill signal * init/tests/test_job_class.c (test_new): Check kill signal initialised correctly. * init/system.c (system_kill): Change to accept a signal rather than a boolean. * init/system.h: Update prototype * init/tests/test_system.c (test_kill): Update tests to pass signals by value. * init/job_process.c (job_process_kill, job_process_kill_timer): Pass the configured kill signal, or SIGKILL, to the function rather than TRUE/FALSE. * init/parse_job.c (stanza_kill): Add parsing for kill signal. * init/tests/test_parse_job.c (test_stanza_kill): Check parsing works * init/errors.h: Add illegal signal error and string. * init/man/init.5: Update documentation * init/job_class.h (JobClass): Replace oom_adj with oom_score_adj * init/job_class.c (job_class_new): Replace oom_adj with oom_score_adj. * init/job_process.c (job_process_spawn): Write the new score adjustment, falling back to calculating and writing the old value if necessary. * init/parse_job.c (stanza_oom): Parse both the new and old values, converting the old value to the new value if present. * init/errors.h: Add new error string. * init/man/init.5: Documentation update. * init/tests/test_job_class.c (test_new): Update check. * init/tests/test_parse_job.c (test_stanza_oom): Update tests. 2011-05-12 Scott James Remnant * init/job_process.c (job_process_run): Always make the shell script fd 9, since that's the highest that shells are required by POSIX to support. Pass the file descriptor to job_process_spawn() (job_process_run): Accept the extra file descriptor, moving it to fd 9. (job_process_error_read): Add handling for error condition. * init/job_process.h: Adjust prototypes, add constant * init/tests/test_job_process.c (test_spawn): Add argument to call in tests 2011-03-22 Scott James Remnant * configure.ac: Bump version to 1.3 * NEWS: Begin new release * NEWS: Release 1.2 * init/job_process.c (job_process_run): Correct shell redirection; the form we used dosen't work with at least pdksh 2011-03-16 Scott James Remnant * configure.ac: Bump version to 1.2 * NEWS: Begin new release * NEWS: Release 1.1 * configure.ac (NIH_COPYRIGHT): Update * init/main.c: Don't close the console until initialization is complete. * util/Makefile.am (uninstall-hook): Clean up symlinks on uninstall * init/environ.c (environ_all_valid): Only verify that an = is present (environ_valid): Drop this function, the part of POSIX I read about valid environment variable names only applies to other things defined by POSIX, elsewhere it explicitly says Applications may do whatever they like (and even encourages to avoid conflict) (environ_expand_until): Remove validity check for name. * init/environ.h: Update header. * init/tests/test_environ.c (test_valid): Drop tests. (test_all_valid): Drop name tests. (test_expand): Remove illegal expansion test. * init/tests/test_control.c (test_emit_event): Remove the test case for an invalid name in the environment. * init/tests/test_job_class.c (test_start, test_stop) (test_restart): Change the invalid argument tests to use an entry without an = as the invalid test. * util/reboot.c: pass '-H' to shutdown when called as 'halt' * init/job_process.c (job_process_handler): Check the job's normal exit list, decrease log priority of messages from warning to information if the exit status or signal is in the list. * init/tests/test_job_process.c (test_handler): Change the normal exit test cases to not expect the warning * init/job_process.c (job_process_run): Prepend a shell command to the pasted script to force the shell to close the file descriptor being used to paste the script. The shell will already have a new copy when it opened the path. 2011-03-15 James Hunt * init/conf.c (conf_source_reload, conf_source_reload_dir): Fix typos in doc-strings * init/job_process.c (job_process_run): Fix typo in doc-string * init/parse_job.c (stanza_env): Fix typo in doc-string 2011-03-15 Patty Langasek * init/man/init.5: Grammar fixes 2011-03-15 Jacek Konieczny * contrib/vim/syntax/upstart.vim: Further improve syntax hilighting 2011-03-01 Scott James Remnant * configure.ac: Bump version to 1.1 * NEWS: Begin new release * NEWS: Release 1.0 2011-02-17 Scott James Remnant * configure.ac, NEWS: Bump version to 1.0 * TODO: Update. * init/tests/test_conf.c (test_source_reload_job_dir): Add tests for a crasher bug when a file is created called ".conf" * init/conf.c (conf_dir_filter): Apply fix for the crasher; check that the character before the ".conf" extension is not "/" * NEWS: Update. 2011-01-06 Petr Lautrbach * init/job_process.c (job_process_termianted): Don't rewind the utmp file between updates. * init/tests/test_job_process.c (test_utmp): Add test case for newer mingetty behaviour. 2010-12-21 James Hunt * contrib/bash_completion/upstart: Add bash completion script. * contrib/Makefile.am (EXTRA_DIST): Include in tarball. * NEWS: Update. 2010-12-20 Scott James Remnant * NEWS: update. 2010-12-20 Petr Lautrbach * init/job_process.c (job_process_terminated): On termination of a job, update the utmp file replacing any existing entry for that pid with a DEAD_PROCESS entry; likewise append an entry to wtmp. * init/tests/test_job_process.c (test_utmp): Test utmp handling. * util/shutdown.c: Exit non-zero if unable to shutdown the system. 2010-12-14 Scott James Remnant * configure.ac: Bump version to 0.6.8 * NEWS: Begin new release * NEWS: Release 0.6.7 * dbus/com.ubuntu.Upstart.Job.xml (start_on, stop_on, emits): Add new properties to return the job's relationship to events. * init/job_class.c (job_class_get_start_on) (job_class_get_stop_on, job_class_get_emits): Implement the properties * init/job_class.h: Add prototypes. * init/tests/test_job_class.c (test_get_start_on) (test_get_stop_on, test_get_emits): Test the new properties too 2010-12-14 James Hunt * init/parse_job.c (stanza_manual): New function to handle manual stanza. * init/tests/test_parse_job.c (test_stanza_manual): New function to test manual stanza. * init/man/init.5: Update for manual stanza. 2010-12-14 James Hunt * init/job_class.h: Added debug member. * init/job_class.c: Initialized debug member. * init/job_process.c: Pause child using raise(3). * init/main.c: Display PID+PPID for debug builds. * init/parse_job.c: Added new function stanza_debug. * init/tests/test_job_process.c (test_spawn): Added test for debug stanza. 2010-12-10 Scott James Remnant * dbus/upstart.h (DBUS_SERVICE_UPSTART, DBUS_ADDRESS_UPSTART): For debugging purposes, when -DDEBUG is given, change the values of these constants. You'll need to modify your own D-Bus configuration of course. 2010-12-09 Scott James Remnant * init/tests/test_job.c (test_change_state): Add missing DBUS_TYPE_INVALID to dbus_message_get_args() call. 2010-12-08 Colin Watson * dbus/com.ubuntu.Upstart.Instance.xml (GoalChanged, StateChanged) (Failed): New signals. * init/job.c (job_change_goal): Emit GoalChanged signal after (job_change_state): Emit StateChanged signal after changing state. (job_failed): Emit Failed signal after marking job as failed. * init/tests/test_job.c (test_change_goal): Test for this. (test_change_state): Test for this. * NEWS: Update. 2010-12-08 James Hunt * init/event.c, init/event_operator.c: Fix grammar and factual errors in comments. * init/man/init.5: Fix grammar errors and clarify export behaviour. 2010-12-08 Clint Byrum * init/man/init.5: Typo existing -> exiting 2010-08-12 Scott James Remnant * init/job_process.c (job_process_spawn): We can fail to open the system console for various reasons, sometimes because there isn't a console (ENXIO or ENODEV) but worse due to kernel race conditions on SMP/multi-core systems (EIO). If "console output" is used, and these happen, fall back to /dev/null. 2010-04-27 Scott James Remnant * configure.ac: Bump version to 0.6.7 * NEWS: Begin new release * NEWS: Release 0.6.6 * configure.ac: Bump the requirement of libnih to 1.0.2 after verifying that building using --with-local-libnih and an earlier version installed still works. 2010-04-24 Scott James Remnant * configure.ac: Replace the --with-local-libnih code with an expansion of the NIH_WITH_LOCAL_LIBNIH macro that now contains it. * README: Bump libnih version. 2010-03-31 Colin Watson * init/man/init.5 (env): Document behaviour when the environment variable's value is omitted. * init/parse_job.c (stanza_env): Document that arguments may be simply VAR as well as VAR=VALUE. 2010-03-02 Michael Biebl * configure.ac: Remove double-quoting from NIH_CFLAGS and NIH_DBUS_CFLAGS when using --with-local-libnih 2010-02-26 Scott James Remnant * NEWS: Update. * init/job_process.c (job_process_run): Since /proc is always mounted, guaranteed because we mount it ourselves if it isn't, we don't need to check for it and can always use /proc/self/fd/NNN when we want. * init/tests/test_job_process.c (test_run): Since /proc is always mounted, we don't need to check for it and skip tests. * init/system.c (system_mount): Add function to mount a kernel filesystem (ie. /proc and /sys) * init/system.h: Add header. * init/main.c: Mount /proc and /sys on initialisation. * init/paths.h (DEV_FD): Drop this definition, it's needless. * init/job_process.c (job_process_run): Rather than using /dev/fd, use /proc/self/fd which is more Linuxish and is always guaranteed to exist when /proc is mounted - needing no symlinks. * init/tests/test_job_process.c (test_run): Adjust test to match. 2010-02-09 Scott James Remnant * configure.ac: Use NIH_COPYRIGHT instead of AC_COPYRIGHT 2010-02-04 Scott James Remnant * configure.ac: Bump version to 0.6.6 * NEWS: Begin new release * NEWS: Release 0.6.5 * util/tests/test_initctl.c (test_reload_action): Don't send SIGHUP to the server process, it'll be terminated anyway since reload doesn't loop. * init/event_operator.c (event_operator_match): Support operator negation using != * init/tests/test_event_operator.c (test_operator_update): Add test cases for negation. * init/man/init.5: Add negation to documentation * init/man/init.8: Improve reference to init(5) to make it more obvious that this is where documentation can be found. * init/man/init.5: Add Upstart to the title to make it show up with man -k upstart * init/man/init.8: Add missing OPTIONS section, documenting the --verbose option. * init/main.c (main): After resetting the system console, close it again and reopen /dev/null for ourselves so we don't hold the system console open. * init/job_process.c (job_process_error_abort): Free the error before exiting. * util/initctl.c (reload_action): Add a reload command, this obtains the pid of the main process of the given job instance and sends SIGHUP to it. It might not be in its final form, but it's damned useful for now. * util/tests/test_initctl.c (test_reload_action): Add test cases. * util/man/initctl.8: Add documentation for the reload command, and missing documentation for restart. * util/Makefile.am (install-data-hook, install-exec-hook): Create additional reload symlinks. * util/reboot.c (main): Restore the sync() system call before calling reboot(); the Linux kernel says we have to do this, and I suspect that ext4 is no longer forcing this before power off. * init/main.c (hup_handler): Move call to reconnect to D-Bus system bus into new function (usr1_handler): This is because a config reload "forgets" existing state, such as events that were pending. (main): Add SIGUSR1 signal handler. * init/job_process.c (job_process_handler): Reduce priority of the stopped/continued by signal messages to informational. 2010-02-03 Scott James Remnant * util/shutdown.c (shutdown_now): Free error before exiting. 2010-02-03 Johan Kiviniemi * conf/rc-sysinit.conf: Don't replace DEFAULT_RUNLEVEL with an empty string when there is no "initdefault" line in /etc/inittab 2010-02-03 Scott James Remnant Update code to work with libnih 1.0.1 * init/tests/test_event.c (test_new): Replace TEST_ALLOC_ORPHAN(env) with TEST_ALLOC_PARENT(env, NULL); discard environment after creating event from it * init/tests/test_event_operator.c (test_operator_new): Replace TEST_ALLOC_ORPHAN(env) with TEST_ALLOC_PARENT(env, NULL); discard environment after creating event from it * init/tests/test_control.c (test_emit_event): Discard event environment after emission * init/init.supp: Add nih_alloc_ref_new() to init functions libnih is now released as its own project, so rather than expecting to include it with the source we depend on it being outside of it. * Makefile.am (SUBDIRS): Remove m4 directory along with the nih bits. (EXTRA_DIST): Remove ChangeLog.nih * configure.ac (AM_INIT_AUTOMAKE): Remove dist-bzip2, since we don't actually use it; add color-tests and silent-rules. (AM_SILENT_RULES): Use silent rules by default (AM_MAINTAINER_MODE): Enable maintainer mode by default (as before), but allow it to be disabled (AM_GNU_GETTEXT_VERSION): Bump to 0.17 (NIH_INIT): Replace with the expanded out calls that we actually need. (AC_CONFIG_FILES): Remove nih directories Add magic to allow use of a local libnih source tree. * init/Makefile.am (AM_CFLAGS): Add NIH_CFLAGS and NIH_DBUS_CFLAGS (init_LDADD, test_system_LDADD, test_environ_LDADD, test_process_LDADD) (test_job_class_LDADD, test_job_process_LDADD, test_job_LDADD) (test_event_LDADD, test_event_operator_LDADD) (test_blocked_LDADD, test_parse_job_LDADD) (test_parse_conf_LDADD, test_conf_LDADD, test_control_LDADD): Replace library paths with NIH_LIBS and NIH_DBUS_LIBS ($(com_ubuntu_Upstart_OUTPUTS)), ($(com_ubuntu_Upstart_Job_OUTPUTS)), ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Use external nih-dbus-tool and obey silent rules. (test_system_LDFLAGS, test_environ_LDFLAGS) (test_process_LDFLAGS, test_job_class_LDFLAGS) (test_job_process_LDFLAGS, test_job_LDFLAGS, test_event_LDFLAGS) (test_event_operator_LDFLAGS, test_blocked_LDFLAGS) (test_parse_job_LDFLAGS, test_parse_conf_LDFLAGS) (test_conf_LDFLAGS, test_control_LDFLAGS): Drop -static * util/Makefile.am (AM_CFLAGS): Add NIH_CFLAGS and NIH_DBUS_CFLAGS (initctl_LDADD, reboot_LDADD, runlevel_LDADD, shutdown_LDADD) (test_initctl_LDADD, test_utmp_LDADD, test_sysv_LDADD) (test_telinit_LDADD): Replace library paths with NIH_LIBS and NIH_DBUS_LIBS ($(com_ubuntu_Upstart_OUTPUTS)): ($(com_ubuntu_Upstart_Job_OUTPUTS)): ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Use external nih-dbus-tool and obey silent rules. (initctl_LDFLAGS, reboot_LDFLAGS, runlevel_LDFLAGS) (shutdown_LDFLAGS, telinit_LDFLAGS, test_initctl_LDFLAGS) (test_utmp_LDFLAGS, test_sysv_LDFLAGS, test_telinit_LDFLAGS): Drop -static * README: Add libnih to the dependencies. * HACKING: Remove the instructions for checking out libnih, replace with a description about how to use a libnih source tree instead of the installed one. * configure.ac: Bump version to 0.6.5, bump copyright year to 2010. * NEWS: Begin new release. 2009-08-02 Scott James Remnant * NEWS: Release 0.6.3 2009-08-01 Scott James Remnant * init/tests/test_job_process.c (test_handler): Add a missing test case for the running process exiting while we're in the stopping state. * init/job_process.c (job_process_terminated): Don't change the state or record failure information if we're in the stopping state when the main process dies, otherwise we hit an assertion later; just wait for the stopping event to finish and carry on as before. 2009-07-31 Scott James Remnant * dbus/upstart.h: Allow the service name and address to be overriden 2009-07-29 Michael Biebl * init/tests/test_job_process.c: Add missing sys/ptrace.h include 2009-07-21 Scott James Remnant * configure.ac: Bump version to 0.6.3 * NEWS: Begin new release * NEWS: Release 0.6.2 * init/main.c (crash_handler): Restore missing chdir ("/") call. * init/tests/test_job_process.c (test_handler): We should allow a job to exec() before it calls fork() to allow shell scripts to exec daemons. * init/job_process.c (job_process_trace_exec): Continue the traced process instead of detaching if it has not yet forked. * init/job.c (job_change_state): Obvious bug fix; the set of states into which we can enter JOB_STOPPING includes JOB_STARTING because we can get the "stop" event or command there. 2009-07-16 Scott James Remnant * configure.ac: Bump version to 0.6.2 * NEWS: Begin new release * NEWS: Release 0.6.1 * util/runlevel.c: Output the path before the error message, to make it clear that it's the utmp file missing not runlevel. * util/runlevel.c: If there is no current runlevel because the environment variable is empty, output "unknown" instead of "N N". 2009-07-15 Scott James Remnant * README: Now that D-Bus 1.2.16 proper has been released, update our requirements. 2009-07-14 Scott James Remnant * TODO: Update * init/tests/test_job_process.c (test_handler): Rework the existing ptrace fork handler test case to make sure we test the case where we get the fork event before the stopped child. Add a second test case for the opposite (stopped child before the fork event) which we don't currently handle. * init/job_process.c (job_process_trace_fork): Test for the missed child event using ptrace(), if it succeeds the child is ready so we can just assume we had the event. * util/Makefile.am (EXTRA_DIST): Distribute the valgrind suppressions file * util/tests/test_utmp.c (test_write_shutdown): Additional instance of the same test. * util/tests/test_utmp.c (test_write_runlevel): Looks like glibc is fixed to return the right error code. 2009-07-11 Scott James Remnant * init/control.c (control_server_open): Don't hardcode the server address, otherwise the test suite can't test this function. * init/tests/test_control.c (test_server_open) (test_server_connect, test_server_close): Change the server address in the tests. * configure.ac: Bump version to 0.6.1 * NEWS: Begin new release 2009-07-09 Scott James Remnant * NEWS: Release 0.6.0 * README: Note that we need D-Bus GIT HEAD. * NEWS: Update. * init/man/inittab.5: People keep trying "man inittab", so explain that it's gone. * init/Makefile.am (dist_man_MANS): Install it * NEWS: Declare the "lacks documentation" bug fixed * init/man/init.8: Refresh and turn it into more of an overview of Upstart now that we have lots of other pages to refer to. * init/man/upstart.7: Since it's an overview, people might go "man upstart" so redirect to it. * init/man/init.5: Actually document the configuration format. * init/Makefile.am (dist_man_MANS): Install the configuration documentation, and the redirect. * util/man/runlevel.8, util/man/telinit.8, util/man/shutdown.8, * util/man/reboot.8: Add environment and files sections. * init/man/startup.7, init/man/starting.7, init/man/started.7, * init/man/stopping.7, init/man/stopped.7 * init/man/control-alt-delete.7, init/man/keyboard-request.7, * init/man/power-status-changed.7: Write manual pages for each of the events generated by the init daemon by default. * init/Makefile.am (dist_man_MANS): Distribute and install the new manpages. * util/man/runlevel.7: Indent the example, don't boldface * init/job.c (job_start, job_stop, job_restart): Restructure slightly to avoid gcc warning * init/job_class.c (job_class_start, job_class_restart): Make the same change to these too * util/shutdown.c: Warn if we can't change directory * util/telinit.c: Assert that we don't fall out of the switch * init/tests/test_job_class.c (test_get_version) (test_get_author, test_get_description, test_get_name): Initialise alloc-safe variables to NULL to avoid gcc warning * util/tests/test_initctl.c (test_job_status, test_start_action) (test_stop_action, test_restart_action, test_status_action) (test_list_action, test_emit_action) (test_reload_configuration_action, test_version_action) (test_log_priority_action, test_upstart_open): Initialise alloc-safe variables to NULL and diverted return values to 0 to avoid gcc warnings. (test_start_action, test_stop_action, test_restart_action): Replace sigsetjmp/siglongjmp with a call to _exit() in the handler * util/tests/test_sysv.c (test_change_runlevel): Initialise alloc-safe variables to NULL to avoid gcc warnings * util/man/runlevel.7: Formatting fixes, and mention that rcS runs rc-sysinit again. * util/man/runlevel.8: s/utilities/tools/ * util/man/telinit.8: s/utilities/tools/ * util/man/shutdown.8: s/utilities/tools/ * util/man/reboot.8: s/utilities/programs/ * util/man/initctl.8: s/utility/tool/ * init/job_class.h (JobClass): Drop the leader option; at the time it seemed to make sense that Upstart would provide a "daemon"-like environment, but it really doesn't in practice. Software should feel safe to daemonise on its own, and I'd rather fix supervision of those; freeing up Upstart jobs to run as new sessions by default again. This is also the only real option that would change the behaviour between 0.6 and 0.10 in an awkwardly compatible way. * init/job_class.c (job_class_new): Remove leader initialisation * init/tests/test_job_class.c (test_new): Drop the initialisation check for leader * init/parse_job.c (stanza_session): Drop the stanza * init/tests/test_parse_job.c (test_stanza_session): Drop the stanza test cases. * init/job_process.c (job_process_spawn): Drop the double-fork. This means we don't need to read the pid of our extra child either. (job_process_error_read): we no longer need a fork error. * init/job_process.h (JobProcessErrorType): Drop the fork error. * init/tests/test_job_process.c (test_spawn): Replace the simple job test case with the session leader test case, now that's the default. (test_run, test_spawn, test_kill, test_handler): Remove all the class->leader = TRUE from the tests, we only ever really tested session leaders anyway since that's all the test suite could follow * init/tests/test_job.c (test_change_goal, test_change_state): Remove the leader flag from test jobs * init/tests/test_event.c (test_pending, test_finished): Remove the leader flag from test jobs. * init/job_process.c (job_process_catch_runaway): Use a monotonic clock, not the realtime clock, for respawn interval detection. * init/tests/test_job_process.c (test_kill, test_handler): Use the monotonic clock in test cases too * init/Makefile.am (init_LDADD): Link with librt * NEWS: Update. * util/utmp.c (utmp_write_runlevel): Don't write 'N' to utmp or wtmp for the previous runlevel, this will force writing reboot records if prevlevel='N'/0 since read_runlevel will always return 'N' in that case. * util/tests/test_utmp.c (test_write_runlevel): Add test case for passing 'N' and having it treated as zero (test_read_runlevel): Add a couple of test cases for the problems we found last night where shutdown and corrupt utmp records result in the wrong data being returned. * util/tests/test_sysv.c (test_change_runlevel): Add a test case for switching from sysinit to the first runlevel * init/conf.h, * init/control.h, * init/event.h, * init/job_class.h: Variable declarations in header files need to be prefixed with "extern", the NIH_BEGIN_EXTERN stuff only applies to C++. * util/reboot.c: Reboot can't write the shutdown time before calling shutdown, otherwise shutdown won't be able to get the current runlevel anymore. * util/man/reboot.8: Update, we don't write the shutdown time before calling shutdown - it's up to the shutdown scripts to call reboot -w before remounting the root filesystem. * util/tests/test_utmp.c (test_get_runlevel): Replace test case with one that expects 'N' rather than fall-through. * util/tests/test_sysv.c (test_change_runlevel): Expect N when there is no previous runlevel * util/utmp.c (utmp_read_runlevel): Also catch a zero runlevel from utmp, replacing with 'N' - these functions should never return 0 * util/sysv.c (sysv_change_runlevel): Should set prevlevel to N when we don't find one * util/utmp.c (utmp_read_runlevel): Catch a negative runlevel from corrupt utmp data, convert to 'N' (utmp_get_runlevel): Return N when RUNLEVEL is set but empty, rather than falling through * util/telinit.c: Catch a missing argument separately so we don't output "(null)" * README: Update requirements. * TODO: Update. * conf/rc-sysinit.conf: Fix typo. 2009-07-08 Scott James Remnant * conf/rc-sysinit.conf: Michael Biebl pointed out that by setting the runlevel to "S" during sysinit, we end up with the runlevel after boot being "S 2" - and that means scripts in rc2.d that are also in rcS.d won't get started. The way we had it before ("N 2") was correct. This happily fixes the one corner case our reboot handling didn't cover - crashing in single user mode and rebooting. * util/telinit.c: Fix missing ret = from kill * conf/rc-sysinit.conf: Ignore -s/single if we're already coming from single-user-mode. * util/telinit.c (options): Unignore the -t option * NEWS: Update. * init/main.c (hup_handler): Also try and reconnect to the message bus if we've lost the connection. * init/conf.c (conf_source_reload_dir): Don't blacklist certain patterns from the configuration directory, instead just filter to whitelist. (conf_dir_filter): Whitelist filter, only accept files ending in .conf (conf_reload_path): Strip .conf from the filename to generate the job name. (conf_file_filter): Add the extra is_dir argument. * init/tests/test_conf.c (test_source_reload_job_dir) (test_source_reload_conf_dir, test_source_reload_file) (test_source_reload): Append .conf to all our filenames * init/tests/test_control.c (test_reload_configuration): Append .conf to filenames here too * NEWS: Update. * init/job_process.c (job_process_run): Stop being stingy, the post-stop script can have the stop environment too * init/tests/test_job_process.c (test_run): Add a test case to make sure it is. 2009-07-08 Michael Biebl * contrib/vim/syntax/upstart.vim: Upstart job syntax highlighting * contrib/vim/ftdetect/upstart.vim: Use for the /etc/init directory * contrib/Makefile.am: Include the vim syntax files in the distribution * configure.ac (AC_CONFIG_FILES): Create contrib/Makefile * Makefile.am (SUBDIRS): Recurse into the contrib sub-directory 2009-07-08 Scott James Remnant * conf/rc.conf: This doesn't need to be an instance job, Upstart will do the right thing and stop the task before starting it again with the new environment (I spent so much time on that, you'd think I'd remember :p) * conf/control-alt-delete.conf: Default job for Control-Alt-Delete * conf/rc-sysinit.conf: Default job for system initialisation * conf/rc.conf: A fully wacky instance job that runs the rc script for runlevel changes * conf/rcS.conf: And a job for single-user-mode, which calls back to rc-sysinit * conf/Makefile.am (dist_init_DATA): Install the default files into the /etc/init directory * configure.ac (AC_CONFIG_FILES): Create conf/Makefile * Makefile.am (SUBDIRS): Recurse into the conf directory. * util/initctl.c (upstart_open, start_action, stop_action) (restart_action, status_action, list_action): Don't auto-start the init daemon, it makes no sense. (upstart_open): When not running from the test suite, and not as root, it makes sense to default to using the system bus daemon. * util/tests/test_initctl.c (test_upstart_open): Make sure that auto-start is FALSE, not TRUE. * NEWS: Update. * util/Makefile.am (dist_man_MANS): Oops, had the wrong name for the runlevel(7) manpage. * util/shutdown.c: Gets a bit of a redress, but not much of rewrite since this is largely just compatibility madness. (shutdown_now): Port to use sysv_change_runlevel() (warning_message): Construct plural forms a little better. (wall): use utmpx, rather than utmp * util/man/shutdown.8: Minor tweaks and improvements * NEWS: Update. * util/reboot.c: Following the pattern of the previous, remove much of the reboot code, but in the process adding support for reboot implying --force in runlevel 0 or 6, and writing the shutdown wtmp record. * util/man/reboot.8: Minor updates. * NEWS: Update. * util/telinit.c: Drop quite a bit of the code of telinit too, just becoming a wrapper about sysv_change_runlevel() - also support Qq/Uu by using kill() * util/tests/test_telinit.c (test_env_option): Since we have an env option, we should test it. * util/man/telinit.8: Update the manual page. * util/man/runlevel.8: Typo (/var/run/wtmp -> /var/log/wtmp) * util/Makefile.am (TESTS): Run the new test (test_telinit_SOURCES, test_telinit_CFLAGS) (test_telinit_LDFLAGS, test_telinit_LDADD): Details for the test suite binary * NEWS: Update. * util/runlevel.c: Drop about 90% of the code, this just becomes a wrapper around utmp_get_runlevel() * util/man/runlevel.8: Update the runlevel manpage. * util/man/runlevel.7: Also put together a manual page that describes the runlevel event, as well as the implementation in Upstart. * util/Makefile.am (dist_man_MANS): Install the new manpage. * NEWS: Update. * util/Makefile.am (reboot_SOURCES, runlevel_SOURCES): Compile and link the utmp handling source, depending on the header. (reboot_LDADD, runlevel_LDADD): Drop dependency on libupstart (shutdown_SOURCES, telinit_SOURCES): Compile and link both the utmp handling and sysv compat source, depending on the headers (nodist_shutdown_SOURCES, nodist_telinit_SOURCES): Also link in the auto-generated bindings (shutdown_LDADD, telinit_LDADD): Drop dependencies on libupstart, replacing with dependencies on libnih-dbus and the D-Bus libs. (runlevel_SOURCES, runlevel_LDFLAGS, runlevel_LDADD) (shutdown_SOURCES, shutdown_LDFLAGS, shutdown_LDADD) (telinit_SOURCES, telinit_LDFLAGS, telinit_LDADD): Remove duplicate entries mistakenly copied from compat/sysv * util/sysv.c (sysv_change_runlevel): Pretty much the core compat function for System V, generate a runlevel event and store the appropriate things in utmp and wtmp. * util/sysv.h: Prototype. * util/tests/test_sysv.c: Test cases for the new function. * util/Makefile.am (TESTS): Run the sysv test cases (test_sysv_SOURCES, nodist_test_sysv_SOURCES, test_sysv_LDFLAGS) (test_sysv_LDADD): Details for the sysv test cases, which obviously depend on the auto-generated bindings code. * util/utmp.c (utmp_write_runlevel): Make sure that it's ok to have no previous runlevel. * util/tests/test_utmp.c (test_write_runlevel): Add no previous runlevel test. * util/utmp.c (utmp_read_runlevel): Don't call utmpxname() if we don't pass a utmp_file, letting glibc pick the default. * util/tests/test_utmp.c (test_read_runlevel): Add a test case for no filename. * util/util.supp: utmpname leaks memory, so suppress it from valgrind * util/utmp.c: Set of functions for dealing with utmp and wtmp (utmp_read_runlevel): Read the current runlevel from the file (utmp_get_runlevel): Obtain the current runlevel from the environment, or the file if not set (utmp_write_runlevel): Write a runlevel change record, and also deal with the reboot record if the utmp or wtmp files don't quite match. (utmp_write_shutdown): Write a shutdown time record (utmp_entry, utmp_write, wtmp_write): utility functions for creating and writing utmp and wtmp records. * util/utmp.h: Prototypes for new functions. * util/tests/test_utmp.c: Test cases. * util/Makefile.am (test_utmp_SOURCES, test_utmp_LDFLAGS) (test_utmp_LDADD): Details for utmp test cases (tests): Move to the bottom of the file and make PHONY 2009-07-07 Scott James Remnant * util/man/initctl.8: Improve the manpage. 2009-07-06 Scott James Remnant * util/initctl.c: Rewrite from scratch, utilising the current D-Bus API and auto-generated method functions for it. * util/tests/test_initctl.c: Rewrite from scratch to test all of the new methods. * util/Makefile.am (test_initctl_CFLAGS): Include AM_CFLAGS (install-data-hook, install-exec-hook): Install a symlink for "restart" as well. * NEWS: Update. 2009-07-03 Scott James Remnant * dbus/com.ubuntu.Upstart.Instance.xml (Start, Stop, Restart): add wait arguments to the instance commands as well. * init/job.c (job_start, job_stop, job_restart): Add wait arguments, when TRUE the functions behave as before; when FALSE the methods return after changing the goal and no blocked entries are created. * init/job.h: Amend prototypes. * init/tests/test_job.c (test_start, test_stop, test_restart): Pass TRUE for wait and check for a blocking entry in existing tests, add tests for passing FALSE and making sure that there's no blocking but we still get the reply. * dbus/com.ubuntu.Upstart.Job.xml (Start, Stop, Restart): Add wait arguments to these too * init/job_class.c (job_class_start, job_class_stop) (job_class_restart): Add wait arguments, when TRUE the functions behave as before; when FALSE the methods return after changing the goal and no blocked entries are created. * init/job_class.h: Amend prototypes. * init/tests/test_job_class.c (test_start, test_stop, test_restart): Pass TRUE for wait and check for a blocking entry in existing tests, add tests for passing FALSE and making sure that there's no blocking but we still get the reply. (test_get_name, test_get_description, test_get_author) (test_get_version): Add missing code to free the class on enomem * dbus/com.ubuntu.Upstart.xml (EmitEvent): Add wait argument * init/control.c (control_emit_event): Add wait argument, when TRUE this behaves as before; when FALSE the method returns after queuing the event and no blocked entry is created for it. * init/control.h: Amend prototype. * init/tests/test_control.c (test_emit_event): Pass TRUE for wait and check for a blocking entry in existing tests, add a test for passing FALSE and making sure that there's no blocking but we still get the reply. * dbus/com.ubuntu.Upstart.Instance.xml: Add a "processes" property to obtain the list of current job processes, both their type and their pid. * init/job.c (job_get_processes): Implement the new property accessor * init/job.h: Add prototype * init/tests/test_job.c (test_get_processes): Add test cases for returning process arrays. (test_get_name, test_get_goal, test_get_state): Add missing free for job class. * init/tests/test_control.c (test_emit_event): Directly acess the number from an NihDBusError * dbus/com.ubuntu.Upstart.xml: Add a "version" property to obtain the version of the init daemon, and a "log_priority" property to get and set the daemon's log priority. * init/control.c (control_get_version, control_get_log_priority) (control_set_log_priority): Methods to support the new properties * init/control.h: Prototypes. * init/tests/test_control.c (test_get_version) (test_get_log_priority, test_set_log_priority): Add tests for the property accessor functions. 2009-07-02 Scott James Remnant * dbus/Upstart.conf: Need to adjust the security configuration * dbus/upstart.h: And the constants as well. * dbus/com.ubuntu.Upstart.xml, * dbus/com.ubuntu.Upstart.Job.xml, * dbus/com.ubuntu.Upstart.Instance.xml: Now we don't hardcode the interface name anywhere, we can version it properly. * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): ($(com_ubuntu_Upstart_Job_OUTPUTS)): ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Update default interface names. * util/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): ($(com_ubuntu_Upstart_Job_OUTPUTS)): ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Update here too. * dbus/Makefile.am (EXTRA_DIST): Make sure we distribute it * dbus/upstart.h: Add a header file with the usual D-Bus constants. * init/control.h: Drop CONTROL_ROOT, replace with DBUS_PATH_UPSTART * init/control.c (control_server_open, control_bus_open) (control_register_all): Replace CONTROL_* constants with the new ones (control_get_job_by_name): Use DBUS_INTERFACE_UPSTART when constructing error names. * init/job_class.c (job_class_new, job_class_register) (job_class_unregister): Construct paths using DBUS_PATH_UPSTART (job_class_get_instance) (job_class_get_instance_by_name, job_class_start) (job_class_stop, job_class_restart): Use DBUS_INTERFACE_UPSTART to construct error names * init/job.c (job_new): Construct path using DBUS_PATH_UPSTART (job_finished, job_start, job_stop, job_restart): Use DBUS_INTERFACE_UPSTART to construct error names. * init/event.c (event_finished): Use DBUS_INTERFACE_UPSTART to construct error name. * init/tests/test_control.c (test_server_open): Don't hardcode the address, extract the abstract path from the constant. (test_server_connect, test_bus_open, test_emit_event): Don't harcode addresses, paths or interfaces - use the constants * init/tests/test_job_class.c (test_consider, test_reconsider) (test_register, test_unregister, test_start, test_stop) (test_restart, test_get_instance, test_get_instance_by_name): Use the constants instead of harcoding. (test_new): Derive the expected path from the constant * init/tests/test_job.c (test_new): Derive the paths from the constant, check for jobs by that interface constant. (test_change_state): Use DBUS_INTERFACE_UPSTART_JOB (test_start, test_stop, test_restart): Use DBUS_INTERFACE_UPSTART_INSTANCE, and generate errors from DBUS_INTERFACE_UPSTART * dbus/com.ubuntu.Upstart.xml, * dbus/com.ubuntu.Upstart.Job.xml, * dbus/com.ubuntu.Upstart.Instance.xml: Remove the empty symbol annotation for the interfaces. * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): ($(com_ubuntu_Upstart_Job_OUTPUTS)): ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Define the default interface and build-time instead. * util/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): ($(com_ubuntu_Upstart_Job_OUTPUTS)): ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Likewise for util 2009-06-30 Scott James Remnant * dbus/Upstart.conf: It doesn't make much sense to restrict getting the values of properties, or looking up jobs or interfaces, so make these public. 2009-06-23 Scott James Remnant * Makefile.am (SUBDIRS): Add util to the list of sub-directories again. * configure.ac (AC_CONFIG_FILES): Generate util/Makefile * util/Makefile.am (AM_CFLAGS): Append D-Bus CFLAGS (AM_CPPFLAGS): Make sure the build directory is also in the quoted include path (nodist_initctl_SOURCES): Build and link the generated D-Bus bindings, but don't distribute them (initctl_LDADD): Drop the libupstart dependency, instead put libnih-dbus and DBUS_LIBS in there. (com_ubuntu_Upstart_OUTPUTS, com_ubuntu_Upstart_XML) ($(com_ubuntu_Upstart_OUTPUTS)): Auto-generate D-Bus binding code to proxy the manager object (com_ubuntu_Upstart_Job_OUTPUTS, com_ubuntu_Upstart_Job_XML) ($(com_ubuntu_Upstart_Job_OUTPUTS)): Auto-generate D-Bus binding code to proxy job class objects (com_ubuntu_Upstart_Instance_OUTPUTS) (com_ubuntu_Upstart_Instance_XML) ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Auto-generate D-Bus binding code to proxy job instance objects (BUILT_SOURCES, CLEANFILES): Built sources have to come first and be cleaned up (test_initctl_LDADD): Tests need to be linked to libnih-dbus and the D-Bus libraries, as well as the auto-generated output * init/Makefile.am (EXTRA_DIST): Drop the EXTRA_DIST for the sources, already handled since they're in a different directory * COPYING: Change licence to version 2 of the GNU GPL. All files have been updated to reflect this. * init/paths.h (CONFFILE): Add new macro * init/Makefile.am (AM_CPPFLAGS): Add CONFFILE definition (install-data-local): No need to make conf.d or jobs.d * init/main.c: Only parse CONFFILE (/etc/init.conf) as a configuration file source and CONFDIR (/etc/init) as a job configuration source. * configure.ac: Bump version to 0.6.0 * NEWS: Copy in news from 0.5.3; that release doesn't appear in this ChangeLog since it was made on a separate branch. Begin new release. 2009-06-18 Casey Dahlin * util/man/initctl.8: Fix formatting of SYNOPSIS 2009-06-18 Scott James Remnant * dbus/com.ubuntu.Upstart.xml, dbus/com.ubuntu.Upstart.Job.xml, dbus/com.ubuntu.Upstart.Instance.xml: Add a comment to these files to clarify that you may communicate and interact with Upstart through these interfaces without restriction. It also makes sense that these files be copied into software that does so to turn into their own bindings, so use the FSF permissive licence for them. 2009-06-17 Scott James Remnant * configure.ac: Bump version to 0.5.3 * NEWS: Copy in news from 0.5.2; that release doesn't appear in this ChangeLog since it was made on a separate branch. * NEWS: Include 0.3.10 release, which happened from a separate branch. * init/parse_job.c (stanza_kill, stanza_respawn, stanza_nice) (stanza_oom): Check errno after using strtol() to avoid overflows. (stanza_normal, stanza_umask, stanza_limit): Also check with strtoul() too * init/tests/test_parse_job.c (test_stanza_kill) (test_stanza_respawn): Add test cases for the two that don't check for overflow already. (test_stanza_limit): Add test for the too large case where we don't already cope. * dbus/Upstart.conf: Allow root to obtain properties * dbus/com.ubuntu.Upstart.Instance.xml: Add name, goal and state properties to the instance * init/job.c (job_get_name, job_get_goal, job_get_state): Add methods to return the property values * init/job.h: Add prototypes. * init/tests/test_job.c (test_get_name, test_get_goal) (test_get_state): Test cases. * dbus/com.ubuntu.Upstart.Job.xml: Add name, description, author and version properties to the job * init/job_class.c (job_class_get_name) (job_class_get_description, job_class_get_author) (job_class_get_version): Add methods to return the property values. * init/job_class.h: Add prototypes * init/job_process.c (job_process_error_abort): Don't abort() from a child process, it confuses people; just exit with an interesting error code (which we ignore anyway). * dbus/Upstart.conf: Update the D-Bus configuration based on newer D-Bus recommended practice with a proper deny-by-default D-Bus, making sure to not use send_interface without send_destination. Allow introspection as well. 2009-06-17 Jeff Oliver * init/job_process.c (job_process_spawn): Only attempt to set the OOM adjustment if set in the class, avoiding issue where /proc is not mounted for the first job. 2009-06-17 Scott James Remnant * init/tests/test_job_process.c (test_handler): Add test cases for a respawning job failing while it's post-start or pre-stop processes are still running while making sure that it still respawns afterwards. * init/job_process.c (job_process_terminated): To fix it, check for a running post-start or pre-stop process before checking for a the respawn. That's not enough because then we won't respawn when the existing process finishes, so use the goal as a hint. * init/job.c (job_next_state): Use that hint goal here, remembering to set the goal back to JOB_START afterwards. (job_change_goal): Nothing to do in the respawn case (job_goal_name, job_goal_from_name): Add the new values * init/job.h (job_goal): Add the respawn goal * init/tests/test_job.c (test_next_state): Add tests for the respawn goal (test_goal_name, test_goal_from_name): Tests for the new values * configure.ac (AC_CONFIG_FILES): dbus goes before init just in case we ever do anything to them later * init/job_class.c (job_class_register, job_class_unregister): Update name of signal functions that we call. (job_class_interfaces): No need to declare this separately * init/job.c (job_register, job_change_state): Update name of signal functions. (job_interfaces): Drop, it comes from the generated header now * init/control.c (manager_interfaces): Drop, comes from the header as control_interfaces (control_register_all): Change array name * init/tests/test_job_class.c, * init/tests/test_job.c, * init/tests/test_control.c, * init/tests/test_blocked.c: Rename conn member of NihDBusMessage to connection * dbus/com.ubuntu.Upstart.xml, * dbus/com.ubuntu.Upstart.Job.xml, * dbus/com.ubuntu.Upstart.Instance.xml: Use annotation to mark the methods as async, rather than a namespaced attribute. Omit the interface symbol. * init/Makefile.am (AM_CPPFLAGS): Add builddir to the quoted includes (init_SOURCES): Don't distribute the auto-generated outputs ($(com_ubuntu_Upstart_OUTPUTS)) ($(com_ubuntu_Upstart_Job_OUTPUTS)) ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Generate using the new binary tool. (BUILT_SOURCES): Remind myself why these are BUILT_SOURCES (MAINTAINERCLEANFILES): Change to ordinary CLEANFILES (EXTRA_DIST): outputs aren't distributed 2009-05-22 Scott James Remnant * init/tests/test_conf.c: Remove nih/inotify.h include * COPYING: Change licence from GPL-2+ to GPL-3 only. 2009-05-17 Scott James Remnant * init/tests/test_job.c, * init/tests/test_job_class.c, * init/tests/test_control.c: Include nih-dbus/errors.h 2009-05-09 Scott James Remnant * init/init.supp: setenv on tls/i686/cmov * init/job_class.c (job_class_get_instance, job_class_start) (job_class_stop, job_class_restart): Clean up the code by using nih_error_steal() * init/conf.c (conf_source_reload_file, conf_source_reload_dir): Steal the error that we stash instead of getting it, otherwise we'll fail if another one occurs. * init/conf.c (conf_reload_path): Simply return, no need to re-raise the error. * init/job_class.c (job_class_get_instance, job_class_start) (job_class_stop, job_class_restart): If not ENOMEM, we need to re-raise the error as a D-Bus one, that means we now have to free the old error first (saving the msssage) * init/job_process.c (job_process_error_read): Replace call to nih_error_raise_again() with nih_error_raise_error() * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): ($(com_ubuntu_Upstart_Job_OUTPUTS)): ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Use the Python variant of nih-dbus-tool for now 2009-03-27 Scott James Remnant * init/tests/test_process.c (test_from_name): Cast -1 to ProcessType * init/tests/test_job_process.c (test_kill, test_handler): Cast -1 to ProcessType * init/tests/test_job.c (test_new, test_change_state): Cast -1 to ProcessType (test_goal_from_name): Cast -1 to JobGoal (test_state_from_name): Cast -1 to JobState * init/tests/test_control.c (test_bus_open): Add braces * init/Makefile.am (tests): Add rule to build test cases * util/Makefile.am (tests): Likewise * init/job.c (job_interfaces): Put static first (job_emit_event): Cast -1 to ProcessType (job_emit_event): Cast -1 to ProcessType * init/job_class.c (job_class_interfaces): Put static first. * init/job_process.c (job_process_kill_timer): Cast -1 to ProcessType * init/control.c (manager_interfaces): Put static first * init/Makefile.am (AM_CPPFLAGS): Use -iquote$(srcdir) instead of -I since we only need it to pick those paths up. * util/Makefile.am (AM_CPPFLAGS): Likewise. 2009-02-20 Scott James Remnant * util/initctl.c (handle_job_instance_end, handle_job_process) (handle_job_status_end, handle_event), * util/shutdown.c (main): No need for new_* temporary variable when looping over nih_realloc with NIH_MUST. * util/initctl.c (job_info_output, output_name, handle_job_list) (handle_job_instance, handle_job_instance_end) (handle_job_status, handle_job_process, handle_job_status_end) (handle_event, env_option), * util/telinit.c (main), * util/shutdown.c (main, shutdown_now, timer_callback, wall): * init/event.c (event_init, event_pending_handle_jobs, event_finished), * init/event_operator.c (event_operator_events), * init/job.c (job_emit_event, job_name), * init/job_class.c (job_class_init, job_class_start) (job_class_stop, job_class_restart), * init/job_process.c (job_process_run, job_process_error_read) (job_process_kill), * init/conf.c (conf_init, conf_source_reload_file) (conf_reload_path), * init/control.c (control_init, control_server_connect) (control_bus_open): Set variable outside of NIH_MUST macro. * init/event.c (event_pending_handle_jobs): Set variable outside of NIH_SHOULD macro. * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): ($(com_ubuntu_Upstart_Job_OUTPUTS)): ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Update expected path of nih-dbus-tool * configure.ac: Create nih-dbus-tool Makefile * Makefile.am (SUBDIRS): Build in nih-dbus-tool 2009-01-29 Scott James Remnant * configure.ac: Bump version to 0.5.2 * NEWS: Begin 0.5.2 * NEWS: Copy in news from 0.5.1; that release doesn't appear in this ChangeLog since it was made on a separate branch. * init/tests/test_blocked.c (test_new), * init/tests/test_control.c (test_get_job_by_name) (test_get_all_jobs, test_emit_event), * init/tests/test_event.c (test_finished), * init/tests/test_job.c (test_change_state), * init/tests/test_job_class.c (test_get_instance) (test_get_instance_by_name, test_get_all_instances): Continue the battle with the gcc optimiser which declares variables first used inside TEST_ALLOC_FAIL as used uninitialized. * init/parse_job.c (parse_exec, parse_script, stanza_instance) (stanza_description, stanza_author, stanza_version) (stanza_start, stanza_stop, stanza_chroot, stanza_chdir): Unreference members when replacing them instead of freeing; not strictly necessary but the style is the thing. * init/job_process.c (job_process_terminated): Unreference the kill timer instead of freeing * init/job_class.c (job_class_get_instance): Use nih_local for instance environment and name (job_class_start, job_class_stop, job_class_restart): Unreference job environment instead of freeing * init/job.c (job_change_state, job_start, job_stop, job_restart): Unreference job environment instead of freeing (job_name): Discard job name in case a reference was taken. * init/event.c (event_pending_handle_jobs): Unreference the job environment instead of freeing * init/environ.c (environ_add): should unreference the old environment string in case anyone took a ref elsewhere (environ_set): use nih_local for str (environ_expand_until): Should set *str to NULL if we free it, just in case. * init/conf.c (conf_source_reload): File should be unreferenced, not freed. (conf_source_reload_file): Use nih_local for dpath (conf_delete_handler): Watch and file should be unreferenced, not freed. (conf_reload_path): File should be unreferenced, not freed; use nih_local for file buffer * init/blocked.c (blocked_new), * init/conf.c (conf_source_new, conf_file_new), * init/event.c (event_new), * init/event_operator.c (event_operator_new), * init/job.c (job_new), * init/job_class.c (job_class_new): No need to cast function argument to nih_alloc_set_destructor() * init/tests/test_job_process.c (test_handler): We can't just assume that our child is sitting at the signal otherwise we might end up sending the CONT signal before it's even stopped. Use waitid() to wait for the child to stop first. * init/init.supp: More expressions for environment memory which valgrind can't deal with * init/conf.c (conf_source_reload): The ConfFile destructor has side-effects that involve the iteration of the sources and their files, so we can't simply call it while iterating because of the cursor. Move the sources into a deleted list first, and delete them from there. * init/conf.h: Fix prototype. * init/tests/test_conf.c (test_source_reload_job_dir): Test pointers with TEST_EQ_P not TEST_EQ 2009-01-28 Scott James Remnant * init/job_class.c (job_class_start): We can't create the blocked until we know we're going to block, otherwise we could ref and unref the message (freeing it). Wait until the job is created, which means we can't fail to create the blocked item (we'll already have announced the new instance). (job_class_stop, job_class_restart): For consistency, don't fail if OOM when making blocked. * init/tests/test_job.c (test_new): Initialise a bunch of subsystems outside of TEST_ALLOC_FAIL * init/environ.c (environ_add): We can't allocate nih_local with a context, it won't be freed; so don't, but then remember to reference it when we do just use it. * init/event.c (event_pending_handle_jobs): Must reset the start_on operator in case of error. * init/job_process.c (job_process_kill_timer): Oops, move the assert that we have a process pid to after we know which process we have. * init/tests/test_job_process.c (test_run): Initialise the error context and NihIo outside of TEST_ALLOC_FAIL (test_kill): Initialise timers and the event system. * init/init.supp: Reference from the jobs hash to the bins is still reachable, obviously; as is the string inside job_name() either way it is allocated * init/tests/test_parse_job.c (test_parse_job): Initialise the error context outside of TEST_ALLOC_FAIL * init/init.supp: Update suppressions for new nih_alloc() * init/job_process.c (job_process_run): Had the shell variable setting round the wrong way, now it should be ok. * init/tests/test_blocked.c (test_new): in the case of allocation failure, the message should not be referenced; which we test by trying to discard it and seeing whether that works. * init/job.c (job_emit_event): event_new() only references the environment now, so use nih_local to make sure we clean it up if that doesn't happen * init/job.h (Job): Add kill_process member * init/job.c (job_new): Initialise to -1 * init/job_process.c (job_process_kill): Store the process to be killed in the kill_process member for the timer, since we can't pass two sets of data. Assert that it's not set to anything, this all needs fixing, obviously. (job_process_kill_timer): Take the job as the data argument, eliminating the need for nih_alloc_parent(). Sanity check the job and reset kill_timer and kill_process when done. (job_process_terminated): Clear the kill_process field too. * init/tests/test_job.c (test_new): Check it's -1 (test_change_state): Check kill_process is set to PROCESS_MAIN when active, or -1 when not. * init/tests/test_job_process.c (test_kill): Make sure the kill_process member is set and cleared. (test_handler): Set the kill_process member for the timer and make sure it's cleared when appropriate. * init/job_class.c (job_class_start, job_class_stop) (job_class_restart): Use nih_local to eliminate nih_alloc_reparent, and to clean up some of the code too. * init/job_class.c: Update documentation to match new nih_alloc() * init/parse_job.c (parse_on_operator, parse_on_collect): Use an nih_ref/nih_unref pair instead of nih_alloc_reparent; this is not ideal, but then this code is rather messy and leaves a lot of allocated data attached to the object on the assumption that it will be thrown away. * init/event_operator.c: Update documentation to match new nih_alloc() (event_operator_match): Use nih_local on expanded value. (event_operator_environment): Make evlist nih_local, it will be referenced by the environment array on success * init/event_operator.c (event_operator_new): Reference the event instead of reparenting it. * init/event.c: Update documentation to match new nih_alloc() (event_finished): Use nih_local to tidy up a slight bit. * init/event.c (event_new): Reference the event, don't reparent (event_pending_handle_jobs): Use nih_local for environment array and for the job name, damn I love this thing. Reference the array into the job to avoid freeing. * init/parse_job.c (parse_job): Update documentation to match new nih_alloc() (parse_process, parse_on_operator, stanza_start, stanza_stop) (stanza_expect, stanza_kill, stanza_respawn, stanza_normal) (stanza_session, stanza_console, stanza_nice, stanza_umask) (stanza_oom, stanza_limit): Use nih_local for all the temporary arguments where we can. * init/parse_job.c (parse_on_operand, stanza_env, stanza_export) (stanza_emits): Make temporary string variables use nih_local, this gives us a massive code clean-up and makes nih_str_array_addp safe to take a reference. * init/job_process.c (job_process_run): Make argv, env, script and cmd all use nih_local, this cleans up the code a little and makes nih_str_array_addp safe to take a reference. * init/environ.c: Update documentation to match new nih_alloc() * init/tests/test_job_process.c (test_run): Check that trailing newlines are ignored when running a script (can verify r1025 is fixed with gdb) * init/tests/test_environ.c (test_expand): Add a test case for the bug fixed in r1027, the implicit case of the gap in the environment string being the same size as the value replacing it. * init/environ.c (environ_add): Use nih_local for new_str, making the code paths a little simpler and ensuring we pass something that can be referenced to nih_str_array_addp() * init/tests/test_event.c (test_new): Make sure that env is an orphan with TEST_ALLOC_ORPHAN. * init/tests/test_event_operator.c (test_operator_new): Make sure that env is an orphan with TEST_ALLOC_ORPHAN. (test_operator_copy): Drop pointless NULL parent check. * init/tests/test_control.c: Include limits.h * init/blocked.c (blocked_new): Take a reference to the message, otherwise it will be freed; we free the Blocked structure when we're done, so will automatically unref the message. * init/tests/test_blocked.c (test_new): Add tests to make sure the reference is taken. * init/tests/test_job.c (test_start, test_stop, test_restart): Make sure the message is referenced when an error is not returned but not referenced when one is. * init/tests/test_job_class.c (test_start, test_stop) (test_restart): Make sure the message is referenced when an error is not returned but not referenced when one is. * init/tests/test_control.c (test_emit_event): Make sure that the message is referenced. * init/tests/test_blocked.c: Change nih/dbus.h include to nih-dbus/dbus_message.h * init/tests/test_control.c: Change nih/dbus.h include to error, connection and object; include D-Bus test macros. * init/tests/test_job.c: Change nih/dbus.h include to error, message and object; include D-Bus test macros * init/tests/test_job_class.c: Change nih/dbus.h include to error, message and object; include D-Bus test macros * init/job_class.h: Change nih/dbus.h include to nih-dbus/dbus_message.h and include the actual D-Bus header * init/job_class.c: Change nih/dbus.h include to error, message, object and util. * init/job.h: Change nih/dbus.h include to nih-dbus/dbus_message.h and include the actual D-Bus header * init/job.c: Change nih/dbus.h include to error, message, object and util. * init/control.h: Change nih/dbus.h include to nih-dbus/dbus_message.h and include the actual D-Bus header * init/control.c: Change nih/dbus.h include to error, connection, message and object includes. * init/blocked.h: Change nih/dbus.h include to nih-dbus/dbus_message.h * init/blocked.c: Change nih/dbus.h include to nih-dbus/dbus_message.h 2009-01-27 Scott James Remnant * init/Makefile.am: Update paths to libnih-dbus dependencies. 2009-01-26 Scott James Remnant * configure.ac (AC_CONFIG_FILES): Add nih-dbus sub-directory * Makefile.am (SUBDIRS): Add nih-dbus sub-directory * configure.ac: Bump copyright to 2009 * configure.ac: Matching libnih, we now mandate libtool 2.2.x * HACKING: Update dependency requirement to 2.2.4 * init/init.supp: Adjust suppression for glibc 2.8 * init/tests/test_event.c (test_finished): Remove erroneous test of free'd memory. * configure.ac: Bump version to 0.5.1 * init/tests/test_event_operator.c (test_operator_handle): Add a test for duplicate events when already matched. * init/event_operator.c (event_operator_handle): Skip if already matched. * README: Update features and requirements. * NEWS: Copy in news from 0.5.0; that release doesn't appear in this ChangeLog since it was made on a separate branch. 2009-01-26 Casey Dahlin * init/environ.c (environ_expand_until): Handle the implicit case of the gap in the string being the same size of the value. * init/job_process.c (job_process_handler): Handle the case of a child being continued by a signal, otherwise we'll assert. * init/job_process.c (job_process_run): Double-check that the newline(s) we see are at the end of the script before stripping, since we can fall through if the newline is mid-script but /dev/fd isn't mounted. 2008-07-05 Scott James Remnant * TODO: Update. 2008-07-01 Scott James Remnant * init/Makefile.am ($(com_ubuntu_Upstart_OUTPUTS)): ($(com_ubuntu_Upstart_Job_OUTPUTS)): ($(com_ubuntu_Upstart_Instance_OUTPUTS)): Must be newer than the source for the dbus tool, and ensure the dbus tool is built 2008-06-30 Scott James Remnant * init/Makefile.am: Update along with libnih so that we leave the D-Bus bindings in the dist tarball, meaning Python is no longer a build-dependency. 2008-06-11 Scott James Remnant * Makefile.am (SUBDIRS): List dbus before init in case we need to generate anything in that directory later on. * Makefile.am (SUBDIRS): List po last so that update-po is run after generating any sources. 2008-06-08 Scott James Remnant * init/Makefile.am (EXTRA_DIST): Ship the built sources, don't clean them. (maintainer-clean-local): Well, not unless maintainer-clean anyway * init/job.c, init/job_class.c: Add missing errno.h include * dbus/com.ubuntu.Upstart.Job.xml (GetInstance): Add method to get an instance name in the same basic manner as start and stop would, though this one's synchronous. * init/job_class.c (job_class_get_instance): Implementing by copying the relevant bit of Stop. * init/job_class.h: Add prototype. * init/tests/test_job_class.c (test_get_instance): Add tests. * TODO: Continue to document the C&P madness. * init/conf.c (conf_reload_path): Read file directly into memory, not using mmap. * compat/sysv/reboot.c, compat/sysv/runlevel.c, compat/sysv/shutdown.c, * compat/sysv/telinit.c: Move into the util directory; we're going to support limited SysV-a-like commands without full compatibility which is what we always did, and I'm not going to worry about adding others. * compat/sysv/man/reboot.8, compat/sysv/runlevel.8, * compat/sysv/man/shutdown.8, compat/sysv/telinit.8: Move as well. * compat/sysv/Makefile.am, util/Makefile.am: Merge. * configure.ac: Remove the (commented out) compat/sysv and logd Remove the --enable-compat option. * Makefile.am (SUBDIRS): Remove (commented out) compat/sysv and logd * logd/Makefile.am, logd/main.c, logd/man/logd.8, logd/jobs.d/logd.in: Consign logd to oblivion. We haven't supported it for ages, it has non-working issues, and there's got to be a better way to do this. * TODO: Update. * init/job.c (job_change_goal): Adjust the documentation. After careful thought, there's no way this can return after freeing the job, since it'll either block on an event, a process or do nothing. * init/job.c (job_start, job_stop, job_restart): Clear the start and stop environment, shouldn't necessarily make a difference, but it pays to be consistent. * dbus/com.ubuntu.Upstart.Job.xml (Start, Stop, Restart): Add methods to control jobs, all take an environment array and both Start and Restart return an instance path so properties, etc. can be obtained afterwards. * init/job_class.c (job_class_start, job_class_stop) (job_class_restart): Add the code for the top halves of the methods * init/job_class.h: Add prototypes for the new methods. * init/job.c (job_finished): And the bottom halves go here. * init/tests/test_job_class.c (test_start, test_stop) (test_restart): Add test cases for the methods. * init/blocked.h (blocked_type): Add enums for the new methods. * init/blocked.c (blocked_new): Handle the new methods here. * init/tests/test_blocked.c (test_new): Add add tests for handling. 2008-06-07 Scott James Remnant * init/job_process.c (job_process_terminated): Don't check the goal to see whether the main process was allowed to terminate, check the state. A termination is only not a failure if we're on the KILLED state (ie. we killed it), otherwise it can still be a failure even if it was going to stop anyway. * init/tests/test_job_process.c (test_handler): Add a test case. * init/control.c (control_emit_event): Use environ_all_valid here(), also reorder the blocking stuff to be less strange, it's ok to free environment. * init/tests/test_control.c (test_emit_event): The event array should be a child of message, which means it doesn't matter if the function we call frees it. * init/environ.c (environ_all_valid): Add a validation function for external input. * init/environ.h: Add prototype. * init/tests/test_environ.c (test_all_valid): Test function. * init/environ.c: Note that we can call this in a loop with OOM, since the resulting table will always be the same. * init/event_operator.c (event_operator_environment): Use environ_append(), and while we're at it, there's no reason this should use NIH_MUST. * init/event_operator.h: Adjust prototype. * init/tests/test_event_operator.c (test_operator_environment): Allow for failure. * init/event.c (event_pending_handle_jobs): Call with NIH_MUST, which is actually safe. * init/job_class.c (job_class_environment): Use environ_append() * init/environ.c (environ_append): There are multiple cases where we append one environment table onto another, so we should have a function to do that. * init/environ.h: Prototype for it. * init/tests/test_environ.c (test_append): Test the new function. * init/job_process.c (job_process_run): Invert the logic; we nearly always want to pass the script with /dev/fd/NNN. The only times we don't are if it doesn't exist, or if we're dealing with a single-line shell script. * init/tests/test_job_process.c (test_run): Update test cases to only expect an argv-execution for single-line scripts. * init/job.c (job_restart): Wrote the blocking bit slightly weirdly without neededing to, so leave it as it should be. * TODO: Update. * dbus/com.ubuntu.Upstart.Instance.xml (Start, Stop, Restart): Add simple instance control methods, these only change the goal of an existing instance - thus cannot pass environment. * init/job.c (job_start, job_stop, job_restart): Add methods, which look spookily similar to each other, except for the subtle yet important differences. (job_finished): Implement bottom halves. * init/job.h: Add prototypes. * init/tests/test_job.c (test_start, test_stop, test_restart): Add tests for the new methods. * init/blocked.h (blocked_type): Add enums for methods. * init/blocked.c (blocked_new): Handle methods here too * init/tests/test_blocked.c (test_new): Add tests for them. 2008-06-06 Scott James Remnant * init/blocked.h (blocked_type): Having a single message type won't work for the job cases, so expand to have many. * init/blocked.c (blocked_new): We'll just have to list them all here. * init/control.c (control_emit_event): Happily we create them individually anyway. * init/event.c (event_finished): And since we have to handle them individually, it'll actually protect us replying to the wrong one. * init/tests/test_conf.c (test_source_reload): Clean up the temporary directory. * init/tests/test_control.c (test_reload_configuration): That goes for this one too. * init/tests/test_control.c (my_connect_handler): Use TEST_DBUS_MESSAGE instead of a pop/read/write loop. (test_emit_event): Renamed TEST_DBUS_CONN to TEST_DBUS_OPEN. * init/tests/test_job.c (test_new, test_register) (test_change_state): Use TEST_DBUS_OPEN and TEST_DBUS_CLOSE to setup and tear down D-Bus connections and TEST_DBUS_MESSAGE instead of a loop. * init/tests/test_job_class.c (test_consider, test_reconsider) (test_register, test_unregister): Likewise. * init/control.c (control_get_job_by_name): Sanity check the name of a job in the same way; we don't need to sanity check the instance name because "" is valid (and the default for singletons). * init/tests/test_control.c (test_get_job_by_name): Test. * dbus/com.ubuntu.Upstart.xml (EmitEvent): Add an asynchronous method to emit an event, providing the name and accompanying environment. No return value, it either works or you get an error. * init/control.c (control_emit_event): Implement top half of the method, blocking the message in the event. * init/control.h: Add prototype. * init/event.c (event_finished): Implement the bottom half which sends the reply or error, these are actually tested along with the top for sanity reasons. * init/tests/test_control.c (test_emit_event): Test the various ways the method may be used and abused; the async nature means we actually need a real D-Bus server to do this. * TODO: Update. * init/event.c (event_new): There's no reason this shouldn't be allowed to return insufficient memory, so do so. (event_finished): Wrap call. * init/tests/test_event.c (test_new): Add alloc failed test. * init/job.c (job_emit_event): Must create the event. * init/main.c (main, cad_handler, kbd_handler, pwr_handler): Wrap with NIH_MUST 2008-06-05 Scott James Remnant * TODO: Update. * init/job.c (job_unblock): Rename to job_finished, since this does not behave like event_unblock but more like event_finished (job_change_state, job_failed): Change name in call. * init/job.h: Update prototype. * init/tests/test_job.c (test_unblock): Rename to test_finished * init/event.c (event_pending_handle_jobs): Update calls here. * init/job.h (Job): Rename blocked to blocker to match event, since it has the same use as event->blockers except it's a toggle * init/job.c (job_new, job_change_state): Rename where used * init/event.c (event_finished): Rename here also since its reset * init/tests/test_job.c, init/tests/test_job_process.c, * init/tests/test_event.c: Rename in test cases too. * init/job.c (job_emit_event): Add a Blocked record to the event's blocking list for the starting and stopping events. * init/tests/test_job.c (test_emit_event): Add tests for the record being added to the list with the right details. (test_change_goal): Make sure that a Blocked record is added (test_change_state): Make sure that Blocked records are added * init/tests/test_job_process.c (test_handler): Also make sure that Blocked records are added. * init/event.c (event_finished): Clear jobs referenced in the blocking list, rather than iterating the entire jobs hash. (event_finished_handle_jobs): Drop this function. * init/tests/test_event.c (test_finished, test_finished_handle_jobs): Merge tests again and test using both the blocking list and job's blocked member. * init/event.h (event): Add blocking member. * init/event.c (event_new): Initialising blocking list. * init/tests/test_event.c (test_new): Make sure it's initialised to an empty list. * init/tests/test_job_process.c (test_handler): Update tests to use Blocked. * init/event.c (event_pending_handle_jobs): Collect environment and events independantly, which means we don't have to worry about the list contents or freeing them up in case of error. * init/event_operator.c (event_operator_events): Fix parent. * init/tests/test_event.c (test_pending_handle_jobs): Update tests. * init/init.supp: Update collect suppression. * init/event_operator.c (event_operator_collect): Break in two. (event_operator_environment): Collect the environment from the event, appending the list of event names if necessary. (event_operator_events): Block events and pass them to the given list. * init/event_operator.h: Update prototypes. * init/tests/test_event_operator.c (test_operator_collect): Also split into two new functions (test_operator_environment, test_operator_events): Adjust * init/event_operator.c (event_operator_collect): Placed Blocked structures in the list, rather than ordinary entries; I strongly suspect that while it's nice to iterate the operator tree only once, this needs to be three functions really. * init/tests/test_event_operator.c (test_operator_collect): Update test suite. * init/job.h (Job): Make blocking a statically defined list. * init/job.c (job_new): Initialise rather than setting to NULL. (job_unblock): Assume that blocking members are Blocked structures and that the list itself is always iterable. * init/tests/test_job.c (test_new): Check the list is empty, rather than NULL. (test_change_state, test_failed, test_unblock): Change tests cases to expect blocking to always be present, and create members as Blocked structures. * init/blocked.c (blocked_new): Set destructor (forgotten) * init/init.supp: Add setenv, which has crept in * init/blocked.h: Header containing enum, struct and prototype. * init/blocked.c (blocked_new): Function to allocate the structure with the right details. * init/tests/test_blocked.c (test_new): Tests for the new function. * init/Makefile.am (init_SOURCES): Compile using blocked.c and header (TESTS): Build blocked test suite (test_process_LDADD, test_job_class_LDADD) (test_job_process_LDADD, test_job_LDADD, test_event_LDADD) (test_event_operator_LDADD, test_parse_job_LDADD) (test_parse_conf_LDADD, test_conf_LDADD, test_control_LDADD): Link blocked.o to most test suites. (test_blocked_SOURCES, test_blocked_LDFLAGS, test_blocked_LDADD): Details for test suite. * init/main.c: Also remove SIGTERM handling, we don't re-exec properly and this is a dangerous signal to use anyway. (term_handler): Drop function. * init/main.c: Remove handling for stop/cont; there's no reason a user should be able to pause the event queue. (stop_handler): Drop function. * init/event.c (event_poll): Remove paused handling. * init/control.c: Fix doc string. * dbus/com.ubuntu.Upstart.xml (ReloadConfiguration): Add method that's effectively the same as the HUP signal. * init/control.c (control_reload_configuration): Unsurprisingly, the implementation is identical. * init/control.h: Add prototype. * init/tests/test_control.c (test_reload_configuration): Make sure the method works as expected. (test_get_job_by_name, test_get_all_jobs): Add missing free calls for message in cases of out of memory. * dbus/com.ubuntu.Upstart.xml (JobAdded, JobRemoved): Add signals for when new jobs are added to the known list and when existing jobs are removed, this allows GUIs to always show an up-to-date list. * dbus/com.ubuntu.Upstart.Job.xml (InstanceAdded, InstanceRemoved): Also add matching signals for when instances are added to the list for a job and when they're removed again. * init/job_class.c (job_class_register): Emit the JobAdded signal for this job when registering if the new signal argument is TRUE; pass on the signal argument to job_register() (job_class_add): Emit signals when registering jobs with existing connections. (job_class_unregister): Emit signals when unregistering a job. * init/job.c (job_register): Likewise, emit the InstanceAdded signal for the job class if the new signal argument is TRUE. (job_new): Emit signals when registering instances with existing connections. (job_change_state): Emit the instance removed signal when destroying an inactive instance. * init/job_class.h, init/job.h: Add signal argument to prototypes * init/control.c (control_register_all): When registering job classes on a new connection, do not emit a signal since they will already exist at the point when the name appears on the bus or the connection is complete. * init/tests/test_control.c (test_bus_open): Add comment that we are testing for signal non-emission already with the fake server, since it was this test that actually made me realise we had to not emit them :p * init/tests/test_job_class.c (test_register): Test that the signal is emitted when signal is TRUE and not emitted when signal is FALSE (test_unregister): Test that the JobRemoved signal is emitted (test_get_instance_by_name, test_get_all_instances): Free message if allocation failed. (test_consider, test_reconsider): Test that the JobAdded and JobRemoved signals are emitted (or not) when appropriate. * init/tests/test_job.c (test_register): Make sure that the InstanceAdded signal is emitted when TRUE is passed, and not when FALSE is passed. (test_new): Make sure the InstanceAdded signal is emitted when the job is registered on the bus. (test_change_state): Make sure the InstanceRemoved signal is sent when deleting an instance. 2008-06-02 Scott James Remnant * init/tests/test_job.c (test_new, test_register): Also use a private dbus server to avoid session bus problems. * init/tests/test_job_class.c (test_consider, test_reconsider) (test_register, test_unregister): Use a private dbus server instead of connecting to the session bus, which might not be there. * init/tests/test_control.c (test_disconnected): Simplify using a private dbus server rather than faking one. * init/tests/test_control.c (test_bus_close): Don't rely on being able to connect to the various buses, instead use a special private one. 2008-06-01 Scott James Remnant * dbus/com.ubuntu.Upstart.Job.xml (GetAllInstances): And also add a similar method to return the object path of all instances of a particular job. * init/job_class.c (job_class_get_all_instances): Implement the method, pretty much the same as the other. * init/job_class.h: Add prototype. * init/control.c: Fix comment. * init/tests/test_control.c (test_get_all_jobs): Ensure that the individual paths are children of the array. * dbus/com.ubuntu.Upstart.xml (GetAllJobs): Add method to return the object path of all known jobs. * init/control.c (control_get_all_jobs): Implement the method, somewhat simple happily. * init/control.h: Add prototype for the method. * init/tests/test_control.c (test_get_all_jobs): Test that the right data is returned. * dbus/com.ubuntu.Upstart.xml, dbus/com.ubuntu.Upstart.Job.xml, * dbus/com.ubuntu.Upstart.Instance.xml: Add libnih XML NS to the files so that we can tag methods as sync or async later. * init/control.c (control_get_job_by_name): Remove const from return parameter. * init/control.h: Update prototype. * init/tests/test_control.c (test_get_job_by_name): Remove const from path type. * init/job_class.c (job_class_get_instance_by_name): Remove wrong const from parameter now that we've fixed the bindings generator. * init/job_class.h: Update prototype to match. * init/tests/test_job_class.c (test_get_instance_by_name): Change type of path to match. * HACKING (Dependencies): clarify that autoreconf and configure need to be run for libnih first. * init/Makefile.am (test_process_LDADD, test_job_class_LDADD) (test_job_process_LDADD, test_job_LDADD, test_event_LDADD) (test_event_operator_LDADD, test_parse_job_LDADD) (test_parse_conf_LDADD, test_conf_LDADD, test_control_LDADD): Link the auto-generated D-Bus code in, otherwise the tests won't be complete. 2008-05-24 Scott James Remnant * HACKING: Changed branch location again, of both upstart and libnih. 2008-05-16 Scott James Remnant * init/job_class.c (job_class_consider, job_class_reconsider): Find the best class first and compare against the current class before acting, this avoids the re-register jump every time a job stops. (job_class_select): Rename to job_class_add() since this is takes a class and is the direct opposite to job_class_remove(). 2008-05-15 Scott James Remnant * init/event.c (event_new): We can't rely on the event poll function being the last in the main loop, it's often the first, so after adding an event to the queue ensure the loop is iterated at least once so that the event poll occurs for it. 2008-05-09 Scott James Remnant * TODO (Anytime): Update. * dbus/com.ubuntu.Upstart.Instance.xml: format to match others * dbus/com.ubuntu.Upstart.Job.xml (GetInstanceByName): Add method * init/job_class.c (job_class_get_instance_by_name): Implementation. * init/job_class.h: Add prototype. * init/tests/test_job_class.c (test_get_instance_by_name): Tests for new method. * init/job_class.h (JobClass): Make instances a hash table. * init/job_class.c (job_class_new): Initialise instances as a hash table now. (job_class_register): Iterate instances as hash table. (job_class_remove): Slightly odd construct needed to return FALSE if there's anything in the hash table. (job_class_unregister): Likewise to assert on no instances. * init/tests/test_job_class.c (test_new): Check that instances is now a hash table. * init/job.h (Job): Make name the first member. * init/job.c (job_new): Add to instances as hash table. (job_instance): Drop entirely, replaced by a hash lookup. * init/tests/test_job.c (test_instance): Drop. * init/job_process.c (job_process_find): Iterate instances as a hash table. * init/event.c (event_pending_handle_jobs) (event_finished_handle_jobs): Iterate instances as hash table. (event_pending_handle_jobs): Replace job_instance call with an ordinary hash lookup. * init/tests/test_event.c: Update to use hash table. * init/tests/test_conf.c: Update instances stealing for hash table * init/job_class.c (job_class_new): initialise instance to the empty string. * init/tests/test_job_class.c: Update job_new() calls. (test_new): Check instance against the empty string. * init/job.c (job_new): name may no longer be NULL. * init/tests/test_job.c: Update job_new() calls. (test_instance): Reset back to "" when done. * init/event.c (event_pending_handle_jobs): Always expand the name, since the class->instance is always non-NULL. * init/tests/test_event.c: Update job_new calls. * init/tests/test_conf.c: Update job_new calls. * init/tests/test_job_process.c: Update job_new calls. * init/job.c (job_new): Singleton jobs have a fixed name of "", rather than a NULL name, and a D-Bus name of "_". (job_instance): Which rather simplifies this function (in fact, it makes this function look like a common one). (job_emit_event): Always set INSTANCE variable. (job_name): Still distinguish in output, to avoid ugly "()" but check character rather than NULL. * init/tests/test_job.c (test_new): Check name is set to "" and path to ".../_" (test_change_state, test_emit_event): Update test cases to assume an empty INSTANCE variable (test_instance): Update to pass "" instead of NULL. * init/job_process.c (job_process_run): Always set UPSTART_INSTANCE * init/tests/test_job_process.c (test_run): Always assume an UPSTART_INSTANCE variable, it may just be empty. * init/tests/test_event.c (test_pending_handle_jobs): Expect the name to be set to the empty string. * init/Makefile.am (com.ubuntu.Upstart.c com.ubuntu.Upstart.h) (com.ubuntu.Upstart.Job.c com.ubuntu.Upstart.Job.h) (com.ubuntu.Upstart.Instance.c com.ubuntu.Upstart.Instance.h): Drop setting of data-type, turns out it doesn't work anyway. * dbus/Upstart.conf: Add configuration file. * dbus/Makefile.am (dbussystemdir, dist_dbussystem_DATA): Install the configuration file into the right place. * dbus/com.ubuntu.Upstart.xml (GetJobByName): Add method * init/control.c (control_get_job_by_name): Implementation. * init/control.h: Prototype. * init/tests/test_control.c (test_get_job_by_name): Test the method using a fake message. 2008-05-08 Scott James Remnant * dbus/com.ubuntu.Upstart.xml, dbus/com.ubuntu.Upstart.Job.xml, * dbus/com.ubuntu.Upstart.Instance.xml: Add DTDs. * init/control.c (manager_interfaces): Export the general com.ubuntu.Upstart interface * init/job_class.c (job_class_interfaces): Export the com.ubuntu.Upstart.Job interface * init/job.c (job_interfaces): Export the com.ubuntu.Upstart.Instance interface * init/Makefile.am (BUILT_SOURCES) (com.ubuntu.Upstart.c com.ubuntu.Upstart.h) (com.ubuntu.Upstart.Job.c com.ubuntu.Upstart.Job.h) (com.ubuntu.Upstart.Instance.c com.ubuntu.Upstart.Instance.h): Generate C code and header files from the XML files which produce object bindings. (init_SOURCES): Link the built sources. (CLEANFILES): Clean them up afterwards * dbus/com.ubuntu.Upstart.xml: Initially empty description for manager object interface(s). * dbus/com.ubuntu.Upstart.Job.xml: Initially empty description for job class object interface(s). * dbus/com.ubuntu.Upstart.Instance.xml: Initially empty description for job instance object interface(s). * dbus/Makefile.am: Distribute the three interface files, they're used as sources elsewhere. * configure.ac (AC_CONFIG_FILES): Generate dbus/Makefile * Makefile.am (SUBDIRS): Descend into the dbus sub-directory. * init/job_class.c (job_class_consider, job_class_reconsider): Separate out the actual meat of the functions, since it's largely duplicated between the two. This makes the difference between the two functions clearer, consider always stages an election no matter which is registered, reconsider only stages an election if the current class is registered. (job_class_select, job_class_remove): Functions containing the common code, which now also handle registering and unregistering the class with D-Bus. Here is the right place, not in new, since we only export the current best class of a given name. (job_class_register, job_class_unregister): Function to register a job and its instances, and to unregister a job (we assert that there must be no instances for us to do this). * init/job_class.h: Add prototypes. * init/tests/test_job_class.c (test_consider, test_reconsider): Check that D-Bus registration and unregistration happens as expected. (test_register, test_unregister): test on their own. * init/job.c (job_new): Register instances with D-Bus, since instances can only ever exist for active classes, all instances are always registered on the bus. (job_register): Function to register an instance on the bus. * init/job.h: Add prototype. * init/tests/test_job.c (test_new): Test creating a job with an active d-bus connection, which should have it registered. (test_register): Test registration on its own. * init/control.c (control_register_all): Make this always succeed, and register existing jobs on the new connection. (control_server_connect, control_bus_open): registration is always successful. * init/tests/test_control.c (test_server_connect, test_bus_open): Test with existing jobs when we get a connection or create the bus connection, ensure that the jobs and instances are registered. * init/tests/test_job.c (test_change_state): Check for a bug where a job with multiple instances will be freed when one instance is deleted rather than the last instance. * init/job.c (job_change_state): Add debugging messages when we destroy a job that's no longer the current one or an instance that's no longer active; also ensure that we never destroy a job that's the current one. * init/event.c (event_pending_handle_jobs): Add a debugging message when we create a new instance of a job. * init/conf.c (conf_file_destroy): Add a debugging message when we destroy a job that's no longer the current one. 2008-05-07 Scott James Remnant * init/control.c (control_server_open, control_server_close) (control_server_connect): Create and manage a listening d-bus server that is used for private direct connections to Upstart for when the d-bus daemon is not available. Each new connection has the same objects as the d-bus system bus, they only differ in their method. (control_conns, control_init): Cache the open connections, including the bus daemon and any private connections; we'll iterate this list when sending signals. (control_bus_open): Store connection in the list, don't worry about setting close-on-exec, we check that by test case and rely on d-bus to do it. (control_bus_disconnected): Rename to control_disconnected (control_disconnected): Work for system bus and private connections, remove from the connections list. * init/control.h: Add prototypes, remove global definition of bus name to just being private again. * init/tests/test_control.c (test_server_open, test_server_close) (test_server_connect): Test the new functions. (test_bus_open): add check for list entry (test_bus_disconnected): rename to test_disconnected * init/main.c: Open the listening server, warning if we're unable to do so (but we won't treat it as a hard error since there's the d-bus daemon as the default anyway). * init/init.supp: suppress the fact that the control connections list stays around. * init/job_process.c (job_process_run): Use NIH_ZERO instead of NIH_MUST and == 0 2008-05-06 Scott James Remnant * init/environ.c (environ_expand_until): Odd gcc optimiser warning, it reckons arg_start and end may be used uninitialised, but I don't see how they can be. * init/main.c (main): Warn if we can't set the root directory. * init/job_process.c (job_process_spawn) (job_process_error_abort): loop on the return of write() * init/tests/test_job_process.c (child, main): assert getcwd() works (test_handler): initialise list and entry for gcc's blind spot. (test_run): initialise ret for gcc's blind spot * init/tests/test_job.c (test_name): jump through hoops for gcc (test_change_state): list and entry. * init/tests/test_event.c (test_finished_handle_jobs, test_finished) (test_pending_handle_jobs, test_poll, test_pending): initialise to NULL and buy gcc glasses * init/tests/test_event_operator.c (test_operator_collect): another NULL to make gcc happy. 2008-05-01 Scott James Remnant * TODO: Update. * init/init.supp: Suppress a few test case artefacts caused by valgrind hating reachable memory at exec() time. * init/tests/test_job_process.c: Fix a few cases where we were still dup'ing the name argument to job_new(). * init/tests/test_parse_job.c: Include missing signal.h * init/event.c (event_pending_handle_jobs) (event_finished_handle_jobs): Land the old job event handling functions here as static functions, right now they're immense but we'll actually move much of the code back out again as we go. * init/tests/test_event.c (test_pending_handle_jobs) (test_finished_handle_jobs): Also land the test cases in renamed and somewhat restructued functions, since we now have to do the testing through event_poll(). (test_poll, test_pending, test_finished): It never hurts to improve test cases while you're in there. 2008-04-30 Scott James Remnant * init/job.c (job_change_state): Change calls to job_process_run and job_process_kill. * init/main.c: Change to job_process_handler * init/job_process.c, init/job_process.h: Land the code from job.c and defs from job.h that deal specifically with a job's processes, rename the functions to job_process_*() in the process. * init/tests/test_job_process.c: And land the test cases as well. * init/job.c: Strip of everything not related to creation and finding of instances and the core state machine; process stuff will move to job_process.c and event handling to event.c, class (nee config) stuff is already moved to job_class.c (job_new): Don't reparent the name, it doesn't help anything, just take a copy. (job_name, job_failed, job_unblock, job_emit_event): Make extern since we need to use these outside or just want to test them. * init/job.h: Clean out also. * init/tests/test_job.c: Also clean out. (test_name, test_failed, test_unblock, test_emit_event): Add test cases for newly extern functions. * init/main.c: Include events.h to get the ones we need. * init/control.c (control_job_config_path, control_job_path) (control_path_append): Drop these functions (replaced by the more generic nih_dbus_path() function) * init/control.h: Make CONTROL_ROOT public, and drop other prototypes. * init/tests/test_control.c (test_job_config_path) (test_job_path): Drop tests. 2008-04-29 Scott James Remnant * init/event.c, init/event.h, init/tests/test_event.c: Strip out the event operator code and events list. * init/job_class.c, init/job_class.h: We only need the event operator code here now. * init/events.h, init/event_operator.c, init/event_operator.h, init/tests/test_event_operator.c: Separate out the event operator code and the list of events into separate source files. * init/Makefile.am (init_SOURCES): Build and link event operator code and use the lists of events. (TESTS): Build and run the event operator test suite. (test_event_operator_SOURCES, test_event_operator_LDFLAGS) (test_event_operator_LDADD): Details for the event operator test suite. (test_process_LDADD, test_job_class_LDADD) (test_job_process_LDADD, test_job_LDADD, test_event_LDADD) (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD) (test_control_LDADD): Link the event operator code. * init/job_class.c, init/main.c: Correct includes and some function names. * init/process.c, init/process.h, init/tests/test_process.c: Land original Process code (used by job class and similar). * init/process.c, init/process.h, init/tests/test_process.c: Break into two pieces, one part becomes job_process which requires both job information and process information, the other becomes system which requires no job information. * init/errors.h: Update error name. * init/Makefile.am (init_SOURCES): Build and link job process code and header along with system code and header. (TESTS): Build and run job process and system test suites. (test_job_process_SOURCES, test_job_process_LDFLAGS) (test_job_process_LDADD): Details for job process test suite. (test_system_SOURCES, test_system_LDFLAGS, test_system_LDADD): Details for system test suite. (test_process_LDADD, test_job_class_LDADD, test_job_LDADD) (test_event_LDADD, test_parse_job_LDADD, test_parse_conf_LDADD) (test_conf_LDADD, test_control_LDADD): Link job process and system code. * init/parse_conf.c: Remove parse_job include. * init/init.supp: Update leak check for class init; remove valgrind workaround since it's gone away with the change of that function. * init/conf.h (ConfFile): Change type of job member, but leave name. Add prototype for new function. * init/conf.c (conf_reload_path): Somewhat simplify the case of having parsed a job, we only need to call job_class_consider() now to have it dealt with. (conf_file_destroy): Likewise after removing the ConfFile from the source (so it won't get considered) and marking the job class as deleted, we only need to call job_class_reconsider() and check the return value to see whether we've been replaced. (conf_select_job): In return we provide the function to decide which of the available job sources is the best one. * init/tests/test_conf.c: Update types in tests. (test_select_job): Test the new function. * init/parse_job.h: Update to include job_class.h and update prototype to return JobClass, we'll keep the name though since we'll never parse jobs and otherwise things get annoying. * init/parse_job.c: Update to work on job classes. * init/tests/test_parse_job.c: Update to match. * init/job_class.h (JobClass): Factor out old JobConfig object into a new JobClass object with the same properties, but in its own source file. (ExpectType): Rename old JobExpect to this to match other enums. (ConsoleType): Move along with the object that uses it. * init/job_class.c (job_class_init, job_class_new) (job_class_environment): Bring along methods that only operate on a JobClass, cleaning them up in the process. (job_class_consider, job_class_reconsider): Replace job_config_replace with these two functions that may be used for a new job class and when discarding or finishing with an old one respectively. * init/tests/test_job_class.c: Tests for the functions. * init/Makefile.am (init_SOURCES): Build and link job class source and header. (TESTS): Build and run job class test suite. (test_job_class_SOURCES, test_job_class_LDFLAGS) (test_job_class_LDADD): Details for job class test suite. (test_process_LDADD, test_job_LDADD, test_event_LDADD) (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD) (test_control_LDADD): Link job class code to other tests too. 2008-04-28 Scott James Remnant * init/control.c (control_job_config_path, control_job_path): Add functions to generate D-Bus object paths for jobs and instances (control_path_append): and a static function used by both to append escaped path elements. * init/control.h: Add prototypes. * init/tests/test_control.c (test_job_config_path) (test_job_path): Add test cases for the new functions. * init/job.h (JobConfig, Job): Add path member to both structures. * init/job.c (job_config_new, job_new): Initialise the path members. * init/tests/test_job.c (test_config_new, test_new): Make sure the path members are initialised to something sensible. * init/init.supp: Valgrind whines, I do not know why. * init/control.c (control_bus_open): Call out to register objects on the new bus connection. (control_register_all): Start off by registering the connection manager object, no methods/signals for now. * init/tests/test_control.c (test_bus_open): Make sure the manager object is registered. 2008-04-27 Scott James Remnant * init/tests/test_control.c (test_bus_open): Correct name of error macro. * init/job.c (job_emit_event): Make INSTANCE the second variable. * init/tests/test_job.c (test_next_state): Update tests. 2008-04-25 Scott James Remnant * init/tests/test_control.c (test_bus_open): Use D-bus macros for error strings instead of naming them by hand. 2008-04-22 Scott James Remnant * init/tests/test_control.c (test_bus_close): Add another missing call to dbus_shutdown. 2008-04-21 Scott James Remnant * init/tests/test_control.c (test_bus_open): Under valgrind we seem to get NoReply instead of Disconnected which is a wee bit odd. Add missing call (test_bus_disconnected): Add missing call to dbus_shutdown. 2008-04-19 Scott James Remnant * init/process.c: Add missing limits.h include * init/job.h (JobConfig): Merge instance and instance_name; if instance is set, the job is multi-instance with the name derived from that; if unset the job is singleton. We will not support unlimited instances. * init/job.c (job_config_new): Initialise instance to NULL. (job_new): Assert that name is set for instance jobs. (job_instance): Alter to only deal with singleton and instance jobs, the unlimited instances case is gone. (job_handle_event): Use instance instead of instance_name * init/tests/test_job.c (test_config_new): Check instance is NULL (test_find_by_pid): Adjust the way instance jobs are made, which means we have to pass a name to job_config_new now. (test_instance): Adjust tests to remove unlmited-instance tests and pass name to job_config_new (test_change_state, test_run_process): Pass instance name to job_new as an allocated argument rather than waiting to set it until afterwards. (test_handle_event): Set instance instead of instance_name * init/parse_job.c (stanza_instance): Make the argument mandatory. * init/tests/test_parse_job.c (test_stanza_instance): Remove the checks for without argument, and make sure that without argument is an error. * init/parse_job.c (stanza_oom): Oops, forgot to free never arg. * init/job.h (JobConfig): NihList is rather overkill for emits, which is static configuration; turn into a NULL-terminated array which'll make it easier to turn into a D-Bus property later. * init/job.c (job_config_new): Initialise to NULL now. * init/tests/test_job.c (test_config_new): Make sure it's NULL. * init/parse_job.c (stanza_emits): Store in an array instead. * init/tests/test_parse_job.c (test_stanza_emits): Redo tests. * init/job.c (job_emit_event): Append exported variables to the job event without overwriting the builtins. * init/tests/test_job.c (test_change_state): Check that exported environment is added to the job events. * init/parse_job.c (stanza_export): Parse a new export stanza, which takes one or more environment variable names. * init/tests/test_parse_job.c (test_stanza_export): Test the new stanza. * init/job.h (JobConfig): Add new export member. * init/job.c (job_config_new): Initialise to NULL. * init/tests/test_job.c (test_config_new): Make sure it's NULL. * init/environ.c (environ_add, environ_set): Add a replace argument which when FALSE does not replace existing entries in the environment table. * init/environ.h: Adjust prototypes. * init/tests/test_environ.c (test_add): Add tests for non-replacement mode, including corner cases. (test_set): Replace should be TRUE in this test. * init/event.c (event_operator_collect): Always replace existing environment members. * init/job.c (job_config_environment, job_run_process): Always replace existing environment members. (job_emit_event): Always replace existing environment members, and rework this function to get rid of the confusing gotos. * init/tests/test_job.c (test_change_state): Add tests to make sure we include the INSTANCE variable in the event environment. 2008-04-18 Scott James Remnant * init/process.c (process_kill): Make sure we do send the signal to the process group; in practice this makes no difference, but it pays to be explicit in such things. * init/tests/test_process.c (test_kill): Add a test case for when the session leader is no more. * init/job.h (JobConfig): Another day, another obscure job config detail. This one is for adjusting how likely you are to be killed by the OOM Killer. * init/job.c (job_config_new): Set to zero by default. * init/tests/test_job.c (test_config_new): And make sure it is zero. * init/parse_job.c (stanza_oom): And it helps to have a function to set that one. * init/tests/test_parse_job.c (test_stanza_oom): Test it. * init/errors.h: And we need an error if its out of bounds. * init/conf.c (conf_reload_path): Which also needs to be caught. * init/process.c (process_spawn): Of course, we have to do something with the oom adjustment. (process_error_read): message for failure error. * init/process.h (processErrorType): And need an error if it fails * init/main.c: Drop the legacy configuration directory, the format of jobs has changed sufficiently to not support it. * init/Makefile.am (AM_CPPFLAGS): Remove LEGACY_CONFDIR definition. (install-data-local): Don't create it, either. * init/enum.c, init/enum.h, init/tests/test_enum.c: Remove these source files, a hold-over from when we had them in a separate library and passed around the integer values. * init/job.c, init/job.h, init/tests/test_job.c: Restore in their proper place. * init/Makefile.am: Remove enum.* from build instructions. * init/main.c: Attempt to connect to the system bus on startup, but don't expect it to work. * init/control.c (control_bus_open, control_bus_disconnected) (control_bus_close): Functions to open a connection to the D-Bus system bus, clean up if disconnected or disconnect ourselves explicitly. * init/control.h: Prototypes. * init/tests/test_control.c (test_bus_open) (test_bus_disconnected, test_bus_close): Test the functions using a fake D-Bus system bus daemon. * init/errors.h: Add error for "name taken". * init/Makefile.am (init_SOURCES): Build and link control.c and control.h (TESTS): Build and run control test suite. (test_control_SOURCES, test_control_LDFLAGS, test_control_LDADD): Details for control test suite. (test_process_LDADD, test_job_LDADD, test_event_LDADD) (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD): Link control.o 2008-04-16 Scott James Remnant * init/job.h (JobConfig): Add leader member. * init/job.c (job_config_new): Initialise leader to FALSE. * init/tests/test_job.c (test_config_new): Make sure leader is FALSE. (test_change_goal, test_change_state, test_run_process) (test_kill_process, test_child_handler, test_handle_event) (test_handle_event_finished): Jobs have to be leaders now to allow waitpid() to work in test cases. * init/parse_job.c (stanza_session): Parse "session leader" stanza to set to TRUE. * init/tests/test_parse_job.c (test_stanza_session): Test new stanza parsing. (test_stanza_console): Add missing "missing argument" test. * init/process.c (process_error_read): Deal with new fork error. (process_spawn): If we're not to be a session leader, fork again and write the pid back on the open socket. * init/process.h (ProcessErrorType): Introduce new fork error. * init/tests/test_process.c (test_spawn): Test that we can't start a non-session-leader and still have process details. (test_spawn, test_kill): Other jobs have to be leaders now to allow waitpid() to work. * init/tests/test_event.c (test_poll): Jobs have to be leaders now to allow waitpid() to work. 2008-04-12 Scott James Remnant * configure.ac (NIH_INIT): Require that libnih build D-Bus support, failing configure if we can't get it. * init/Makefile.am (AM_CFLAGS): Build with D-Bus CFLAGS, (init_LDADD, test_process_LDADD, test_job_LDADD, test_event_LDADD) (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD): and link with libnih-dbus.la and D-Bus LIBS. (init_LDFLAGS): No need for -static now since libnih will only exist statically anyway. * init/main.c: Use a better name for kbdrequest * init/event.h (KBDREQUEST_EVENT): Rename event to keyboard-request * init/main.c: Drop the attempt to rescue a crashed system by carrying on with no state (crash_handler): After the child has core dumped, the parent will die and the kernel will panic. That's the best we can do, I think. * init/job.c (job_change_state): Don't generate the stalled event; there's nothing useful you can do with it other than start a root shell and that's just a security hole waiting to happen. (job_new): Don't increment the instances counter. * init/job.h: Remove extern for instances counter. * init/tests/test_job.c (test_new): Remove the check that the instance counter is incremented. (test_change_state): Remove the test for the stalled event. * init/event.h (STALLED): Remove stalled event definition, * TODO: Update. * init/job.h (Job): And while we're at it, the instance name is guaranteed unique for a given job name, which is also guaranteed to be unique - so don't bother with job ids either, since they also get reused in bad cases. * init/job.c (job_next_id): Drop this function. (job_new): Don't assign an id anymore. (job_find_by_id): Drop this function. (job_run_process): Set UPSTART_INSTANCE to the instance name if set. (job_name): Function to create the string used in messages. (job_change_goal, job_change_state, job_run_process) (job_kill_process, job_kill_timer, job_child_handler) (job_process_terminated, job_process_trace_new) (job_process_trace_new_child, job_process_trace_signal) (job_process_trace_fork, job_process_trace_exec): Use the instance name in messages (if set) in place of the job id. * init/tests/test_job.c (test_new): Drop checks on the id field. (test_find_by_id): Drop test. (test_run_process): Check that UPSTART_INSTANCE is set only for named job instances, and contains the instance name. (test_change_state, test_run_process, test_child_handler): Remove id setting and update error message checks. * TODO: Update. * init/event.h (Event): We don't use the id field for anything; and it can't be guaranteed to be unique since it can wrap over and get reused. Drop it. * init/event.c (event_next_id): Drop this function. (event_new): Don't assign an id anymore. (event_find_by_id): Drop this function. * init/tests/test_event.c (test_new): Drop checks on the id field (test_find_by_id): Drop test. (test_poll): Drop id setting which was needless anyway. 2008-04-11 Scott James Remnant * init/tests/test_job.c (test_child_handler): Add tests to make sure that respawn works for both services and tasks; the only difference we want for tasks is that zero is a normal exit code. * init/job.c (job_process_terminated): Status need not be non-zero if the job is not a task. Change the default job type from task to service, which will finally match people's expectations. * init/job.h (JobConfig): Replace service member with task * init/job.c (job_config_new): Initialise task to FALSE (job_change_state): Unblock if not a task instead of if a service * init/tests/test_job.c (test_config_new): Make sure task is FALSE (test_change_state): Check service by default, task with flag; this also means we expect blockers to be cleared if we end up in running for the other checks (test_child_handler): Expect blockers to be cleared if we end up in running now that service is the default. * init/tests/test_event.c (test_poll): Test with a task since we want to remain blocked for longer. * init/parse_job.c (stanza_respawn): Don't set service to TRUE (stanza_service): Rename to stanza_task and set task flag instead * init/tests/test_parse_job.c (test_stanza_respawn): Remove checks for setting of service flag (test_stanza_service): Rename to test_stanza_task and test task * init/job.c (job_init): Create hash using nih_hash_string_new() * init/conf.c (conf_source_new): Likewise. 2008-03-08 Scott James Remnant * HACKING: Terminology changes: Bazaar-NG is now just Bazaar; Malone is now just Launchpad's bug tracking system. Update bugs URL to match modern form. * init/enum.h (JobWaitType): Rename to JobExpect * init/job.h (JobConfig): Rename wait_for to expect * init/job.c (job_config_new, job_change_state, job_run_process) (job_process_stopped, job_process_trace_new_child): Rename wait_for to expect in all occurances. * init/tests/test_job.c: Likewise rename all occurances. * init/parse_job.c (stanza_wait): Rename to stanza_expect and drop the intermediate argument. * init/tests/test_parse_job.c (test_stanza_wait): Rename to test_stanza_expect and adjust tests to match new syntax. * init/tests/test_process.c (test_spawn): Remove set of wait_for. * doc/states.dot: Remove the state transition from starting to waiting ("emit_stopped" in the graph); we don't have a "respawning too fast" exit here anymore, so always go to stopping. * doc/states.png: Regenerate. * TODO: Document the problems with overflowing ids and instance counter before I forget about them. 2008-03-07 Scott James Remnant * TODO: Update. * init/job.h (JobConfig): Add instance_name member. (Job): Add name member. * init/job.c (job_config_new): Initialise instance name to NULL. (job_new): Accept the name as an argument, reparenting and stealing (job_handle_event): Expand the instance name and pass to job_new (job_instance): Accept a name and look that up in the list of current instances returning the instance if found. * init/tests/test_job.c: Add extra argument to all job_new calls (test_config_new): Make sure instance name is initialised to NULL. (test_handle_event): Make sure the job name is set from the instance, and make sure an existing instance is reused if we can. (test_instance): Make sure that the existing instance is returned. * init/parse_job.c (stanza_instance): Check for an optional argument and store it in the instance_name member if it exists, otherwise free and reset the instance_name member. * init/tests/test_parse_job.c (test_stanza_instance): Check the new argument is handled properly and stored in the right place. * init/tests/test_conf.c (test_source_reload_job_dir) (test_file_destroy): Add extra NULL to job_new * init/tests/test_event.c (test_poll): Add extra NULL to job_new * init/event.c (event_operator_match): Accept an environment array and expand the operator value against it before attempting to match. (event_operator_handle): Also accept the environment array and pass through to calls to event_operator_match(). * init/event.h: Update prototypes. * init/tests/test_event.c (test_operator_match): Add extra NULL argument to most tests, and add tests for known and unknown variable references. (test_operator_handle): Add extra NULL arguments to most tests, and add test for passing of environment through. (test_operator_reset): Add extra NULL argument to call. * init/job.c (job_handle_event): Pass the job environment for the stop event handling, but NULL for the start event. * init/tests/test_job.c (test_handle_event): Make sure that a stop operator is expanded from the job environment before being matched against the stop event. * init/event.c, init/event.h, init/environ.c: Documentation tweaks. * init/job.c (job_change_state): Remove the code to check for runaway jobs from here, we'll always let people explicitly start an instance. (job_process_terminated): Call job_catch_runaway when actually doing the respawn instead. * init/tests/test_job.c (test_change_state): Remove "too fast" checks, we're going to allow start/stop requests to restart jobs as much as they like since this is an external request. (test_handle_event, test_handle_event_finished): No need to remove a respawn limit with this behaviour. (test_child_handler): Instead check that the respawn counter is dealt with by the child handler. * TODO: Update, I found a bug with the current model. * init/tests/test_environ.c (test_expand): Check that a string without an expansion still works ok. 2008-03-06 Scott James Remnant * init/event.c (event_operator_collect): Just use strcat functions. 2008-03-03 Scott James Remnant * init/environ.c (environ_valid): New function to check the validity of an environment variable name, should call before accepting any. (environ_expand_until): New function to expand variable references in a string using an environment table; supports a few common shell-like expressions. (environ_getn): Change to return the value of the string, not the entire environment string. * init/environ.h: Add prototypes. * init/errors.h: Add errors raised by new functions. * init/tests/test_environ.c (test_valid, test_expand): Add test cases for the new functions. (test_get, test_getn): Change test case to check for the variable value instead of returning the whole string. * TODO: Add thoughts on blocking commands. * TODO: Update. * init/event.h (Event): Remove the refs member; we now never hold a reference to an event we're blocking since we always copy the environment out if we want to keep it. (EventOperator): Events are always blocked while we hold them, so drop the blocked member. (EventProgress): The done state is no longer needed, we can free in finished now. * init/event.c (event_ref, event_unref): Drop these functions. (event_new): Don't ininitialise the refs member since it's gone. (event_poll): Remove the done state since it's directly freed in event_finished again (event_finished): No done state, event is freed before return. (event_operator_new): No blocked member. (event_operator_copy): Always block the event after copying. (event_operator_destroy): Simply unblock. (event_operator_handle): Simply block the event on match. (event_operator_collect): Always block the copied event (event_operator_unblock): This function is no longer required, since it has an identical effect to reset. (event_operator_reset): Simply unblock the event. * init/tests/test_event.c (test_new): Drop the check for refs being initialised to zero. (test_ref, test_unref, test_operator_collect): Drop test for functions that have been dropped in the code. (test_operator_new): Drop the check for blocked being initialised to FALSE. (test_block, test_unblock, test_operator_destroy): Drop any references to the refs member. (test_operator_destroy): Actually fix the function to test things. (test_poll): Drop the check for remaining in the done state. (test_operator_new, test_operator_copy): Drop the checks for blocked. (test_operator_handle, test_operator_collect, test_opreator_reset): Drop references to refs and blocked. * init/job.c (job_unblock, job_handle_event): Drop the call to event_unref() since the next call was always event_unblock() and that's the one that we didn't delete. * init/tests/test_job.c (test_change_state, test_child_handler) (test_handle_event, test_handle_event_finished): Events don't have references anymore, so remove calls to reference, unreference and checks for the reference count - it's all done with blocks now. (test_new): Remove check that the operator is not blocked for a new job since there's no such thing now. (test_handle_event): Operators don't have a blocked member anymore, if there's an event, it's blocked. * init/job.c (job_change_state): Don't reference the event we're blocked on, we'll always know when it's finished. (job_handle_event_finished): Likewise no reason to unreference it. * init/tests/test_job.c (test_change_goal, test_child_handler) (test_handle_event, test_change_state) (test_handle_event_finished): Remove the expectation that the blocked event is referenced by the job. * init/tests/test_event.c (test_poll): Don't reference the event, since the job would not have. * init/job.c (job_emit_event): Use environ_add/set for style reasons. * init/job.c (job_handle_event): Reset the stop_on operator after processing the event, thus the expression needs to be completely reevaluated before the job can be stopped again by it. At last, correct behaviour! (job_change_state): No reason to reset the stop_on operator when starting since it's always reset after evaluating to TRUE now; likewise no reason to reset on re-entering running or waiting, job_unblock() is sufficient. (job_failed): No reason to iterate stop_on to set failed, it's empty - job_unblock() does what we want. * init/tests/test_job.c (test_handle_event): Check that the operator is actually reset and the event not referenced when handling from the event. (test_change_state, test_child_handler): Don't put anything in stop_on and thus don't expect anything to come out of it -- event environment is all done in stop_env and blocking done in blocking. * init/job.c (job_handle_event): Collect the stop events and store them in the blocking list, unblocking any that were there before such as the start events. (job_change_state): Unblock blocking events when returning to running from pre-stop. * init/tests/test_job.c (test_handle_event): Make sure the stop events are collected and replace any previously blocking events. (test_change_state, test_child_handler): Test that stop events in the blocking list are kept and unblocked when necessary. 2008-03-02 Scott James Remnant * init/job.c (job_change_state): Shouldn't emit the started event on pre-stop cancellation, and shouldn't unblock the job because it's a service. * init/job.c (job_change_state): Throw away the stop environment when starting and returning to running. * init/tests/test_job.c (test_change_state): Make sure the stop environment is actually thrown away. * init/job.c (job_run_process): Append the environment from the stop events if given the pre-stop process to run; do this before the special events so they can never be overriden. * init/tests/test_job.c (test_run_process): Check that the stop event environment is included for pre-stop and not for other jobs. * init/job.c (job_handle_event): Remove setting of UPSTART_JOB and UPSTART_JOB_ID, we set that when we run the process. * init/tests/test_job.c (test_handle_event): Don't check for UPSTART_JOB and UPSTART_JOB_ID since we no longer copy it in here. * init/job.c (job_run_process): Copy the environment to pass it to the job, appending the UPSTART_JOB and UPSTART_JOB_ID variables here; we never want to be able to match these, etc. * init/tests/test_job.c (test_run_process): Add tests to make sure that the environment is actually set in the processes we run. * init/job.h (Job): Add stop_env member to store environment from stop events for the stop script. * init/job.c (job_new): Initialise stop_env to NULL. (job_handle_event): Copy environment from the stop_on operator into the stop_env member. * init/tests/test_job.c (test_new): Check that stop_env is NULL. (test_handle_event): Add lots of tests to make sure that the environment is collected from the events and stored in stop_env properly, overwriting what was there already if necessary. * init/init.supp (job-run-process-args): Add a suppression for the fact that job_run_process will leak its arguments to a new process assuming that it will call exec() or exit() * init/tests/test_job.c (test_child_handler): Remove bogus free tag of the list, which we don't use in this test (valgrind failure) * init/job.h (Job): Remove the start_on member. * init/job.c (job_new): Don't initialise start_on since it's gone. (job_change_state): Drop call to unblock the start_on operator since the events are already unblocked by job_unblock. (job_failed): Drop setting of start_on events to failed since this is already done by job_unblock. This results in a slight change in behaviour, now when a job fails to start - the event or command will be immediately unblocked since there's no point waiting until it stops again - it was waiting for it to start. * init/tests/test_job.c (test_new): Remove start_on checks (test_change_state, test_child_handler, test_handle_event): Remove all references to start_on, instead relying on the blocking checks instead. * init/tests/test_event.c (test_poll): Remove solitary reference to job's start_on, this wasn't necessary anyway - we proved that it was the right event by affecting the job. Revert previous commit that temporarily increased the number of references, they should be one again now only the blocking list holds them. * init/job.h (job): Add blocking member, a list of events that we're blocking from finishing. * init/job.c (job_new): Initialise blocking member to NULL. (job_handle_event): Collect the list of events from the operator and store them in the job's blocking list (unblocking any existing first); if the job is already running, unblock unref and discard. (job_unblock): New function to deal with unblocking the events we're holding onto and resetting the blocking list; this will be extended later to also unblock any command. (job_change_state): Unblock events in running for services and in waiting for everything. (job_failed): Unblock events and mark them as failed. * init/tests/test_job.c (test_new): Check that it's initialised to NULL (test_handle_event): Extend the test cases to check the value of the blocking list, and to make sure that the previous blocking list is overwritten when necessary. (test_change_state, test_child_handler): Extend test cases so that wherever we're had a blocked event in start_on, we also have that in the blocking list. * init/tests/test_event.c (test_poll): Temporarily increase the expected number of references/blockers to the event in the poll test. * init/job.h (Job): Add start_env member, this stores the environment to use when starting the event so it doesn't overwrite the current environment of a restarting job. * init/job.c (job_handle_event): Do the heavy lifting of starting a new job instance here; construct the environment from the built-ins and configured, append that collected from the start events, locate or create a new instance, add the job name and id then copy into the new start_env member before starting the job. At some point this will probably all become a function since it'll be similar for the control functions. (job_change_state): Copy the start_env member into the env member when in the starting state; thus the job environment remains the same until restarted. (job_new): Remove code to initialise the environment, we now do that when actually starting the instance. * init/tests/test_job.c (test_handle_event): Add test cases for starting the job, making sure that the environment is correctly copied into the right field and also checking what happens if it's already stopping or running. (test_change_state): Make sure that start_env is correctly copied over into env, overwriting what is there if non-NULL or keeping it if NULL. (test_new): Remove checks for environment setup, since we don't do that anymore here; replace with checking for NULL and restore the alloc fail tests. * TODO: Update. * init/environ.c (environ_add): Allow it to accept NULL length, since we can't always keep that around. * init/process.c (process_spawn): Accept the environment list as a parameter, then finally we can change this function to take a JobConfig as the first argument. (process_error_read): Remove the associated error handler. * init/process.h: Change prototype. (ProcessErrorType): Remove error enum for environment. * init/tests/test_process.c (test_spawn): Update calls in test to just pass in an environment array (direct testing). * init/job.c (job_run_process): Pass configuration and environment to process_spawn. * init/process.c (process_spawn): Take the environment directly out the job structure, rather than recreating it. (process_environment): Drop function, absorbed elsewhere. * init/process.h: Remove prototype. * init/tests/test_process.c (test_spawn): Set the job_id variable before calling job_new and set config->start_on instead of job->start_on so that job_new can pick up both. (test_environment): Remove test cases. * init/job.h (Job): finally gains env pointer of its own. * init/job.c (job_new): Initialise the environment, moving the last of the code from process_environment -- this is only temporary though in the interests of refactoring, it'll move out of here again soon enough. * init/tests/test_job.c (test_new): Make sure that the environment is set in a manner which tests the overriding of things by other things; we have to temporarily comment out the alloc fail stuff though :-( * init/event.c (event_operator_collect): Make list the last argument for consistency with future functions. * init/event.h: Update prototype. * init/tests/test_event.c (test_operator_collect): Swap arguments. * init/process.c (process_environment): Update. * init/job.c (job_config_environment): Function to generate an environment table from a JobConfig, code largely moved from process.c * init/job.h: Add protoyype. (JOB_DEFAULT_ENVIRONMENT): List of environment variables to always copy from the environment (moved from process.h) * init/tests/test_job.c (test_config_environment): Add test case, again largely copied from test_process.c * init/process.c (process_environment): Call job_config_environment instead of the code moved out. * init/process.h (PROCESS_ENVIRONMENT): Move to job.h * TODO: Update. * TODO: Update. 2008-03-01 Scott James Remnant * init/event.c (event_operator_collect): Create a mega-function to iterate an EventOperator tree (filtering out those bits that aren't TRUE) and collect the events, adding them to a linked list, adding their environment to a table and making a string list for another environment variable. Fundamentally this function marshals data out of the Event subsystem into the right format for the Job subsystem. * init/event.h: Add prototype. * init/tests/test_event.c (test_operator_collect): Tests for the collector function; some bits may seem similar to test_process.c * init/process.c (process_environment): Use event_operator_collect to gather the environment, instead of its own code (which pretty much got pasted into event_operator_collect anyway). Force everything else to allocate matching the caller. * init/tests/test_process.c (test_spawn, test_environment): Had forgotten to set the value of the intermediate AND operator to TRUE, necessary now. * init/process.c (process_environment_add): Move and rename this function, since it's not really process associated (process_environment): Change to use environ_add or environ_setf instead. * init/process.h: Remove prototype. * init/environ.c (environ_add): New name/location of process_environment_add, modified to not take a copy of the string (environ_set): Wrapper for the above for common dealing with environment we want to set from a format string. (environ_get, environ_getn, environ_lookup): Functions to get an environment variable entry; largely cripped from event.c but bug-fixed at the same time. * init/environ.h: Function prototypes. * init/event.c (event_operator_match): Change to use environ_lookup * init/tests/test_process.c (test_environment_add): Move the tests. * init/tests/test_environ.c: Test suite for environment handling * init/Makefile.am (init_SOURCES): Build environ.c and environ.h (TESTS): Build environment test suite (test_environ_SOURCES, test_environ_LDFLAGS, test_environ_LDADD): Details for environment test suite (test_process_LDADD, test_job_LDADD, test_event_LDADD) (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD): Link environ.o to other test suites * init/job.c (job_new): Increment the number of instances. (job_instance): Simplify the function, it now only returns the existing instance or NULL. This makes it easier to extend when we have env-limited instances later on. (job_handle_event): If job_instance returns NULL, create a new instance with job_new() and always reset the operator afterwards. * init/tests/test_job.c (test_new): Check that the instances variable is incremented when a new job is created. (test_instance): Change to check that it returns NULL when there is no active instance, or for multi-instance jobs, instead of creating a new one itself. (test_config_replace, test_find_by_pid) (test_find_by_id, test_change_goal, test_change_state) (test_next_state, test_run_process, test_kill_process) (test_child_handler, test_handle_event) (test_handle_event_finished): Call job_new to create a new instance from a config, instead of job_instance. * init/tests/test_conf.c (test_source_reload_job_dir) (test_file_destroy): Call job_new to create a new instance from a config, instead of job_instance. * init/tests/test_event.c (test_poll): Call job_new to create a new instance from a config, instead of job_instance. * init/tests/test_process.c (test_spawn, test_environment): Call job_new to create a new instance from a config, instead of job_instance 2008-02-29 Scott James Remnant * configure.ac: Compare the evaluated $sbindir against the common things we put in PATH, if it doesn't match, define EXTRA_PATH to contain it. * init/paths.h: Append EXTRA_PATH to PATH if defined. * init/Makefile.am (AM_CPPFLAGS): Replace TELINIT definition with SBINDIR, pointing at the common directory. * compat/sysv/Makefile.am (AM_CPPFLAGS): Replace SHUTDOWN definition with SBINDIR, pointing at the common directory. * init/paths.h (TELINIT): Redefine to be SBINDIR with "/telinit" on the end; define SBINDIR if necessary. * compat/sysv/reboot.c (SHUTDOWN): Redefine to be SBINDIR with "/shutdown" on the end; define SBINDIR if necessary. 2008-02-22 Scott James Remnant * init/event.c (event_operator_match): Rewrite to match both positionally and by name. * init/tests/test_event.c (test_operator_match): Update tests to check the new behaviour works. * init/parse_job.c (parse_on_operand): Add arguments to env list rather than args; sanity check afterwards to ensure that positional doesn't follow name-based -- when parsing the job is the right place to catch this. * init/tests/test_parse_job.c (test_stanza_start) (test_stanza_stop): Change args to env when checking operators. Check that arguments may be quoted in manners that we expect to be sane. Check that positional arguments cannot follow name-based ones. * init/errors.h: Add new error. * init/conf.c (conf_reload_path): Treat expected variable as a permanent error. * init/tests/test_process.c (test_spawn, test_environment): Update event_new() calls to remove extra argument. * init/main.c (main, cad_handler, kbd_handler, pwr_handler): Update event_new() calls to remove extra argument. * init/job.c (job_change_state): Update event_new () call. (job_emit_event): Update to put failure information in environment. * init/tests/test_job.c (test_new, test_instance) (test_child_handler, test_handle_event) (test_handle_event_finished): Remove extra argument to event_new, rename args to env in operator where necessary. (test_change_state): Update to check emitted event by full environment. * init/event.h (Event): Remove args member. (EventOperator): Rename args member to env. Update prototypes to match. * init/event.c (event_new): Remove args member. (event_finished): Remove copying of args member to failed event. (event_operator_new): Rename args member to env. (event_operator_copy): Rename args copying to env. (event_operator_match): ?? * init/tests/test_event.c (test_new): Update test to remove args. (test_operator_new): Update test to rename args to env. (test_operator_copy): Update test to rename args to env. (test_operator_match): ??? * TODO: Update with job atomicity notes. 2008-02-20 Scott James Remnant * init/job.c: Switch around job_find_by_pid and job_find_by_id * init/job.h: Likewise. * init/job.h: Update prototypes to match variable names in the code. 2008-02-17 Scott James Remnant * init/process.c (process_kill): Change to accept a JobConfig rather than a Job, since in theory this should only ever need that in a future where we can specify a kill signal (right now it's not used for anything!) * init/process.h: Update prototype. * init/tests/test_process.c (test_kill): Update test cases. * init/job.c (job_kill_process, job_kill_timer): Pass in JobConfig instead of Job. * init/process.c (process_spawn): Accept trace as an argument instead of using a random piece of job state to determine whether to trace or not. * init/process.h: Update prototype. * init/tests/test_process.c (test_spawn): Update tests to pass in via argument whether to trace the job or not. * init/job.c (job_run_process): Pass in the trace variable rather than relying on it working it out for itself; this means we don't need to set the state until after, therefore don't need to reset it. * AUTHORS, logd/jobs.d/logd.in: Update e-mail addresses. * README: Update kernel recommendation to 2.6.24, since that's the oldest version that the test suite will complete under. 2008-01-17 Scott James Remnant * TODO: Update. * init/job.c (job_run_process): Don't append the list of event names, they can be found in $UPSTART_EVENTS now. This is better since it's consistent for exec and script. * init/tests/test_job.c (test_run_process): Drop test case. * init/process.c (process_environment): Function to build an environment table for a job containing built-in variables, those from the configuration, events and finally the upstart job ones. (process_environment_add): Helper function for the above that handles adding a variable to the array; dealing with fetching the value from init's environment if necessary. (process_setup_environment): This function now gets dropped in favour of the new ones. (process_spawn): Call the new process_environment() function and set the environ variable directly. * init/process.h (PROCESS_ENVIRONMENT): Define built-in environment variables that are always copied from our own environment. Add prototypes. * init/tests/test_process.c (test_environment): Check that the environment is built correctly and that each bit overrides the right other bit. (test_environment_add): Check that the array is built correctly. (test_spawn): Adjust order and values of expected environment to match what's now set. 2008-01-16 Scott James Remnant * init/job.c (job_failed): Separate the logic that marks the job and its associated events as failed into its own function, since it's a large enough amount of code that we were otherwise duplicating everywhere else (and in a few places, failing to mark the events as failed as well). (job_change_state, job_process_terminated): Call job_failed instead of doing it ourselves. (job_emit_event): De-nest the logic and fix so that we don't add environment to the failed respawn event. * init/tests/test_job.c (test_change_state): Add checks on whether the event was marked as failed or not. * TODO: Update. * configure.ac (AC_COPYRIGHT): Update copyright to 2008. * TODO: Update. * init/tests/test_job.c (test_child_handler): Don't run the signal and ptrace tests while in valgrind, sometimes signals (specifically SIGCONT after SIGSTOP) don't behave right and we kinda need that reliability. * init/tests/test_job.c (test_child_handler): After adding extra processes, make sure we clean up again so each test is roughly independant. Fix the final test case to not rely on previous setup and work on its own. * init/tests/test_job.c (test_change_state): Remove useless check of job->start_on from a killed/post-stop check (noticed while writing the other). * init/job.c (job_change_state): Check the return value of job_run_process() and if particular processes fail, change the goal to stop and push the job into the next state; setting the job as failed along the way. (job_emit_event): If the exit_status is -1 then it means the job failed to spawn, so don't place EXIT_SIGNAL or EXIT_STATUS in the event environment. * init/tests/test_job.c (test_change_state): Check what happens when each process type fails, make sure that the job is stopped for pre-start, spawned and post-stop and the failure is ignored for post-start and pre-stop. 2008-01-15 Scott James Remnant * init/main.c: Selectively compile out certain pieces when make is run with CPPFLAGS=-DDEBUG, giving us a build that'll happily run from a user terminal. * init/event.h: Change the startup event to "debug" when built like that, so we don't accidentally do bad things. * init/job.c (job_run_process): Catch PROCESS_ERROR and abort the attempt to run the process, returning a non-temporary error condition. * init/tests/test_job.c (test_run_process): Add test case for attempting to spawn a file that doesn't exist. * init/process.c (process_error_read): Avoid the word process, since it's likely included in the higher error message. * init/process.c (process_spawn): Call process_error_abort() on any error condition. * init/tests/test_process.c (test_spawn): Add a test case for failing to spawn a process and receiving ProcessError correctly; fix other cases to ensure they return a pid. * init/errors.h: Add PROCESS_ERROR to the enum, but not to the string list since there's no specific defined string for this one. * init/process.h (ProcessError): Structure that builds on NihError to add additional information for a process error. (ProcessErrorType): enum of different process error types. * init/process.c (process_spawn): After forking read the error in the parent, returning if we raise one. Ensure we close the pipe if the fork fails. Re-order so that we set the environment, umask and priority after the resource limits (which should apply to them). (process_error_abort): New function to immediately abort with an error, writing it on the pipe first. (process_error_read): Counterpart function to read the error from the pipe and raise it, with appropriate error messages. * init/process.c (process_spawn): Create a pipe to use for communication with the child, ensuring its closed before the parent returns and ensuring that the writing end is close-on-exec in the child. * init/job.c (job_run_process): Change to return a value indicating whether there's been a non-temporary error (always returns zero so far). * init/job.h: Update prototype. * init/tests/test_job.c (test_run_process): Check that job_run_process always returns zero. * init/job.c (job_change_goal): Document in which states this function has unexpected side-effects such as freeing the job, since we do attempt to call it from within job_change_state(). * init/process.c (process_setup_limits): Integrate this function back into process_spawn() since there's no reason for it to be separate. (process_setup_console): Alter this function so it closes the original console descriptors, opens the new ones and can reset them to if required -- in particular, this no longer takes a Job parameter. (process_spawn): Use the new process_setup_console function and integrate code from process_setup_limits(). * init/process.h: Update function prototype. * init/main.c (main): Use the new process_setup_console() argument form. Move syslog opening to the end of the function, rather than where it is now where it could be at risk of being closed again immediately. Change the root directory in case we're run in some weird way. (reset_console): Remove function since the code is now in process_setup_console() * init/enum.h (console_type): Remove CONSOLE_LOGGED and make the CONSOLE_NONE constant be zero. * init/parse_job.c (stanza_console): Drop parsing of "logged" * init/tests/test_parse_job.c (test_stanza_console): Drop testing of "logged" parsing. 2008-01-14 Scott James Remnant * HACKING: Correct bzr URLs to trunk. 2007-12-15 Scott James Remnant * init/process.c (process_spawn): Fix some documentation strings. * init/process.c (process_kill): Move to beneath the process setup functions. * init/process.h: Adjust ordering here too. * init/process.c (process_spawn): Group console closing and setup together, becoming the session and process group leader first. 2007-12-07 Scott James Remnant * init/process.c (process_spawn): Drop the debug message since it's always repeated by the caller. * init/job.c (job_run_process): Drop the word Active which is a hold-over from when we had different process states. * TODO: Update. * init/job.c (job_child_handler): Add code to handle the trapped signal and ptrace event cases, distinguishing between a trapped signal and process stopped after exec or fork using our trace state member. Call out to other functions to do the work. (job_process_trace_new): Called after the first exec to set the ptrace options, update the trace state and allow the process to continue without delivering the signal. Also called after the fork to do the same. (job_process_trace_new_child): Called after a fork for the new child; increments the fork counter and if it goes over the number we want, detaches from the process and allows it to move to running. Otherwise calls job_process_trace_new() instead. (job_process_trace_signal): Called when a signal is trapped, simply delivers it to the process unchanged. (job_process_trace_fork): Called before a fork for the parent, obtains the new child process id from the event, updating the job structure, and detaches from the parent which we're no longer interested in. (job_process_trace_exec): Called after an exec other than the first, assumed to be the end of forking so detaches from the process and allows it to move to running. * init/tests/test_job.c (test_child_handler): Add test cases for the various ptrace states. * init/job.c (job_run_process): Set process trace state to new for the main job if we need to wait for the daemon or fork; otherwise reset the state. * init/tests/test_job.c (test_run_process): Add test cases to make sure the trace state is set right and picked up by process_spawn. * init/process.c (process_spawn): Set a ptrace before execing the binary if the trace state is TRACE_NEW, set by the caller. * init/tests/test_process.c (test_spawn): Make sure that a job is ptraced if set up properly. (child): Add a simple case that just exits immediately for testing the above. * init/job.h (Job): Add new trace_forks member to keep count of how many forks we've seen and trace_state member to track whether we've just started the trace or just forked. * init/enum.h (TraceState): Add enumeration to keep track of ptrace state to differentiate between a signal and an event. * init/job.c (job_new): Initialise new members. * init/tests/test_job.c (test_new): Check new members are initialised * init/enum.h (JobWaitType): Add new daemon and fork wait types. * init/parse_job.c (stanza_wait): Add parsing for daemon and fork. * init/tests/test_parse_job.c (test_stanza_wait): Add tests too. * init/job.h (JobConfig): Remove daemon and pid members. (Job): Remove pid_timer member. (JOB_DEFAULT_PID_TIMEOUT): Remove this constant. * init/job.c (job_config_new, job_new): Remove initialisation of removed members. (job_change_state): Stay in spawned unless we're not waiting for anything -- remove the daemon flag. * init/tests/test_job.c (test_config_new, test_new): Remove checks for initialisation of removed members. (test_change_state): Remove daemon flag stays in spawned check since the daemon flag has gone. * init/parse_job.c (stanza_daemon, stanza_pid): Remove these functions since they have no members to set. * init/tests/test_parse_job.c (test_stanza_daemon, test_stanza_pid): Remove the tests for the now non-existant functions. * init/process.c (process_spawn): raise the system error before calling another syscall, in case we overwrite errno. 2007-12-06 Scott James Remnant * init/job.c (job_child_handler): Implement a combined child event handler to replace the multiple separate ones. This handler deals with adding appropriate messages to the log and decoding any state information before calling specific action functions. (job_child_reaper): Remove, moving the bulk of the code into new (job_process_terminated): function that handles it cleanly. (job_child_minder): Remove, moving the bulk of the code into new (job_process_stopped): function that's a lot cleaner. * init/job.h: Update prototypes. * init/tests/test_job.c (test_child_reaper, test_child_minder): Combine unit tests from both functions into single new (test_child_handler): function. * init/main.c (main): Call the combined function on child events instead of separate ones. * init/job.c (job_child_minder): Add informational message and improve style and documentation. 2007-12-02 Scott James Remnant * init/enum.h (JobWaitType): Introduce a new enum that specifies how to transition the job from spawned to running; either we don't wait, or we wait for it to emit the stopped signal. * init/job.h (JobConfig): Add the wait_for member. Add protoype for job_child_minder. * init/job.c (job_config_new): Initialise to JOB_WAIT_NONE. (job_child_minder): New function to catch when a process is stopped by a signal, and move it to the next state when it does so. * init/tests/test_job.c (test_config_new): Check the initialisation of wait_for to JOB_WAIT_NONE. (test_child_minder): Tests for the new function. (test_change_state): Copy the daemon test case to refer to waiter. * init/main.c (main): Call job_child_minder whenever the job is stopped by a signal * init/parse_job.c (stanza_wait): Parse a new "wait" stanza that specifies what to wait for before leaving the spawned state. * init/tests/test_parse_job.c (test_stanza_wait): Check the new stanza. 2007-11-29 Scott James Remnant * init/tests/test_job.c (test_change_state): Add a few sets to NULL so gcc is happy. 2007-11-15 Scott James Remnant * init/job.c (job_child_reaper): Update argument names and types to match new NihChildHandler pattern; switch on event instead, which can now have three values not two (it always could, this was a bug) to output warning and assume that status is always non-zero if killed so no need to check that separately. * init/job.h: Update prototype. * init/tests/test_job.c (test_child_reaper): Update calls to job_child_reaper to pass an NihChildEvents member instead of FALSE or TRUE for killed. * init/main.c: Adjust call to nih_child_add_watch to indicate which events we want to pass to the reaper; we don't use NIH_CHILD_ALL since we're going to add ptrace stuff to a different function. 2007-11-07 Scott James Remnant * init/main.c (main): Tidy up. 2007-11-04 Scott James Remnant Complete the simplification of job config; rather than try and precompute job replacements, keeping them all in the same hash table and chaining them together, we just work it out when it's actually necessary based on what's in the conf_sources list. * init/job.h (JobConfig): Remove the replacement and replacement_for members and put a deleted member in instead. * init/job.c (job_config_new): Initialise deleted to FALSE; don't replace the job into the hash table, since we only want the current one in there now. (job_config_find_by_name): Now that there is only ever one job config in the hash table, we don't need any special function and can just use nih_hash_lookup directly, so drop this function. (job_config_should_replace): Rename to job_config_replace (job_config_replace): Rework, it now checks to see whether there are instances, and if not removes the job from the hash table before selecting a new one (which might be the same job). * init/tests/test_job.c (test_config_new): Update test to check deleted starts off as FALSE and that the job isn't in the hash. (test_config_find_by_name): Drop. (test_config_should_replace): Rename and rewrite to test replacement actually works as we expect. (test_change_state): Update tests for entering the waiting mode and replacing jobs. (test_find_by_pid, test_find_by_id, test_handle_event) (test_handle_event_finished): Add jobs to the hash table, otherwise we can't find them (test_child_reaper): Add job to the hash table, and also create a source for it since we end up with it in the waiting state so need to be able to keep it. * init/Makefile.am (test_process_LDADD, test_job_LDADD) (test_event_LDADD): Need the full .o file list now. * init/conf.c (conf_file_destroy): Rewrite to mark the job deleted, call job_config_replace if it's the current job and free it if it isn't the current job either before or after that call. (conf_reload_path): Handle job replacement here; look up the old job in the hash table, if it exists attempt a replacement otherwise add the new job to the hash table. * init/tests/test_conf.c (test_source_reload_job_dir) (test_source_reload_conf_dir, test_source_reload_file): Update tests to check job->deleted and use nih_hash_lookup to see whether it's the current job. (test_file_destroy): Write tests to check the common cases, we don't need to worry about the intermediate now since they can't happen. * init/parse_job.c (parse_job): Massively simplify, this only creates the config and parses it now. * init/tests/test_parse_job.c (test_parse_job): Remove the replacement checks. * init/tests/test_event.c (test_poll): Add configs to the hash table so they can be found. * TODO: Update. 2007-11-03 Scott James Remnant * init/conf.h (ConfSource): Remove priority, we'll place these in a linked list and use that order instead. (ConfSourcePriority): Drop accordingly. (ConfItem): Drop this structure; permitting jobs and states to be defined inside larger conf files made things complicated for no benefit; move the item union into (ConfFile): here, instead of the items list. (ConfItemType): Drop accordingly. * init/conf.c (conf_init): Store sources in a linked list, instead of a hash table; no idea why it ever was. (conf_source_new): Drop priority argument and add to list not hash. (conf_file_new): Set data to NULL instead of initialising items, set destructor to conf_file_destroy. (conf_item_destroy): Rename to conf_file_destroy (conf_file_destroy): and adjust to refer to ConfItem instead, getting the item type through the source. (conf_item_new): Drop. (conf_reload): Iterate as linked list not hash table. (conf_reload_path): Simplify handling of old files and items a little, just look it up and always free if it exists before parsing the new file. (conf_file_get): No longer any need for this function. * init/tests/test_conf.c (test_file_get, test_item_new): Drop test functions for those that have been removed. (test_item_destroy): Rename to test_file_destroy. (test_source_new): Don't pass or check priority, or hash lookup. (test_file_new): Check data is set correctly. (test_source_reload_job_dir, test_source_reload_conf_dir) (test_source_reload_file): Update tests accordingly. * init/parse_conf.c (stanza_job): Drop the job stanza, jobs may only be defined in dedicated directories. * init/tests/test_parse_conf.c (test_parse_conf): Simply check to only make sure the file is parsed. (test_stanza_job): Drop function. * init/main.c: Update calls to conf_source_new. * init/init.supp: Update intermediate function in suppression. 2007-10-26 Scott James Remnant * init/process.c (process_spawn): Mask out all signals across the fork() rather than just SIGCHLD; reset the signal handlers to default before unmasking again. The original rationale was we needed to avoid SIGCHLD occurring before we'd stashed the pid, but that's no longer a problem; the new rationale is that we want to avoid the signal handlers running in the newly forked child. 2007-10-20 Scott James Remnant * init/job.c (job_init): The job's name is the first item in the structure again, so we can use nih_hash_string_key. (job_config_name): Drop this function, then. * init/conf.h (ConfSourcePriority): Add a priority enum (ConfSource): Add priority member. * init/conf.c (conf_source_new): Take priority as an argument and set it in the structure. * init/tests/test_conf.c (test_source_new): Make sure priority is set from the argument. (test_file_new, test_file_get, test_item_new) (test_source_reload_job_dir, test_source_reload_conf_dir) (test_source_reload_file, test_source_reload, test_item_destroy): Pass in a priority when creating a ConfSource. * init/tests/test_parse_conf.c (test_parse_conf): Likewise. * init/main.c (main): Set relative priorities for the configuration directories. * init/conf.h (conf_file, conf_item): Add source and file members respectively that point to the parent structure. * init/conf.c (conf_file_new, conf_item_new): Set the members. * init/tests/test_conf.c (test_file_new, test_file_get) (test_item_new): Make sure the new members are set properly. * util/Makefile.am (install-data-hook, install-exec-hook): Apply transform to source and destination of both manpage and program symlinks. * compat/sysv/Makefile.am (install-data-hook, install-exec-hook): Likewise for the compatibility symlinks. * TODO: Update. * init/tests/test_process.c (test_spawn): Make the event a child of the operator so it doesn't get freed first. * init/job.c (job_instance): Increment an instances counter each time we spawn an instance. (job_change_state): Decrement the instances counter again. (job_detect_stalled): Drop the main loop function, since we perform active detection of stall now. * init/job.h: Update header. * init/tests/test_job.c (test_change_state): Check that we get the stalled event for the last instance. (test_detect_stalled): Drop the test. * init/main.c: Remove job_detect_stalled from the main loop. * init/event.c (event_operator_destroy): Destructor for an EventOperator that unblocks and unreferences the event first. (event_operator_new): Set the operator. (event_operator_copy): Remove error handling since it's unnecessary with the destructor in place. * init/event.h: Add prototype. * init/tests/test_event.c (test_operator_destroy): Make sure it works properly. (test_operator_copy): Don't unblock or unref events before freeing them, since that's now taken care of when it's referenced. * init/job.c (job_new): Remove unnecessary error handling. * init/tests/test_job.c (test_run_process): Reference the event when setting it, otherwise we'll assert when we try to free it. * TODO: Update. * init/job.c (job_new): Drop the parent argument for consistency. (job_instance): Update call to job_new. * init/job.h: Update prototype. * init/tests/test_job.c (test_new): Adjust call, check the parent and make sure that start_on and stop_on are copied over properly. * TODO: Update. * init/conf.c (conf_file_get): Split out the allocation code from here (conf_file_new): into this new function. * init/conf.h: Add prototype. * init/tests/test_conf.c (test_file_new): New tests. * TODO: Update. * init/job.c (job_change_state): Hardcode the next state when we catch a runaway job to be JOB_WAITING. (job_next_state): Change next state for JOB_STARTING when goal is JOB_STOP to be JOB_STOPPING for consistency with the others; otherwise if our goal is stopped during our starting event, we'll never emit a stopping event to match it. * init/tests/test_job.c (test_next_state): Update test case. * doc/states.dot: Adjust the state transitions. * doc/states.png: Regenerate. * TODO: Update. 2007-10-19 Scott James Remnant Dealing with instances has always been tricky since they're copies that exist in the hash table; this patch changes that so the job's configuration is separated from its state. The only difference between instance and non-instance jobs now is that non-instance jobs only ever have one entry in their instances list. * init/job.h (Job): Separate out the members that come from the configuration into a new JobConfig structure which can be shared amongst all of the instances; this means we can drop instance_of. (JobConfig): Add instances list. (JobProcess): Remove pid member, replaced by pid list in Job. Update prototypes of functions to match. * init/job.c (job_new): Split off initialisation of configuration pieces into new job_config_new function leaving the state here; copy the start_on and stop_on members from JobConfig (job_copy): Drop this function, we don't need to copy jobs now. (job_name): Rename to job_config_name. (job_init): Set key function to job_config_name. (job_process_new): Drop initialisation of pid. (job_process_copy): Drop this function entirely, we don't need it. (job_find_by_name): Rename to job_config_find_by_name; massively simplify now we won't find instances or deleted jobs in the list. (job_should_replace): Rename to job_config_should_replace; simplify now that we can do a simple check to see whether a job exists or not (job_find_by_pid, job_find_by_id): Loop through the instances after looping through the hash table. (job_instance): Simplify, now all it needs to do is call job_new() if there isn't anything in the instances list, or it's multi-instance. (job_change_goal): Document that job should not be used on return. No need to check for instance jobs anymore. Place the job id in the output. (job_change_state): Document that job should not be used on return. Place the job id in the output. Check for information in the job's config. Merge the waiting and deleted states, so that a job instance is automatically deleted when it finishes. (job_next_state): Assert that we never call job_next_state when in JOB_WAITING since there's no possible next state. Check config for whether a main process exists. (job_emit_event): Obtain config-replaced pieces from the job's config (job_run_process): Obtain process information from the job's config but store the pid in the Job. Put job id in the output. (job_kill_process, job_kill_timer): We don't need to obtain the JobProcess just the pid from the job. Put job id in the output. (job_child_reaper): Put job id in the output. Check job config. (job_handle_event): Iterate job instances and process their stop_on operators, but process the start_on from the job configs. (job_handle_event_finished): Loop through the instances too. (job_detect_stalled): Check start_on from the config and just check whether there are any instances in the list. (job_free_deleted): No deleted state, so drop this function. * init/tests/test_job.c (test_new): Split into test_new and new test_config_new function. Create JobConfig object and spawn Job instances from that. (test_copy): Drop the tests. (test_process_new): Drop check of pid. (test_process_copy): Drop test. (test_find_by_name): Rename to test_config_find_by_name. (test_should_replace): Rename to test_config_should_replace. (test_instance): Create JobConfig object, and adjust tests to ensure that we always get a Job object. (test_find_by_pid, test_find_by_id, test_change_goal): Create JobConfig object and spawn Job instances from that. (test_change_state): Create JobConfig object and spawn Job instances from that. Adjust tests that previously checked for JOB_WAITING to check for job being freed. Drop checks for JOB_DELETED. (test_next_state): Create JobConfig object and spawn Job instances from that. Drop JOB_DELETED and JOB_WAITING checks. (test_run_process, test_kill_process, test_child_reaper) (test_handle_event, test_detect_stalled): Create JobConfig object and spawn Job instances from that. (test_free_deleted): Drop. * init/main.c: Don't add job_free_deleted to the main loop. * init/enum.h (JobState): Drop JOB_DELETED. * init/enum.c (job_state_name, job_state_from_name): Drop JOB_DELETED. * init/tests/test_enum.c (test_state_name, test_state_from_name): Drop tests that use the JOB_DELETED value. * init/process.c (process_spawn, process_setup_limits) (process_setup_environment, process_setup_console): Get details from the job config. Put job id in the output. * init/tests/test_process.c (test_spawn, test_kill): Create a JobConfig object and make Job instances from that. * init/tests/test_event.c (test_poll): Create a JobConfig object and make Job instances from that. (test_operator_copy): Set pointers to NULL to avoid gcc complaining. * init/conf.h (ConfItem): Make the type for a job be JobConfig. * init/conf.c (conf_item_destroy): Don't attempt to replace the new middle-man target, if it was due to be replaced it would have already been. If we can replace the config, ensure nothing points at it and then free it, rather than kicking state. * init/tests/test_conf.c (test_source_reload_job_dir) (test_source_reload_conf_dir, test_source_reload_file) (test_source_reload, test_item_destroy): Call job_config_new to create JobConfig objects, track when they are freed rather than marked in the deleted state. Create instances with job_instance, and fetch from the instances list. Expect the job to be freed with the item. * init/tests/test_parse_conf.c (test_parse_conf) (test_stanza_job): Change expected type from Job to JobConfig. * init/parse_job.c: Update prototypes of all functions to refer to JobConfig instead of Job. (parse_job): If the old job already has a replacement, remove the replacement from the hash table -- but don't free it because it's linked by a ConfItem -- this is temporary. Likewise for when we replace the old job. * init/parse_job.h: Update prototype. * init/tests/test_parse_job.c: Update all functions to use JobConfig instead of Job. (test_parse_job): Create an instance. * doc/states.dot: Remove the deleted state. * doc/states.png: Regenerate. * TODO: Update with notes from the conversion. 2007-10-16 Scott James Remnant Update to catch up with changes in libnih that make code a little bit easier to follow (we hope). * init/tests/test_process.c (test_spawn, test_kill): Replace calls to nih_list_free() with nih_free() * init/event.c (event_poll): Replace nih_list_free with nih_free since the former function has gone from libnih. (event_new): Adjust setting of the destructor. (event_operator_new): Set destructor for the tree node. * init/tests/test_event.c (test_new, test_find_by_id, test_ref) (test_unref, test_block, test_unblock, test_poll) (test_operator_match): Replace nih_list_free with nih_free. (test_poll): Use TEST_FREE_TAG and TEST_FREE rather than abusing destructors. * init/job.c (job_new): Set destructor to nih_list_destroy. (job_copy, job_free_deleted): Use nih_free instead of nih_list_free * init/tests/test_job.c (test_new, test_copy, test_find_by_name) (test_find_by_pid, test_find_by_id, test_instance) (test_change_goal, test_change_state, test_next_state) (test_should_replace, test_run_process, test_kill_process) (test_child_reaper, test_handle_event) (test_handle_event_finished, test_detect_stalled) (test_free_deleted): Replace all uses of nih_list_free with nih_free (test_child_reaper, test_free_deleted): Replace destructor abuse with TEST_FREE, etc. * init/conf.c (conf_reload_path): Use nih_free instead of nih_list_free (conf_source_new, conf_file_get, conf_item_new): Set destructor (conf_source_reload, conf_delete_handler): Use nih_free not the custom conf_file_free() function. (conf_reload_path): Use nih_free not the custom conf_item_free() function. (conf_delete_handler): Use nih_free not nih_watch_free() (conf_source_free, conf_file_free): Drop these functions, since all the free chaining happens properly with destructors. (conf_item_free): Rename to conf_item_destroy and turn into destructor * init/conf.h: Update prototypes. * init/tests/test_conf.c (test_source_new, test_file_get) (test_item_new, test_source_reload_job_dir) (test_source_reload_conf_dir, test_source_reload_file) (test_item_free): Replace nih_list_free calls with nih_free (test_source_reload_job_dir, test_source_reload_conf_dir) (test_source_reload_file, test_source_reload, test_item_free): Replace calls to conf_source_free with nih_free (test_source_free, test_file_free): Drop functions. (test_item_free): Rename to test_item_destroy (test_item_new): Assign a job before freeing, otherwise the destroy function will foul up as it expects one. * init/parse_conf.c (stanza_job): Replace nih_list_free with nih_free * init/tests/test_parse_conf.c (test_parse_conf) (test_stanza_job): Replace conf_source_free() with nih_free() (test_parse_conf, test_stanza_job): Replace conf_item_free() with nih_free() * init/parse_job.c (parse_job, parse_on_paren, parse_on_collect): Replace nih_list_free with nih_free (parse_on): always cut out the stack head before returning (it won't be empty on error) otherwise we end up with a bunch of list entries pointing to it -- and it's way out of scope when we try and free them (parse_on_operator, parse_on_operand): Use the job as the context not the operator for consistency of freeing. * init/tests/test_parse_job.c: Replace all instances of nih_list_free with nih_free (too many functions to list). 2007-10-15 Scott James Remnant Strip out all of the IPC code, removing it and consigning it to the great revision control history in the sky. We're going to switch from home-brew to D-BUS. so all this is somewhat obsolete. Rather than maintain this while we carry on developing, we'll strip it out now and put the D-BUS code in ater once the rest of the core changes are done (otherwise we'd just be dragging those through maintenance too). * Makefile.am (SUBDIRS): Remove the upstart sub-directory entirely; comment out util, compat/sysv & logd since we'll fix them up later * configure.ac (AC_CONFIG_FILES): Remove from here too. * upstart/enum.c, upstart/enum.h, upstart/tests/test_enum.c: Move these files into the init/ sub-directory; strictly speaking we'll probably need to share them again later in some way, but for now they can live with the rest of the daemon code. * upstart/: Delete. * init/Makefile.am (init_SOURCES): Remove control.c, control.h, notify.c and notify.h; add enum.c and enum.h (TESTS): Remove test_control and test_notify; add test_enum (test_control_SOURCES, test_control_LDFLAGS, test_control_LDADD) (test_notify_SOURCES, test_notify_LDADD): Remove. (test_enum_SOURCES, test_enum_LDFLAGS, test_enum_LDADD): Add details (init_LDADD): Remove libupstart (test_process_LDADD, test_job_LDADD, test_event_LDADD) (test_parse_job_LDADD, test_parse_conf_LDADD, test_conf_LDADD): Remove libupstart, control.o and notify.o; add enum.o * init/control.c, init/control.h, init/tests/test_control.c: Delete * init/notify.c, init/notify.h, init/tests/test_notify.c: Delete * init/enum.c, init/job.c, init/job.h: Update include path for enum.h * init/parse_job.c: Remove unnecessary enum.h include * init/tests/test_enum.c: Update to reflect where it is. * init/main.c (main): Drop control socket opening. * init/tests/test_job.c: Remove unnecessary control.h include * init/event.c (event_pending, event_finished): Remove calls to notify_event and notify_event_finished * init/job.c (job_change_goal, job_change_state): Remove calls to notify_job. * init/tests/test_parse_conf.c: Remove calls to notify_init * init/tests/test_parse_job.c: Remove calls to notify_init * init/tests/test_event.c (test_poll): Strip out the part of the test that checks processes are notified. (check_event, check_event_finished): Remove. * configure.ac: Bump Autoconf dependency to 2.61 to match libnih * HACKING: Bump dependency in docs too. * NEWS: Copy in news from 0.3.9; that release doesn't appear in this ChangeLog since it was made on a separate branch by backporting bug fixes made here. * configure.ac: Bump version to 0.5.0, which is where development is heading for. 2007-10-12 Scott James Remnant * HACKING: Change URL for libnih. 2007-10-08 Scott James Remnant * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.16.1 since this version of gettext is needed for compatibility with Automake 1.10 * HACKING: Bump version in the docs too. * compat/sysv/Makefile.am: Only create symlinks if COMPAT_SYSV is enabled, otherwise we leave dangling ones. * Makefile.am (ACLOCAL_AMFLAGS): Specify that aclocal install ordinarily system-wide macros into m4 (libtool.m4, specifically). This makes it easier for packagers to modify autoconfery since aclocal is no longer a destructive event. * configure.ac (AM_INIT_AUTOMAKE): Increase Automake requirement to 1.10 to ensure we have aclocal --instal * HACKING: Increase Automake version in the docs. 2007-09-21 Scott James Remnant * init/job.c (job_detect_stalled, job_free_deleted): Call job_init() on entry, since we don't have a Job pointer passed to us, we need to make sure we don't dereference a potentially NULL list. 2007-06-22 Scott James Remnant * TODO: Update. * init/job.h: Update prototype of job_change_goal. (Job): Remove cause member. * init/job.c (job_change_goal): Drop additional argument since cause is no longer used. (job_change_state, job_child_reaper, job_handle_event): Only pass two arguments to job_change_goal. * init/control.c (control_job_start, control_job_stop): Only pass two argumenst to job_change_goal. * init/tests/test_job.c (test_change_goal, test_change_state): Only pass two arguments to job_change_goal. * init/job.c (job_new): Drop setting of cause. (job_change_cause): Drop this function entirely. (job_change_goal, job_change_state): Drop calls to job_change_cause (job_change_state, job_child_reaper): Don't pass job->cause to job_change_goal calls. * init/tests/test_job.c: Remove all tests that checked the value of job->cause, since that variable is going away. (test_change_goal): Remove the specific tests that checked whether cause was updated or not. * init/job.c (job_run_process): Replace the arguments from the event with a list of event names. * init/tests/test_job.c (test_run_process): Update test case to supply arguments from the list of events. * init/process.c (process_setup_environment): Drop the UPSTART_EVENT environment variable; it doesn't make sense when you can have multiple events. (process_setup_environment): Put all variables from the job's start events into the job's environment; replacing the UPSTART_EVENT variable * init/job.c (job_change_cause): Don't notify the job event subscribers when changing the cause. * init/notify.c (notify_job_finished): Instead notify them when the job reaches a rest state. * init/notify.c (notify_job): Call notify_job_event regardless, since this now looks over the start_on and stop_on fields. (notify_job_event): Rewrite to iterate over start_on and stop_on, and notifying for each cause event found. (notify_job_event_caused): Static function that is the guts of the above function. * init/tests/test_notify.c (test_job, test_job_event): Modify tests to refer exclusively to the start_on/stop_on expressions rather than the cause. * init/job.c (job_change_cause): Only notify the job event and update the cause member, we don't need to ref or block it anymore since that's handled by start_on and stop_on. * init/tests/test_job.c (test_change_goal): Drop checks on cause being referenced and blocked. (test_change_state, test_child_reaper, test_handle_event): Update test cases to not reference ->cause, and not count any references or blockers towards it. * init/tests/test_event.c (test_poll): Update expected reference and block counts for events handled by jobs. * init/tests/test_process.c (test_kill): Make sure that all processes in the process group are killed, rather than just the lone one. * init/process.c (process_kill): Send the signal to all processes in the same process group as the pid. * init/tests/test_job.c (test_change_state, test_kill_process): After spawning a child, call setpgid() to put it in its own process group otherwise we could end up TERMing ourselves. * init/tests/test_job.c (test_child_reaper): Update test cases to include checking of the start_on and stop_on expression trees. * init/job.c (job_child_reaper): Mark all blocked events in the start_on and stop_on trees as failed; since these are copies of the cause event, we can drop that setting already. * TODO: Update again, still thinking about the atomicity of event expressions. 2007-06-21 Scott James Remnant * init/tests/test_job.c (test_change_state): Include tests on a job's start_on and stop_on event expression trees, and make sure that events are unblocked and unreferenced at the appropriate moments. * init/job.c (job_change_state): Unblock the events that started the job in running (if a service), and reset when we reach waiting (leave referenced otherwise so the environment is always present). Unblock and unreference the events that stopped the job in starting (for restarting), running (if coming from pre-stop) and waiting. * init/tests/test_job.c (test_handle_event): Rewrite tests using event expressions, and make sure events are referenced and blocked correctly matching how jobs are affected. Include tests for correct instance behaviour. (test_instance): Make sure that instances copy across the expression state, and reset the parent. * init/job.c (job_instance): After spawning a new instance, reset the start_on expression of the master job. * init/event.c (event_operator_copy): Change to making the parent of copies nodes be the actual tree parent, rather than the top parent; otherwise you can't free an entire tree in one go. * init/tests/test_event.c (test_operator_copy): Check parents of copied nodes. * init/tests/test_job.c (test_copy): Update parent checks here too. * init/tests/test_job.c (test_copy): Make sure that the job copy references and blocks the event; and in the event of failure, doesn't * init/job.c (job_copy): Reset the start_on and stop_on expressions in the event of failure. 2007-06-20 Scott James Remnant * TODO: Update. * init/parse_job.c (parse_on): New generic parsing function to deal with event expressions, including operators, parentheses, etc. (parse_on_operator): Function called by parse_on() to deal with an operator or operand. (parse_on_paren): Function called by parse_on() to deal with a parenthesis. (parse_on_operand): Function called by parse_on_operator() to deal with a non-operator token. (parse_on_collect): Function called by all of the above to collect the operators on the stack and deposit them into the output box, either for collection by a later operator or for returning from parse_on(). (stanza_start, stanza_stop): Call the new parse_on() function to deal with "start on" and "stop on", storing it in the appropriate part of the job. * init/tests/test_parse_job.c (test_parse_job): Replace list empty checks for start_events/stop_events with NULL checks on the new start_on/stop_on members. (test_stanza_start, test_stanza_stop): Test new stanza code. * init/errors.h (PARSE_EXPECTED_EVENT, PARSE_EXPECTED_OPERATOR) (PARSE_MISMATCHED_PARENS): Add numerics and strings for the errors that can be generated by parsing an event expression. * init/conf.c (conf_reload_path): Handle the new errors properly, including the line number where they occurred. * logd/jobs.d/logd.in: Update "stop on" to work with the new parser. * init/parse_job.c (stanza_emits): Each entry in the emits list is now an NihListEntry with the event name as the string data pointer, rather than an EventInfo structure (since that structure is gone). * init/tests/test_parse_job.c (test_stanza_emits): Update test case to check for NihListEntry structures. * init/parse_job.c: Where the stanza function parses an argument and can possibly reject it, save the position and line number and do not return that unless we're happy with the argument. This ensures errors are raised pointing *at* the argument, rather than past it. * init/tests/test_parse_job.c: Fix several test case errors where the buffer was built incorrectly. Pedantically check pos and lineno after successful parsing, and after errors, to make sure they are where they should be. 2007-06-18 Scott James Remnant * init/job.h (Job): Replace the start_events and stop_events NihLists with start_on and stop_on EventOperators. * init/job.c (job_new): Drop list initialising, and instead just set the new start_on/stop_on members to NULL. (job_copy): Copy the entire event operator tree to the new job, including references and blockers. emits has changed to a list of NihListEntry with embedded strings, so copy them that way. (job_run_process): Drop "->info." (job_handle_event): Instead of iterating the events lists, call event_operator_handle and check the return value and top node value. (job_detect_stalled): Modify to iterate the start_on tree. * init/tests/test_job.c (test_change_state, test_detect_stalled): Drop references to "->info." since we can get the variables directly. (test_new): Check that start_on and stop_on are NULL. (test_copy): Adjust tests of copying start_on and stop_on trees as well as the emits list. (test_handle_event, test_handle_event_finished) (test_detect_stalled): Change references from start_events to start_on, stop_events to stop_on and construct using EventOperators instead. (test_handle_event): Update number of blockers now that the event expressions themselves will block the event. * init/tests/test_event.c (test_poll): Update number of blockers since both the events and cause will block it for now; also change start_events and stop_events to start_on and stop_on respectively. * init/event.c (event_operator_copy): Copy the children nodes as well. * init/tests/test_event.c (test_operator_copy): Test copying with children nodes. * init/tests/test_control.c (test_event_emit): Drop "->info." * init/notify.c (notify_event, notify_event_finished): Drop "->info." from event references. * init/process.c (process_setup_environment): Drop "->info." from cause references * init/tests/test_process.c (test_spawn): Likewise. * init/event.h (Event): Directly include the name, args and env fields rather than using an interim structure; this makes more sense since we use them differently than a match does. (EventOperatorType, EventOperator): New structure to build event expression trees that combine a match with "or" and "and" boolean operators; solve some problems by holding the reference and blocker on the matched event inside this structure directly and provide methods to unblock and reset them. (EventInfo): Drop this structure completely now that it is unused. * init/event.c (event_info_new): Rename this structure to event_operator_new() and initialise the new fields properly. (event_info_copy): Likewise rename to event_operator_copy and deal with copying event references and blockers over to the new structure, since the state is useful to copy. (event_match): Rename to event_operator_match and switch the arguments around since it makes slightly more sense that way. (event_operator_update): Function to update the value of an EVENT_OR or EVENT_AND operator based on the value of the two children. (event_operator_handle): Function to iterate an entire expression tree looking for a given event, and update the values of other operators if matched. (event_operator_unblock): Function to iterate an expression tree and release any events we're blocking. (event_operator_reset): Function to iterate an expression tree, unreferencing any events and resetting all values back to FALSE. (event_new, event_pending, event_finished): Update references to the Event structure to discard the intermediate "->info." * init/tests/test_event.c (test_info_new): Rename to test_operator_new() and test various features of the function added in the converstion. (test_info_copy): Likewise rename to test_operator_copy() and add a few more tests, especially that blockers and references are copied. (test_match): Rename to test_operator_match() and adjust argument order to match the change. (test_new) Call event_init() to avoid a valgrind error and update references to drop "->info." (test_poll): Use EventOperators in the job to test event polling, rather than the old structures. (test_operator_update, test_operator_handle, test_operator_unblock) (test_operator_reset): Test behaviour of the new functions. 2007-06-13 Scott James Remnant * TODO: Update utmp/wtmp thoughts. 2007-06-12 Scott James Remnant * init/paths.h: Remove extra /, oops. * init/Makefile.am (install-data-local): Make destination configuration directories as part of "make install". (AM_CPPFLAGS): Define LEGACY_CONFDIR to be $(sysconfdir)/event.d * logd/Makefile.am (jobs.d/logd): Replace mkdir_p with MKDIR_P * init/main.c: Use macro to pick up /etc/event.d so it can be moved by configure * TODO: Update. * init/Makefile.am (AM_CPPFLAGS): Define CONFDIR to be $(sysconfdir)/init, replacing the old CFG_DIR definition. * init/paths.h (CFG_DIR): Replace with CONFDIR definition, and set the default to /etc/init * init/main.c: Load configuration from /etc/init/init.conf, /etc/init/conf.d and /etc/init/jobs.d; retain loading from /etc/event.d for the time being. * init/man/init.8: Change reference to directory. * logd/Makefile.am: Replace references of eventdir with jobsdir, and event.d with jobs.d * logd/event.d: Rename to logd/jobs.d * init/conf.c (conf_reload): Ignore ENOENT, it's not interesting in the general case. * init/tests/test_conf.c (test_source_reload): Test the general reload function. * init/tests/test_conf.c (test_source_free): s/unlink/rmdir/ (test_source_reload_file): Test that configuration files work, and are parsed with anything alongside ignored automatically. * init/conf.c (conf_file_filter): As well as not filtering out the source path itself, we also need to not filter out the path we're watching which is different in the case of files; we need to know about it because we handle its removal. (conf_delete_handler): Compare the path deleted against the path we're watching, rather than the source path, since this means the watch needs to be freed. * compat/sysv/shutdown.c: Use nih pidfile functions since they're more reliable than doing it ourselves. 2007-06-11 Scott James Remnant * init/conf.c (conf_reload_path): Call parse_conf for mixed files and directories. Make a correction to the old_items code, was passing the wrong arguments to nih_list_add; the effect we wanted was that we add the old items head into the list, and remove the existing head (what we did was add the first item to the old_items list and then cut the rest out). * init/tests/test_conf.c (test_source_reload_dir): Rename to test_source_reload_job_dir, since that's what this does. (test_source_reload_conf_dir): Add another function that tests directories of mixed configuration. * init/parse_conf.c (parse_conf): Parse a configuration file that defines jobs by name. (stanza_job): Job stanza, slightly trickier than it would appear to need to be, to parse the block in-place and keep pos/lineno consistent. * init/parse_conf.h: Prototype for external function. * init/tests/test_parse_conf.c: Test suite for mixed configuration parsing. * init/Makefile.am (init_SOURCES): Build and link parse_conf.c and parse_conf.h (TESTS): Build and run parse_conf tests (test_parse_conf_SOURCES, test_parse_conf_LDFLAGS) (test_parse_conf_LDADD): Details for parse_conf test suite. (test_conf_LDADD): Add parse_conf.o and conf.o since this calls them now. * init/conf.c (conf_source_reload, conf_source_reload) (conf_reload_path): Add some debugging messages. * init/conf.c (conf_source_new): Add missing call to conf_init() * init/conf.c (conf_item_new): Drop source parameter, since it's unused in the function and makes it harder to call this when we only have one data pointer. (conf_reload_path): Drop source from conf_item_new() call. * init/conf.h: Update prototype. * init/tests/test_conf.c (test_item_new, test_item_free) (test_file_free): Drop source parameter from calls. 2007-06-10 Scott James Remnant * init/main.c (main): Add a handler for the SIGHUP signal (hup_handler): Handler for SIGHUP, just calls conf_reload(). * init/main.c (main): Read the configuration again. * TODO: Update. * init/tests/test_conf.c (test_source_reload_dir): Reset the priority and clean up consumed inotify instances. (test_source_free, test_file_free, test_item_free): Test the free functions on their own, paying special attention to conf_item_free() even though this really duplicates other tests. * init/conf.c (conf_reload_path): In the case where we fail to map the file into memory, we still need to purge all the items that previously existed. * init/tests/test_conf.c (test_source_reload): Rename to test_source_reload_dir, so that we can keep this and the file tests separate to make it easier to deal with. (test_source_reload_dir): Add tests for physical and parse errors when re-loading jobs with and without inotify, and for inotify-based modification handling of jobs. * init/tests/test_conf.c (test_source_reload): Add test for walk of non-existant directory with and without inotify; also test for what happens when the top-level directory is deleted, again with and without inotify. * init/conf.c (conf_delete_handler): Handle the case of the top-level directory being deleted by freeing the watch (so next time we asked to reload, we can restore it). * init/tests/test_conf.c (test_source_reload): Add a test for deletion of a running job. * init/conf.c (conf_item_free): Fix this up; when deleting an item from a source, we first mark it for deletion unless it's already marked for replacement. Then if it's the replacement for something else, we mark that to be replaced by whatever we're being replaced by (so there are no references to us) and change that state if necessary. Finally we replace our own item and free the record before returning. * init/tests/test_conf.c (test_source_reload): Check that we handle the cases of modiciation of a running job, modification of a replacement of a running job and deletion of a replacement for a running job. * init/parse_job.c (parse_job): Instead of freeing the previous replacement, which could leave invalid references to it, mark it for deletion and change the state. * init/tests/test_parse_job.c (test_parse_job): Adjust the test so that we hold a reference to the replacement job and make sure that the state is changed to deleted, rather than checking for a destructor being called on it. * init/init.supp (conf-init): Add valgrind suppression for the configuration sources hash table. * init/conf.c (conf_item_free): Don't overwrite any previous replacement, only mark us for deletion if we wouldn't otherwise be replaced. Add some commented possible code for testing. * init/tests/test_conf.c (test_source_reload): Test replacement of jobs works properly; test modification with direct write and with atomic rename replace; test deletion. * init/conf.c (conf_reload_path): It turns out that the flag trick doesn't work for items since we often reparse them within the same file tag (it works with files because they're atomic and reparsed). Store the old items in a different list instead. (conf_source_free): We need to be careful about freeing sources, so have a function to do it properly. (conf_item_new): Since the flag member isn't useful, don't bother setting it. * init/conf.h: Add conf_source_free prototype. (ConfFile): Remove flag member. * init/tests/test_conf.c (test_source_reload): Add test for inotify create detection. * init/conf.c (conf_file_delete): Rename to conf_file_free and match the pattern of those kinds of functions. (conf_item_delete): Likewise rename to conf_item_free and match the pattern of these kinds of functions. * init/conf.h: Add prototypes. * init/conf.c (conf_reload_path): Fix bug with job name generation. Allow non-parsing errors to be returned from the function. (conf_item_delete): Drop all replacement management code, we'll put this back through testing. * init/tests/test_conf.c (test_source_reload): Test reloading adds the right inotify watch and parses the files, also check that loading without inotify and mandatory reloading work. * init/conf.c (conf_source_reload): Move the item deletion detection code from this function, where it would only happen on a mandatory reload (conf_reload_path): to this function, where it will happen every time the file is parsed; which is actually what we want. 2007-06-08 Scott James Remnant * init/conf.h (ConfItem): Drop the name and replace it with a type. (ConfItemType): Enum for different types of configuration items (ConfFile): Change items from a hash table to a list. * init/conf.c (conf_file_get): Initialise the items member as a list. (conf_item_set): Rename to conf_item_new again. (conf_item_new): Allocates a new ConfItem and adds it to the file's list, we won't reuse items anymore since it doesn't really make sense. (conf_source_reload): Adjust clean-up code now that items is a list. (conf_reload_path): Work out the name of jobs found by filename, allocate a new item for them and parse the job into it. Perform handling of errors by outputting a warning. (conf_item_delete): Takes both source and file so we can make intelligent decisions. (conf_file_delete): Takes a source and passes it to conf_item_delete (conf_delete_handler): Pass both source and file to conf_file_delet * init/tests/test_conf.c (test_file_get): Check that the items list is empty; rather than the hash being unallocated. (test_item_set): Rename back to test_item_new and only allocate a single item which should get added to the list. 2007-06-06 Scott James Remnant * init/parse_job.c (stanza_respawn): Permit the word "unlimited", raise a specific error for illegal limit and illegal interval. (stanza_pid, stanza_kill, stanza_normal, stanza_umask) (stanza_nice, stanza_limit): Raise specific errors rather than a generic "illegal value" error. * init/tests/test_parse_job.c (test_stanza_respawn): Check that we can use "unlimited", also check for new error return. (test_stanza_pid, test_stanza_kill, test_stanza_normal) (test_stanza_umask, test_stanza_nice, test_stanza_limit): Check for new specific errors. * init/errors.h: Replace CFG_ILLEGAL_VALUE with a series of parse errors. * init/conf.c: Comments. * init/conf.c (conf_item_set): Call out to conf_item_delete() to handle unsetting of an item's data. (conf_source_reload): Add code to deal with mandatory reloading, calls conf_file_delete() and/or conf_item_delete() as appropriate. (conf_delete_handler): Call conf_file_delete() on the ConfFile that we find. (conf_file_delete): Function to delete all items in a file. (conf_item_delete): Placeholder function to delete an item. * init/conf.c (conf_file_new): Rename to conf_file_get; in practice we never just want to allocate one of these, we always want to return the existing entry if it exists. (conf_item_new): Rename to conf_item_set; again in practice we always want to update an existing item. This function will grow the "deal with replacement" stuff. (conf_reload): Start putting in place the code that will allow mandatory reloads, as well as initial setup. This function iterates over the sources and deals with errors. (conf_source_reload): Function to reload an individual source, calls out to one of the following two functions and will eventually perform the deleted items scan. (conf_source_reload_file): Set up a watch on a file, and reload it. (conf_source_reload_dir): Set up a watch on a directory and reload it. (conf_file_filter): Filter for watching parent directory of files. (conf_create_modify_handler): File creation and modification handler. (conf_delete_handler): File deletion handler. (conf_file_visitor): Tree walk handler. (conf_reload_path): Function that deals with files themselves, currently just sorts out the ConfFile structure and maps the file into memory. * init/conf.h: Add new prototypes, update existing ones. * init/tests/test_conf.c (test_file_new): Rename to test_file_get, also test repeated calls when already in the table. (test_item_new): Rename to test_item_set, also test repeated calls when already in the table. (test_source_reload): Start of test for reloading sources. 2007-06-05 Scott James Remnant * init/conf.c: Make a start on the new configuration management routines, which will allow finer-grained tracking of configuration and support mandatory reloading. (conf_source_new, conf_file_new, conf_item_new): Start off with the functions to allocate the tracking structures we need to use. * init/conf.h: Structures and prototypes * init/tests/test_conf.c: Test suite for allocation functions. * init/Makefile.am (init_SOURCES): Build and link conf.c and conf.h (TESTS): Run the conf test suite. (test_conf_SOURCES, test_conf_LDFLAGS, test_conf_LDADD): Details for the conf test suite. 2007-06-04 Scott James Remnant * init/parse_job.c (stanza_description, stanza_author, stanza_version) (stanza_chroot, stanza_chdir, stanza_pid): Instead of erroring when the string has already been allocated, free it and replace it with the new one. Attempting to forbid duplicates is just too inconsistent, especially for the integer ones which we compare against the default; using the last one allows us to be entirely consistent. (stanza_daemon, stanza_respawn, stanza_service, stanza_instance): Don't error if the flag is already set, just ignore it. (stanza_respawn, stanza_pid, stanza_kill, stanza_console) (stanza_umask, stanza_nice): Don't compare the current value against the default, just overwrite it! (parse_exec, parse_script): Free existing process command string before setting a new one over the top. (parse_process, stanza_exec, stanza_script, stanza_limit): Instead of erroring if the structure is already set and allocated, just don't allocate a new one and allow its members to be overwritten. * init/tests/test_parse_job.c (test_stanza_exec) (test_stanza_script, test_stanza_pre_start) (test_stanza_post_start, test_stanza_pre_stop) (test_stanza_post_stop, test_stanza_description) (test_stanza_author, test_stanza_version, test_stanza_daemon) (test_stanza_respawn, test_stanza_service, test_stanza_instance) (test_stanza_pid, test_stanza_kill, test_stanza_console) (test_stanza_umask, test_stanza_nice, test_stanza_limit) (test_stanza_chroot, test_stanza_chdir): Replace tests that check for an error in the case of duplicate stanzas with tests that make sure the last of the duplicates is used. * init/errors.h (CFG_DUPLICATE_VALUE, CFG_DUPLICATE_VALUE_STR): Drop this error, since we don't consider this a problem anymore. * upstart/Makefile.am (libupstart_la_LIBADD): Add $(LTLIBINTL) * init/Makefile.am (init_LDADD): Reorder and add $(LTLIBINTL) * util/Makefile.am (initctl_LDADD): Reorder and add $(LTLIBINTL) * compat/sysv/Makefile.am (reboot_LDADD): Reorder and add $(LTLIBINTL) (runlevel_LDADD): add $(LTLIBINTL) (shutdown_LDADD): Reorder and add $(LTLIBINTL) (telinit_LDADD): Reorder and add $(LTLIBINTL) * logd/Makefile.am (logd_LDADD): Add $(LTLIBINTL) 2007-06-03 Scott James Remnant * init/tests/test_job.c (test_run_process): Add a test case for a crasher when the event has no arguments. * init/job.c (job_run_process): Fix the bug, we need to check the arguments before trying to append them. * init/cfgfile.c, init/cfgfile.h, init/tests/test_cfgfile.c: Rename to parse_job and strip out all functions except the parsing and stanza ones. * init/Makefile.am (init_SOURCES): Build and link parse_job.c and h (TESTS): Run the parse job test suite (test_cfgfile_SOURCES, test_cfgfile_LDFLAGS, test_cfgfile_LDADD): Rename and update. * init/parse_job.c: Rename all cfg_stanza_*() functions to just stanza_*(), rename all cfg_parse_*() functions to just parse_*(). (parse_job, parse_process, stanza_exec, stanza_script, stanza_start) (stanza_stop, stanza_emits, stanza_normal, stanza_env, stanza_limit): Don't use NIH_MUST, it's fine to be out of memory and we should fail in that case with a useful error. The user can always reload the config file. (cfg_read_job, cfg_watch_dir, cfg_job_name, cfg_create_modify_handler) (cfg_delete_handler, cfg_visitor): Drop these functions for now. * init/parse_job.h: Update so it just contains the one prototype. * init/tests/test_parse_job.c: Update all tests to pass a string to parse_job(), and check errors raised; rather than mucking around with file descriptors all of the time. Spend the effort while we're in here to run TEST_ALLOC_FAIL where we can. * init/main.c: Drop config file loading for now since it's missing. 2007-05-27 Scott James Remnant * init/cfgfile.h (CFG_DIR): Drop this define, since it's in paths.h (CfgDirectory): * init/cfgfile.c (cfg_read_job): Separate out the job-handling code into a new function that we could call from a stanza if we want later; this one now just maps the file into memory and deals with exceptions from the parsing. (cfg_parse_job): Function containing the seperated out code; parses a new job, marking it as a replacement for any existing job with the same name. Drop the warnings for using pid options without a daemon, since these are actually useful for other things later. * init/tests/test_cfgfile.c (test_read_job): Drop the check on unexpected daemon options, since we don't issue these warnings anymore. 2007-05-20 Scott James Remnant * init/event.c (event_match): Change to accept Event as the first argument and EventInfo as the second, making it obvious that this matches a received Event against known EventInfo rather than just comparing two info structs (since the order matters). * init/event.h: Update prototype. * init/tests/test_event.c (test_match): Update test accordingly. (test_poll): Fix typo. * init/job.c (job_handle_event): Pass in the event as the first argument to event_match, rather than its info. * TODO: Update. * init/job.c (job_emit_event): Return the event that we emit; don't bother tracking block status or setting blocked, leave that to the state loop so things are more obvious. (job_change_state): Set the blocked flag here for starting and stopping to the return value of job_emit_event(). * init/event.c (event_ref, event_unref): Reference counting of events so we don't free those we still need. (event_block, event_unblock): Blocker counting that replaces the previous jobs member. (event_new): Initialise refs and blockers fields. (event_emit_finished): Remove this function. (event_poll): Handle the new done state, and deal with the blockers and references counts; turns out that we can fall all the way through this switch if these are zero without needing to check again. (event_pending): Remove call to event_emit_finished, the event_poll() loop handles this case now. (event_finished): Set progress to done on the way out. * init/event.h (EventProgress): Add new done state (Event): Add refs and blockers members, replacing jobs * init/tests/test_event.c (test_new): Check refs and blockers are initialised to zero. (test_ref, test_unref, test_block, test_unblock): Check the ref counting function behaviours. (test_emit_finished): Drop this function since it's not used * init/job.c (job_change_cause): Reference and block the event, and unblock and unreference before changing. (job_emit_event): Reference the event that blocks the job from continuing. (job_handle_event_finished): Unreference the blocking event again. (job_change_state): Make sure that blocked has been cleared before allowing a state change. * init/tests/test_job.c: Change tests to use refs/blockers on the cause event when counting, and also to follow the status of blocked since that is now ref-counted as well. 2007-05-18 Scott James Remnant * init/main.c (main, cad_handler, kbd_handler, pwr_handler): Use event_new rather than event_emit. * init/job.h (Job): Change type of cause and blocked to Event * init/job.c (job_change_goal, job_change_cause, job_emit_event) (job_handle_event, job_handle_event_finished): Update all references to EventEmission to use Event instead. (job_detect_stalled): Call event_new instead of event_emit (job_run_process): Use the info member of cause, not event member * init/tests/test_job.c (test_change_goal, test_change_state) (test_run_process, test_child_reaper, test_handle_event) (test_handle_event_finished): Update all references to EventEmission to use Event instead. (test_detect_stalled): Correct to use right structure types. * init/process.c (process_setup_environment): Use cause's info member, rather than event member. * init/tests/test_process.c (test_spawn): Update to use Event. * init/notify.h (NotifySubscription): Change member to event * init/notify.c (notify_subscribe_event) (notify_subscription_find, notify_job_event, notify_event) (notify_event_finished): Update functions to use event member and Event structures. * init/tests/test_notify.c (test_subscribe_event) (test_subscription_find, test_job, test_job_event, test_event) (test_event_finished): Update to use Event instead of EventEmission * init/control.c (control_event_emit): Update to use event_new. * init/tests/test_control.c (test_event_emit) (test_subscribe_events, test_unsubscribe_events): Update to use Event rather than EventEmission. * init/event.h: Fix up a few references. * init/tests/test_event.c (test_new): Remove reference to emission. * init/event.h (EventEmission): Rename to Event, and rename event member to info. * init/event.c (event_emit_next_id): Rename to event_next_id (event_emit): Rename to event_new, and add standard parent argument. (event_emit_find_by_id): Rename to event_find_by_id (event_poll): Iterate over Events in the list (event_pending, event_finished): Operate on Event * init/tests/test_event.c (test_emit): Rename to test_new and adjust for names and arguments. (test_emit_find_by_id): Rename to test_find_by_id and adjust for names. (test_emit_finished, test_poll): Adjust names. * init/cfgfile.c (cfg_stanza_start, cfg_stanza_stop) (cfg_stanza_emits): Convert to use EventInfo and event_info_*. * init/job.c (job_copy): Use EventInfo and event_info_copy. (job_handle_event, job_detect_stalled): Iterate EventInfo structures * init/tests/test_cfgfile.c (test_stanza_start, test_stanza_stop) (test_stanza_emits): Update to use EventInfo * init/tests/test_job.c (test_copy, test_handle_event) (test_handle_event_finished, test_detect_stalled): Update to use EventInfo and event_info_new * init/event.c (event_copy): Use nih_str_array_copy here, to make the code somewhat simpler. (event_finished): Copy the arguments and environment from the old event, rather than stealing and reparenting. * init/job.c (job_copy): Use nih_str_array_copy here too. (job_run_process): Use nih_str_array_append to add the arguments from the emission onto the command run. * init/event.h (Event): Rename to EventInfo, since this structure representations information about an event, rather than an actual event in progress. * init/event.c (event_new): Rename to event_info_new, also now can take arguments and environment like event_emit() can. (event_copy): Rename to event_info_copy. * init/tests/test_event.c (test_new): Rename to test_info_new, update names in test and test being given args or env. (test_copy): Rename to test_info_copy and update names in test. (test_match, test_poll): Use EventInfo. * TODO: Update. 2007-04-24 Scott James Remnant * configure.ac: Add AM_PROG_CC_C_O since we use per-target flags for one of the test cases. 2007-03-16 Scott James Remnant * upstart/message.c (upstart_message_newv): Add va_end to match va_copy because the standard says so. * upstart/wire.c (upstart_push_packv, upstart_pop_packv): Add va_end here as well. 2007-03-13 Scott James Remnant * init/main.c: Wait until we've closed inherited standard file descriptors and opened the console instead before trying to open the control socket; otherwise we end up closing it by accident if we weren't opened with sufficient descriptors in the first place. Also wait until we've set up the logger before trying to parse the configuration. In fact both of these things need to be pretty low down the main() function. * init/tests/test_job.c (test_run_process): Skip /dev/fd test cases if that's not available. * init/tests/test_control.c (test_log_priority): Make sure we know that the message has been sent before calling the watcher. * init/cfgfile.c (cfg_watch_dir): We get ENOSYS for missing inotify support, not EOPNOTSUPP. * init/tests/test_cfgfile.c (test_watch_dir): Actually make the directory tree before testing for inotify, since we use the same tree there too. * util/initctl.c (job_info_output): Restructure so gcc doesn't think name can be used uninitialised. * init/tests/test_cfgfile.c (test_watch_dir): Correct an error where i wouldn't be initialised if we skipped the inotify tests. * util/initctl.c (job_info_output): Restructure so gcc doesn't think * init/process.c (process_setup_environment): job id fits inside a %u now * upstart/message.h: Style; always refer to "unsigned int" as "unsigned int", and never "unsigned. * upstart/tests/test_message.c (my_handler): Catch a stray couple of "unsigned"s * init/control.c (control_job_query, control_job_start) (control_job_stop): Change type of id argument to unsigned int, and call printf with %u to output it. * init/tests/test_control.c (check_job, check_job_instance) (check_job_instance_end, check_job_status__waiting) (check_job_status_end__waiting, check_job_status__starting) (check_job_status_end__starting, check_job_status__running) (check_job_status_end__running, check_job_status__pre_stop) (check_job_status_end__pre_stop, check_job_status__stopping) (check_job_status_end__stopping, check_job_status__deleted) (check_job_status_end__deleted, check_job_unknown) (check_job_invalid, check_job_unchanged, check_event): Change type of id arguments to unsigned int. (check_list): Change type of id to unsigned int. * init/tests/test_notify.c (check_job_status) (check_job_status_end, check_job_finished, check_event) (check_event_caused, check_event_finished): Change type of id arguments to unsigned int. * init/job.h (Job): Change the type of the id to unsigned int. * init/job.c (job_next_id): Change ids to be unsigned ints, and now we can just use %u in the nih_error call. (job_find_by_id): Change argument to be unsigned int * init/tests/test_job.c (test_find_by_id): Change id type to unsigned int. * init/event.h (Event): Change the type of the id to unsigned int. * init/event.c (event_emit_next_id): Change ids to be unsigned ints, and now we can just use %u in the nih_error call. (event_emit_find_by_id): Change argument to be unsigned int * init/tests/test_event.c (test_emit, test_emit_find_by_id) (check_event, check_event_finished): Change id type to unsigned int. * util/initctl.c (output_name): Use an unsigned int for the job id, which means we can use ordinary %u for the printf argument. (handle_job, handle_job_finished, handle_job_instance) (handle_job_instance_end, handle_job_status) (handle_job_status_end, handle_job_unknown, handle_job_invalid) (handle_job_unchanged, handle_event, handle_event_caused) (handle_event_finished): Change argument type of id from uint32_t to unsigned int. (job_info_output): Change output type of id from %zu to %u * upstart/message.c (upstart_message_handle): Use unsigned int for ids, rather than a fixed-width type. * upstart/tests/test_message.c (my_handler): Use unsigned int for the ids, and give "unsigned int" instead of "unsigned" to va_arg as a matter of style. * upstart/wire.c (upstart_push_int, upstart_pop_int): Send over the wire using a plain old integer type, instead of a fixed width type; there's no advantage to using the fixed-width type and we could hurt ourselves if we tried running on ILP64. (upstart_push_unsigned, upstart_pop_unsigned): Likewise use a plain unsigned int over the wire. (upstart_push_string, upstart_pop_string): Use an unsigned int for the length of the string, technically this means that we silently truncate any string that's greater than 4GB on 64-bit platforms; it's either that or make the test cases harder (we did this before anyway). (upstart_push_header, upstart_pop_header): Type is always an unsigned int (best conversion from an enum) 2007-03-11 Scott James Remnant * configure.ac: Bump version to 0.3.9 * NEWS: Update. * util/man/initctl.8: Document the new commands. * TODO: Update. * init/job.c (job_handle_event): Correct the function so we don't try and stop the master of an instance, and cause an assertion error. * util/initctl.c: Oops, correct function pointers in command table * util/tests/test_initctl.c (test_version_action): * util/initctl.c (handle_version): Handle receipt of the version reply. (version_action): Send the version-query message to the server and expect one response. (log_priority_action): Parse the single argument into an NihLogLevel and send it to the server. * init/control.c (control_version_query, control_log_priority): Functions to handle the new messages from the server pov * init/tests/test_control.c (test_version_query) (test_log_priority): Test the new messages are handled properly. (check_version): Check the version string matches. * upstart/message.h: Add messages for querying the version of the init daemon and changing the log priority. * upstart/message.c (upstart_message_newv) (upstart_message_handle): Marshal the new messages. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Test the marshalling of the new messages, * upstart/libupstart.ver: Add enum functions to the global list. * util/initctl.c (start_action, stop_action): Imply --no-wait if we take the job id or name from an environment variable, since we'd end up waiting for ourselves otherwise * util/tests/test_initctl.c (test_start_action, test_stop_action): Update test cases to make sure no-wait is implied. 2007-03-09 Scott James Remnant * configure.ac: Bump version to 0.3.8 * NEWS: Updated. * configure.ac: Increase version to 0.3.7 * init/tests/test_job.c (test_change_state): Add a test case for deleting the last instance of a replaced job. * init/job.c (job_change_state): When moving a instance of a job into the deleted state, check whether we should replace the job it's an instance of, and if so, change that job's state too. * TODO: Update. * util/initctl.c (handle_job_list): Always allocate current_list, since we need it to be the parent of pointers we attach to it. (handle_job_list_end): Always free the current list, only suppress output if there aren't any entries in it. (initctl_recv): Check the current_list pointer, no need for in_list (handle_job_instance, handle_job_instance_end, handle_job_status): Check current_list not in_list. * util/tests/test_initctl.c: Correct some memory leaks. * init/process.c (process_setup_environment): Set the UPSTART_JOB_ID environment variable to the job's unique id. * init/tests/test_process.c (test_spawn): Make sure it's set. * util/man/initctl.8: Update the initctl manpage. * compat/sysv/man/reboot.8: Correct a minor grammar error. * compat/sysv/man/shutdown.8: Fix reference from runlevel to telinit. * README: Add a README that copies the text from the web page and adds some notes about recommended operating system versions. * util/initctl.c: Completely rewrite initctl, top to bottom; handling of the new messages is done natively, meaning that the commands just vary the requests send and number of responses expected. * util/tests/test_initctl.c: Test all of the new code. * init/main.c: Improve restarting and rescuing a little; store the program path in a static variable so we can always access it, and use the exported loglevel to pass the same to the new process. * TODO: Update. * compat/sysv/shutdown.c: More error/fatal adjustments. * compat/sysv/telinit.c: More error/fatal adjustments. 2007-03-08 Scott James Remnant * init/main.c (main, crash_handler): Promote deadly errors to nih_fatal * logd/main.c (main): Promote deadly errors to nih_fatal * compat/sysv/reboot.c (main): Promote deadly errors to nih_fatal * compat/sysv/shutdown.c (main, shutdown_now): Promote deadly errors to nih_fatal * compat/sysv/telinit.c (main): Promote deadly errors to nih_fatal * init/event.c (event_pending): The message that we're handling an event should be logged with --verbose. * init/cfgfile.c (cfg_parse_script): Remove the unnecessary check for a token inside a script block. * TODO: Update. * init/control.c (control_watch_jobs): Rename to control_subscribe_jobs and update to handle new event name. (control_unwatch_jobs): Rename to control_unsubscribe_jobs and update to handle the new event name. (control_watch_events): Rename to control_subscribe_events and update to handle the new event name. (control_unwatch_events): Rename to control_unsubscribe_events and update to handle the new event name. * init/tests/test_control.c (test_watch_jobs): Rename to test_subscribe_jobs and update to new event name. (test_unwatch_jobs): Rename to test_unsubscribe_jobs and update to new event name. (test_watch_events): Rename to test_subscribe_events and update to new event name. (test_unwatch_events): Rename to test_unsubscribe events and update to new event name. * upstart/message.h: Rename the watch commands to subscribe/unsubscribe and regroup with new message numbers. * upstart/message.c (upstart_message_newv) (upstart_message_handle): Marshal the updated subscription messages. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Update tests to new names and numbers. * TODO: Update. * upstart/message.c (upstart_message_handle): Raise a the unknown message error if the type is unknown, rather than the invalid message error. * upstart/tests/test_message.c (test_handle): Correct test case. * init/job.c (job_change_state): Correct a problem here too, when moving from pre-stop to running, we don't want to emit a started event since we never emitted a stopping event and never killed the process anyway. We do need to notify the job as finished, since the process that tried to stop it will need to be told not to wait any longer. * init/tests/test_job.c (test_change_state): Add a test for pre-stop back to running. * doc/states.dot: Fix an error in the state diagram; when moving from starting back to waiting, due to a failed respawn, we need to emit the stopped event otherwise it will never happen. * doc/states.png: Update. 2007-03-05 Scott James Remnant * upstart/message.c (upstart_message_new): Make this a wrapper around (upstart_message_newv): which has all the old code, but accepts a va_list instead of making its own. * upstart/message.h: Add prototype. * init/main.c (crash_handler): Simply trying to leave a SEGV handler doesn't work so well, we end up repeating the problem instruction. We really can't resume from this point, and can't even jump elsewhere since our state is probably buggered up. Only thing for it is to re-exec ourselves with a clean state. * init/cfgfile.c (cfg_read_job, cfg_delete_handler): Don't try and free the magic (void *)-1 replacement (delete). * util/events.c, util/events.c, util/jobs.c, util/jobs.h: With the new message responses, that intermix event and job information freely, it no longer makes sense to distinguish between them. So fold these files back into the main initctl.c * util/initctl.h: Drop unused header. * util/Makefile.am (initctl_SOURCES): Update sources list. (TESTS): Change which tests we build (test_initctl_SOURCES, test_initctl_CFLAGS, test_initctl_LDFLAGS) (test_initctl_LDADD): Build the new combined test case binary, use an automake feature to rebuild initctl.c with -DTEST and a different .o file, and thus be able to define out main() * util/tests/test_events.c, util/tests/test_jobs.c: Collapse the two test case files into one single * util/tests/test_initctl.c * init/control.c (control_job_find): And implement the find function that returns a list of jobs matching an optional pattern. * init/tests/test_control.c: Make sure we do send all messages. (check_list): Complex function to check the responses to a job list (test_job_find): Test a couple of job lists. * init/tests/test_notify.c: Make sure we do send all messages. * init/control.c (control_job_query): Implement the query message, this just needs to return the status or instance set. * init/tests/test_control.c (test_job_query): Test the query command. (check_job_status__deleted, check_job_status_end__deleted): Pair of functions to check we can query deleted jobs directly. * init/control.c (control_send_instance): Function to send an instance job, collating all of its instances together. * init/control.h: Update. * init/tests/test_control.c (test_send_instance): Check we receive the right messages. (check_job_instance, check_job_instance_end): Pair of functions to check the instance messages. * upstart/message.h: Add new UPSTART_JOB_INSTANCE and UPSTART_JOB_INSTANCE_END messages which we'll use to communicate that a job is an instance, and group the instances of it together. * upstart/message.c (upstart_message_new, upstart_message_handle): Marshal the new instance messages. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Test the new message types. * upstart/message.h: Restore arguments to JOB_LIST, but rename to pattern since that's what it is. * upstart/message.c (upstart_message_handle): Restore arguments with updated name. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Restore tests for arguments, rename and make sure we include a wildcard. 2007-03-04 Scott James Remnant * upstart/message.h: Drop arguments to JOB_LIST. * upstart/message.c (upstart_message_new, upstart_message_handle): Drop arguments to JOB_LIST. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Drop the arguments from the test. * init/control.c (control_job_start): Update to return INVALID for instances and replacements; add the forgotten UPSTART_JOB message. (control_job_stop): Update to return INVALID for replacements; add the forgotten UPSTART_JOB message. Deal with instance masters magically by iterating all instances and stopping those instead. * init/tests/test_control.c (check_job_deleted): Rename to check_job_invalid and check that message. (check_job): Function to check the job we've acted upon. (test_job_start): Check that we get the UPSTART_JOB message first, restore the check on deleted jobs causing an error and add checks that instance and replacement jobs also cause an error. (test_job_stop): Check that we get the UPSTART_JOB message first, restore the check on deleted jobs causing an error. Make sure instances are handled. * upstart/message.h: More message changes; add a JOB_FIND message and replace UPSTART_JOB_DELETED with UPSTART_JOB_INVALID since there's a few more problem conditions. * upstart/message.c (upstart_message_new, upstart_message_handle): Marshal the new message and update names. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Update tests to check the new message and update the values and names of the existing ones. * init/job.h (Job): Remove the delete flag, add replacement and replacement_for pointers instead. * init/job.c (job_new): Initialise replacement and replacement_for pointers to NULL. (job_find_by_name): Update to return what job the one we found is a replacement for, and to skip DELETED jobs. (job_instance): Make it simply illegal to call this for deleted jobs, instances or replacements. (job_change_goal): Make it illegal to change the goal of a replacement job. (job_free_deleted): Remove the previous code to handle deleted instance masters, because it's now bogus. (job_should_replace): New function to determine whether a job is replaceable. * init/tests/test_job.c (test_new): Check pointers are set. (test_copy): Check that replacement and replacement_for are not copied, since their state of an individual job. (test_find_by_name): Update tests to make sure we ignore deleted jobs, instances and replacements. (test_instance): Remove test that will now cause an assertion, and no longer check delete is set. (test_change_goal): Remove test that will now cause an assertion. (test_free_deleted): Remove test cases for deleted masters. (test_should_replace): Test the new check function. (test_change_state): Make sure that we end up in deleted for instances and replaced jobs, and that replacements become the real job. * init/cfgfile.c (cfg_read_job): Update to handle replacement jobs; the old job's previous replacement is discarded, and set to the current job; and then if the job should be replaced, it's moved to deleted (which should promote the new job). (cfg_delete_handler): Handle deletion of a job in a similar manner, except we sent the replacement pointer to the special -1 value since we have no actual replacement. * init/tests/test_cfgfile.c (test_watch_dir): Update tests to make sure that deletion and modification are handled wrt replacement. (test_read_job): Make sure that reparsing an existing file is handled. * init/tests/test_control.c (test_job_start): Remove checks that delete gets set to true for instances. (test_job_stop, test_job_start): Temporarily comment out deleted job behaviour, since that's been somewhat changed. * upstart/message.h: We're not going to return JOB_LIST for JOB_STOP since that's just awkward for the client; just act on the master, and return JOB_UNCHANGED. * init/notify.c (notify_job_status): Move this function to * init/control.c (control_send_job_status): here, since we need it for the new control responses. (control_job_query): New single function to list all jobs or a particular job. * init/control.h: Add prototype. * init/tests/test_control.c (test_error_handler): Simplify this a little to just sending a NO_OP message, since we can send an entire stream of messages and leave them in the queue. (check_job_status__stopping, check_job_process) (check_job_status_end__stopping): Trio of check functions for a job status that's stopping, with an active main process. (test_send_job_status): Test the now global status function. (check_job_status__starting, check_job_status_end__starting): Pair of check functions for a starting job with no process yet. (test_watch_jobs, test_unwatch_jobs): Update to expect the full new job status messages, with an optional process part as well. (check_event): Function to check an event. (test_watch_events): Minor update to use above function. (check_job_status__waiting, check_job_status_end__waiting): Pair of check functions for the first step in starting a job (goal change only) (check_job_unknown, check_job_deleted, check_job_unchanged): Trio of functions to check common error responses. (test_job_start): Update tests to newer behaviour. (check_job_status__running, check_job_status_end__running) (check_job_status__pre_stop, check_job_status_end__pre_stop): Checks for the states we go through when stopping a job. (test_job_stop): Update tests to newer behaviour. * init/notify.c (notify_job, notify_job_event, notify_job_finished): Update to call the newly exported function. * init/job.c: Make job_id and job_id_wrapped externally available. * init/job.h: Update. * init/event.c: Make emission_id and emission_id_wrapped externally available. * init/event.h: Update. * upstart/message.h: Rename UPSTART_JOB_INVALID to UPSTART_JOB_UNCHANGED, as it's not really invalid just a no-op * upstart/message.c (upstart_message_new, upstart_message_handle): Update the constant, fields are unchanged, * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Rename constants/messages. * upstart/message.h: Turns out we need extra errors to indicate that the job was deleted or already at that goal, otherwise the client would sit there waiting for the finished event. * upstart/message.c (upstart_message_new, upstart_message_handle): Marshal the new error messages. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Test the handling of the new messages. * init/tests/test_job.c (test_free_deleted): Found a bug; because master instances never change state, they never end up in the deleted state so are never reaped. Add some test cases for cleaning them up, but not while they have remaining instances. * init/job.c (job_free_deleted): Implement the bug fix. * init/job.c (job_instance): Split out the instance spawning code into its own function, as we'll frequently need a pointer to the instance before we try and change the goal. (job_change_goal): Clean this function back up again, it no longer needs to return values and can assert that it's never called for deleted jobs or instance mastersr. (job_handle_event): Spawn an instance when we get a start event. * init/job.h: Update. * init/tests/test_job.c (test_instance): Check instance creation. (test_change_goal): Update tests now that it doesn't return a value again, and doesn't spawn instances itself. (test_handle_event): Make sure instances are spawned. * init/tests/test_event.c (test_poll): Needs a slight fix now that we generate more events than we check, and that subscriptions go away automatically. * init/notify.c (notify_job_status): Static function to handle sending the more complicated job status message series (notify_job): Call notify_job_status() to send the new-style message (notify_job_event): Send the new UPSTART_EVENT_CAUSED message with the emission id, then call notify_job_status() to send the new-style common status message. (notify_job_finished): New function to be called when we reach the job rest state, notifies and unsubscribes directly subscribed processes, and includes failed information. (notify_event_finished): Unsubscribe processes after sending the finished event, since the event has gone away. Also don't send this to processes subscribed to all events, since it's not useful for them. * init/notify.h: Add prototype. * init/tests/test_notify.c: Update all test cases and helper functions to the new message types. (test_job_finished): Check the new finished message is sent with a status message preceeding it. * init/job.c (job_change_state, job_change_state): Notify subscribed processes with notify_job_finished() when in the running (for service) or waiting states, just before we drop the cause. * upstart/message.h: Add failed, failed_process and exit_status arguments to UPSTART_JOB_FINISHED. * upstart/message.c (upstart_message_new, upstart_message_handle): Marshal the new arguments. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Test the new arguments. * upstart/message.h: Update the message types, introducing a more structured job message set and replacing the UPSTART_EVENT_JOB_STATUS message with UPSTART_EVENT_CAUSED which will be immediately followed by an ordinary UPSTART_JOB_STATUS message. * upstart/message.c (upstart_message_new, upstart_message_handle): Marshal the new messages. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Test the new message types. * TODO: Update. 2007-03-03 Scott James Remnant * TODO: Update. * init/cfgfile.c (cfg_parse_exec, cfg_parse_script): Separate out the parsing of an exec or script stanza into separate functions, seeing as this is quite a common operation. This also means we just need to change them in one place now. (cfg_parse_process): Function to call either of the above depending on the next argument. (cfg_stanza_exec): Call cfg_parse_exec instead. (cfg_stanza_script): Call cfg_parse_script instead. (cfg_stanza_pre_start, cfg_stanza_post_start) (cfg_stanza_pre_stop, cfg_stanza_post_stop): Call cfg_parse_process with the right arguments instead of doing by hand in each function. * init/event.c (event_emit_next_id): Split the id assigning code into a static inline function for easier modification. * init/job.c (job_next_id): Use the same style function here too. 2007-03-02 Scott James Remnant * init/event.c (event_emit): Port the slightly more efficient in the early case code from job_new. * init/job.h (Job): Add a unique id to the job structure. * init/job.c (job_new): Assign an incrementing id to each new job allocated. (job_find_by_id): Locate a job by its unique id, sadly not very efficient in a hash table ;-) (job_name): New hash key function since name isn't the first entry anymore. (job_init): Change hash key function. * init/tests/test_job.c (test_find_by_id): Make sure we can find a job by its id. * init/job.c (job_change_goal): Return the new instance in that circumstance, and clean up a little bit. * init/job.h: Update prototype. * init/tests/test_job.c (test_change_goal): Update tests. * init/job.c (job_find_by_name): Skip jobs marked for deletion too. * init/tests/test_job.c (test_find_by_name): Update test case. * init/event.h, init/notify.h, upstart/message.h: Provide C-level names for enums, this makes the compiler generate things that gdb can get. * init/job.c (job_run_process, job_kill_process, job_kill_timer): Change process argument to be a plain ProcessType, this means we know exactly which process we're trying to run or kill. (job_change_state): Update calls to job_run_process and job_kill_process * init/tests/test_job.c (test_run_process, test_kill_process): Update function calls to just pass a ProcessType in. * upstart/enum.h: Rename JobAction to ProcessType. * upstart/enum.c (job_action_name): Rename to process_name. (job_action_from_name): Rename to process_from_name. * upstart/tests/test_enum.c (test_action_name, test_action_from_name): Rename and update to match. * init/job.c (job_new, job_copy, job_change_state) (job_next_state): Change JOB_*_ACTION constants to PROCESS_*. (job_find_by_pid): Change JobAction argument to ProcessType. (job_emit_event): Call process_name on the failed process. (job_child_reaper): Update to use ProcessType instead of JobAction. * init/job.h (Job): Change type of failed_process to ProcessType. * init/tests/test_job.c (test_find_by_pid): Update to use ProcessType instead of JobAction in tests. (test_new, test_copy, test_change_goal, test_change_state) (test_next_state, test_run_process, test_kill_process) (test_child_reaper, test_handle_event_finished): Change JOB_*_ACTION constants to PROCESS_* * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_script) (cfg_stanza_pre_start, cfg_stanza_post_start) (cfg_stanza_pre_stop, cfg_stanza_post_stop): Change JOB_*_ACTION constants to PROCESS_* * init/tests/test_cfgfile.c (test_stanza_exec) (test_stanza_script, test_stanza_pre_start) (test_stanza_post_start, test_stanza_pre_stop) (test_stanza_post_stop, test_read_job, test_watch_dir): Change JOB_*_ACTION constants to PROCESS_* * init/tests/test_event.c (test_poll): Change JOB_*_ACTION constants to PROCESS_* * init/tests/test_control.c (test_job_start, test_job_stop): Change JOB_*_ACTION constants to PROCESS_* * init/cfgfile.c (cfg_watch_dir): Restore the prefix argument; pass as the data pointer to the inotify callbacks and visitor function. Change the return value to be the watch structure. (cfg_job_name): Add prefix argument and prepend to relative path. (cfg_create_modify_handler, cfg_delete_handler, cfg_visitor): Get the prefix for the job names from the data pointer and pass to cfg_job_name(). * init/cfgfile.h: Update prototypes. * init/tests/test_cfgfile.c (test_watch_dir): Actually test the watch functions. * init/main.c (main): Pass NULL for the prefix for the global job directory, compare the return value against (void *)-1. * TODO: Update. * init/cfgfile.c (cfg_stanza_on): Drop the simple on stanza. * init/tests/test_cfgfile.c (test_stanza_on): Remove test case. * TODO: Update. 2007-03-01 Scott James Remnant * util/jobs.c (handle_job_status): Drop the process field from the output for now. * util/events.c (handle_event_job_status): Likewise * util/tests/test_jobs.c (test_start_action, test_list_action) (test_jobs_action): Drop pid from messages we simulate. * util/tests/test_events.c (test_emit_action): Likewise. * upstart/message.c (upstart_message_new, upstart_message_handle): Remove the pid field from the job status and event job status messages. * upstart/message.h: Update description of job status and event job status message to remove the pid field. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Remove checks using the pid field. * init/control.c (control_job_start, control_job_stop) (control_job_query, control_job_list): Remove the pid field from the messages, it'll come back later when we get better message formats. * init/tests/test_control.c (check_job_status, check_job_waiting) (check_job_started, check_job_stopped): Remove checks on the process id, since that field is gone from the message. (test_job_stop): Use the pid field of the main process. (test_job_start): Initialise the main action process. * init/notify.c (notify_job, notify_job_event): Remove the pid field from the message, it'll come back later when we get better message formats. * init/tests/test_notify.c (check_job_status) (check_event_job_status): Remove checks on the pid, since that field is no longer present. * init/job.c (job_process_copy): Use job_process_new here, oops. * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_script) (cfg_stanza_pre_start, cfg_stanza_post_start) (cfg_stanza_pre_stop, cfg_stanza_post_stop): Use job_process_new to allocate process structures and store in the process array. * init/tests/test_cfgfile.c (test_read_job, test_stanza_exec) (test_stanza_script, test_stanza_pre_start) (test_stanza_post_start, test_stanza_pre_stop) (test_stanza_post_stop): Update test cases to use process array member information. * init/tests/test_event.c (test_poll): Update to use newer job process array and find the pid under there. * init/job.h (Job): Remove the pid and aux_pid fields; replace the individual JobProcess pointers with an array of them of a fixed minimum size; replace failed_state with failed_process. (JobProcess): add a pid field here, so now we can obtain the pid on an individual process/action basis rather than global. * init/job.c (job_process_new): Function to create a JobProcess structure, setting the initial values to FALSE/NULL/0. (job_process_copy): Function to copy a JobProcess. (job_new): Don't initialise the pid or aux_pid members, initialise the process array to a fixed initial size and set the members to NULL, initialise the failed_process member to -1. (job_copy): Update to use job_process_copy and copy the process array. (job_find_by_pid): Look through the process structures in the job's process array to find the pid, and optionally return which action it was. (job_change_state): Call job_kill_process in the JOB_KILLED state if we have a main process and that has a pid, pass in the main process. (job_next_state): Check the process id of the main process when deciding what the next state is for running. (job_run_process): Store the process id in the process structure (job_kill_process): Accept a process structure and use that to obtain the process id we need to send TERM too. Remove the code that forced a state change if kill() failed, since we will get a child signal anyway and should do it there. (job_kill_timer): Likewise, accept a process structure and don't forcibly change the state anymore. (job_child_reaper): Rewrite to switch based on the action that died, rather than the state we were in; assert that the state is what we expected. (job_emit_event): The argument to the failed event is now the action name, rather than the state name; an action of -1 indicates that respawn failed. * init/tests/test_job.c (test_process_new, test_process_copy): Make sure the structure is created and copied properly. (test_new, test_copy): Drop checks on the pid and aux_pid members, add checks for the process array and pid members of processes. (test_find_by_pid): Update test case to make sure we can find the pid of any process, returning the action index rather than the process pointer. (test_run_process, test_kill_process, test_change_goal) (test_change_state, test_next_state, test_child_reaper): Update test cases to use pid fields inside process structures rather than the pid or aux_pid members. (test_handle_event, test_handle_event_finished) (test_free_deleted): Update to avoid pid field checks. * upstart/enum.h (JobAction): Enumeration of different actions. * upstart/enum.c (job_action_name, job_action_from_name): Enumeration to string conversion functions. * upstart/tests/test_enum.c (test_action_name) (test_action_from_name): Tests for the new functions. * init/cfgfile.c (cfg_read_job): Instead of trying to copy over an old job's state and instances into the new one, mark the old job as deleted. This ensures we never end up applying a new post-stop script to a job started with an old pre-start script, etc. It also makes life so much simpler. * init/tests/test_cfgfile.c (test_read_job): Update tests to make sure the old job is marked for deletion, instead of freed. * TODO: Update. * init/notify.c (notify_job): Split out notification to processes subscribed to the cause event into a new function (notify_job_event): We can call this when we change cause. * init/job.c (job_change_state): Notify anyone subscribed to the job after we've changed the state, rather than before, otherwise we won't know the new pids or anything. (job_change_cause): Call notify_job_event before changing the cause so that subscribers get a final status update. * init/tests/test_notify.c (test_job_event): Check the new function. * TODO: Update. * init/cfgfile.c (cfg_stanza_respawn): Remove the shortcut that lets you specify "respawn COMMAND". It was confusing as it hid the common "[when] exec"/"[when] script" syntax, made it non-obvious that "exec" and "respawn" were the same flag, etc. * init/tests/test_cfgfile.c (test_stanza_respawn): Update tests. (test_stanza_service): Fix test case to not use shortcut. * logd/event.d/logd.in: Update to not use respawn shortcut. 2007-02-25 Scott James Remnant * init/job.c (job_child_reaper): Shift the signal value into the higher byte to make it easier to detect, and not stamp over exit statuses between 128 and 255. (job_emit_event): Detect the signal stored in the new way. * init/cfgfile.c (cfg_stanza_normal): Store signal in the higher bytes. * init/tests/test_job.c (test_copy, test_change_state) (test_child_reaper): Update test cases. * init/tests/test_cfgfile.c (test_stanza_normal): Update test. * TODO: Update. * init/event.h (PWRSTATUS_EVENT): Add new power-status-changed event. * init/main.c (pwd_handler): Handle the SIGPWR signal by generating the new event, leave it up to a job to parse the file and do whatever it likes. * TODO: Update. 2007-02-13 Scott James Remnant * upstart/tests/test_message.c (test_reader, test_handle_using) (test_handle); Usual fix for gcc optimiser thinking that fixed for loops might not be. * init/tests/test_job.c (test_run_process, test_kill_process): Likewise. * init/tests/test_notify.c (test_subscription_find): I still don't know what a type-punned pointer is, nor why dereferencing such a thing would break strict-aliasing rules. * init/tests/test_cfgfile.c (test_read_job): More type-punning. * util/tests/test_jobs.c (test_start_action): More for-loop action. * util/tests/test_events.c (test_emit_action): And again. 2007-02-11 Scott James Remnant * init/job.c (job_change_goal): We need to be able to stop a running job without a process, because that's what a job-as-state is! The check was added because job_child_reaper calls job_change_goal and then job_change_state immediately after, we should fix that instead. (job_child_reaper): If we call job_change_goal while in the running state, it will call job_change_state for us; so check for that first and don't change the state! * init/tests/test_job.c (test_change_goal): Update the test to ensure that we can stop a job with no running process. * init/cfgfile.c (cfg_stanza_normalexit): normalexit is inconsistent, change to "normal exit" * init/tests/test_cfgfile.c (test_stanza_normalexit): Update. * init/cfgfile.c (cfg_stanza_start, cfg_stanza_stop) (cfg_stanza_pre_start, cfg_stanza_post_start) (cfg_stanza_pre_stop, cfg_stanza_post_stop, cfg_stanza_respawn): We're not going to allow stanza keywords to be quoted, since this gives us an easy way to allow users to make something explicitly not a keyword. 2007-02-10 Scott James Remnant * configure.ac: Bump version to 0.3.6 * configure.ac: Increase version to 0.3.5 * NEWS: Update. * TODO: Update. * TODO: More notes. * TODO: Note an issue with using JobProcess->pid * init/cfgfile.c (cfg_stanza_pre_start, cfg_stanza_post_start) (cfg_stanza_pre_stop, cfg_stanza_post_stop): Add a needed check for a token when parsing "exec". Correct line number we expect to see the duplicated value on. Correct expected error for missing argument from "Unexpected token" to "Expected token". * init/tests/test_cfgfile.c (main): Actually invoke the tests for the scripts. * init/cfgfile.c (cfg_read_job): Correct type of lineno in error. * TOOD: Minor notify bug * TODO: Big update. * init/tests/test_job.c (test_child_reaper): Make sure that we can reap post-start and pre-stop processes, and have only the aux_pid changed. Also make sure that if the running process dies while in these states, with or without an aux process, that we don't transition badly. * init/job.c (job_find_by_pid): Check aux_pid as well. * init/tests/test_job.c (test_find_by_pid): Make sure we can find it. * init/job.h (Job): Add an auxiliary pid member. * init/job.c (job_new): Initialise the aux_pid member. (job_change_state): Run the post-start and pre-stop scripts when we enter the state with the same name (assuming they exist). (job_run_process): Store the pid in aux_pid when starting the post-start or pre-stop processes. * init/tests/test_job.c (test_change_state): Add tests for running the new post-start and pre-stop scripts; which get their process ids stored in aux_pid instead of pid. (test_new): Make sure the aux_pid member is initialised properly. (test_copy): Make sure the aux_pid member is not copied. * TODO: Update. * init/tests/test_job.c (test_change_state): Add a check for the daemon stanza holding the job in spawned; we snuck this in a while back and never tested it (there's no support to get it out of spawned yet). * init/job.h (Job): Add new post_start and pre_stop scripts. * init/job.c (job_new): Initialise new scripts to NULL. (job_copy): Copy the information from the new scripts over as well. * init/tests/test_job.c (test_new): Check they're initialised. (test_copy): Check that the information is copied properly. * init/cfgfile.c (cfg_stanza_post_start, cfg_stanza_pre_stop): Add new script stanza functions for the additional two scripts that we want. * init/tests/test_cfgfile.c (test_stanza_post_start) (test_stanza_pre_stop): Add tests for the new stanzas. * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_script): Rewrite to allocate a JobProcess and parse the command or script into it. (cfg_read_job): Fix the long broken assumption that pid_file and pid_binary are required for respawn, when they're actually required for daemon. (cfg_stanza_start, cfg_stanza_stop): Remove script second-level. (cfg_stanza_respawn): Parse into the job's process. (cfg_stanza_pre_start, cfg_stanza_post_stop): New stanzas for the processes alone. * init/tests/test_cfgfile.c (test_read_job): Update a few test cases to match reality. (test_stanza_start, test_stanza_stop): Remove script-related checks. 2007-02-09 Scott James Remnant * init/tests/test_job.c (test_kill_process): Poll the event queue after each test to get rid of the allocated events and make valgrind happy. * init/tests/test_control.c (test_job_start, test_job_stop) (test_event_emit): Poll the event queue after each test to get rid of the allocated events, as they make valgrind complain. (test_event_emit): Free args and env when done. * init/job.h (JobName): Drop obsolete structure (JobProcess): Add a new structure to represent a single process within the job, instead of using two variables to pick either the script or command. (Job): Change command and script to a single JobProcess called process; change start_script and stop_script to a JobProcess called pre_start and post_stop respectively. * init/job.c (job_new): Initialise new members to NULL. (job_copy): Copy the process structures across, including contents. (job_change_state): Call job_run_process passing in the structure; rather than fiddling with if statements. (job_run_script, job_run_command, job_run_process): Combine all of these three functions into a single new job_run_process function. * init/tests/test_job.c (test_new, test_copy, test_change_goal) (test_change_state, test_child_reaper) (test_handle_event_finished): Change to using JobProcess for when we need to construct a command. (test_run_script, test_run_command): Merge into single new (test_run_process) function. * init/tests/test_event.c (test_poll): Replace command with process. * init/tests/test_control.c (test_job_start): Change to using JobProcess to specify the command. * init/main.c (main): Run job_free_deleted each time through the main loop. * init/job.c (job_change_goal): Minor tweak to the logic; we may have just made the job an instance, that should still let us stop the one underneath. * TODO: Update. * util/jobs.c (do_job): Always expect a list of replies. * init/control.c (control_job_status, control_job_stop) (control_job_query): Reply with information about all instances of the job. * init/tests/test_control.c (test_job_status, test_job_stop) (test_job_query): Make sure we get the list end even for a single job; and make sure we get details of all instances attached to the job. * init/tests/test_job.c (test_change_goal): Check that starting an instance job actually starts a new instance of it. * init/cfgfile.c (cfg_stanza_limit): Support the word "unlimited" in limit arguments for both the soft and hard values. * init/tests/test_cfgfile.c (test_stanza_limit): Make sure that we can make limits be unlimited. * init/event.c (event_copy): Function to copy an event structure. * init/event.h: Add prototype. * init/tests/test_event.c (test_copy): Make sure we copy the event correctly, with or without arguments and/or environment. * init/job.c (job_copy): Function to copy a job structure, leaving the state as it is. * init/job.h: Add prototype. * init/tests/test_job.c (test_copy): Make sure that we copy the job details whether they are NULL or non-NULL, but don't copy the state. * init/init.supp: Update supression. * init/job.c (job_find_by_name): If we get a job that's an instance, return what it's an instance of. * init/tests/test_job.c (test_find_by_name): Restore accidentally deleted test function; test that we get the real job, not an instance. * init/job.c (job_new): instance_of is initialised to NULL. * init/job.h: Add a new instance_of pointer, pointing to the parent that we're an instance of. * init/tests/test_job.c (test_new): Check that. * init/tests/test_cfgfile.c (test_read_job): Make sure instance_of pointers are updated. * init/job.c (jobs): Store jobs in a hash table. (job_new): Add to hash table, not to a list. (job_handle_event, job_handle_event_finished, job_detect_stalled) (job_free_deleted): Iterate across the hash table, rather than list. (job_find_by_name): Use nih_hash_lookup, we keep this function because we'll add "is instance or not" smarts soon! (job_find_by_pid): Iterate across the entire hash table. * init/tests/test_job.c (test_find_by_name): Drop test since this function is now gone. (test_free_deleted): Can't assume things are in a line now. * init/control.c (control_job_list): Iterate the hash table. * init/event.c: Don't hide the events list anymore * init/event.h: Publish it and the init function. * init/job.c: Don't hide the jobs list anymore. (job_list): Since we don't hide it, we can drop this. * init/job.h: Publish it and the init function. * init/notify.c: Don't hide the subscriptions list anymore. * init/notify.h: Publish it and the init function. * init/control.c (control_job_list): Iterate the job list directly * init/tests/test_control.c (test_event_emit): Use the events list available to us. * init/tests/test_event.c (test_poll): Call job_init directly and just use the events list available to us. * init/tests/test_job.c (test_new): Call job_init directly. (test_change_state): Use the events list available to us. * init/tests/test_notify.c (test_unsubscribe): Use the subscriptions list available to us. * doc/states.dot: Add updated state graph. * doc/Makefile.am (EXTRA_DIST): Ship the states diagram. (states.png): Include rules to build the png, we'll put it in bzr anyway, but this is useful. * init/cfgfile.c (cfg_delete_handler): Handle deleted jobs; mark the job as deleted, and if it's dormant, invoke a state change. * upstart/enum.h: Add a new JOB_DELETED state. * upstart/enum.c (job_state_name, job_state_from_name): Add the new state to the string functions. * upstart/tests/test_enum.c (test_state_name) (test_state_from_name): Check the enum works. * init/job.c (job_change_goal): New decision; we can start a waiting job if it's marked delete (it might be a new instance) -- we'll use the new deleted state to decide that we shouldn't. (job_change_state): Once we reach waiting, if the job is to be deleted, move to the next state. (job_next_state): The next state for a waiting job if the goal is stop is deleted. We should never call job_next_state () for a deleted job. (job_free_deleted): Very simple function, just detects deleted jobs and frees them. * init/job.h: Add prototype for new function. * init/tests/test_job.c (test_change_goal): Update test to use new deleted state; and don't even change the goal. (test_change_state): Add a check to make sure we end up in deleted. (test_next_state): Make sure waiting goes to deleted. (test_free_deleted): Check the function. * init/job.c (job_change_goal): Don't try and start a job if it's marked to be deleted and is just waiting for cleanup. * init/tests/test_job.c (test_change_state): Make sure that the cause is released when we reach waiting. * init/tests/test_cfgfile.c (test_read_job): Make sure that a deleted job gets resurrected. * init/cfgfile.c (cfg_visitor): Correct number of arguments and call to cfg_job_name. * TODO: Update. * init/cfgfile.c (cfg_stanza_daemon): Don't allow arguments anymore. * init/tests/test_cfgfile.c (test_stanza_daemon): Update tests. * init/job.c (job_handle_event_finished): Function to unblock all jobs blocked on a given event emission. (job_new, job_emit_event): Rename blocker to blocked; it's useful for testing for truth. * init/job.h: Add prototype, rename member. * init/tests/test_job.c (test_handle_event_finished): Test it. (test_new, test_change_state): Update name here too. * init/event.c (event_finished): Call job_handle_event_finished function to unblock jobs. * init/tests/test_event.c (test_poll): Make sure the job gets unblocked; a few other tests have to change since running event_poll always unblocks the job if nothing listens to it. * init/job.c (job_child_reaper): Set failed back to FALSE if we're respawning, since we don't want to be failing. * init/tests/test_job.c (test_child_reaper): cause will be NULL. also free and poll events when done. (test_handle_event): pid can never be -1 (test_change_state): poll events when done * init/tests/test_job.c (test_child_reaper): Process will always be zero on return from reaper. * init/tests/test_job.c (test_child_reaper): Killed doesn't go past stopping; it goes to waiting, which will clear the cause. * init/tests/test_job.c (test_child_reaper): Fill in values before we test against them. * init/tests/test_job.c (test_kill_process): Fix violated assertion * init/tests/test_job.c (test_change_state): This should be failed because nothing cleared it. * init/tests/test_job.c (test_change_state): Fix a couple of array index problems. * init/tests/test_job.c (test_change_state): Why set that which does not change? * init/tests/test_job.c (test_change_state): Add newline to test. * init/job.c (job_emit_event): Add the job name as an argument; oops. * init/tests/test_control.c (test_job_stop): Need to kill the process ourselves, as we're blocked on an event. (test_job_query): Fix wrong value in test. (check_job_stopped, test_job_stop, test_unwatch_jobs): Change job name to match the test. * init/job.c (job_change_state): Must only not enter some states with no process now; others like killed actually usually want one! * init/tests/test_cfgfile.c (test_read_job): Fix test case. * init/tests/test_job.c (test_handle_event): Clean up tests. (test_detect_stalled): Clean up. * init/job.c (job_child_reaper): Update the reaping of the child processes; there's a much larger state range for the main process now, so that needs to be taken into account. * init/tests/test_job.c (test_child_reaper): New test cases. * init/job.c (job_next_state): Encapsulate the slightly odd three exit states of running in this function, otherwise we'll end up special-casing it in places I'd rather not think about. (job_change_goal): Only change the state of a running job if it has a process. * init/tests/test_job.c (test_next_state): Add a test case for the dead running job (test_change_goal): Add test case for the dead running job * init/tests/test_job.c (test_change_state): Add test cases for the forgotten stopping to killed transition. * init/job.c (job_kill_process, job_kill_timer): Just check the pid and state, and no longer any need to notify jobs since we're just called from one state amongst many. (job_change_state): Skip over the killed state if there's no process. * init/tests/test_job.c (test_kill_process): Update test cases. * init/job.c (job_run_process): Simplify a little bit, no need to do the state assertions here, just make sure there's no already a process running. * init/tests/test_job.c (test_run_command, test_run_script): Run tests in the spawned state, since that's where we run the primary command or script. Drop check for process state since that's no longer set. * init/job.c (job_change_state, job_next_state): Ok, here's the big one ... rewrite this to use the new state transitions. This has suddenly got a lot simpler and easier to read, this was definitely a good idea. (job_emit_event): Function to make emission of events easier. (job_failed_event): replaces this one which wasn't so easy. * init/tests/test_job.c (test_change_state): I can't say how much I wasn't looking forwards to rewriting these test cases; anyway, it's done now and I hope they're all right; (test_next_state): Make sure the state transitions are correct too. * init/job.h: Rename is_instance to delete and spawns_instance to just instance. * init/job.c (job_new): Update. * init/tests/test_job.c (test_new): Update. * init/cfgfile.c (cfg_stanza_instance): Update. * init/tests/test_cfgfile.c (test_stanza_instance): Update. * init/event.h: Correct the event names. * init/job.h: Add blocker event member. * init/job.c (job_new): Initialise it to NULL. * init/tests/test_job.c (test_new): Check it. * init/job.c (job_change_goal): Have a stab at this function with the new state machine; it gets somewhat simpler (until we introduce the second scripts), now we just induce things by a state change. * init/tests/test_job.c (test_change_goal): Made easier (for now) because we don't need to deal with processes and can just wait to be blocked on an event. 2007-02-08 Scott James Remnant * init/cfgfile.c (cfg_read_job): Drop check for useless respawn script (cfg_stanza_respawn): Drop handling of "respawn script" * init/tests/test_cfgfile.c (test_stanza_respawn): Drop the checks for "respawn script" * init/job.h: Move things about a bit more; remove respawn_script since that state is going away. * init/job.c (job_new): Drop initialisation of process_state. * init/tests/test_job.c (test_new): Improve the tests. * init/main.c (STATE_FD): Remove this define, not used anymore. * init/tests/test_event.c (test_poll): Update the event checking to match what's likely to happen. * init/event.h: Remove commented out bit. * init/tests/test_notify.c (check_job_status, test_job): Correct state usage to match a possible state. * init/control.c (control_job_start, control_job_stop) (control_job_query, control_job_list): Drop process state and description from the job status messages we send back. * init/tests/test_control.c (test_error_handler) (check_job_started, test_job_start, check_job_stopped) (check_job_stopping, test_job_query, check_job_starting) (test_job_list, test_watch_jobs, test_unwatch_jobs): Remove process_state and description, and update usage of job states. * init/notify.c (notify_job): Don't include process state or description in the job status message anymore. * init/tests/test_notify.c (check_job_status, test_job): Update tests * init/cfgfile.c (cfg_read_job): Drop the copying of the process_state member, since it doesn't exist anymore. * init/tests/test_cfgfile.c (test_read_job): Drop the check too. * init/job.h (Job): Drop the process_state member. * util/jobs.c (handle_job_status): Drop the process_state and description arguments; output a process id only if it's greater than zero. * util/tests/test_jobs.c (test_start_action, test_list_action) (test_jobs_action): Update tests to use newer states and arguments. * util/events.c (handle_event_job_status): Simplify in the same way * upstart/message.h: Remove process_state and description from the job status event (we already had the foresight to not put them in the event job status event). * upstart/message.c (upstart_message_new, upstart_message_handle): Update handling of the messages to reduce the arguments. * upstart/tests/test_message.c (test_new, my_handler) (test_handle): Update the tests for the new job status message. * upstart/enum.h (JobState): Change the job states to the new set of states that we've planned. (ProcessState): Drop process state entirely; this information is now contained in the single JobState field. * upstart/enum.c (job_state_name, job_state_from_name): Update strings to match the new state names. (process_state_name, process_state_from_name): Drop these functions. * upstart/tests/test_enum.c (test_state_name) (test_state_from_name): Update test cases to match new names. (test_process_state_name, test_process_state_from_name): Drop. * init/main.c (main): Remove the logd hack for now. * init/job.c (job_new): Change the default console to none for now. * init/tests/test_job.c (test_new): Update test. * init/cfgfile.c (cfg_stanza_console): Can't guard against duplicates for a while. * init/tests/test_cfgfile.c (test_stanza_console): Comment out dup test * init/cfgfile.c (cfg_read_job): Remove the restriction that there must be either an 'exec' or 'script' for a job; jobs without either define states others can use. * init/tests/test_cfgfile.c (test_read_job): Convert the test to a "must work". * init/job.c (job_change_state): Remove restriction that we must have either a script or a command; having neither should just wedge the job at the running rest state. Note that there's no way to get it out yet, because we don't force that particular state change. * init/tests/test_job.c (test_change_state): Make sure that works. * init/job.c (job_change_cause): Put the knowledge about how to change the cause into a separate function, since it's slightly tricky. (job_change_goal, job_change_state): Set the cause using the above function. * init/job.h (Job): Rename goal_event to cause, also shuffle things around so that the state is mostly together. * init/job.c, init/process.c, init/notify.c, init/cfgfile.c: Update references (and comments) to match the new name. * init/tests/test_job.c, init/tests/test_event.c, init/tests/test_process.c, init/tests/test_cfgfile.c, init/tests/test_notify.c: Likewise. * init/job.c (job_child_reaper): Don't change the goal event; the state changes will handle this. (job_change_goal): Only dereference/reference the goal event if we're actually changing it. * init/tests/test_job.c (test_change_state, test_child_reaper): Update tests to not assume that the goal event gets changed. (test_kill_process): Eliminate race condition. * init/job.c (job_child_reaper): Correct some problems with job and event failure; we now don't overwrite an existing failure record, and don't record failure if the main process failed and the goal was stop; since we likely caused it. * init/tests/test_job.c (test_child_reaper): More test cases. * logd/event.d/logd.in: Stop on the new runlevel events, not the shutdown event. * compat/sysv/shutdown.c (shutdown_now): Emit an ordinary runlevel change event now; including the INIT_HALT environment variable * compat/sysv/man/shutdown.8: Update the manual * compat/sysv/telinit.c: Now just sends out a runlevel event with an argument giving the new runlevel. * compat/sysv/man/telinit.8: Update description of the command. * upstart/message.h: Remove the UPSTART_SHUTDOWN message. * upstart/message.c (upstart_message_new, upstart_message_handle): Remove handling for the shutdown message. * upstart/tests/test_message.c (test_new, test_handle): Remove tests against the shutdown message. * init/control.c (control_shutdown): Remove the shutdown command from the server. * init/tests/test_control.c (test_shutdown): Remove tests for it. * init/event.h: Remove the shutdown event. * util/initctl.c: Remove the shutdown command reference. * util/events.c (shutdown_action): Remove the command. * util/events.h: Update. * util/tests/test_events.c (test_shutdown_action): Remove tests. * init/job.c (job_detect_idle): Rename to job_detect_stalled (job_detect_stalled): Remove the idle state detection (job_set_idle_event): Idle event has been removed. * init/job.h: Update. * init/tests/test_job.c (test_detect_idle): Rename to (test_detect_stalled): and remove idle detection tests. * init/main.c (main): Replace job_detect_idle with job_detect_stalled * init/control.c (control_shutdown): Don't set the idle event. * init/tests/test_control.c (test_shutdown): Don't detect the idle event (and thus the second event) * init/cfgfile.c (cfg_stanza_service): Parser for service stanza. * init/tests/test_cfgfile.c (test_stanza_service): Test the service stanza. (test_stanza_respawn): Check that respawn implies service. * TODO: Update. * init/job.h (Job): Add a new service member. * init/job.c (job_new): Service starts off as false. (job_change_state): Check service instead of respawn. * init/tests/test_job.c (test_change_state): Check with service instead of respawn, since that's what we really mean. * init/cfgfile.c (cfg_read_job): Copy a whole bunch more state into the newly parsed job. * init/job.c (job_run_process): Only output the first error. * init/tests/test_cfgfile.c (test_read_job): Make sure important things are copied. * TODO: Update. * init/main.c: Restore a much simplified version of the term handler that doesn't try and copy across any state. * compat/sysv/telinit.c: Update call to event_emit; we'll revisit this shortly when we get rid of the shutdown event. * util/events.c (handle_event): Add new id field (but ignore it) Functio (handle_event_job_status): New function to handle the new event. (handle_event_finished): Function to handle the end of the event. (emit_action): Send the newer event, and loop over replies until we get a finished one. * util/tests/test_events.c (test_emit_action): Update tests cases. * init/control.c (control_event_emit): New function to handle the new-style emit message. * init/tests/test_control.c (test_event_emit): Make sure the new message function behaves. * init/event.c, init/job.c, init/main.c, init/tests/test_event.c, init/tests/test_job.c: Completely drop the serialisation code, it's getting out of date and in the way. * init/event.h: Remove compatibility macros. (EventEmission): Drop the callback function; it was too error prone to try and do it this way, and we only ever wanted to release a job anyway as control requests are better handled through the notify interface. (EventEmissionCb): Drop unused typedef. * init/event.c (event_emit): Drop callback argument. (event_finished): Don't call the callback * init/tests/test_event.c: Update to avoid callbacks. * init/job.c (job_change_state): Convert to using event_emit and EventEmission. (job_detect_idle): Drop extra arguments to event_emit. * init/main.c (main, cad_handler, kbd_handler): Drop extra arguments to event_emit. * init/control.c (control_shutdown): Use event_emit instead of event_queue. * init/tests/test_control.c (test_shutdown): Convert to using EventEmission. (test_watch_events, test_unwatch_events): Drop extra arguments to event_emit. * init/tests/test_notify.c (test_subscribe_event, test_job) (test_event, test_event_finished): Drop extra arguments to event_emit * init/tests/test_job.c (test_change_goal, test_change_state) (test_run_script, test_child_reaper, test_detect_idle): Drop extra arguments to event_emit. * init/tests/test_process.c (test_spawn): Drop extra arguments to event_emit. * TODO: Update. Rewrite the notification subsystem quite significantly; now we have individual functions to subscribe to different types of notification, and can even subscribe to individual jobs or events. * init/notify.c (notify_subscribe_job, notify_subscribe_event) (notify_unsubscribe): New subscription and unsubscription functions that assume one record per subscription, not process. (notify_subscription_find): Function to find a subscription. (notify_job): Send a message to anything subscribed to the goal event as well. (notify_event): Use EventEmission and include the id in the event. (notify_event_finished): New function, sends a finished message and includes both the id and whether the event failed. * init/notify.h (NotifySubscribe): New notify structure that is once per subscription, rather than per-process; and allows subscription to individual jobs or events. * init/tests/test_notify.c (test_subscribe_job) (test_subscribe_event, test_unsubscribe): Test the new subscription functions, replacing the old (test_subscribe): tests. (test_subscription_find): Check finding works (check_event, test_event): Update to use emissions, and check that the id is correct. (test_event_finished): Check this one works too (check_event_job_status, test_job): Make sure processes subscribed via the goal event are notified too. * init/event.c (event_pending): Pass the emission directly. (event_finished): Notify subscribers that the event has finished. * init/control.c (control_error_handler): Call notify_unsubscribe (control_watch_jobs, control_unwatch_jobs, control_watch_events) (control_unwatch_events): Update to the new subscription API. * init/tests/test_control.c (test_error_handler): Use new API (test_watch_jobs, test_unwatch_jobs, test_watch_events) (test_unwatch_events): Also update these to the new API; use a destructor to make sure the subscription is freed. * init/tests/test_process.c: Don't use printf, use TEST_FUNCTION 2007-02-07 Scott James Remnant * upstart/message.h: Allocate new grouped event messages. * upstart/message.c (upstart_message_new, upstart_message_handle): Add support for the new grouped event messages. * upstart/tests/test_message.c (test_new, test_handle) (my_handler): Make sure the new messages are passed correctly. * init/job.c (job_change_state): Clear the goal event whenever we reach the final rest state of a job (waiting for all jobs, running for services). * init/tests/test_job.c (test_change_state): Check that the goal event goes away at the right times. * TODO: Update. * init/tests/test_job.c (test_child_reaper): Make sure that the event is marked failed properly * init/job.c (job_start_event, job_stop_event): There's no reason for these to exist as seperate functions anymore, especially since we want to eventually have some kind of match table. (job_handle_event): Perform the iterations and match calls here instead, since we just call job_change_goal now. * init/job.h: Remove prototypes. * init/tests/test_job.c (test_start_event, test_stop_event): Fold into (test_handle_event): which now handles all the cases. * init/job.c (job_detect_idle): Call event_emit * init/main.c (main, cad_handler, kbd_handler): Call event_emit instead of event_queue. * init/tests/test_event.c (test_new): Call event_poll * init/tests/test_job.c (test_change_state, test_child_reaper) (test_detect_idle, test_change_state): Update to use newer event API. * TODO: Update. * init/job.c (job_start, job_stop): Drop these functions; call job_change_goal instead (which is now public). (job_change_state, job_child_reaper): Call job_change_goal instead. * init/job.h: Update. * init/tests/test_job.c (test_start, test_stop): Merge into new (test_change_goal): function. * init/main.c (main): Call job_change_goal instead of job_start. * init/control.c (control_job_start, control_job_stop): Call job_change_goal instead. * init/tests/test_job.c (test_new, test_change_state) (test_run_script, test_start, test_stop, test_start_event): * init/job.h (Job): goal_event is now an EventEmission, and is a direct pointer to the one in the events queue, rather than a copy. * init/process.c (process_setup_environment): Reference the event name and environment through the goal event, not directly. * init/job.c (job_run_script): Reference the event name and environment through the goal event, not directly. (job_change_state, job_child_reaper): Replace direct setting of the job goal with a call to job_stop; the process state is always PROCESS_NONE in all three cases, so this is completely safe. (_job_start, _job_stop): Merge these two functions together into (job_change_goal): which behaves a lot more like job_change_state, except that it doesn't loop. This handles the changing of the emission. (job_start, job_start_event, job_stop, job_stop_event): Simplify these functions, now they just call job_change_goal passing in the emission pointer (or NULL). * init/main.c, init/job.c, init/job.h, init/event.c, init/event.h, init/tests/test_job.c, init/tests/test_event.c: Remove state serialisation code for the time being; maintaining it is getting increasingly harder, and it introduces some major bugs. It will get rewritten shortly. * init/event.c (event_pending): Pass the emission directly to job_handle_event now. * init/job.c (job_handle_event, job_start_event, job_stop_event): Deal with event emissions rather than just plain events, the change so far doesn't do anything else other than take the structure change. * init/job.h: Change prototypes. * init/tests/test_job.c (test_start_event, test_stop_event) (test_handle_event): Update tests to use emissions. * init/tests/test_event.c (test_read_state, test_write_state): Check the passing of the progress information. * init/event.c (event_read_state, event_write_state): Add progress field to the serialisation (oops). * init/event.h: Add missing attribute for event_read_state. * init/cfgfile.h: Add missing attributes. * init/main.c (read_state): Don't discard return value. * TODO: Update. * init/main.c (read_state): Handle the Emission keyword; also handle Event really being an EventEmission. * init/event.c (event_emit): Make the next emission id a static global (event_read_state, event_write_state): Serialise event emission structures, not plain events; also send over the last id we used so it appears seamless. This doesn't yet handle the callback/data bit of the serialisation, which turns out to be a little tricky ... oops * init/event.h: Update. * init/tests/test_event.c (test_read_state, test_write_state): Check that serialisation is done with EventEmissions instead, and all the fields are passed (except callback and data which are ... tricky). * init/main.c (main): Call event_poll instead of event_queue_run. * init/event.c (event_poll): Add the new function that replaces event_queue_run(); handles the new-style event emission structures in the list and only returns when there are no non-handling events. (event_pending, event_finished): Handling of particular event states during poll; split out for readability. (event_queue, event_queue_run): Drop these obsolete functions. (event_read_state): Force type from event_queue. * init/event.h: Add event_poll prototype; remove prototypes of old functions, replacing with #defines for now so things still compile. * init/tests/test_event.c (test_queue): Drop tests. (test_read_state, test_write_state): Force type from event_queue Change type we check size of. (test_poll): Pretty thoroughly test the new poll function. * init/job.c (job_change_state): Force type from event_queue * init/control.c (control_event_queue): Force type from event queue * init/tests/test_job.c (test_detect_idle): Force type from event_queue * init/tests/test_control.c (test_event_queue, test_shutdown): Force type from event_queue * init/event.c: Revert to a single list of events with an enum (event_emit): Set the progress to pending initially. (event_emit_find_by_id): Simplify now it just checks one list (event_emit_finished): Function for jobs to call once they've done with an event; just sets the progress to finished for the event queue to pick up. * init/tests/test_event.c (test_emit_finished): Check it. * init/event.h: Add prototype. (EventProgress): Add new enum (EventEmission): And add progress member to this structure * init/tests/test_event.c (test_emit): Make sure the event is pending * init/event.c (event_emit_find_by_id): Locate an event emission by its id in either the pending or handling queue. * init/event.h: Add prototype * init/tests/test_event.c (test_emit): Make sure that the emission id is unique each time. (test_emit_find_by_id): Test the function. * init/event.c (event_emit): New function to replace event_queue(); returns an EventEmission structure with the details filled in as given. * init/event.h: Add prototype. * init/event.c (event_init): Rename the single events queue to pending and add a new handling list. * init/event.h (EventEmission, EventEmissionCb): Add a new emission structure that wraps an event, for use in the queue. * util/tests/test_events.c (test_events_action): Update test now that nih_message is more sensible. * util/tests/test_jobs.c (test_start_action, test_list_action) (test_jobs_action): Update test * util/events.c (emit_action): Actually pass the emit_env array * util/tests/test_events.c (test_emit_action): Make sure it does. * util/initctl.c (main): Catch nih_command_parser() returning a negative value to indicate an internal error, and always exit 1. * util/events.c (handle_event): Build up multiple lines to describe the event, including its arguments and environment. * util/tests/test_events.c (test_events_action): Check the new output format is right. * init/main.c (main): Take out inadvertantly leaked debugging code; sorry about that. * init/job.c (job_child_reaper): Rewrite this to make the logic a little easier to follow, and support signals in normalexit. This also now applies to deciding whether the job failed, if it did, we store that information in the job so the stop and stopped events can get it. * init/tests/test_job.c (test_child_reaper): Add new test cases for the setting of the failed flags. * init/cfgfile.c (cfg_stanza_normalexit): Allow signal names in the arguments, which are added to the normalexit array or'd with 0x80 * init/tests/test_cfgfile.c (test_stanza_normalexit): Check that we can now parse signal names correctly. * init/job.c (job_failed_event): Change add to addp to fix leak. * init/job.c (job_failed_event): Function to turn an event into one that includes all the necessary arguments and environment. (job_change_state): Call job_failed_event for the stop and stopped events (bit hacky at the moment, will improve later). * init/tests/test_job.c (test_change_state): Check that the failed events are generated properly. 2007-02-06 Scott James Remnant * init/job.c (job_change_state): Reset the failed member when we enter the starting state. * init/tests/test_job.c (test_change_state): Make sure that the failed member is reset when we enter the starting state. * init/job.h (Job): Add failed, failed_state and exit_status members. * init/job.c (job_new): Initialise new members. * init/job.c (job_child_reaper): Convert signals to names when outputting status messages. * init/tests/test_job.c (test_child_reaper): Check that the signal name gets converted over. * init/event.h (CTRLALTDEL_EVENT): Now we've broken the shared namespace of events and jobs, rename the control-alt-delete event back to control-alt-delete. * init/job.c (job_change_state): Replace the events generated as part of the job state, named for the job and state, with new state events that have the job name as an argument. * init/event.h: Define new job event names. * init/tests/test_job.c (test_change_state): Make sure the new events are correct, with the job name as an argument. * init/job.c (job_change_state): Remove the job event; this has been repeatedly proved to be confusing. * init/tests/test_job.c (test_change_state): Remove checks for the job event. * util/events.c (emit_action): Pass in extra arguments. (env_option): Function to parse an option given an environment variable. * util/events.h: Add prototype. * util/tests/test_events.c (test_emit_action): Make sure that the emit action works with no arguments and with arguments. (test_events_action): Send back events with the right number of args. (test_env_option): Check the env option parser works. * util/initctl.c: Give shutdown its own command and options, give emit a new -e option. * util/events.c (shutdown_action): Split out from emit, seeing as these are going to be different from now on. * util/events.h: Add prototype. * util/tests/test_events.c (test_shutdown_action): Copy test cases. * init/control.c (control_event_queue): Take the arguments and environment from the event queue request; and reparent into the event. * init/tests/test_control.c (test_event_queue): Check that arguments and environment are copied across properly. * init/notify.c (notify_event): Pass in the arguments and environment for the event. * init/tests/test_notify.c (check_event): Check for event arguments and environment from the notify process. (test_event): Add arguments and environment to the event we test with * upstart/tests/test_message.c (test_new, test_handle): Send arguments and environment with the UPSTART_EVENT_QUEUE and UPSTART_EVENT messages. * upstart/wire.c (upstart_pop_int, upstart_pop_unsigned): Shrink only once. (upstart_pop_string): Check the length is at least one first, as we may just have an 'S'. * upstart/message.c (upstart_message_new, upstart_message_handle): The UPSTART_EVENT and UPSTART_EVENT_QUEUE messages gain new array arguments containing the arguments and environment for the event. * upstart/message.h: Document the new arguments. * util/tests/test_events.c, util/tests/test_jobs.c: Update the message format checks here too. * upstart/tests/test_wire.c (test_pop_pack): Free the array. * upstart/tests/test_message.c (test_new, test_handle) (test_handle_using, test_reader): Update tests to include and expect new type markers between each field. * upstart/wire.c (upstart_push_int, upstart_push_unsigned): Take out silly asserts; it must have room! * upstart/wire.c (upstart_push_string, upstart_pop_string): Rewrite to use a type like the rest of the functions; this removes the strange length restriction and allows us to make the pop function non-destructive. * upstart/tests/test_wire.c (test_push_string): Update. (test_pop_string): Update, adding in non-destructive, wrong type and insufficient space for type test cases. (test_push_array, test_pop_array): These needed updated too, changing the string format changed the array format. (test_push_pack, test_pop_pack): And obviously the pack format changed. * upstart/wire.c (upstart_pop_header): Make the function non-destructive in the face of errors. * upstart/tests/test_wire.c (test_pop_header): Make sure that invalid headers are non-destructive on error. * upstart/tests/test_wire.c (test_pop_int, test_pop_unsigned): Make sure that insufficient space is non-destructive. * upstart/wire.c (upstart_push_int, upstart_pop_int) (upstart_push_unsigned, upstart_pop_unsigned): Convert to array-style type first format. (upstart_push_string, upstart_push_header): Write the length and type fields out by hand so they don't get an 'i' prefix. (upstart_pop_string, upstart_pop_header): Read the length and type fields by hand so they don't get an 'i' prefix. * upstart/tests/test_wire.c (test_push_int, test_pop_int) (test_push_unsigned, test_pop_unsigned): Update test cases to match. (test_push_pack, test_pop_pack): Pack format was changed too. * upstart/wire.c (upstart_push_packv, upstart_pop_packv): Add calls to push and pop array. * upstart/tests/test_wire.c (test_push_pack, test_pop_pack): Test support for arrays. * upstart/wire.c (upstart_push_array, upstart_pop_array): Implement new array functions; note that these use a newer format that allows us to transmit NULL without needing to limit the size of the array. * upstart/wire.h: Add prototypes. * upstart/tests/test_wire.c (test_push_array, test_pop_array): Test the new array functions. * init/job.c (job_run_script): Build up the argument list, appending those from the goal event if one is set. (job_run_command): Use nih_str_array_add to build up the arguments, but don't append those from the goal event (use script). * init/tests/test_job.c (test_run_script): Make sure the arguments get passed to the running shell scripts. * init/job.c (job_run_script): Only use the /dev/fd trick if we can actually stat /dev/fd; also don't hardcode that path ... * init/paths.h (DEV_FD): Add here. * init/process.c (process_setup_environment): Copy environment variables from the goal event into the job's process. * init/tests/test_process.c (test_spawn): Make sure the environment reaches the job, but doesn't override that in the job already. * init/tests/test_job.c (test_start_event): * init/job.c (job_start_event, job_stop_event): Copy the arguments and environment from the event into the goal event. * init/job.c (job_read_state, job_write_state): Read and write arguments and environment for goal event. * init/tests/test_job.c (test_read_state, test_write_state): Test with arguments and environment to the goal event. * init/event.c (event_read_state, event_write_state): Read and write the arguments and environment of the event. * init/tests/test_event.c (test_read_state, test_write_state): Make sure arguments and environment are correctly serialised. * init/cfgfile.c (cfg_stanza_console): Fix a leak of the console argument in the case of duplicated options. (cfg_stanza_env): Drop the counting now nih_str_array_addp does it; and be sure to use that function. (cfg_stanza_umask): Fix leak of umask argument (cfg_stanza_nice): Fix leak of nice argument * init/tests/test_event.c (test_new): Call event_queue_run so init is called outside of a TEST_ALLOC_FAIL block. * init/event.c (event_new): Start off with NULL args and env, to match job (saves a few bytes). (event_match): Watch for NULL arguments! * init/tests/test_event.c (test_new): Check for NULL not alloc'd * init/cfgfile.c (cfg_stanza_on, cfg_stanza_start) (cfg_stanza_stop): Parse arguments to the on stanza and store them directly in the event. * init/tests/test_cfgfile.c (test_stanza_on, test_stanza_start) (test_stanza_stop): Make sure arguments are parsed into the event. * init/event.c (event_new): Use nih_str_array_new. * init/cfgfile.c (cfg_stanza_env): Rewrite to use nih_str_array. * init/job.c (job_run_script): Check the error returned from nih_io_reopen; don't just loop. We only ever expect ENOMEM (the other error, EBADF, is impossible). * init/job.c (job_change_state): Reset the goal_event to NULL when we catch a run-away job (as it's not stopping for the same event it started with). (job_child_reaper): Reset the goal_event to NULL after setting the goal to STOP. * init/tests/test_job.c (test_change_state, test_child_reaper): Check that the goal event gets reset whenever the goal gets changed. * init/tests/test_event.c: Use TEST_ALLOC_FAIL * init/event.c (event_match): Match arguments using fnmatch() and allow more arguments in event1 than event2 (but not the other way around). * init/tests/test_event.c (test_match): Check the new permitted combinations. * init/event.h (Event): Add args and env members to Event. * init/event.c (event_new): Initialise args and env members to zero-length arrays. * init/tests/test_event.c (test_new): Use TEST_ALLOC_FAIL and make sure args and env are both initialised to a list containing just NULL. * util/jobs.c (start_action): Get the UPSTART_JOB environment variable and use that if we don't have any arguments passed to us. (do_job): Code split from the above function that handles a named job * util/tests/test_jobs.c (test_start_action): Make sure UPSTART_JOB is picked up. * init/process.h: Add necessary attributes. * init/process.c (process_setup_environment): Set the UPSTART_JOB environment variable from the job, and the UPSTART_EVENT environment variable from the job's goal_event member (if set). * init/tests/test_process.c (test_spawn): Make sure we get the environment in the job. * init/job.h: Add attributes to job_new and job_read_state. * init/tests/test_job.c: Use CHECK_ALLOC_FAIL on the functions we didn't get around to touching while we were in here. * init/job.c (job_start_event, job_stop_event): Set the goal_event member to a copy of the event we found. (job_read_state): Use event_new instead of trying to do it by hand. * init/tests/test_job.c (test_start_event, test_stop_event): Use CHECK_ALLOC_FAIL; and make sure the goal_event is set properly. (test_start, test_stop, test_write_new): Use event_new here too * init/job.c (job_write_state): Output a goal_event field containing the event name or nothing for NULL. (job_read_state): Parse the goal_event field * init/tests/test_job.c (test_write_state): Make sure the state is written out properly. (test_read_state): Make sure that the state is parsed correctly too. * init/job.c (job_start, job_stop): Split all of the code except the goal_event setting into two new static functions that this calls (_job_start, _job_stop): New static functions (job_start_event, job_stop_event): Call _job_start and _job_stop instead of job_start and job_stop * init/job.c (job_catch_runaway): Move this function up a bit. * init/job.c (job_start, job_stop): Clear the goal_event member, these functions are called for a manual start. * init/tests/test_job.c (test_start, test_stop): Make sure the goal_event member is freed and set to NULL. * init/job.h (Job): Add a new goal_event member * init/job.c (job_new): Initialise the goal_event member to NULL. * init/tests/test_job.c (test_new): Check with TEST_ALLOC_FAIL; also make sure goal_event is initialised to NULL. 2007-02-05 Scott James Remnant * configure.ac: Bump version to 0.3.3 * NEWS: Update. * init/process.c (process_spawn): Exit with 255 so we don't clash with anything that uses 1 as a normal exit code. Note why we only close 0..2 (everything else is FD_CLOEXEC). * init/cfgfile.c (cfg_watch_dir): Mark the inotify watch descriptor as FD_CLOEXEC. * init/control.c (control_open): nih_io_set_cloexec can only ever return EINVAL, so no point checking it. 2007-02-04 Scott James Remnant * init/tests/test_control.c: Remove strange old code. 2007-02-03 Scott James Remnant * init/control.c (control_open_sock, control_reopen) (control_close_handler): Drop these functions; unconnected datagram sockets don't close -- so why try dealing with it? (control_error_handler): Don't reopen the socket on error, just log it -- the socket should be fine, there's no remote end to be lost, after all. * init/tests/test_control.c (test_close_handler): Drop. (test_error_handler): Drop the reopen tests. * init/tests/test_job.c (test_run_script): Control socket doesn't get unexpectedly opened anymore; so no need to close it. * init/control.c (control_open): Remove the strange behaviour that this can be called to get the socket. Instead make control_io global; we're all adults after all. * init/tests/test_control.c (test_open): Remove the test for the silly behaviour. * init/notify.c (notify_job, notify_event): Use the control_io pointer directly, and just do nothing if we lost it somehow. * init/main.c (main): Being unable tp open the control socket, or parse the configuration, should be a fatal error; stop being so damned liberal! Don't reset the signal state if we're being restarted, as this loses any pending signals -- be happy that our parent left them in a good state. Set SIGCHLD to the standard handler, otherwise we might lose this before we start the main loop (which does the same anyway). (term_handler): Rework so we don't need to close and open the control socket; instead we just close it in the child that's going to send the state, and notify the parent that it's safe to exec (which will cause it to be closed so the new init can open it). * init/tests/test_control.c (test_open): Fix valgrind error * init/tests/test_notify.c (test_subscribe): Fix valgrind error * init/notify.c (notify_subscribe): Make safe against ENOMEM. * init/tests/test_notify.c (test_subscribe): Use TEST_ALLOC_FAIL * init/control.c: Add needed attributes; tidy up formatting. (control_open): Don't let ENOMEM fail opening the control socket. * init/control.h: Add needed attributes. * init/tests/test_control.c (test_open): Test for failed allocation. * init/main.c (term_handler): Make sure we catch failure to open the control socket again. * TODO: Update * init/cfgfile.c (cfg_watch_dir): Clean this up a bit; now we only output a warning if inotify failed for any reason other than not being supported AND walking worked. * init/cfgfile.c (cfg_watch_dir): Update to even newer watch API; our create_handler is now always called if inotify is successful, so we just need to fall back to walking the directory when it isn't -- if inotify isn't supported, don't even bother complaining. (cfg_create_modify_handler): Check the stat of the file visited to make sure it's a regular file. (cfg_visitor): Check the stat of the file visited to make sure it's a regular file. * init/cfgfile.c: Update include to upstart/enum.h * init/job.c: Update include to upstart/enum.h * init/job.h: Update include to upstart/enum.h * logd/main.c: Add attribute to open_logging * util/initctl.c: Split out the command functions into new files; * util/jobs.c: This gets the job-related commands * util/events.h: This gets the event-related commands * util/initctl.h, util/jobs.h, util/events.h: Headers * util/tests/test_jobs.c: Test suite for job-related commands. * util/tests/test_events.c: Test suite for event-related commands. * util/Makefile.am (initctl_SOURCES): Add new files. (TESTS): Build new test suites. (test_jobs_SOURCES, test_jobs_LDFLAGS, test_jobs_LDADD): Details for job-related commands test suite binary. (test_events_SOURCES, test_events_LDFLAGS, test_events_LDADD): Details for event-related commands test suite binary. * TODO: Remove item about splitting initctl now we've done it. * TODO: Big update; strip anything we have a spec for. * upstart/message.c (upstart_message_handle): Make sure that if we fail to parse a message, we don't leave strings around in memory. * upstart/tests/test_message.c (test_open): Check that we get a raised EADDRINUSE if we try an open a socket twice. (test_handle): Add lots of checks for things like NULL names and incomplete messages; as well as the obvious unknown message. (test_reader): Make sure that errors while handling messages are dealt with by logging it. * upstart/job.c, upstart/job.h, upstart/tests/test_job.c: Rename to enum.c, enum.h and tests/test_enum.c; since this just includes enums and convert functions really. * upstart/Makefile.am: Update. * upstart/libupstart.h: Update include. * upstart/tests/test_message.c: Update include. 2007-02-01 Scott James Remnant * logd/main.c (main): Ensure we error if daemonise fails. * compat/sysv/shutdown.c (main): Ensure that signals and timers are added, even if we run out of memory. * upstart/tests/test_message.c: Change from assert to assert0 * upstart/tests/test_wire.c: Change from assert to assert0 * init/tests/test_notify.c: Change from assert to assert0 * init/tests/test_control.c: nih_io_message_send should always return a value greater than zero. * upstart/tests/test_wire.c: Change to use assert instead of NIH_ZERO; the rationale here is that in test cases we just want to fail, not try again repeatedly. * upstart/tests/test_message.c: Likewise. * init/tests/test_control.c: Use assert to ensure we get the expected return values of functions that raise errors. * init/tests/test_notify.c: Use assert to ensure we get the expected return values of functions that raise errors. * init/cfgfile.c (cfg_watch_dir): Port to the new NihWatch API and use nih_dir_walk(). This also fixes the long-standing bug where we wouldn't watch the configuration directory if inotify was disabled. Drop both the parent and prefix members for now, until we clean this up later. (cfg_create_modify_handler): Wrap cfg_read_job after figuring out the job name. (cfg_job_name): Function to figure out the job name from a path. (cfg_visitor): Visitor function to handle initial parsing, figuring out the job name; otherwise identical to the standard handler. * init/cfgfile.h: Update prototype for cfg_watch_dir. * init/main.c (main): Update call to cfg_watch_dir. 2007-01-31 Scott James Remnant * upstart/tests/test_message.c: Use TEST_ALLOC_FAIL to make sure allocations are handled properly. 2007-01-30 Scott James Remnant * upstart/wire.c: Note that if any of the push functions fail, the entire buffer should be discarded. * upstart/tests/test_wire.c (test_push_int, test_push_unsigned) (test_push_string, test_push_header, test_push_pack): Us TEST_ALLOC_FAIL to ensure that failing to allocate memory is caught. * upstart/tests/test_message.c (my_handler): Free the name and description after checking; they aren't otherwise. * upstart/wire.c (upstart_push_packv, upstart_pop_packv): Consume a copy of the va_list, so these can be called multiple times on the same list without ill effect. * upstart/message.h: Add warn_unused_result attributes to upstart_message_handle and upstart_message_handle_using as they raise errors. * upstart/wire.c: push functions return negative values to indicate insufficient memory. * upstart/wire.h: Add warn_unused_result attributes to push functions * upstart/tests/test_message.c: Guard calls to nih_io_buffer_push and nih_io_message_add_control with NIH_ZERO to ensure they succeed. * upstart/tests/test_wire.c: Guard calls to nih_io_buffer_push * HACKING: Update from libnih with new Documentation, Function Attributes and Test Cases sections. 2007-01-10 Scott James Remnant * init/main.c (crash_handler): s/SEGV/SIGSEGV/ * init/main.c (main): Rename variable * TODO: Update. * init/main.c (main): Change the way we clear the arguments; by deleting just the final NULL terminator, we fool the kernel into only returning one argument in cmdline. * init/main.c (segv_handler): Rename to crash_handler and handle SIGABRT as well, so we can catch assertion errors. Of course, in theory, with our high test converage this should never happen in practice 2007-01-09 Scott James Remnant * init/main.c (main): Clear arguments so that upstart only ever appears as /sbin/init in ps, top, etc. * TODO: Update. * util/initctl.c: Add data pointer to functions and handle calls. * init/control.c: Add data pointer to all functions. * init/tests/test_control.c: Pass data pointer to upstart_message_handle_using() * init/tests/test_notify.c: Pass data pointer to upstart_message_handle_using() * upstart/message.c (upstart_message_handle) (upstart_message_handle_using): Add a data pointer argument to these functions and pass it to the handler. (upstart_message_reader): Pass the io structure's data pointer. * upstart/message.h (UpstartMessageHandler): Add a data pointer to the message handler. * upstart/tests/test_message.c (test_handle, test_handle_using): Pass a data pointer to the function call and check it's passed to the handler correctly. (test_reader): Check that the io data pointer gets passed. * init/tests/test_cfgfile.c (test_stanza_console, test_stanza_env) (test_stanza_umask, test_stanza_nice, test_stanza_limit): Finish off the newer style test cases. * init/cfgfile.c (cfg_stanza_console, cfg_stanza_umask) (cfg_stanza_nice, cfg_stanza_limit, cfg_stanza_chroot) (cfg_stanza_chdir): Guard against duplicate uses of the stanzas. * init/tests/test_cfgfile.c (test_stanza_daemon) (test_stanza_respawn): Check that neither daemon or respawn override exec if they have no arguments. (test_stanza_script): Add missing function (test_stanza_chroot, test_stanza_chdir): Add tests for these simple stanzas. * init/cfgfile.c: Change remaining uses of nih_error_raise and return to just nih_return_error. * init/cfgfile.c (cfg_stanza_exec, cfg_stanza_daemon) (cfg_stanza_respawn, cfg_stanza_script): Disallow duplicates, both of command strings, scripts, limits and of just the flags. * init/tests/test_cfgfile.c (test_stanza_exec) (test_stanza_daemon, test_stanza_respawn, test_stanza_instance): Check the behaviour of these stanzas. * init/cfgfile.c (cfg_stanza_start, cfg_stanza_stop): Disallow duplicate values for the script. * init/tests/test_cfgfile.c (test_stanza_start, test_stanza_stop): Test cases for those two functions. * init/cfgfile.c (cfg_stanza_description, cfg_stanza_author) (cfg_stanza_version): Don't allow stanza to be duplicated anymore. * init/tests/test_cfgfile.c (test_stanza_description) (test_stanza_author, test_stanza_version): Test cases for these simple stanza; making sure duplication is not permitted. (test_stanza_on): Add a test case for this stanza too. * init/cfgfile.c (cfg_stanza_kill): Guard against duplicate uses of the kill timeout stanza. * init/tests/test_cfgfile.c (test_stanza_kill): Test the complex kill stanza. (test_stanza_pid): Check duplicate usage results in an error. * init/job.h (Job): Rename pidfile to pid_file and binary to pid_binary * init/job.c (job_new): Update names here too. * init/errors.h: Add a new "duplicate value" error. * init/cfgfile.c (cfg_read_job): Change name of variables, and catch the duplicate value error to add the line number. (cfg_stanza_pid): Change variable names, and clean this function up a little. Make it an error to use a stanza more than once. * init/tests/test_cfgfile.c (test_stanza_pid): Write a newer test case function for the pid stanza. * init/cfgfile.c (cfg_stanza_normalexit): Use do/while instead of while, that we don't have to test has_token first as next_arg does that for us. * init/cfgfile.c (cfg_stanza_normalexit): Change to peek at the next token to see whether it's missing or not, and then just fetch each next argument at a time. This is more efficient than parsing them all in one go, and also means we can report the error in the right place! * init/tests/test_cfgfile.c (test_stanza_normalexit): Since we've changed the function that parses the stanza, add a proper test case function for it, covering all the behaviours. * init/job.c (job_new): Initialise the emits member to an empty list. * init/job.h (Job): Add the emits member as a list. * init/tests/test_job.c (test_new): Check the emits list starts off empty. * init/tests/test_cfgfile.c (test_stanza_emits): Test the new emits stanza; this function will also serve as a prototype for cleaning up the config tests. * init/cfgfile.c (cfg_stanza_emits): Add function to parse the new emits stanza. * init/cfgfile.c (cfg_stanza_depends): Remove the depends stanza from the configuration file. Dependency support has never been used, and is to be replaced by a more flexible event/state configuration and blocking on the starting/stopping events. * init/tests/test_cfgfile.c: Remove references and tests for the depends stanza. * init/job.h: Remove the depends list from the job structure. * init/job.c (job_new): No depends list to initialise. (job_change_state): No dependencies to release (job_start): No dependencies to iterate; this removes a particularly hairy and complex interaction between state changes. Remove the dependency event. (job_release_depends): Drop this function. * init/tests/test_job.c (test_start, test_stop): Massively simplify these tests cases now we don't have dependencies to worry about. (test_release_depends): Drop tests 2007-01-08 Scott James Remnant * init/cfgfile.c: Rewrite using the nih_config API, rather than one huge function we now just have seperate handler functions for each stanza. We can also use more fine-grained parsing than slurping all args in and counting them. (cfg_read_job): Catch exceptions from the configuration parser and add the line number where the problem occurred to an output message. Parser errors are now fatal, and not ignored. * init/errors.h: Add a file containing errors raised within the init daemon codebase. * init/Makefile.am (init_SOURCES): Build with errors.h * init/tests/test_cfgfile.c: Update test cases now we don't expect a job to be returned if there's a parser error. * TODO: Update 2007-01-06 Scott James Remnant * logd/main.c (logging_reader): Fix inadvertent shadowing of the len parameter. * compat/sysv/telinit.c: Oops, nearly forgot to port this to send the messages in the new way. * compat/sysv/shutdown.c (shutdown_now): Likewise, port this too. * TODO: Update. * util/initctl.c (handle_job_status): Output the process argument, not the pid argument which contains the origin of the message. * upstart/message.c (upstart_message_handle): Raise a new unknown message error if we don't have a handler and a new illegal message error if the source is illegal. * upstart/tests/test_message.c (test_handle): Adjust tests to check for the new errors that we raise. * upstart/errors.h: Define strings for new errors. * util/initctl.c: Yet another makeover for this little program, port it to the new message/control framework using handler functions and NihIoMessage. This starts to make each action function look very similar, so there's method to this madness. 2007-01-05 Scott James Remnant * logd/main.c (main): Make sure that we add the SIGTERM handler. * init/tests/test_job.c (test_run_script): This test case relies on there only being one file descriptor watch, which won't be true if the control socket has been opened because there's a message to go out. Make sure it's closed first. * init/init.supp: Update supressions file now that control_init has been renamed to notify_init * init/Makefile.am: Include notify.o from all tests. * init/job.c (job_change_state, job_kill_process, job_start) (job_stop): Use the new notify_job function name. * init/event.c (event_queue_run): Use the new notify_event function name. * init/control.c (control_error_handler): Handle ECONNREFUSED now that the process id is available to us. * init/tests/test_control.c (test_error_handler): Make sure children going away is handled properly. * upstart/message.c (upstart_message_new): Store the process id in the int_data message field. * upstart/tests/test_message.c (test_new): Check the int_data field is filled in. * init/main.c (main): Guard against various things returning an error that we weren't catching. * init/tests/test_notify.c: Whitespace fix. * init/control.c (control_watch_jobs, control_unwatch_jobs) (control_watch_events, control_unwatch_events): Restore functionality to subscribe and unsubscribe from job and event notifications. * init/tests/test_control.c (test_watch_jobs, test_unwatch_jobs) (test_watch_events, test_unwatch_events): Check that the subscription and unsubscription messages work. * init/Makefile.am (test_control_LDADD): Link to notify.o * init/control.c: Drop unused include of upstart/errors.h * init/notify.c: Move functions that handle subscription and notification from control.c. Other than changing the names, we're keeping the API the same for now; expect it to change later when we add the ability to subscribe to individual jobs or events. (notify_init): initialise the subscriptions list; we don't have a separate send queue now that the control I/O is always asynchronous. * init/notify.h: Moved notification enum, structure and prototypes from control.h, changing the names so they match notify_* in the process. * init/Makefile.am (init_SOURCES): Build and link notify.c using notify.h (TESTS): Build the notify test suite binary. (test_notify_SOURCES, test_notify_LDFLAGS, test_notify_LDADD): Details for notify test suite binary. * init/tests/test_notify.c: Rewrite test cases in the manner of test_control.c so that we have one function for notify_job and one for notify_event, each of which contains the child process that receives the notification, * init/control.c (control_open): Allow this to be called to obtain the control socket, which means we can make it static. * init/tests/test_control.c (test_open): Check that it works. * init/control.c, init/control.h, init/tests/test_control.c: Move functions that handle subscription and notification to new notify.c (control_init): Drop completely, no need to maintain a send queue now (control_open): Change to return an NihIo that uses the default control watcher, and our error handler. Split socket opening into (control_open_sock): which can be called from other functions. (control_close): Use nih_io_close() to close the socket and free the structure in one go. (control_reopen): Close the open control socket and open it again without destroying the NihIo structure, its queues or state. (control_close_handler): Handle the control socket going away (control_error_handler): Handle errors on the control socket, including the connection refused error that indicates a client went away. (control_handle): Split this into a miriad of small functions with a table to link them to the message type; this will make expanding each message handler much easier in future. * init/control.h: Update. * init/tests/test_control.c: Rewrite test cases to check the new handler functions; as a side-effect, this gets rid of the evil giant child/parent functions in favour of one test function per handler function. * upstart/message.c (upstart_message_handle_using): Wrapper function around upstart_message_handle that ensures all messages as passed to a single function. * upstart/message.h: Update. * upstart/tests/test_message.c (test_handle_using): Make sure it calls the single function. 2007-01-04 Scott James Remnant * upstart/message.c (upstart_message_reader): Handle any errors that occurred while handling the message. 2007-01-02 Scott James Remnant * upstart/message.c (upstart_message_handle): Check that the name argument is never NULL. (upstart_message_reader): Simple message reader function that can be associated with an I/O watch and handles each message received. * upstart/message.h: Add prototype. * upstart/tests/test_message.c (test_reader): Test the reader function. * upstart/control.c: Rename to upstart/message.c * upstart/control.h: Rename to upstart/message.h * upstart/tests/test_control.c: Rename to upstart/tests/test_message.c * upstart/libupstart.h: Update includes. * upstart/wire.c: Include message.h * upstart/wire.h: Update includes. * upstart/tests/test_wire.c: Update includes. * upstart/errors.h: Rename UPSTART_INVALID_MESSAGE to UPSTART_MESSAGE_INVALID so that it's prefixed. * upstart/Makefile.am (libupstart_la_SOURCES) (upstartinclude_HEADERS, TESTS): Update filenames. * upstart/control.c (upstart_message_new): New function that creates an NihIoMessage directly from its arguments, which are a type followed by a variable number of args depending on that type. (upstart_message_handler): Function to find a handler function for a particular message type and origin process. (upstart_message_handle): New function that takes an NihIoMessage and invokes a handler function with a variable number of args depending on the message type. (upstart_send_msg, upstart_send_msg_to, upstart_recv_msg): Drop these functions, leave it up to the caller to decide whether to send and receive the messages synchronously or asynchronously; now that the capability is in nih_io_*. * upstart/control.h (UpstartMsgType): Rename to UpstartMessageType. (UpstartMessageHandler): Function with variable number of arguments that handles a message received. (UpstartMsg): Drop this structure entirely, we'll encode or decode the wire format directly from or into a function call, rather than use an intermediate structure to marshal it. (UpstartMessage): New structure to make a table that can be passed to upstart_message_handle to determine which handler should be called. * upstart/tests/test_control.c: Test new behaviour. * upstart/wire.c (upstart_push_header, upstart_pop_header): Change structure name for type parameter. * upstart/wire.h: Update. * upstart/tests/test_wire.c: Update. * configure.ac (AC_COPYRIGHT): Update copyright to 2007. 2006-12-29 Scott James Remnant * upstart/wire.c (upstart_write_int, upstart_write_unsigned) (upstart_write_string, upstart_write_header, upstart_write_packv) (upstart_write_pack): Rename to *_push_* (upstart_read_int, upstart_read_unsigned, upstart_read_string) (upstart_read_header, upstart_read_packv, upstart_read_pack): Rename to *_pop_*. All of the above modified to modify an NihIoMessage structure, instead of trying to carry around buffers ourself. * upstart/wire.h: Update to match above. * upstart/tests/test_wire.c: Update all tests to match the above changes. 2006-12-21 Scott James Remnant * upstart/wire.c (upstart_read_packv, upstart_write_packv): Change nih_assert_notreached to nih_assert_not_reached. * init/job.c (job_run_script): Open the NihIo structure in stream mode. * logd/main.c (logging_watcher): Open the NihIo structure in stream mode. (logging_reader): Need to pass the length of the size_t as a pointer so that it can be modified if less is read. 2006-12-17 Scott James Remnant * upstart/wire.c (upstart_write_packv, upstart_write_pack) (upstart_read_packv, upstart_read_pack): Functions to write a pack of different variables to the stream, or read them from it * upstart/wire.h: Add prototypes. * upstart/tests/test_wire.c (test_write_pack, test_read_pack): Check we can read and write a pack of variables at once. * upstart/wire.c (upstart_write_header, upstart_read_header): Drop the version from the header, we'll just keep the protocol always backwards compatible. * upstart/wire.h: Update. * upstart/tests/test_wire.c (test_write_header, test_read_header): Check that everything works. * upstart/wire.c (upstart_write_string, upstart_read_string): Transmit the length as an unsigned, and use 0xffffffff to mean NULL instead of zero so we can still transmit the empty string. * upstart/wire.h: Update. * upstart/tests/test_wire.c (test_write_string, test_read_string): Tests for the functions to make sure the wire is at it should be. * upstart/wire.c (upstart_read_str, upstart_write_str): Rename to upstart_read_string and upstart_write_string. * upstart/wire.h: Update. * upstart/wire.c (upstart_write_unsigned, upstart_read_unsigned): Functions to send unsigned values over the wire, which we'll use to get a bit extra for the string lengths. * upstart/wire.h: Update. * upstart/tests/test_wire.c (test_write_unsigned) (test_read_unsigned): Test the new functions. * upstart/wire.c (upstart_write_ints, upstart_read_ints): Drop these functions, we'll go with something far more generic and useful. * upstart/wire.h: Remove prototypes. * upstart/wire.c (upstart_write_int, upstart_read_int): Transmit integers as signed 32-bit values in network byte order. * upstart/tests/test_wire.c (test_write_int, test_read_int): Test the functions to make sure the wire is at it should be, * upstart/control.c (upstart_read_int, upstart_write_int) (upstart_read_ints, upstart_write_ints, upstart_read_str) (upstart_write_str, upstart_read_header, upstart_write_header): Move functions to new wire.c file. * upstart/wire.c: Source file to hold wire protocol functions. * upstart/wire.h: Prototypes. * upstart/tests/test_wire.c: (empty) test suite. * upstart/libupstart.h: Include wire.h * upstart/Makefile.am (libupstart_la_SOURCES): Build and link wire.c (upstartinclude_HEADERS): Install wire.h (TESTS): Build and run wire test suite. (test_wire_SOURCES, test_wire_LDFLAGS, test_wire_LDADD): Details for wire test suite binary. * upstart/control.c (MAGIC): Change to "upstart\n", the final character was originally \0 and then was a " " for the 0.2 series. * upstart/tests/test_control.c (test_recv_msg): Change to match. 2006-12-15 Scott James Remnant * util/initctl.c, compat/sysv/telinit.c, compat/sysv/shutdown.c: Update all uses of the UpstartMsg structure to avoid the intermediate union that no longer exists. * init/control.c, init/tests/test_control.c: Update all uses of the UpstartMsg structure to avoid the intermediate union that no longer exists. * upstart/control.h: Combine all the previous message structures into just one that has all of the fields anyway. * upstart/control.c, upstart/tests/test_control.c: Update all uses of the UpstartMsg structure to avoid the intermediate union that no longer exists. * upstart/control.h (UPSTART_API_VERSION): Define API version macro to be public. * upstart/control.c (MSG_VERSION, upstart_send_msg_to): Replacing the previous MSG_VERSION macro here. * upstart/control.c (upstart_read_int, upstart_write_int) (upstart_read_ints, upstart_write_ints, upstart_read_str) (upstart_write_str, upstart_read_header, upstart_write_header): New functions to replace the old "write a struct" protocol with something a little more regimented and supportable. (IOVEC_ADD, IOVEC_READ, WireHdr, WireJobPayload, WireJobStatusPayload) (WireEventPayload): Remove these structures, use the functions instead. (upstart_send_msg_to): Call write functions intead of using macros, this makes the code somewhat neater. (upstart_recv_msg): Call read functions instead of using macros, again making the code somewhat neater. * upstart/tests/test_control.c (test_recv_msg): Change wire tests to match new protocol, and thus actually work properly, previously these were endian sensitive. 2006-12-14 Scott James Remnant * compat/sysv/shutdown.c (wall): Construct the wall message so that we don't put \r into a po file; for some reason, gettext hates that and bitches about it. Someone's confusing internationalisation with operating system portability, I expect. * util/man/initctl.8: Drop reference to start(8), as that's just a symlink to initctl now. * init/man/init.8: Link to initctl. * compat/sysv/reboot.c (main): Clear up help text a little. * HACKING: Correct some typos. * configure.ac (AC_INIT): Correct bug reporting address. 2006-12-13 Scott James Remnant * configure.ac: Bump version to 0.3.2 * NEWS: Update. * util/initctl.c (print_job_status): Drop the newline from the output. 2006-12-13 Alex Smith * util/initctl.c (print_job_status): Clean up initctl job status output, which was badly converted from printf to nih_message. 2006-12-13 Scott James Remnant * compat/sysv/man/shutdown.8: Add missing documentation on the format of TIME by copying it from --help output. 2006-12-13 Alex Smith * init/process.c (process_setup_console): Actually send output to /dev/null instead of /dev/console, when CONSOLE_NONE. 2006-12-13 Scott James Remnant * Makefile.am (EXTRA_DIST): Distribute the nih ChangeLog as well. * init/tests/test_job.c: Port to the new test framework. * init/job.c (job_set_idle_event): Fix a slight memory leak, repeated setting of the idle event never freed the previous one set. 2006-12-12 Scott James Remnant * init/tests/test_cfgfile.c: Port to the new test framework. * init/tests/test_control.c: Port to the new test framework. * init/init.supp: Suppress the list head allocated within control_init. * init/control.c (control_watcher): Need to save the pid when we get ECONNREFUSED, otherwise we lose it when we free the message. * init/tests/test_process.c: Port to the new test framework. * init/init.supp: Suppress the list head allocated within job_init. * init/init.supp: Include a valgrind suppressions file. * init/Makefile.am (EXTRA_DIST): Distribute the suppressions file. * init/tests/test_event.c: Port to the new test framework. * logd/Makefile.am, util/Makefile.am, compat/sys/Makefile.am (AM_CPPFLAGS): Add -I$(srcdir), necessary for testing "programs" that don't have usual library path semantics. * upstart/tests/test_control.c: Port to the new test framework. * upstart/control.c (upstart_free): Drop this function, while not exposing libnih is a valiant effort, it already slips out because of the error handling. * upstart/tests/test_job.c: Add missing include. * upstart/tests/test_job.c: Port to the new test framework. (test_process_state_name): Check that this returns NULL. * HACKING: Update location of download directory. Document requirement that all code have test cases. * logd/main.c (open_logging): Likewise. * init/control.c (control_open): No need to set ENOMEM, errno is always set anyway. * configure.ac (AM_INIT_AUTOMAKE): Include nostdinc so we don't get Automake's broken default includes. * upstart/Makefile.am (DEFAULT_INCLUDES): Drop override now that we don't need it. (DEFS, INCLUDES): Replace these variables with the combined (AM_CPPFLAGS): variable that declares everything. * init/Makefile.am (DEFAULT_INCLUDES): Drop override now that we don't need it. (DEFS, INCLUDES): Replace these variables with the combined (AM_CPPFLAGS): variable that declares everything. * util/Makefile.am (DEFAULT_INCLUDES): Drop override now that we don't need it. (DEFS, INCLUDES): Replace these variables with the combined (AM_CPPFLAGS): variable that declares everything. * compat/sysv/Makefile.am (DEFAULT_INCLUDES): Drop override now that we don't need it. (DEFS, INCLUDES): Replace these variables with the combined (AM_CPPFLAGS): variable that declares everything. * logd/Makefile.am (DEFAULT_INCLUDES): Drop override now that we don't need it. (DEFS, INCLUDES): Replace these variables with the combined (AM_CPPFLAGS): variable that declares everything. 2006-11-02 Scott James Remnant * util/initctl.c (start_action): Remove break calls which shouldn't be there. 2006-10-18 Sean E. Russell * init/main.c: Include sys/time.h * init/cfgfile.c: Include sys/time.h and sys/resource.h * init/job.c: Include sys/time.h and sys/resource.h 2006-10-17 Scott James Remnant * configure.ac: Bump version to 0.3.1 * NEWS: Update. * TODO: Update. * configure.ac (AM_GNU_GETTEXT_VERSION): Quote version number. * logd/Makefile.am (event.d/logd): Make the event.d sub-directory in case we're building outside of the source tree. * compat/sysv/runlevel.c (store): Don't break strict-aliasing rules by avoiding dereferencing type-punned pointer. Answers on a postcard, please. 2006-10-13 Scott James Remnant * util/initctl.c (start_action, emit_action): Add missing \n * util/initctl.c: Rewrite using nih_command_parser. * util/man/initctl.8: Improve. * util/start.c: Remove, replaced by initctl. * util/man/start.8: Remove, replaced by initctl. * util/Makefile.am (sbin_PROGRAMS): Drop start, now just a symlink to initctl. (dist_man_MANS): Drop start.8, now a symlink to initctl.8 (install-exec-hook): Make symlinks to initctl, add start (install-data-hook): Make symlinks to initctl.8, add start.8 * initctl: Rename to util again, I don't want a separate directory for every single little tool; and we'll be shipping more than just initctl (e.g. a non-compat reboot). * configure.ac (AC_CONFIG_FILES): Make util/Makefile instead of initctl/Makefile. * Makefile.am (SUBDIRS): Descend into util, not initctl. * compat/sysv/reboot.c: Remove long options where they didn't exist before. Write help text. * compat/sysv/man/reboot.8: Update. * init/main.c (main): Formatting. * logd/main.c (main): Formatting. * logd/man/logd.8: Formatting. * compat/sysv/runlevel.c (main): Formatting. * compat/sysv/telinit.c (main): Formatting. * compat/sysv/man/shutdown.8: Remove long options. * compat/sysv/shutdown.c: Remove -e/--event, it has no place in a compatibility tool. Get rid of long options that never existed before. Specify help text to describe the options. * compat/sysv/man/shutdown.8: Spruce up a bit. * compat/sysv/telinit.c (main): Set help text to list the valid runlevels. * compat/sysv/man/telinit.8: Refine the notes to mention runlevel(8). * compat/sysv/runlevel.c (main): Make the help text describe the options, rather than the behaviour. * compat/sysv/man/runlevel.8: Flesh out a little more. * configure.ac (AC_INIT): Change bug reporting address to the mailing list, since Launchpad doesn't accept random bugs without accounts and complicated control messages. * init/main.c, logd/main.c: Add a period to the synopsis. * init/main.c (main): Set the synopsis, and direct people to look at telinit in the --help output. * init/man/init.8: Flesh this out a little more, still a lot of explaining to do about jobs and events, but we'll wait until we've changed that code before documentating the behaviour. * logd/main.c (main): Correct help text to describe the options, rather than what the program does. As per standard style. Don't become a daemon until the logging socket is open, and make that exclusive with waiting for SIGCONT. * logd/man/logd.8: Write some more extensive documentation, including describing the startup interlock and the socket protocol. * TODO: Plan to get rid of the signal interlock from logd. 2006-10-12 Scott James Remnant * configure.ac: Expand AC_GNU_SOURCE so we get _GNU_SOURCE and so that gettext doesn't complain. (AM_GNU_GETTEXT_VERSION): Increase to 0.15 (AC_PREREQ): Increase to 2.60 * HACKING: Update autoconf and gettext requirements. 2006-10-11 Scott James Remnant * init/control.c (control_init): Pass NULL to nih_list_new. Clarify list item types. * init/event.c (event_init): Pass NULL to nih_list_new. * init/job.c (job_init): Pass NULL to nih_list_new. * init/main.c: Change nih_signal_add_callback to nih_signal_add_handler and NihSignalCb to NihSignalHandler. * init/cfgfile.c, init/cfgfile.h, init/control.c, init/control.h, init/event.c, init/event.h, init/job.c, init/job.h, init/main.c, init/process.c: Clean up documentation strings and parent pointer types. * compat/sysv/shutdown.c: Change nih_signal_add_callback to nih_signal_add_handler. * compat/sysv/reboot.c: Set synopsis text depending on command used (probably should use nih_command_parser?) * compat/sysv/runlevel.c: Set synopsis and help text, and correct usage. * compat/sysv/shutdown.c: Set synopsis text. * compat/sysv/telinit.c: Set synopsis text. * compat/sysv/runlevel.c, compat/sysv/shutdown.c: Clean up documentation strings. * logd/main.c: Set synopsis and help text. * logd/main.c: Clean up documentation strings. Change nih_signal_add_callback to nih_signal_add_handler. * upstart/control.c, upstart/control.h, upstart/job.c: Clean up documentation strings and correct parent pointer type. * HACKING: Detail function documentation requirement and format. 2006-10-10 Scott James Remnant * event.d/logd.in: Move to logd/event.d * event.d/Makefile.am: Remove * logd/Makefile.am: Create the logd job definition and install * Makefile.am (SUBDIRS): event.d directory has been removed. * configure.ac (AC_CONFIG_FILES): No longer make event.d/Makefile * configure.ac: Check for --enable-compat, default to sysv if given or no compat if not given. * compat/sysv/Makefile.am: Don't build binaries or install manpages unless COMPAT_SYSV is defined. 2006-10-06 Scott James Remnant * doc/upstart-logo.svg: Include the logo Alexandre designed. * doc/Makefile.am (EXTRA_DIST): Ship the logo in the tarball. * Makefile.am (SUBDIRS): Install under doc * configure.ac: Generate doc/Makefile * AUTHORS: Ensure he's credited fully. 2006-09-27 Scott James Remnant * event.d/Makefile.am (do_subst): Eliminate duplicate /s * man/init.8: Move to init/man * init/Makefile.am: Update to install man page. * man/logd.8: Move to logd/man * logd/Makefile.am: Update to install man page. * man/initctl.8, man/start.8: Move to initctl/man * initctl/Makefile.am: Update to install man pages. * man/reboot.8, man/runlevel.8, man/shutdown.8, man/telinit.8: Move to compat/sysv/man * compat/sysv/Makefile.am: Update to install man pages. * man/Makefile.am: Remove * configure.ac (AC_CONFIG_FILES): Remove man/Makefile * Makefile.am (SUBDIRS): Don't build in man * util: Rename to initctl * configure.ac (AC_CONFIG_FILES): Update. * Makefile.am (SUBDIRS): Update. * util/reboot.c: Move to compat/sysv * util/shutdown.c: Move to compat/sysv * util/Makefile.am: Update. * compat/sysv/Makefile.am: Update. * configure.ac: Replace macros with single call to NIH_INIT. Bump version to 0.3.0 to begin new development cycle. 2006-09-21 Scott James Remnant * logd/main.c: Revert the change that logged to the console, in practice this doesn't work so well. I want to get rid of logd in the long term, or at least just have it as a simple logging proxy, so giving it features seems wrong. 2006-09-20 Scott James Remnant * configure.ac: Bump version to 0.2.8 * NEWS: Updated. * logd/main.c (main): Check the kernel command-line for "quiet" (line_reader): Write to console unless silent or a daemon * man/Makefile.am (dist_man_MANS): Drop sulogin.8 * man/sulogin.8: Drop, we don't include an sulogin 2006-09-19 Michael Biebl * event.d/Makefile.am (logd): Drop $(srcdir) * init/Makefile.am (init_SOURCES): Distribute paths.h 2006-09-18 Michael Biebl * configure.ac: Check for sys/inotify.h 2006-09-18 Scott James Remnant * util/shutdown.c (warning_message): Adjust method of constructing the message to not confuse poor translators who think \r and \n are the same thing! 2006-09-14 Scott James Remnant * init/job.c (job_change_state): Catch runaway respawns when we enter the running state, so we catch stop/start loops too. * init/tests/test_job.c (test_change_state): Update test. * event.d/logd: Rename to logd.in * event.d/logd.in: Replace /sbin with @sbindir@ so we can transform * event.d/Makefile.am: Generate logd from logd.in * util/reboot.c: Don't hardcode the location of /sbin/shutdown * util/Makefile.am (DEFS): Use autoconf to seed it * util/shutdown.c (sysvinit_shutdown): Don't hardcode the location of /dev/initctl * init/paths.h: Create a new configuration file that can contain all of the path definitions, and in particular, allow them to be overidden elsewhere. * init/Makefile.am (DEFS): Override definitions of CFG_DIR and TELINIT using autoconf * init/main.c: Include paths.h. Don't hardcode location of telinit * init/job.c: Include paths.h * init/process.c: Include paths.h * init/process.h: Remove definitions from here. * configure.ac: Bump version to 0.2.7 2006-09-13 Scott James Remnant * NEWS: Updated. * TODO: More TODO. 2006-09-10 Scott James Remnant * util/reboot.c (main): Don't give -H with "halt". 2006-09-09 Scott James Remnant * configure.ac: Bump version to 0.2.6 * NEWS: Update. * TODO: Update. * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Change the magic to be the package string. * upstart/tests/test_control.c (test_recv_msg): Update tests. * util/initctl.c (main): Set the usage string. * util/shutdown.c (main): Set the usage string. * util/start.c (main): Set the usage string. * compat/sysv/runlevel.c (main): Set the usage string. * compat/sysv/telinit.c (main): Set the usage string. * man/Makefile.am: Use install-data-hook and $(man8dir) * util/Makefile.am: Also use install-exec-hook * Makefile.am (SUBDIRS): Install contents of the man directory * configure.ac (AC_CONFIG_FILES): Generate man/Makefile * man/Makefile.am: Install manpages in the appropriate places. * man/init.8, man/logd.8, man/initctl.8, man/reboot.8, * man/shutdown.8, man/start.8, man/sulogin.8, man/runlevel.8, * man/telinit.8: Include some basic manpages so we at least have some level of documentation. * init/job.c (job_child_reaper): Don't check the exit status of a respawning job if the goal is to stop it. * compat/sysv/telinit.c (main): Generate events rather than starting and stopping jobs directly, the events are named "runlevel-X". 0, 1, 6 and s/S are shutdown events. * logd/main.c (main): Raise SIGSTOP before entering the main loop. * init/main.c (main): Interlock with logd. * event.d/logd: Should not be a console owner, but should stop on shutdown. * init/process.c (process_setup_console): Revert part of the previous change, should just output to /dev/null if we don't have logd. * configure.ac: Bump version to 0.2.5 * init/main.c (main): Start the logd job if it exists. * init/process.c (process_setup_console): Ignore ECONNREFUSED as that just means that logd isn't around, handle errors by falling back to opening the console. * init/process.c (process_setup_console): Implement handling for CONSOLE_LOGGED and generally clean up the other handling. * init/process.h: Update. * init/main.c (main): Pass NULL for the job to setup console. * TODO: Update. * logd/main.c: Implement the logging daemon, it accepts connections on a unix stream socket with the abstract name "/com/ubuntu/upstart/logd", expects the length of the name and the name to follow; then sequences of lines which are logged to /var/log/boot, or memory until that file can be opened. 2006-09-08 Scott James Remnant * util/shutdown.c (event_setter): Change the event names to distinguish between "shutdown -h" and "shutdown -h -H". * init/job.c (job_handle_event): Allow jobs to react to their own events, this is how we'll do respawn eventually. * init/tests/test_job.c (test_handle_event): Remove test. * init/main.c (cad_handler, kbd_handler): Generate the new event names. * init/event.h (CTRLALTDEL_EVENT, KBDREQUEST_EVENT): Add definitions of these event names, change the ctrlaltdel event to just that. * logd/main.c (main): Add the code to daemonise, etc. 2006-09-07 Scott James Remnant * TODO: Long discussion today on #upstart, many improvements to the job and event model that make it more elegant. * AUTHORS: Include a list of thanks. * util/shutdown.c (shutdown_now): If we get ECONNREFUSED when we try and send the shutdown event to init, it probably means we're still in sysvinit. So try that instead. (sysvinit_shutdown): Function to send a hand-crafted runlevel change message across /dev/initctl. * util/initctl.c (main): Add a shutdown command that takes an arbitrary event name to be issued after "shutdown". You'll nearly always want the /sbin/shutdown tool instead. * init/job.c (job_detect_idle): Only generate the stalled event if at least one job handles it in its start_events list. * init/tests/test_job.c (test_detect_idle): Make sure that works. * init/event.h (STARTUP_EVENT, SHUTDOWN_EVENT, STALLED_EVENT): Macros to define the standard event names. * init/main.c (main): Use STARTUP_EVENT macro instead of "startup" * init/control.c (control_handle): Use SHUTDOWN_EVENT macro instead of "shutdown". * init/job.c (job_detect_idle): Use STALLED_EVENT macro instead of "stalled". * init/job.c (job_detect_idle): Add some log messages for when we detect the idle or stalled states. (job_kill_process, job_kill_timer): Increase log verbosity. * init/event.c (event_queue_run): Log which events we're handling if --debug is given. * compat/sysv/telinit.c (main): Send a shutdown command when requesting to enter runlevel 0 or runlevel 6, likewise for runlevel 1, s or S which all run "rc1" not "rcS". * init/main.c (main): When called directory (pid != 1) try and run telinit before complaining that we're not init. Make sure errors aren't lost. 2006-09-04 Johan Kiviniemi * upstart/control.c (upstart_addr): Replace use of __builtin_offsetof with offsetof. * upstart/tests/test_control.c (test_recv_msg): Likewise. 2006-09-04 Scott James Remnant * util/shutdown.c (main): Exit normally after sending the warning message if -k is given. 2006-09-01 Scott James Remnant * configure.ac: Bump version to 0.2.2 * NEWS: Update. * configure.ac: Bump version to 0.2.1 * init/process.c (process_setup_console): Ensure that the console is always initialised to at least /dev/null * init/job.c (job_change_state): Initialise event to NULL. * init/event.c (event_read_state): Don't mask initialisation of other variable. * init/cfgfile.c (cfg_job_stanza, cfg_parse_script, cfg_next_token): Print lineno using %zi not %d * compat/sysv/runlevel.c (store): Cast pointer type of timeval. * init/main.c: Move the kernel headers include beneath the C library ones, so that compilation doesn't fail on !i386. * util/reboot.c: Likewise. * init/main.c (term_handler): Close the control connection if we re-exec init, otherwise it won't be able to bind. Drop debugging. * init/main.c (term_handler): It always helps if we dup2 the right file descriptor. * init/main.c: Use the TERM signal instead of USR1, as old init used that for something else. Also rather than passing across file descriptor numbers, use a fixed descriptor and just pass "--restart". When we get that option we need to unmask signals otherwise we sit there looking like a lemon. * init/job.c (job_change_state): Don't free the event unless we generate one. * NEWS: Update. * init/cfgfile.c (cfg_watcher): Ignore any file with '.' or '~' * TODO: Update. * init/main.c (main): Parse command-line arguments, specifically look for --state-fd which we'll use for reexec. Don't do a couple of things if we're passed this. (read_state): Parse the line-buffered state. * init/job.c (job_read_state, job_write_state): Job state serialisation so that we can re-exec ourselves. * init/job.h: Update. * init/tests/test_job.c: Test the serialisation. * init/event.c (event_read_state, event_write_state): And similar functions for serialising the event queue. * init/event.h: Update. * init/tests/test_event.c: Test the serialisation. * init/cfgfile.c (cfg_read_job): Fix a bug, need to subtract current time to get due time. * upstart/job.c (job_goal_from_name, job_state_from_name) (process_state_from_name): Add opposite numbers that convert a string back into an enumeration. * upstart/job.h: Update. * upstart/tests/test_job.c: Test the new functions. 2006-08-31 Scott James Remnant * init/job.h (Job): Add respawn_limit, respawn_interval, respawn_count and respawn_time members so that we can keep track of runaway processes. * init/job.c (job_catch_runaway): Increment the respawn_count within respawn_interval, or reset it if we go over. (job_new): Initialise respawn_limit and respawn_interval to sensible defaults. * init/tests/test_job.c (test_new): Check the defaults are set. (test_change_state): Check the respawning code works. * init/cfgfile.c (cfg_job_stanza): Parse the "respawn limit" stanza. * init/tests/test_cfgfile.c (test_read_job): Test the new stanza. * init/process.c (process_setup_console): Remove the console reset code, it tends to just crash X and seems to do nothing interesting. * init/main.c (reset_console): Instead put it here and just do it on startup. * configure.ac: Bump version to 0.2.0 * util/Makefile.am (install-exec-local): Create symbolic links, not hard links. * init/main.c: Can't catch STOP. * util/reboot.c: Pause init while shutting down or rebooting. * init/main.c (stop_handler): Catch STOP/TSTP and CONT. * init/event.c (event_queue_run): Don't run the event queue while paused. * init/job.c (job_detect_idle): Don't detect idle jobs while paused. * util/reboot.c: if we get the -w argument ("only write to wtmp") we need to exit, and not behave as halt normally would. * compat/sysv/runlevel.c (main): Add missing newline. * compat/sysv/telinit.c (main): And here too. * init/main.c (main): Check for idle after the startup event queue has been run, otherwise we may just sit there. * compat/sysv/Makefile.am (sbin_PROGRAMS): Build and install telinit (telinit_SOURCES, telinit_LDFLAGS, telinit_LDADD): Details for telinit binary. * compat/sysv/telinit.c: Trivial telinit program that just runs the appropriate rcX job. * compat/sysv/runlevel.c (main): Suggest help on illegal runlevel. * util/Makefile.am: Tidy up. * configure.ac (AC_CONFIG_FILES): Create compat/sysv/Makefile * Makefile.am (SUBDIRS): Build things found in compat/sysv * compat/sysv/Makefile.am (sbin_PROGRAMS): Build and install runlevel (runlevel_SOURCES, runlevel_LDFLAGS, runlevel_LDADD): Details for runlevel binary. * compat/sysv/runlevel.c: Helper to store and retrieve the current "runlevel" from utmp/wtmp; as well as the reboot time. * init/main.c (main): Drop debugging set. * init/job.c (job_change_state): As well as the job/state events, send the job event when a service is running or a task is stopping. * init/tests/test_job.c (test_change_state): Check the events get sent properly. * util/start.c: Write a simple utility to start, stop, or query the status of the named jobs. * util/Makefile.am (sbin_PROGRAMS): Build and install start (start_SOURCES, start_LDFLAGS, start_LDADD): Details for start (install-exec-local): Also install as stop and status. * util/reboot.c (main): Drop the debugging set. * init/cfgfile.c (cfg_job_stanza): Correct nih_alloc error. * init/process.c (process_setup_environment): Guard memory alloc. * init/job.c (job_set_idle_event): Likewise. (job_change_state): And here too. (job_run_command): Likewise. * init/control.c (control_send): Likewise. * init/cfgfile.c: And throughout this file. * upstart/control.c (upstart_recv_msg): And once here too. * upstart/control.h: Abolish the separate halt, reboot and poweroff messages and replace with a single shutdown message that takes an event name (for the idle event issued afterwards). * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Handle the new shutdown event type by just treating it as an event. * upstart/tests/test_control.c (test_messages): Update tests. * init/job.c (job_set_idle_event): Store a copy of the idle event name. * init/control.c (control_send): Copy the shutdown event name. (control_handle): Replace individual handling with the new single event. * init/tests/test_control.c (test_watcher): Update. * util/initctl.c: Drop handling for things that shutdown does now. * util/shutdown.c: Send the UPSTART_SHUTDOWN event and let the user specify anything they want, just give defaults. This is quite a big change and abolishes level events entirely, along with the event history. We now just treat events as a transient queue of strings that go past, may cause things to change, but are otherwise forgotten. This turns out to be much easier to understand and has no real loss of power. * init/event.c: Vastly simplify; gone are the separate notions of edge and level events, instead we just treat them as one-shot things that go past and are forgotten about. * init/event.h (Event): Remove value member. Update prototypes. * init/tests/test_event.c: Update. * init/job.c (job_change_state): Change the event pattern to be one that includes the job name and a description of the transition instead of the new state. (job_detect_idle): Call event_queue rather than event_queue_edge. * init/tests/test_job.c: Update. * init/cfgfile.c (cfg_job_stanza): Drop "when" and "while". * init/tests/test_cfgfile.c (test_read_job): Drop mentions of "when" and "while". * init/control.c (control_send, control_handle): Drop cases for level events. (control_handle_event): Don't include a level in the event. * init/tests/test_control.c: Update * init/main.c: Call event_queue rather than event_queue_edge. * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Change event handling so that only a name is read. * upstart/control.h: Remove value/level event structures. * upstart/tests/test_control.c (test_messages): Update. * upstart/job.c (process_state_name): Not used for events, adjust documentation so it doesn't lie. * util/initctl.c (main): Drop the set function, simplify trigger. * util/shutdown.c (shutdown_now): Call UPSTART_EVENT_QUEUE for shutdown into maintenance mode. * init/control.c (control_handle): Place a message in the syslog before halting, powering off or rebooting. * util/shutdown.c: Adjust so that the warning message is sent out if shutdown is immediate, and when it actually happens. Include the hostname as wall does. 2006-08-30 Scott James Remnant * TODO: Update. * util/shutdown.c: Implement shutdown utility along the same lines as the sysvinit one, but with rather different code. * util/initctl.c (main): Call setuid on the effective user id so that we can be made setuid root and executable by a special group. * util/reboot.c (main): Likewise. * util/initctl.c (main): Check the effective rather than the real user id, if we're effectively root, that's good enough. * util/reboot.c: Implement reboot/halt/poweroff utility. * util/Makefile.am (sbin_PROGRAMS): Build and install reboot (reboot_SOURCES, reboot_LDFLAGS, reboot_LDADD): Details for reboot (install-exec-local): Create hardlinks to reboot for halt and poweroff. 2006-08-29 Scott James Remnant * init/main.c (main): Actually run the idle-detect function. * init/job.c (job_detect_idle): Interrupt the main loop, otherwise we may end up waiting for a signal before we process the event we just issued. 2006-08-27 Scott James Remnant * util/shutdown.c: Template main function. * util/Makefile.am (sbin_PROGRAMS): Build and install the shutdown binary. (shutdown_SOURCES, shutdown_LDFLAGS, shutdown_LDADD): Details for the shutdown binary * util/initctl.c (main): Add commands for halt, poweroff and reboot. * init/event.c (event_queue_run): Remove the parameters. * init/event.h: Update. * init/main.c (main): Update. * init/tests/test_control.c (test_watcher): Update. * init/tests/test_job.c (test_detect_idle): Update. * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Deal with halting, rebooting and powering off; or at least the appropriate messages. * upstart/control.h: Add control message structures for halting, powering off and rebooting the machine. * upstart/tests/test_control.c (test_messages): Run the tests. * init/control.c (control_handle): Add handling for halt, power off and reboot that issue the shutdown event and arrange for the halt, poweroff or reboot to be issued the next time the system is idle. * init/tests/test_control.c (test_watcher): Test the events. * TODO: Update. * init/job.c (job_detect_idle): Function to detect when the system is stalled or idle. * init/job.h: Update * init/tests/test_job.c (test_detect_idle): Test the new function. * util/initctl.c (main): Handle the list command. * TODO: Update. * upstart/control.c (WireJobStatusPayload): add description to the job status payload. (upstart_send_msg_to, upstart_recv_msg): Send and receieve the description over the wire. * upstart/control.h (UpstartJobStatusMsg): add a description field * upstart/tests/test_control.c: Update test cases. * init/control.c (control_handle): Include the job description in the message. (control_send): Copy the description when we put the message on the queue. (control_handle_job): Copy the description here too * init/tests/test_control.c: Update test cases. * init/job.c (job_list): Add a function to return the job list. * init/job.h: Update. * init/control.c (control_handle): Handle the JOB_LIST message by sending back a list of job status messages followed by the JOB_LIST_END message. * init/tests/test_control.c (test_watcher_child): Check the JOB_LIST message works properly. * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Handle the JOB_LIST and JOB_LIST_END messages which have no payload. * upstart/control.h: Add enums and structures for job list messages. * upstart/tests/test_control.c (test_messages): Update tests. * init/main.c (main): Check that we're both uid and process #1 * init/main.c (main): Stop handling SIGTERM, we never want people to kill init. Handle SIGINT and SIGWINCH through the ordinary handler and SIGSEGV through a direct handler. (segv_handler): Write a sensible core dump handler, we use a child to dump core while we carry on in the parent hopefully stepping over the bad instruction. (cad_handler): Generate the control-alt-delete event. (kbd_handler): Generate the kbdrequest event. 2006-08-25 Scott James Remnant * configure.ac: Bump version to 0.1.2 * NEWS: Update. * TODO: Update. * init/process.c (process_setup_environment): Inherit the PATH and TERM environment variables from the init process, so the console works properly. * init/process.h (PATH): Declare a default value for this variable * init/main.c (main): Set the value of PATH to the default. * init/tests/test_process.c (child): Update test case. * NEWS: Update. * configure.ac: Bump version to 0.1.1 2006-08-24 Scott James Remnant * init/cfgfile.h (CFG_DIR): Change configuration directory to /etc/event.d -- it's not been used by anyone, but is similar to other directories that have which is a good precedent. * event.d/Makefile.am (eventdir, dist_event_DATA): Install files into the new directory name. * Makefile.am (SUBDIRS): Rename sub directory * configure.ac (AC_CONFIG_FILES): Rename generated Makefile * init/Makefile.am (DEFAULT_INCLUDES): Set to include the right directories so out of tree builds work. * logd/Makefile.am (DEFAULT_INCLUDES): Set to include the right directories so out of tree builds work. * upstart/Makefile.am (DEFAULT_INCLUDES): Set to include the right directories so out of tree builds work. (upstartinclude_HEADERS): Install errors.h * util/Makefile.am (DEFAULT_INCLUDES): Set to include the right directories so out of tree builds work. * Makefile.am (SUBDIRS): Add m4 to the list * configure.ac (AC_CONFIG_FILES): Generate m4/Makefile * upstart/Makefile.am (upstartinclude_HEADERS): Add errors.h * upstart/control.c (upstart_open): * init/control.c (control_open): Raise the error before performing other actions so errno is not lost. * TODO: Update.o * init/cfgfile.c (cfg_next_token): Don't count quote characters unless we're actually planning to dequote the file, otherwise we end up allocating short. * init/control.c (control_close): Free the io_watch using list_free in case a destructor has been set. * init/tests/test_control.c: Initialise the type of the message, and free job correctly. * upstart/tests/test_control.c: Fix overwrite of buffer. * init/tests/test_job.c: Clean up not-freed job. 2006-08-23 Scott James Remnant * init/tests/test_event.c: free the entry allocated and initialise the return values. * init/cfgfile.c (cfg_skip_token): Drop this function; we'll make sure *pos is pointing at the start of the thing we want to parse, not the first token. Update the other functions accordingly. (cfg_read_job): Implement function to look over a job file and parse all of the stanzas that are found. Also sanity checks the job afterwards and deals with reloading existing jobs. (cfg_job_stanza): Function that parses an individual stanza, calling out to the other parse functions; this is the main config file parser! (cfg_parse_args, cfg_parse_command): Drop requirement that filename and lineno be passed, so we can be called to reparse arguments after we've already done so. (cfg_parse_script): Remove requirement that it be called at the start of the entire stanza, and instead at the start of the script. When hitting EOF, return the script so far, not NULL. (cfg_parse_args): Correct bug where we didn't check sufficient characters while skipping whitespace. (cfg_next_token): Correct bug where we didn't copy the character after a slash into the text, instead of just not copying the slash. Adjust line numbers to match the fact that it's zero based now. * init/cfgfile.h: Define prototype. * init/tests/test_cfgfile.c (test_read_job): Pretty thoroughly test the config file parser code. 2006-08-22 Scott James Remnant * init/cfgfile.c (cfg_tokenise): Rename to cfg_next_token. (cfg_skip_token): Code to skip whitespace, token and whitespace. (cfg_parse_args): Function to parse an argument list. (cfg_next_token): Extend to support the removal of quotes and slashes from the token. * init/cfgfile.c (cfg_parse_script): Pass filename and lineno and increment the latter as we go. (cfg_script_end): Pass and increment lineno. * init/cfgfile.c: Correct a missing semi-colon in prototypes. (cfg_parse_command): Function to parse any stanza that requires a command and arguments list, e.g. exec/respawn/daemon. We don't want to require that the list be quoted, etc. and do want to allow it to be folded over lines. (cfg_tokenise): Function used by the above to tokenise the file, handling things like \, quoted strings and newlines, etc. Can be used both to determine the length of the token and to copy it. * init/cfgfile.c (cfg_read_script): Rename to cfg_parse_script. * init/cfgfile.c (cfg_read_script): Function to parse a script fragment ("foo script\n....end script\n") from the job file, which is the most complex form we can find. Write it assuming the file is in a character array which may not be NULL terminated (ie. a mmap'd file). (cfg_script_end): Used by the above to detect the end of the fragment. * init/cfgfile.h: Empty header file. * init/Makefile.am (init_SOURCES): Build and link cfgfile.c using the cfgfile.h header (TESTS): Build and run the config file test cases. (test_cfgfile_SOURCES, test_cfgfile_LDFLAGS, test_cfgfile_LDADD): Details for config file test case binary. * init/main.c (main): Remove the calls to the unfinished config file code. 2006-08-21 Scott James Remnant * init/main.c: Add missing include for unistd.h * init/process.c (process_setup_console): Drop use of job. * util/initctl.c (main): Check that we're run as root. * init/main.c (main): Write the main function * init/event.c (event_queue_cb): Rename to event_queue_run. * init/event.h: Update. * init/process.c (process_setup_console): Become an exported function that includes the code to reset a console. 2006-08-19 Scott James Remnant * logd/main.c (main): Write the basic main function. * util/initctl.c (main): Fill in the details to give us a basic test client. * TODO: Update. * util/initctl.c (main): Provide the most basic main function. * util/Makefile.am (sbin_PROGRAMS): Build the initctl binary * Makefile.am (SUBDIRS): Build the utilities. * configure.ac (AC_CONFIG_FILES): Generate the util Makefile. 2006-08-18 Scott James Remnant * init/Makefile.am (test_job_LDADD): Remove the duplicate link. * TODO: Update. * init/job.c (job_handle_child): Rename to job_child_reaper. * init/job.h: Update. * init/tests/test_job.c: Update function names. * init/control.c (control_cb): Rename to control_watcher * init/tests/test_control.c: Update function names. * TODO: Update. * Makefile.am (SUBDIRS): Install the rc.d files. * configure.ac (AC_CONFIG_FILES): Generate the rc.d Makefile. * rc.d/Makefile.am (rcdir): Define rcdir to be /etc/rc.d (dist_rc_DATA): Install the logd file into that directory. * rc.d/logd: Write a simple service definition for the log daemon, this saves us hardcoding any information about it into init; it'll just need to know the name. * Makefile.am (SUBDIRS): Build the logd daemon * configure.ac (AC_CONFIG_FILES): Generate the logd Makefile. * logd/Makefile.am (sbin_PROGRAMS): Install the logd binary into the sbin directory by default. (logd_SOURCES): Build and link main.c * logd/main.c (main): Add basic main function for testing purposes. 2006-08-16 Scott James Remnant * init/job.c (job_start): Ignore self-dependencies; over-document why the dependency event prodding has a surprise in its tail. (job_change_state): Move the job_release_depends call to here. * init/event.c (event_queue_cb): Add event consumer/dispatcher. * init/event.h: Update. * init/control.c (control_send): Make the event code clearer. (control_handle): Handle the changed event semantics. (control_handle_event): Issue the new event type. * init/tests/test_control.c: Update tests. * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Adjust marshal code to match. * upstart/control.h: Update all structures appropriately to the previous changes. * upstart/tests/test_control.c: Update. * init/job.c (job_change_state): Change call to event_trigger_level to event_queue_level. * init/event.c (event_trigger_edge, event_trigger_level): Place the event on the event_queue rather than directly triggering it. Rename to event_queue_edge and event_queue_level respectively. * init/event.h: Update. * init/tests/test_event.c: Update test cases. * init/job.c (job_handle_event): Add another sanity check, jobs should not be able to react to their own events; that's just silly. * init/tests/test_job.c (test_handle_event): Check that the new condition does the right thing. * init/job.c (job_change_state): Make it illegal for a job to exist without either a command or script or both. This is for sanity reasons, allowing no primary process makes no sense and can lead to event loops if someone is feeling nefarious. * init/tests/test_job.c (test_change_state): Drop test on behaviour we've just outlawed. * init/job.c (job_start): Only announce the change if we're still in the waiting state, we could have moved on to running already. * init/job.c (job_start): If holding the job, at least announce the goal change to subscribed clients. * TODO: Update. * init/job.c (job_start): Check for dependencies before starting the process, if we have any that aren't running we stay in waiting until they are. Any that aren't even starting get poked with a dependency event to see whether that wakes them up. * init/tests/test_job.c (test_start): Test paths through new dependency code. * init/job.c (job_run_process): Once we've got an active process in the running state, release our dependencies. * init/job.c (job_release_depends): Function to release any waiting dependencies on the given job. * init/job.h: Update. * init/tests/test_job.c (test_release_depends): Test the behaviour of the function on its own. * init/job.h (Job): Add depends list field (JobName): New structure to hold the name of a job. * init/job.c (job_new): Initialise the depends list. * init/tests/test_job.c (test_new): Make sure the depends list is initialised properly. * init/job.c (job_next_state): Return JOB_STARTING if we're in JOB_WAITING and the goal is JOB_START. This is only called when there's some change, and I don't want to hard-code the goal there. (job_start): Don't hardcode JOB_STARTING, instead just use the next state. * init/tests/test_job.c (test_next_state): Adjust test case. * init/control.c (control_subscribe): Allow the current subscription to be found by passing NOTIFY_NONE. (control_handle): Don't remove an existing subscription to jobs, a GUI will probably want a permanent one to keep the status up to date. * init/job.c (job_kill_process, job_kill_timer): Don't hardcode JOB_STOPPING here, instead move to the next logical state. (job_kill_process): Notify subscribed processes that we killed the job. (job_start, job_stop): Notify subscribed processes of a change of goal that doesn't result in an immediate state change. * init/event.c (event_trigger_edge, event_trigger_level): Swap order so that events are announced before processed. * init/control.c (control_handle): Handle requests to watch and unwatch jobs and events. * init/tests/test_control.c (test_cb_child, test_cb): Check that subscriptions work. * init/tests/test_control.c (test_cb_child): Add a sleep to avoid a race that upsets gdb, have tried this with a STOP/CONT interlock but can't seem to find where the child should reach first. * init/job.c (job_change_state): Notify the control handler. * init/event.c (event_trigger_edge, event_trigger_level): Pass event to the control handler. * init/tests/test_control.c (test_cb_child): Expect to receive job status events as well. * init/Makefile.am (test_event_LDADD, test_process_LDADD) (test_job_LDADD): Add control.o to the linkage. * init/control.c (control_cb): Don't display an error for ECONNREFUSED, just remove any subscriptions. * init/tests/test_control.c (test_handle_job, test_handle_error): Clean up our subscriptions properly. * init/control.c (control_handle_job): Function to send out an UPSTART_JOB_STATUS message to subscribed processes whenever a job state changes. (control_handle_event): Function to send out an UPSTART_EVENT_TRIGGERED message to subscribed processes whenever an event is triggered. * init/control.h: Update. * init/tests/test_control.c (test_handle_job, test_handle_event): Check that the functions work properly. * init/control.c (control_handle): Handle messages that trigger edge and level events; subscribe the process to receive notification of job changes during the event. * init/tests/test_control.c (test_cb_child): Check that the messages are handled properly (without subscription check). * init/control.c (control_cb): Unsubscribe a process if it stops listening. * init/control.c (control_send): Copy the pointers in the new event messages. * init/tests/test_control.c (test_send): Check the pointers are copied across correctly. * init/control.c (control_subscribe): Add function to handle processes that want to subscribe to changes. (control_init): Initialise the subscriptions list. * init/control.h: Add structures and prototypes. * init/tests/test_control.c (test_subscribe): Test the function. * upstart/control.h (UpstartMsgType): add messages for triggering edge and level events, receiving the trigger for an event and for watching jobs and events. (UpstartEventTriggerEdgeMsg, UpstartEventTriggerLevelMsg) (UpstartEventTriggeredMsg, UpstartWatchJobsMsg) (UpstartUnwatchJobsMsg, UpstartWatchEventsMsg): (UpstartUnwatchEventsMsg): Add structures for the new messages. (UpstartMsg): And add them to the union. * upstart/control.c (WireEventPayload): The event messages can all share a wire payload type; the watch messages don't need any special payload. (upstart_send_msg_to): Add the payloads onto the wire. (upstart_recv_msg): And take the payloads back off the wire. * upstart/tests/test_control.c (test_messages): Test the new message types. * upstart/control.h (UpstartJobStatusMsg): add a process id. * upstart/control.c (WireJobStatusPayload): and here too. (upstart_send_msg_to): copy the process id onto the wire. (upstart_recv_msg): copy the process id from the wire. * init/control.c (control_handle): Fill in the pid from the job. * upstart/tests/test_control.c (test_messages): Check the pid gets passed across the wire properly. * init/control.c (control_cb): Disable the poll for write once the send queue becomes empty. * upstart/Makefile.am (libupstart_la_SOURCES): Correct ordering. * init/control.c (control_handle): Add missing break. * upstart/job.c (job_goal_name, process_state_name): For completeness add these two functions as well. * upstart/job.h: Update. * upstart/tests/test_job.c (test_goal_name) (test_process_state_name): Test the new functions. * init/job.c (job_state_name): Move this utility function from here * upstart/job.c (job_state_name): to here so all clients can use it. * init/job.h: Update. * upstart/job.h: Update. * init/tests/test_job.c (test_state_name): Move the test case from here * upstart/tests/test_job.c: to here as well. * upstart/Makefile.am (libupstart_la_SOURCES): Build and link job.c (TESTS): Run the job test cases (test_job_SOURCES, test_job_LDFLAGS, test_job_LDADD): Details for job test case binary. * init/Makefile.am (test_job_LDADD, test_process_LDADD) (test_event_LDADD): Link to libupstart.la * init/control.c: Code to handle the server end of the control socket, a bit more complex than a client as we want to avoid blocking on malcious clients. * init/control.h: Prototypes. * init/tests/test_control.c: Test the control code. * init/Makefile.am (init_SOURCES): Build and link control.c using the control.h header (init_LDADD): Link to libupstart as well (TESTS): Build and run the control test suite. (test_control_SOURCES, test_control_LDFLAGS, test_control_LDADD): Details for control test suite binary. * upstart/control.c: Add a way to disable the safety checks. * upstart/tests/test_control.c (test_free): Fix bad test case. * upstart/control.c (upstart_recv_msg): fixed bogus return type for recvmsg from size_t to ssize_t so we don't infiniloop on error. * upstart/control.c (upstart_send_msg_to, upstart_recv_msg): Avoid job_start as the short-cut for assigning name, as that might become a more complex message eventually. Use job_query instead. * upstart/control.c (upstart_free): Add wrapper function around nih_free so we're a proper library and don't expose libnih too much (upstart_recv_msg): Stash the sender pid in an argument. * upstart/control.h: Update. * upstart/tests/test_control.c (test_recv_msg): Test pid is returned properly. (test_free): Test the nih_free wrapper. * init/job.c (job_run_script): Document future FIXME. * init/exent.h, init/job.h, init/process.h: Fix up headers. * upstart/control.c, upstart/control.h, upstart/errors.h, upstart/job.h, upstart/libupstart.h: Fix up headers. * upstart/control.c: Write the code to handle the control socket and communication over it; turns out this was possible to write so that both ends are handled in the same code. * upstart/control.h: Structures and prototypes. * upstart/tests/test_control.c: Test the new code. * upstart/Makefile.am (libupstart_la_LIBADD): Link to libnih * upstart/errors.h: Header file containing errors raised by libupstart. * upstart/libupstart.h: Include errors.h 2006-08-15 Scott James Remnant * init/event.h: Add missing attribute for event_new() * init/job.h (JobGoal, JobState, ProcessState, ConsoleType): Move the enums from here * upstart/job.h: into here so that we can use them across the control socket. * Makefile.am (SUBDIRS): Build the libupstart library * configure.ac (AC_CONFIG_FILES): Generate upstart/Makefile * upstart/Makefile.am: Makefile for sub-directory * upstart/libupstart.ver: Linker version script. * upstart/libupstart.h: "Include everything" header file. * TODO: Update. * init/job.c (job_handle_child): Warn when processes are killed or exit with an abnormal status. Warn when respawning. * init/job.c (job_handle_child): Respawn processes that were not supposed to have died. * init/tests/test_job.c (test_handle_child): Test the respawn code. * TODO: Update. * init/event.c (event_trigger_edge, event_trigger_level): Call job_handle_event so that we actually do something useful. * init/Makefile.am (test_event_LDADD): Link to process.o and job.o now that event.c calls code from job. * init/job.c (job_start_event): Function to start a job if an event matches. (job_stop_event): Function to stop a job if an event matches. (job_handle_event): Iterate the job list and dispatch the given event, causing jobs to be stopped or started using the above two functions. * init/job.h: Update. * init/tests/test_job.c: Test the new functions. * init/job.c (job_new): Initialise start_events and stop_events to an empty list. * init/job.h (Job): Add start_events and stop_events list heads. * init/tests/test_job.c (test_new): Check the lists are initialised correctly to the empty list. * init/event.c (event_match): Function to check events for equality. * init/event.h: Update. * init/tests/test_event.c (test_match): Test function. * init/job.c (job_change_state): Trigger the level event with the same name as the job, with the value taken from the state. * init/tests/test_job.c (test_change_state): Check the event gets set to the right values as we go. * init/Makefile.am (test_job_LDADD, test_process_LDADD): Link to event.o now that job.c uses code from there. * init/event.c (event_change_value): Rename event_set_value to this as we intended in the first place; makes it more consistent with job. Always change the value. (event_trigger_edge): Add a high-level function to trigger an edge event. (event_trigger_level): And another to trigger a level event with a given value, this inherits the "don't change it" functionality that was in event_set_value. * init/event.h: Update. * init/tests/test_event.c: Test new behaviours and functions. * init/event.c: Add simple code to keep track of events, whether they have been recorded or not and their current value if any. * init/event.h: Structures and prototypes. * init/tests/test_event.c: Test cases for event code. * init/Makefile.am (init_SOURCES): Build and link event.c using event.h (TESTS): Run the event test suite. (test_event_SOURCES, test_event_LDFLAGS, test_event_LDADD): Details for event test suite binary. * init/job.c (job_run_process, job_kill_process, job_kill_timer): Downgrade error messages to warning as they're not fatal. (job_change_state): Change info message to be more regular. * init/job.c (job_start): A very simple, but very necessary, function. Set the goal of the given job to JOB_START and kick it off. (job_stop): And its companion, cause a running job to be stopped. * init/job.h: Update. * init/tests/test_job.c: Test the functions. * init/job.c (job_handle_child): Child handler to kick jobs into the next state when their process dies. * init/job.h: Update. * init/tests/test_job.c (test_handle_child): Test the handler directly by just invoking it with various job states. 2006-08-14 Scott James Remnant * init/tests/test_process.c (test_kill): Use select rather than poll for consistency with other test cases. * init/job.c (job_kill_process): Add function to send the active process of a job the TERM signal, and then set a timer to follow up with the KILL signal if the job doesn't get cleaned up in time. (job_kill_timer): Timer callback to send the KILL signal; this does the same job as the child handler and puts the job into the next state as there's no point waiting around now. * init/job.h: Update. * init/tests/test_job.c (test_kill_process): Test both functions in one test case (as one is just the bottom half of the other). * init/tests/test_process.c (test_spawn): Use the right thing in the test case filename and unlink it to make sure. * init/job.c (job_change_state): Write the principal state gate function, called once a state has been left to enter the given new state (which one should determine with job_next_state). Spawns the necessary processes or moves to the next appropriate state. * init/job.h: Update. * init/tests/test_job.c: Test the state changes. * init/job.c (job_run_process): Internal function to call process_spawn and update the job structure. (job_run_command): Simple(ish) wrapper for the above to split a command by whitespace, or use a shell if it needs more complex argument processing. (job_run_script): More complex wrapper that uses a shell to execute verbatim script, either using -c or a /dev/fd/NN and feeding the shell down a pipe to it. * init/job.h: Update. * init/tests/test_job.c: Test the new functions. * init/Makefile.am (init_SOURCES, TESTS): Reorder so that process.c, which is arguably lower level, comes first. (test_job_LDADD): Link the process code. (test_process_LDADD): Swap the order. * TODO: Update. * init/process.c (process_spawn): Correct typo (progress -> process), thanks Johan. 2006-08-12 Scott James Remnant * init/process.c (process_spawn): Correct formatting of function. * init/process.h (SHELL): Define the location of the shell, all in the spirit of not hard-coding stuff like this. * init/job.c (job_new): Initialise all structure members to zero as this doesn't happen automatically. 2006-08-10 Scott James Remnant * init/job.h (job_state_name): Declare as a const function. 2006-08-09 Scott James Remnant * init/job.c (job_next_state): State transition logic; this uses our departure from the specification (the goal) so that the state can always be currently accurate rather than suggestive. (job_state_name): Cute function to convert enum into a name. * init/job.h: Update. * init/tests/test_job.c (test_next_state): Test the transitions. (test_state_name): And the return values. * TODO: Add file to keep track of things. * init/job.c: Include nih/macros.h and nih/list.h * init/process.c: Include order fixing, include nih/macros.h * init/tests/test_job.c: Include nih/macros.h and nih/list.h * init/tests/test_process.c: Include nih/list.h * init/job.c: Include order fixing. (job_find_by_name): Function to find a job by its (unique) name. (job_find_by_pid): Function to find a job by the pid of its process. * init/job.h: Update. * init/tests/test_job.c (test_find_by_name, test_find_by_pid): Test new functions. * init/process.c (process_spawn): Spawn a process using the job details to set up the environment, etc. (process_setup_console): Set up the console according to the job. (process_setup_limits): Set up the limits according to the job. (process_setup_environment): Set up the environment according to the job. (process_kill): Simple function to send a kill signal or raise an error; mostly just a wrapper without any particular logic. * init/process.h: Prototypes and macros. * init/tests/test_process.c: Test cases. * init/Makefile.am (init_SOURCES): Build and link process.c and its header file. (TESTS): Run the process test suite. (test_process_SOURCES, test_process_LDFLAGS, test_process_LDADD): Details for process test sutie binary. 2006-08-08 Scott James Remnant * init/job.c (job_new): nih_list_free is necessary. * init/tests/test_job.c (test_new): Free job when done. * init/job.h: Header file to contain the definition of the Job structure and associated typedefs, etc. (JobGoal): In a divergence from the specification, we introduced a "goal" for a job which tells us which way round the state machine we're going (towards start, or towards stop). (JobState): Which means this always holds the current state, even if we're trying to get out of this state (ie. if we've sent the TERM signal to the running process, we're still in the running state until it's actually been reaped). (ProcessState): And in another divergence, we keep the state of the process so we know whether we need to force a state transition or can just expect one because something transient is happening. * init/job.c (job_new): Function to allocate a Job structure, set the pointers to NULL and other important members to sensible defaults. (job_init): Initialise the list of jobs. * init/tests/test_job.c: Test suite. * init/Makefile.am (init_SOURCES): Compile and link job.c using its header file. (TESTS): Run the job test suite. (test_job_SOURCES, test_job_LDFLAGS, test_job_LDADD): Details for the job test suite binary. 2006-08-02 Scott James Remnant * configure.ac: Check for C99 * HACKING: Document dependency on libnih. 2006-07-27 Scott James Remnant * init/Makefile.am (DEFS): Append to the default DEFS list, rather than overriding, otherwise we lose HAVE_CONFIG_H 2006-07-13 Scott James Remnant * HACKING: Correct incorrect Bazaar URL. * AUTHORS: Change e-mail address to ubuntu.com. * HACKING: Update Bazaar and Release URLS. * configure.ac (AC_COPYRIGHT): Change copyright to Canonical Ltd. (AC_INIT): Change bug submission address to Launchpad. * init/main.c: Update header to use Canonical copyright and credit me as author. 2006-05-16 Scott James Remnant * init/main.c: Add the simplest template main.c * init/Makefile.am: Add template Makefile.am that builds init from main.c and links to libnih statically * configure.ac (AC_CONFIG_FILES): Configure nih and init subdirs. * Makefile.am (SUBDIRS): Recurse into nih and init subdirs. 2006-05-14 Scott James Remnant * ChangeLog: Initial project infrastructure created. upstart-1.13.2/config.sub0000755000175000017500000010563412373101367012220 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-05-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: upstart-1.13.2/util/0000775000175000017500000000000012402042412011247 500000000000000upstart-1.13.2/util/sysv.h0000664000175000017500000000202012373101356012350 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef UTIL_SYSV_H #define UTIL_SYSV_H #include NIH_BEGIN_EXTERN int sysv_change_runlevel (int runlevel, char * const *env, const char *utmp_file, const char *wtmp_file) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* UTIL_SYSV_H */ upstart-1.13.2/util/Makefile.in0000664000175000017500000020416112402042375013250 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = initctl$(EXEEXT) reboot$(EXEEXT) runlevel$(EXEEXT) \ shutdown$(EXEEXT) telinit$(EXEEXT) TESTS = test_initctl$(EXEEXT) test_utmp$(EXEEXT) test_sysv$(EXEEXT) \ test_telinit$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) @ENABLE_CGROUPS_TRUE@am__append_1 = $(CGMANAGER_LIBS) subdir = util DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(dist_man_MANS) \ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = test_initctl$(EXEEXT) test_utmp$(EXEEXT) \ test_sysv$(EXEEXT) test_telinit$(EXEEXT) am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man7dir)" \ "$(DESTDIR)$(man8dir)" PROGRAMS = $(sbin_PROGRAMS) am_initctl_OBJECTS = initctl.$(OBJEXT) xdg.$(OBJEXT) am__objects_1 = com.ubuntu.Upstart.$(OBJEXT) am__objects_2 = com.ubuntu.Upstart.Job.$(OBJEXT) am__objects_3 = com.ubuntu.Upstart.Instance.$(OBJEXT) nodist_initctl_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) initctl_OBJECTS = $(am_initctl_OBJECTS) $(nodist_initctl_OBJECTS) am__DEPENDENCIES_1 = initctl_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_reboot_OBJECTS = reboot.$(OBJEXT) utmp.$(OBJEXT) reboot_OBJECTS = $(am_reboot_OBJECTS) reboot_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_runlevel_OBJECTS = runlevel.$(OBJEXT) utmp.$(OBJEXT) runlevel_OBJECTS = $(am_runlevel_OBJECTS) runlevel_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_shutdown_OBJECTS = shutdown.$(OBJEXT) utmp.$(OBJEXT) sysv.$(OBJEXT) nodist_shutdown_OBJECTS = $(am__objects_1) shutdown_OBJECTS = $(am_shutdown_OBJECTS) $(nodist_shutdown_OBJECTS) shutdown_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_telinit_OBJECTS = telinit.$(OBJEXT) utmp.$(OBJEXT) sysv.$(OBJEXT) nodist_telinit_OBJECTS = $(am__objects_1) $(am__objects_3) telinit_OBJECTS = $(am_telinit_OBJECTS) $(nodist_telinit_OBJECTS) telinit_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_initctl_OBJECTS = test_initctl-test_initctl.$(OBJEXT) \ test_initctl-initctl.$(OBJEXT) test_initctl-xdg.$(OBJEXT) test_initctl_OBJECTS = $(am_test_initctl_OBJECTS) @ENABLE_CGROUPS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) test_initctl_DEPENDENCIES = com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) test_initctl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_initctl_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_sysv_OBJECTS = test_sysv.$(OBJEXT) nodist_test_sysv_OBJECTS = $(am__objects_1) test_sysv_OBJECTS = $(am_test_sysv_OBJECTS) \ $(nodist_test_sysv_OBJECTS) test_sysv_DEPENDENCIES = sysv.o utmp.o $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_test_telinit_OBJECTS = test_telinit-test_telinit.$(OBJEXT) \ test_telinit-telinit.$(OBJEXT) test_telinit_OBJECTS = $(am_test_telinit_OBJECTS) test_telinit_DEPENDENCIES = sysv.o utmp.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) test_telinit_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_telinit_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_utmp_OBJECTS = test_utmp.$(OBJEXT) test_utmp_OBJECTS = $(am_test_utmp_OBJECTS) test_utmp_DEPENDENCIES = utmp.o $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(initctl_SOURCES) $(nodist_initctl_SOURCES) \ $(reboot_SOURCES) $(runlevel_SOURCES) $(shutdown_SOURCES) \ $(nodist_shutdown_SOURCES) $(telinit_SOURCES) \ $(nodist_telinit_SOURCES) $(test_initctl_SOURCES) \ $(test_sysv_SOURCES) $(nodist_test_sysv_SOURCES) \ $(test_telinit_SOURCES) $(test_utmp_SOURCES) DIST_SOURCES = $(initctl_SOURCES) $(reboot_SOURCES) \ $(runlevel_SOURCES) $(shutdown_SOURCES) $(telinit_SOURCES) \ $(test_initctl_SOURCES) $(test_sysv_SOURCES) \ $(test_telinit_SOURCES) $(test_utmp_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) AM_CPPFLAGS = \ -DLOCALEDIR="\"$(localedir)\"" \ -DSBINDIR="\"$(sbindir)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ -I$(top_srcdir)/intl \ -I$(top_srcdir)/test -iquote $(top_srcdir)/test dist_man_MANS = \ man/initctl.8 \ man/reboot.8 \ man/shutdown.8 \ man/runlevel.8 \ man/telinit.8 \ man/runlevel.7 initctl_SOURCES = \ initctl.c initctl.h \ $(top_srcdir)/init/xdg.c $(top_srcdir)/init/xdg.h nodist_initctl_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) initctl_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) reboot_SOURCES = \ reboot.c \ utmp.c utmp.h reboot_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) runlevel_SOURCES = \ runlevel.c \ utmp.c utmp.h runlevel_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) shutdown_SOURCES = \ shutdown.c \ utmp.c utmp.h \ sysv.c sysv.h nodist_shutdown_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) shutdown_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) telinit_SOURCES = \ telinit.c \ utmp.c utmp.h \ sysv.c sysv.h nodist_telinit_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) telinit_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) com_ubuntu_Upstart_OUTPUTS = \ com.ubuntu.Upstart.c \ com.ubuntu.Upstart.h com_ubuntu_Upstart_XML = \ ../dbus/com.ubuntu.Upstart.xml com_ubuntu_Upstart_Job_OUTPUTS = \ com.ubuntu.Upstart.Job.c \ com.ubuntu.Upstart.Job.h com_ubuntu_Upstart_Job_XML = \ ../dbus/com.ubuntu.Upstart.Job.xml com_ubuntu_Upstart_Instance_OUTPUTS = \ com.ubuntu.Upstart.Instance.c \ com.ubuntu.Upstart.Instance.h com_ubuntu_Upstart_Instance_XML = \ ../dbus/com.ubuntu.Upstart.Instance.xml # These have to be built sources because we can't compile object files # without the header file existing first BUILT_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) CLEANFILES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) EXTRA_DIST = util.supp # Ensure a clean test environment (that will not touch the running users # one). Tests that need the variables listed below are expected to set # them to appropriate temporary values as needed. AM_TESTS_ENVIRONMENT = \ unset -v \ XDG_RUNTIME_DIR \ DBUS_SESSION_BUS_ADDRESS \ UPSTART_SESSION \ UPSTART_INSTANCE \ UPSTART_EVENTS \ UPSTART_JOB; @ENABLE_TAP_OUTPUT_FALSE@LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver @ENABLE_TAP_OUTPUT_TRUE@LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh test_initctl_SOURCES = \ tests/test_initctl.c \ initctl.c \ $(top_srcdir)/init/xdg.c $(top_srcdir)/init/xdg.h test_initctl_CFLAGS = $(AM_CFLAGS) -DTEST test_initctl_LDADD = com.ubuntu.Upstart.o com.ubuntu.Upstart.Job.o \ com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(am__append_1) test_utmp_SOURCES = tests/test_utmp.c test_utmp_LDADD = \ utmp.o \ $(NIH_LIBS) test_sysv_SOURCES = tests/test_sysv.c nodist_test_sysv_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) test_sysv_LDADD = \ sysv.o utmp.o \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) test_telinit_SOURCES = tests/test_telinit.c telinit.c test_telinit_CFLAGS = $(AM_CFLAGS) -DTEST test_telinit_LDADD = \ sysv.o utmp.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu util/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list initctl$(EXEEXT): $(initctl_OBJECTS) $(initctl_DEPENDENCIES) $(EXTRA_initctl_DEPENDENCIES) @rm -f initctl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(initctl_OBJECTS) $(initctl_LDADD) $(LIBS) reboot$(EXEEXT): $(reboot_OBJECTS) $(reboot_DEPENDENCIES) $(EXTRA_reboot_DEPENDENCIES) @rm -f reboot$(EXEEXT) $(AM_V_CCLD)$(LINK) $(reboot_OBJECTS) $(reboot_LDADD) $(LIBS) runlevel$(EXEEXT): $(runlevel_OBJECTS) $(runlevel_DEPENDENCIES) $(EXTRA_runlevel_DEPENDENCIES) @rm -f runlevel$(EXEEXT) $(AM_V_CCLD)$(LINK) $(runlevel_OBJECTS) $(runlevel_LDADD) $(LIBS) shutdown$(EXEEXT): $(shutdown_OBJECTS) $(shutdown_DEPENDENCIES) $(EXTRA_shutdown_DEPENDENCIES) @rm -f shutdown$(EXEEXT) $(AM_V_CCLD)$(LINK) $(shutdown_OBJECTS) $(shutdown_LDADD) $(LIBS) telinit$(EXEEXT): $(telinit_OBJECTS) $(telinit_DEPENDENCIES) $(EXTRA_telinit_DEPENDENCIES) @rm -f telinit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telinit_OBJECTS) $(telinit_LDADD) $(LIBS) test_initctl$(EXEEXT): $(test_initctl_OBJECTS) $(test_initctl_DEPENDENCIES) $(EXTRA_test_initctl_DEPENDENCIES) @rm -f test_initctl$(EXEEXT) $(AM_V_CCLD)$(test_initctl_LINK) $(test_initctl_OBJECTS) $(test_initctl_LDADD) $(LIBS) test_sysv$(EXEEXT): $(test_sysv_OBJECTS) $(test_sysv_DEPENDENCIES) $(EXTRA_test_sysv_DEPENDENCIES) @rm -f test_sysv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_sysv_OBJECTS) $(test_sysv_LDADD) $(LIBS) test_telinit$(EXEEXT): $(test_telinit_OBJECTS) $(test_telinit_DEPENDENCIES) $(EXTRA_test_telinit_DEPENDENCIES) @rm -f test_telinit$(EXEEXT) $(AM_V_CCLD)$(test_telinit_LINK) $(test_telinit_OBJECTS) $(test_telinit_LDADD) $(LIBS) test_utmp$(EXEEXT): $(test_utmp_OBJECTS) $(test_utmp_DEPENDENCIES) $(EXTRA_test_utmp_DEPENDENCIES) @rm -f test_utmp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_utmp_OBJECTS) $(test_utmp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Instance.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initctl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runlevel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/telinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_initctl-initctl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_initctl-test_initctl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_initctl-xdg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_sysv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_telinit-telinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_telinit-test_telinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdg.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< xdg.o: $(top_srcdir)/init/xdg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xdg.o -MD -MP -MF $(DEPDIR)/xdg.Tpo -c -o xdg.o `test -f '$(top_srcdir)/init/xdg.c' || echo '$(srcdir)/'`$(top_srcdir)/init/xdg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xdg.Tpo $(DEPDIR)/xdg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/init/xdg.c' object='xdg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xdg.o `test -f '$(top_srcdir)/init/xdg.c' || echo '$(srcdir)/'`$(top_srcdir)/init/xdg.c xdg.obj: $(top_srcdir)/init/xdg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xdg.obj -MD -MP -MF $(DEPDIR)/xdg.Tpo -c -o xdg.obj `if test -f '$(top_srcdir)/init/xdg.c'; then $(CYGPATH_W) '$(top_srcdir)/init/xdg.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/init/xdg.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xdg.Tpo $(DEPDIR)/xdg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/init/xdg.c' object='xdg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xdg.obj `if test -f '$(top_srcdir)/init/xdg.c'; then $(CYGPATH_W) '$(top_srcdir)/init/xdg.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/init/xdg.c'; fi` test_initctl-test_initctl.o: tests/test_initctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -MT test_initctl-test_initctl.o -MD -MP -MF $(DEPDIR)/test_initctl-test_initctl.Tpo -c -o test_initctl-test_initctl.o `test -f 'tests/test_initctl.c' || echo '$(srcdir)/'`tests/test_initctl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_initctl-test_initctl.Tpo $(DEPDIR)/test_initctl-test_initctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_initctl.c' object='test_initctl-test_initctl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -c -o test_initctl-test_initctl.o `test -f 'tests/test_initctl.c' || echo '$(srcdir)/'`tests/test_initctl.c test_initctl-test_initctl.obj: tests/test_initctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -MT test_initctl-test_initctl.obj -MD -MP -MF $(DEPDIR)/test_initctl-test_initctl.Tpo -c -o test_initctl-test_initctl.obj `if test -f 'tests/test_initctl.c'; then $(CYGPATH_W) 'tests/test_initctl.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_initctl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_initctl-test_initctl.Tpo $(DEPDIR)/test_initctl-test_initctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_initctl.c' object='test_initctl-test_initctl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -c -o test_initctl-test_initctl.obj `if test -f 'tests/test_initctl.c'; then $(CYGPATH_W) 'tests/test_initctl.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_initctl.c'; fi` test_initctl-initctl.o: initctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -MT test_initctl-initctl.o -MD -MP -MF $(DEPDIR)/test_initctl-initctl.Tpo -c -o test_initctl-initctl.o `test -f 'initctl.c' || echo '$(srcdir)/'`initctl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_initctl-initctl.Tpo $(DEPDIR)/test_initctl-initctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='initctl.c' object='test_initctl-initctl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -c -o test_initctl-initctl.o `test -f 'initctl.c' || echo '$(srcdir)/'`initctl.c test_initctl-initctl.obj: initctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -MT test_initctl-initctl.obj -MD -MP -MF $(DEPDIR)/test_initctl-initctl.Tpo -c -o test_initctl-initctl.obj `if test -f 'initctl.c'; then $(CYGPATH_W) 'initctl.c'; else $(CYGPATH_W) '$(srcdir)/initctl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_initctl-initctl.Tpo $(DEPDIR)/test_initctl-initctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='initctl.c' object='test_initctl-initctl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -c -o test_initctl-initctl.obj `if test -f 'initctl.c'; then $(CYGPATH_W) 'initctl.c'; else $(CYGPATH_W) '$(srcdir)/initctl.c'; fi` test_initctl-xdg.o: $(top_srcdir)/init/xdg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -MT test_initctl-xdg.o -MD -MP -MF $(DEPDIR)/test_initctl-xdg.Tpo -c -o test_initctl-xdg.o `test -f '$(top_srcdir)/init/xdg.c' || echo '$(srcdir)/'`$(top_srcdir)/init/xdg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_initctl-xdg.Tpo $(DEPDIR)/test_initctl-xdg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/init/xdg.c' object='test_initctl-xdg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -c -o test_initctl-xdg.o `test -f '$(top_srcdir)/init/xdg.c' || echo '$(srcdir)/'`$(top_srcdir)/init/xdg.c test_initctl-xdg.obj: $(top_srcdir)/init/xdg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -MT test_initctl-xdg.obj -MD -MP -MF $(DEPDIR)/test_initctl-xdg.Tpo -c -o test_initctl-xdg.obj `if test -f '$(top_srcdir)/init/xdg.c'; then $(CYGPATH_W) '$(top_srcdir)/init/xdg.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/init/xdg.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_initctl-xdg.Tpo $(DEPDIR)/test_initctl-xdg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/init/xdg.c' object='test_initctl-xdg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_initctl_CFLAGS) $(CFLAGS) -c -o test_initctl-xdg.obj `if test -f '$(top_srcdir)/init/xdg.c'; then $(CYGPATH_W) '$(top_srcdir)/init/xdg.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/init/xdg.c'; fi` test_sysv.o: tests/test_sysv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_sysv.o -MD -MP -MF $(DEPDIR)/test_sysv.Tpo -c -o test_sysv.o `test -f 'tests/test_sysv.c' || echo '$(srcdir)/'`tests/test_sysv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_sysv.Tpo $(DEPDIR)/test_sysv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_sysv.c' object='test_sysv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_sysv.o `test -f 'tests/test_sysv.c' || echo '$(srcdir)/'`tests/test_sysv.c test_sysv.obj: tests/test_sysv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_sysv.obj -MD -MP -MF $(DEPDIR)/test_sysv.Tpo -c -o test_sysv.obj `if test -f 'tests/test_sysv.c'; then $(CYGPATH_W) 'tests/test_sysv.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_sysv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_sysv.Tpo $(DEPDIR)/test_sysv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_sysv.c' object='test_sysv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_sysv.obj `if test -f 'tests/test_sysv.c'; then $(CYGPATH_W) 'tests/test_sysv.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_sysv.c'; fi` test_telinit-test_telinit.o: tests/test_telinit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_telinit_CFLAGS) $(CFLAGS) -MT test_telinit-test_telinit.o -MD -MP -MF $(DEPDIR)/test_telinit-test_telinit.Tpo -c -o test_telinit-test_telinit.o `test -f 'tests/test_telinit.c' || echo '$(srcdir)/'`tests/test_telinit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_telinit-test_telinit.Tpo $(DEPDIR)/test_telinit-test_telinit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_telinit.c' object='test_telinit-test_telinit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_telinit_CFLAGS) $(CFLAGS) -c -o test_telinit-test_telinit.o `test -f 'tests/test_telinit.c' || echo '$(srcdir)/'`tests/test_telinit.c test_telinit-test_telinit.obj: tests/test_telinit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_telinit_CFLAGS) $(CFLAGS) -MT test_telinit-test_telinit.obj -MD -MP -MF $(DEPDIR)/test_telinit-test_telinit.Tpo -c -o test_telinit-test_telinit.obj `if test -f 'tests/test_telinit.c'; then $(CYGPATH_W) 'tests/test_telinit.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_telinit.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_telinit-test_telinit.Tpo $(DEPDIR)/test_telinit-test_telinit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_telinit.c' object='test_telinit-test_telinit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_telinit_CFLAGS) $(CFLAGS) -c -o test_telinit-test_telinit.obj `if test -f 'tests/test_telinit.c'; then $(CYGPATH_W) 'tests/test_telinit.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_telinit.c'; fi` test_telinit-telinit.o: telinit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_telinit_CFLAGS) $(CFLAGS) -MT test_telinit-telinit.o -MD -MP -MF $(DEPDIR)/test_telinit-telinit.Tpo -c -o test_telinit-telinit.o `test -f 'telinit.c' || echo '$(srcdir)/'`telinit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_telinit-telinit.Tpo $(DEPDIR)/test_telinit-telinit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='telinit.c' object='test_telinit-telinit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_telinit_CFLAGS) $(CFLAGS) -c -o test_telinit-telinit.o `test -f 'telinit.c' || echo '$(srcdir)/'`telinit.c test_telinit-telinit.obj: telinit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_telinit_CFLAGS) $(CFLAGS) -MT test_telinit-telinit.obj -MD -MP -MF $(DEPDIR)/test_telinit-telinit.Tpo -c -o test_telinit-telinit.obj `if test -f 'telinit.c'; then $(CYGPATH_W) 'telinit.c'; else $(CYGPATH_W) '$(srcdir)/telinit.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_telinit-telinit.Tpo $(DEPDIR)/test_telinit-telinit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='telinit.c' object='test_telinit-telinit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_telinit_CFLAGS) $(CFLAGS) -c -o test_telinit-telinit.obj `if test -f 'telinit.c'; then $(CYGPATH_W) 'telinit.c'; else $(CYGPATH_W) '$(srcdir)/telinit.c'; fi` test_utmp.o: tests/test_utmp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utmp.o -MD -MP -MF $(DEPDIR)/test_utmp.Tpo -c -o test_utmp.o `test -f 'tests/test_utmp.c' || echo '$(srcdir)/'`tests/test_utmp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utmp.Tpo $(DEPDIR)/test_utmp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_utmp.c' object='test_utmp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utmp.o `test -f 'tests/test_utmp.c' || echo '$(srcdir)/'`tests/test_utmp.c test_utmp.obj: tests/test_utmp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utmp.obj -MD -MP -MF $(DEPDIR)/test_utmp.Tpo -c -o test_utmp.obj `if test -f 'tests/test_utmp.c'; then $(CYGPATH_W) 'tests/test_utmp.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_utmp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utmp.Tpo $(DEPDIR)/test_utmp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_utmp.c' object='test_utmp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utmp.obj `if test -f 'tests/test_utmp.c'; then $(CYGPATH_W) 'tests/test_utmp.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_utmp.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man7: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.7[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-man8: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_initctl.log: test_initctl$(EXEEXT) @p='test_initctl$(EXEEXT)'; \ b='test_initctl'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_utmp.log: test_utmp$(EXEEXT) @p='test_utmp$(EXEEXT)'; \ b='test_utmp'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_sysv.log: test_sysv$(EXEEXT) @p='test_sysv$(EXEEXT)'; \ b='test_sysv'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_telinit.log: test_telinit$(EXEEXT) @p='test_telinit$(EXEEXT)'; \ b='test_telinit'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man7 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man7 uninstall-man8 .MAKE: all check check-am install install-am install-data-am \ install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool clean-local \ clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-man7 \ install-man8 install-pdf install-pdf-am install-ps \ install-ps-am install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic maintainer-clean-local mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am recheck tags tags-am uninstall \ uninstall-am uninstall-hook uninstall-man uninstall-man7 \ uninstall-man8 uninstall-sbinPROGRAMS $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=upstart \ --default-interface=com.ubuntu.Upstart0_6 \ --output=$@ $< $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job_class \ --default-interface=com.ubuntu.Upstart0_6.Job \ --output=$@ $< $(com_ubuntu_Upstart_Instance_OUTPUTS): $(com_ubuntu_Upstart_Instance_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job \ --default-interface=com.ubuntu.Upstart0_6.Instance \ --output=$@ $< install-data-hook: src=`echo initctl | sed '$(transform)'`.8; \ for symlink in start stop restart reload status; do \ inst=`echo $$symlink | sed '$(transform)'`.8; \ echo " ln -sf '$$src' '$(DESTDIR)$(man8dir)/$$inst'"; \ ln -sf "$$src" "$(DESTDIR)$(man8dir)/$$inst"; \ done src=`echo reboot | sed '$(transform)'`.8; \ for symlink in halt poweroff; do \ inst=`echo $$symlink | sed '$(transform)'`.8; \ echo " ln -sf '$$src' '$(DESTDIR)$(man8dir)/$$inst'"; \ ln -sf "$$src" "$(DESTDIR)$(man8dir)/$$inst"; \ done install-exec-hook: src=`echo initctl | sed '$(transform);s/$$/$(EXEEXT)/'`; \ for symlink in start stop restart reload status; do \ inst=`echo $$symlink | sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " ln -sf '$$src' '$(DESTDIR)$(sbindir)/$$inst'"; \ ln -sf "$$src" "$(DESTDIR)$(sbindir)/$$inst"; \ done src=`echo reboot | sed '$(transform);s/$$/$(EXEEXT)/'`; \ for symlink in halt poweroff; do \ inst=`echo $$symlink | sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " ln -sf '$$src' '$(DESTDIR)$(sbindir)/$$inst'"; \ ln -sf "$$src" "$(DESTDIR)$(sbindir)/$$inst"; \ done uninstall-hook: for symlink in start stop restart reload status halt poweroff; do \ file=`echo $$symlink | sed '$(transform)'`.8; \ echo " rm -f '$(DESTDIR)$(man8dir)/$$file'"; \ rm -f "$(DESTDIR)$(man8dir)/$$file"; \ file=`echo $$symlink | sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$file'"; \ rm -f "$(DESTDIR)$(sbindir)/$$file"; \ done .PHONY: tests tests: $(BUILT_SOURCES) $(check_PROGRAMS) $(top_builddir)/init/init $(top_builddir)/test/libtest_util_common.a clean-local: rm -f *.gcno *.gcda maintainer-clean-local: rm -f *.gcov # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/util/Makefile.am0000664000175000017500000001440312373101356013237 00000000000000## Process this file with automake to produce Makefile.in AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) AM_CPPFLAGS = \ -DLOCALEDIR="\"$(localedir)\"" \ -DSBINDIR="\"$(sbindir)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ -I$(top_srcdir)/intl \ -I$(top_srcdir)/test -iquote $(top_srcdir)/test dist_man_MANS = \ man/initctl.8 \ man/reboot.8 \ man/shutdown.8 \ man/runlevel.8 \ man/telinit.8 \ man/runlevel.7 sbin_PROGRAMS = \ initctl \ reboot \ runlevel \ shutdown \ telinit initctl_SOURCES = \ initctl.c initctl.h \ $(top_srcdir)/init/xdg.c $(top_srcdir)/init/xdg.h nodist_initctl_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) initctl_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) reboot_SOURCES = \ reboot.c \ utmp.c utmp.h reboot_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) runlevel_SOURCES = \ runlevel.c \ utmp.c utmp.h runlevel_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) shutdown_SOURCES = \ shutdown.c \ utmp.c utmp.h \ sysv.c sysv.h nodist_shutdown_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) shutdown_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) telinit_SOURCES = \ telinit.c \ utmp.c utmp.h \ sysv.c sysv.h nodist_telinit_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) telinit_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) com_ubuntu_Upstart_OUTPUTS = \ com.ubuntu.Upstart.c \ com.ubuntu.Upstart.h com_ubuntu_Upstart_XML = \ ../dbus/com.ubuntu.Upstart.xml $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=upstart \ --default-interface=com.ubuntu.Upstart0_6 \ --output=$@ $< com_ubuntu_Upstart_Job_OUTPUTS = \ com.ubuntu.Upstart.Job.c \ com.ubuntu.Upstart.Job.h com_ubuntu_Upstart_Job_XML = \ ../dbus/com.ubuntu.Upstart.Job.xml $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job_class \ --default-interface=com.ubuntu.Upstart0_6.Job \ --output=$@ $< com_ubuntu_Upstart_Instance_OUTPUTS = \ com.ubuntu.Upstart.Instance.c \ com.ubuntu.Upstart.Instance.h com_ubuntu_Upstart_Instance_XML = \ ../dbus/com.ubuntu.Upstart.Instance.xml $(com_ubuntu_Upstart_Instance_OUTPUTS): $(com_ubuntu_Upstart_Instance_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job \ --default-interface=com.ubuntu.Upstart0_6.Instance \ --output=$@ $< # These have to be built sources because we can't compile object files # without the header file existing first BUILT_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) CLEANFILES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) EXTRA_DIST = util.supp install-data-hook: src=`echo initctl | sed '$(transform)'`.8; \ for symlink in start stop restart reload status; do \ inst=`echo $$symlink | sed '$(transform)'`.8; \ echo " ln -sf '$$src' '$(DESTDIR)$(man8dir)/$$inst'"; \ ln -sf "$$src" "$(DESTDIR)$(man8dir)/$$inst"; \ done src=`echo reboot | sed '$(transform)'`.8; \ for symlink in halt poweroff; do \ inst=`echo $$symlink | sed '$(transform)'`.8; \ echo " ln -sf '$$src' '$(DESTDIR)$(man8dir)/$$inst'"; \ ln -sf "$$src" "$(DESTDIR)$(man8dir)/$$inst"; \ done install-exec-hook: src=`echo initctl | sed '$(transform);s/$$/$(EXEEXT)/'`; \ for symlink in start stop restart reload status; do \ inst=`echo $$symlink | sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " ln -sf '$$src' '$(DESTDIR)$(sbindir)/$$inst'"; \ ln -sf "$$src" "$(DESTDIR)$(sbindir)/$$inst"; \ done src=`echo reboot | sed '$(transform);s/$$/$(EXEEXT)/'`; \ for symlink in halt poweroff; do \ inst=`echo $$symlink | sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " ln -sf '$$src' '$(DESTDIR)$(sbindir)/$$inst'"; \ ln -sf "$$src" "$(DESTDIR)$(sbindir)/$$inst"; \ done uninstall-hook: for symlink in start stop restart reload status halt poweroff; do \ file=`echo $$symlink | sed '$(transform)'`.8; \ echo " rm -f '$(DESTDIR)$(man8dir)/$$file'"; \ rm -f "$(DESTDIR)$(man8dir)/$$file"; \ file=`echo $$symlink | sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$file'"; \ rm -f "$(DESTDIR)$(sbindir)/$$file"; \ done # Ensure a clean test environment (that will not touch the running users # one). Tests that need the variables listed below are expected to set # them to appropriate temporary values as needed. AM_TESTS_ENVIRONMENT= \ unset -v \ XDG_RUNTIME_DIR \ DBUS_SESSION_BUS_ADDRESS \ UPSTART_SESSION \ UPSTART_INSTANCE \ UPSTART_EVENTS \ UPSTART_JOB; if ENABLE_TAP_OUTPUT LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh else LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver endif TESTS = \ test_initctl \ test_utmp \ test_sysv \ test_telinit check_PROGRAMS = $(TESTS) test_initctl_SOURCES = \ tests/test_initctl.c \ initctl.c \ $(top_srcdir)/init/xdg.c $(top_srcdir)/init/xdg.h test_initctl_CFLAGS = $(AM_CFLAGS) -DTEST test_initctl_LDADD = \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) if ENABLE_CGROUPS test_initctl_LDADD += $(CGMANAGER_LIBS) endif test_utmp_SOURCES = tests/test_utmp.c test_utmp_LDADD = \ utmp.o \ $(NIH_LIBS) test_sysv_SOURCES = tests/test_sysv.c nodist_test_sysv_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) test_sysv_LDADD = \ sysv.o utmp.o \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) test_telinit_SOURCES = tests/test_telinit.c telinit.c test_telinit_CFLAGS = $(AM_CFLAGS) -DTEST test_telinit_LDADD = \ sysv.o utmp.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) .PHONY: tests tests: $(BUILT_SOURCES) $(check_PROGRAMS) $(top_builddir)/init/init $(top_builddir)/test/libtest_util_common.a clean-local: rm -f *.gcno *.gcda maintainer-clean-local: rm -f *.gcov upstart-1.13.2/util/telinit.c0000664000175000017500000001535212373101356013023 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" #include "sysv.h" /* Prototypes for option functions */ int env_option (NihOption *option, const char *arg); NihDBusProxy * upstart_open (const void *parent) __attribute__ ((warn_unused_result)); int restart_upstart (void) __attribute__ ((warn_unused_result)); /** * extra_env: * * Extra environment variables to append to the runlevel event. **/ char **extra_env = NULL; /** * env_option: * @option: NihOption invoked, * @arg: argument to parse. * * This option setter is used to append @arg to the list of environment * variables pointed to by the value member of option, which must be a * pointer to a char **. * * The arg_name member of @option must not be NULL. * * Returns: zero on success, non-zero on error. **/ int env_option (NihOption *option, const char *arg) { char ***value; nih_assert (option != NULL); nih_assert (option->value != NULL); nih_assert (arg != NULL); value = (char ***)option->value; NIH_MUST (nih_str_array_add (value, NULL, NULL, arg)); return 0; } /** * upstart_open: * @parent: parent object for new proxy. * * Opens a connection to the Upstart init daemon and returns a proxy * to the manager object. If @dest_name is not NULL, a connection is * instead opened to the system bus and the proxy linked to the * well-known name given. * * If @parent is not NULL, it should be a pointer to another object * which will be used as a parent for the returned proxy. When all * parents of the returned proxy are freed, the returned proxy will * also be freed. * * Returns: newly allocated D-Bus proxy or NULL on raised error. **/ NihDBusProxy * upstart_open (const void *parent) { DBusError dbus_error; DBusConnection *connection; NihDBusProxy * upstart; dbus_error_init (&dbus_error); connection = dbus_connection_open (DBUS_ADDRESS_UPSTART, &dbus_error); if (! connection) { nih_dbus_error_raise (dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); return NULL; } dbus_connection_set_exit_on_disconnect (connection, FALSE); dbus_error_free (&dbus_error); upstart = nih_dbus_proxy_new (parent, connection, NULL, DBUS_PATH_UPSTART, NULL, NULL); if (! upstart) { dbus_connection_unref (connection); return NULL; } upstart->auto_start = FALSE; /* Drop initial reference now the proxy holds one */ dbus_connection_unref (connection); return upstart; } /** * restart_upstart: * * Request Upstart restart itself. * * Returns: 0 on SUCCESS, -1 on raised error. **/ int restart_upstart (void) { nih_local NihDBusProxy *upstart = NULL; DBusPendingCall *ret; upstart = upstart_open (NULL); if (! upstart) return -1; /* Fire and forget: * * Ask Upstart to restart itself using the async interface to * avoid the client-side complaining if and when it detects that * Upstart has severed all connections to perform the re-exec. */ ret = upstart_restart (upstart, NULL, NULL, NULL, 0); dbus_connection_flush(upstart->connection); /* We don't care about the return code, but we have to keep * the compiler happy. */ if (ret != (DBusPendingCall *)TRUE) return 0; return 0; } #ifndef TEST /** * options: * * Command-line options accepted. **/ static NihOption options[] = { { 'e', NULL, N_("set environment variable in the runlevel event"), NULL, "KEY=VALUE", &extra_env, env_option }, /* Compatibility options, all ignored */ { 't', NULL, NULL, NULL, "SECONDS", NULL, NULL }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char **args; int runlevel; int ret = 0; nih_main_init (argv[0]); nih_option_set_usage ("RUNLEVEL"); nih_option_set_synopsis (_("Change runlevel.")); nih_option_set_help ( _("RUNLEVEL should be one of 0123456sS, where s and S are " "considered identical.\n" "\n" "RUNLEVEL may also be Q or q to instruct the init daemon " "to reload its configuration, this is rarely necessary " "since the daemon watches its configuration for changes.\n" "\n" "RUNLEVEL may be U or u to instruct the init daemon to " "re-execute itself, this is not recommended since Upstart " "does not currently preserve its state.\n")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); /* First argument must be a single character we know */ if (! args[0]) { fprintf (stderr, _("%s: missing runlevel\n"), program_name); nih_main_suggest_help (); exit (1); } if ((! strchr ("0123456SsQqUu", args[0][0])) || args[0][1]) { fprintf (stderr, _("%s: illegal runlevel: %s\n"), program_name, args[0]); nih_main_suggest_help (); exit (1); } /* Check we're root */ if (setuid (geteuid ()) < 0) nih_warn (_("Couldn't set uid.")); if (getuid ()) { nih_fatal (_("Need to be root")); exit (1); } /* Send the appropriate message */ runlevel = args[0][0]; switch (runlevel) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': ret = sysv_change_runlevel (runlevel, extra_env, NULL, NULL); break; case 'S': case 's': ret = sysv_change_runlevel ('S', extra_env, NULL, NULL); break; case 'Q': case 'q': ret = kill (1, SIGHUP); if (ret < 0) nih_error_raise_system (); break; case 'U': case 'u': /* If /sbin/init is not Upstart, just exit non-zero */ ret = restart_upstart (); break; default: nih_assert_not_reached (); } if (ret < 0) { NihError *err; err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); exit (1); } return 0; } #endif upstart-1.13.2/util/reboot.c0000664000175000017500000001267412373101356012651 00000000000000/* upstart * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "utmp.h" /** * DEV: * * Directory containing device nodes. **/ #ifndef DEV #define DEV "/dev" #endif /** * SBINDIR: * * Directory containing system binaries. **/ #ifndef SBINDIR #define SBINDIR "/sbin" #endif /** * SHUTDOWN: * * Program to call when not called with -f. **/ #ifndef SHUTDOWN #define SHUTDOWN SBINDIR "/shutdown" #endif /* Operation modes */ enum { REBOOT, HALT, POWEROFF, REBOOTCOMMAND, }; /** * no_sync: * * TRUE to suppress the call to sync() before reboot(). **/ static int no_sync = FALSE; /** * force: * * TRUE to behave as if we're called by shutdown. **/ static int force = FALSE; /** * poweroff: * * TRUE if the power should be switched off. **/ static int poweroff = FALSE; /** * exit_only: * * TRUE if we should exit immediately. **/ static int exit_only = FALSE; /** * options: * * Command-line options accepted. **/ static NihOption options[] = { { 'n', "no-sync", N_("don't sync before reboot or halt"), NULL, NULL, &no_sync, NULL }, { 'f', "force", N_("force reboot or halt, don't call shutdown(8)"), NULL, NULL, &force, NULL }, { 'p', "poweroff", N_("switch off the power when called as halt"), NULL, NULL, &poweroff, NULL }, { 'w', "wtmp-only", N_("don't actually reboot or halt, just write wtmp record"), NULL, NULL, &exit_only, NULL }, /* Compatibility options, all ignored */ { 'd', NULL, NULL, NULL, NULL, NULL, NULL }, { 'i', NULL, NULL, NULL, NULL, NULL, NULL }, { 'h', NULL, NULL, NULL, NULL, NULL, NULL }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char **args; int mode; int runlevel; char *rebootcommand=NULL; nih_main_init (argv[0]); mode = REBOOT; if (! strcmp (program_name, "halt")) { mode = HALT; nih_option_set_synopsis (_("Halt the system.")); } else if (! strcmp (program_name, "poweroff")) { mode = POWEROFF; nih_option_set_synopsis (_("Power off the system.")); } else { mode = REBOOT; nih_option_set_synopsis (_("Reboot the system.")); } nih_option_set_help ( _("This command is intended to instruct the kernel " "to reboot or halt the system; when run without the -f " "option, or when in a system runlevel other than 0 or 6, " "it will actually execute /sbin/shutdown.\n")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); /* Check we're root */ if (setuid (geteuid ()) < 0) nih_warn (_("Couldn't set uid.")); if (getuid ()) { nih_fatal (_("Need to be root")); exit (1); } /* If the system runlevel is 0 or 6, we always behave as if --force * were given. */ runlevel = utmp_get_runlevel (NULL, NULL); if (runlevel < 0) { nih_free (nih_error_get ()); } else if ((runlevel == '0') || (runlevel == '6')) { force = TRUE; } /* Check for -p if halt */ if ((mode == HALT) && poweroff) mode = POWEROFF; /* Check for rebootcommand to pass in the syscall */ if ((mode == REBOOT) && force && args && *args) { mode = REBOOTCOMMAND; rebootcommand = *args; } /* Normally we just exec shutdown, which notifies everyone and * signals init. */ if ((! force) && (! exit_only)) { char *args[5]; int i = 0; args[i++] = SHUTDOWN; switch (mode) { case REBOOT: args[i++] = "-r"; break; case HALT: args[i++] = "-h"; args[i++] = "-H"; break; case POWEROFF: args[i++] = "-h"; args[i++] = "-P"; break; } args[i++] = "now"; args[i] = NULL; nih_info (_("Calling shutdown")); execv (args[0], args); nih_fatal (_("Unable to execute shutdown: %s"), strerror (errno)); exit (1); } /* Write the shutdown record */ if (utmp_write_shutdown (NULL, NULL) < 0) nih_free (nih_error_get ()); if (exit_only) exit (0); if (! no_sync) sync (); /* Re-enable Control-Alt-Delete in case it breaks */ reboot (RB_ENABLE_CAD); /* Do the syscall */ switch (mode) { case REBOOT: nih_info (_("Rebooting")); reboot (RB_AUTOBOOT); break; case HALT: nih_info (_("Halting")); reboot (RB_HALT_SYSTEM); break; case POWEROFF: nih_info (_("Powering off")); reboot (RB_POWER_OFF); break; case REBOOTCOMMAND: nih_info (_("Rebooting with %s"), rebootcommand); syscall (SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, rebootcommand); } /* Shouldn't get here, but if we do, carry on */ reboot (RB_DISABLE_CAD); return 0; } upstart-1.13.2/util/tests/0000775000175000017500000000000012402042412012411 500000000000000upstart-1.13.2/util/tests/test_utmp.c0000664000175000017500000010260412373101356014536 00000000000000/* upstart * * test_utmp.c - test suite for util/utmp.c * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "utmp.h" void test_read_runlevel (void) { char filename[PATH_MAX]; FILE * file; struct utmpx utmp; struct utsname uts; struct timeval tv; int runlevel; int prevlevel; NihError * err; TEST_FUNCTION ("utmp_read_runlevel"); TEST_FILENAME (filename); /* Check that we can obtain both the current and previous runlevel * from the utmp file. */ TEST_FEATURE ("with runlevel and previous"); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = '2' + 'S' * 256; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_read_runlevel (filename, &prevlevel); TEST_EQ (runlevel, '2'); TEST_EQ (prevlevel, 'S'); } /* Check that if no filename is passed, it defaults to the currently * set file. */ TEST_FEATURE ("with no filename"); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = '2' + 'S' * 256; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_read_runlevel (NULL, &prevlevel); TEST_EQ (runlevel, '2'); TEST_EQ (prevlevel, 'S'); } /* Check that if there was no previous runlevel, the special 'N' * runlevel is returned instead. */ TEST_FEATURE ("with no previous runlevel recorded"); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = '2'; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_read_runlevel (filename, &prevlevel); TEST_EQ (runlevel, '2'); TEST_EQ (prevlevel, 'N'); } /* Check that we can choose not to obtain the previous runlevel, * and instead only obtain the current one. */ TEST_FEATURE ("with runlevel only"); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = '2' + 'S' * 256; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_read_runlevel (filename, NULL); TEST_EQ (runlevel, '2'); } /* Check that a raised ESRCH error is returned along with a * negative value if we couldn't find a runlevel marker. */ TEST_FEATURE ("with no record"); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); prevlevel = 0; runlevel = utmp_read_runlevel (filename, &prevlevel); TEST_LT (runlevel, 0); TEST_EQ (prevlevel, 0); err = nih_error_get (); TEST_EQ (err->number, ESRCH); nih_free (err); } /* Check that an empty runlevel record (e.g. by the shutdown tool) * results in the 'N' runlevel being returned instead. */ TEST_FEATURE ("with shutdown record"); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = 0; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "shutdown", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_read_runlevel (filename, &prevlevel); TEST_EQ (runlevel, 'N'); TEST_EQ (prevlevel, 'N'); } /* Check that a corrupt runlevel record results in the 'N' runlevel * being returned instead. */ TEST_FEATURE ("with corrupt record"); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = -14 + -12 * 256; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_read_runlevel (filename, &prevlevel); TEST_EQ (runlevel, 'N'); TEST_EQ (prevlevel, 'N'); } unlink (filename); } void test_get_runlevel (void) { char filename[PATH_MAX]; FILE * file; struct utmpx utmp; struct utsname uts; struct timeval tv; int runlevel; int prevlevel; NihError * err; TEST_FUNCTION ("utmp_get_runlevel"); TEST_FILENAME (filename); /* Check that the function returns the contents of the environment * in preference to the contents of the utmp file. */ TEST_FEATURE ("with environment"); setenv ("RUNLEVEL", "3", TRUE); setenv ("PREVLEVEL", "2", TRUE); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = '2' + 'S' * 256; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_get_runlevel (filename, &prevlevel); TEST_EQ (runlevel, '3'); TEST_EQ (prevlevel, '2'); } unsetenv ("RUNLEVEL"); unsetenv ("PREVLEVEL"); /* Check that we can obtain both the current and previous runlevel * from the utmp file when there's no environment set. */ TEST_FEATURE ("with runlevel and previous"); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = '2' + 'S' * 256; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_get_runlevel (filename, &prevlevel); TEST_EQ (runlevel, '2'); TEST_EQ (prevlevel, 'S'); } /* Check that when the environment variables are set, but empty, * the code substitutes 'N' instead. */ TEST_FEATURE ("with empty environment"); setenv ("RUNLEVEL", "", TRUE); setenv ("PREVLEVEL", "", TRUE); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = '2' + 'S' * 256; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_get_runlevel (filename, &prevlevel); TEST_EQ (runlevel, 'N'); TEST_EQ (prevlevel, 'N'); } unsetenv ("RUNLEVEL"); unsetenv ("PREVLEVEL"); /* Check that when the runlevel environment variable is set, but not * the previous level variable the runlevel from the variable is * still returned and prevlevel is N not the contents of utmp. */ TEST_FEATURE ("with missing PREVLEVEL"); setenv ("RUNLEVEL", "3", TRUE); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = '2' + 'S' * 256; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_get_runlevel (filename, &prevlevel); TEST_EQ (runlevel, '3'); TEST_EQ (prevlevel, 'N'); } unsetenv ("RUNLEVEL"); /* Check that we can choose not to obtain the previous runlevel, * and instead only obtain the current one. */ TEST_FEATURE ("with runlevel only"); setenv ("RUNLEVEL", "3", TRUE); setenv ("PREVLEVEL", "2", TRUE); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; utmp.ut_pid = '2' + 'S' * 256; strcpy (utmp.ut_line, "~"); strcpy (utmp.ut_id, "~~"); strncpy (utmp.ut_user, "runlevel", sizeof utmp.ut_user); if (uname (&uts) == 0) strncpy (utmp.ut_host, uts.release, sizeof utmp.ut_host); gettimeofday (&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; utmpxname (filename); setutxent (); pututxline (&utmp); endutxent (); prevlevel = 0; runlevel = utmp_get_runlevel (filename, NULL); TEST_EQ (runlevel, '3'); } unsetenv ("RUNLEVEL"); unsetenv ("PREVLEVEL"); /* Check that the function returns the contents of the environment * even if the utmp file is empty. */ TEST_FEATURE ("with environment and no record"); setenv ("RUNLEVEL", "2", TRUE); setenv ("PREVLEVEL", "S", TRUE); TEST_ALLOC_FAIL { unlink (filename); prevlevel = 0; runlevel = utmp_get_runlevel (filename, &prevlevel); TEST_EQ (runlevel, '2'); TEST_EQ (prevlevel, 'S'); } unsetenv ("RUNLEVEL"); unsetenv ("PREVLEVEL"); /* Check that a raised ESRCH error is returned along with a * negative value if we couldn't find a runlevel marker. */ TEST_FEATURE ("with no record"); TEST_ALLOC_FAIL { unlink (filename); file = fopen (filename, "w"); fclose (file); prevlevel = 0; runlevel = utmp_get_runlevel (filename, &prevlevel); TEST_LT (runlevel, 0); TEST_EQ (prevlevel, 0); err = nih_error_get (); TEST_EQ (err->number, ESRCH); nih_free (err); } unlink (filename); } void test_write_runlevel (void) { char utmp_file[PATH_MAX]; char wtmp_file[PATH_MAX]; struct utmpx * utmp; struct utmpx record; struct utsname uts; struct timeval tv; int ret; NihError * err; TEST_FUNCTION ("utmp_write_runlevel"); TEST_FILENAME (utmp_file); TEST_FILENAME (wtmp_file); /* Check that we can write a runlevel record to both the utmp * and wtmp files; the record should be a RUN_LVL entry with the * "runlevel" user, pid containing both the new and previous * runlevel, and other fields left as defaults. Since the files * are fresh, a reboot record should also be written. */ TEST_FEATURE ("with utmp and wtmp file"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = utmp_write_runlevel (utmp_file, wtmp_file, '2', 'S'); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); } /* Check that it's ok to have no known previous runlevels, it * will be left blank in the file and reboot entries always * added. */ TEST_FEATURE ("with no previous runlevel"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = utmp_write_runlevel (utmp_file, wtmp_file, '2', 0); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2'); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2'); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); } /* Check that the user-facing 'N' for no previous runlevel is * converted to zero and thus always left blank in the file and * reboot entries always added. */ TEST_FEATURE ("with unknown previous runlevel"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = utmp_write_runlevel (utmp_file, wtmp_file, '2', 'N'); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2'); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2'); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); } /* Check that the new runlevel record replaces the existing record * in the utmp file, but appends a new record to the wtmp file. * Since the records match, no reboot record need to be written. */ TEST_FEATURE ("with existing records in files"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); memset (&record, 0, sizeof record); record.ut_type = RUN_LVL; record.ut_pid = '2' + 'S' * 256; strcpy (record.ut_line, "~"); strcpy (record.ut_id, "~~"); strncpy (record.ut_user, "runlevel", sizeof record.ut_user); if (uname (&uts) == 0) strncpy (record.ut_host, uts.release, sizeof record.ut_host); gettimeofday (&tv, NULL); record.ut_tv.tv_sec = tv.tv_sec; record.ut_tv.tv_usec = tv.tv_usec; utmpxname (utmp_file); setutxent (); pututxline (&record); endutxent (); updwtmpx (wtmp_file, &record); /* utmp/wtmp records do not have nanosecond resolution * yet the tests expect time to lapse, but it might not * on very, very fast machines. * https://jenkins.qa.ubuntu.com/view/Raring/view/AutoPkgTest/job/raring-adt-upstart/ * Is there a better way to fix the tests? */ usleep (200); ret = utmp_write_runlevel (utmp_file, wtmp_file, '5', '2'); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '5' + '2' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '5' + '2' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); } /* Check that if the existing utmp record does not match the * previous runlevel stated in the change, a missed reboot is * assumed and the reboot entry is prepended to the file first. */ TEST_FEATURE ("with missed reboot in utmp file"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); memset (&record, 0, sizeof record); record.ut_type = RUN_LVL; record.ut_pid = '0' + '2' * 256; strcpy (record.ut_line, "~"); strcpy (record.ut_id, "~~"); strncpy (record.ut_user, "runlevel", sizeof record.ut_user); if (uname (&uts) == 0) strncpy (record.ut_host, uts.release, sizeof record.ut_host); gettimeofday (&tv, NULL); record.ut_tv.tv_sec = tv.tv_sec; record.ut_tv.tv_usec = tv.tv_usec; utmpxname (utmp_file); setutxent (); pututxline (&record); endutxent (); record.ut_pid = 'S'; updwtmpx (wtmp_file, &record); /* Allow time to pass so that the timestamp for the new * record is guaranteed to be different to the existing * timestamp allowing the test to detect if a record * other than the artificially-created existing one was * read back. */ usleep (200); ret = utmp_write_runlevel (utmp_file, wtmp_file, '2', 'S'); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, 'S'); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); } /* Check that if the existing wtmp record does not match the * previous runlevel stated in the change, a missed reboot is * assumed and the reboot entry is appended to the file first. */ TEST_FEATURE ("with missed reboot in wtmp file"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); memset (&record, 0, sizeof record); record.ut_type = RUN_LVL; record.ut_pid = 'S'; strcpy (record.ut_line, "~"); strcpy (record.ut_id, "~~"); strncpy (record.ut_user, "runlevel", sizeof record.ut_user); if (uname (&uts) == 0) strncpy (record.ut_host, uts.release, sizeof record.ut_host); gettimeofday (&tv, NULL); record.ut_tv.tv_sec = tv.tv_sec; record.ut_tv.tv_usec = tv.tv_usec; utmpxname (utmp_file); setutxent (); pututxline (&record); endutxent (); record.ut_pid = '0' + '2' * 256; updwtmpx (wtmp_file, &record); /* Allow time to pass so that the timestamp for the new * record is guaranteed to be different to the existing * timestamp allowing the test to detect if a record * other than the artificially-created existing one was * read back. */ usleep (200); ret = utmp_write_runlevel (utmp_file, wtmp_file, '2', 'S'); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '0' + '2' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); } /* Check that an error writing to the utmp file is returned as * a raised error, but doesn't prevent writing to the wtmp file. */ TEST_FEATURE ("with error writing to utmp file"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); chmod (utmp_file, 0400); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = utmp_write_runlevel (utmp_file, wtmp_file, '2', 'S'); TEST_LT (ret, 0); /* glibc < 2.10 seem to return EBADF not ACCESS */ err = nih_error_get (); if (err->number != EBADF) TEST_EQ (err->number, EACCES); nih_free (err); utmpxname (utmp_file); utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); } /* Check that an error writing to the wtmp file doesn't prevent * writing to the utmp file and doesn't result in an error. */ TEST_FEATURE ("with error writing to wtmp file"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); chmod (wtmp_file, 0400); ret = utmp_write_runlevel (utmp_file, wtmp_file, '2', 'S'); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_EQ_P (utmp, NULL); } unlink (utmp_file); unlink (wtmp_file); } void test_write_shutdown (void) { char utmp_file[PATH_MAX]; char wtmp_file[PATH_MAX]; struct utmpx * utmp; struct utmpx record; struct utsname uts; struct timeval tv; int ret; NihError * err; TEST_FUNCTION ("utmp_write_shutdown"); TEST_FILENAME (utmp_file); TEST_FILENAME (wtmp_file); /* Check that we can write a shutdown record to both the utmp * and wtmp files; the record should be a RUN_LVL entry with the * "shutdown" user and other fields left as defaults. */ TEST_FEATURE ("with utmp and wtmp file"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = utmp_write_shutdown (utmp_file, wtmp_file); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "shutdown"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "shutdown"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); } /* Check that the new shutdown record replaces the existing record * in the utmp file, but appends a new record to the wtmp file. */ TEST_FEATURE ("with existing records in files"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); memset (&record, 0, sizeof record); record.ut_type = RUN_LVL; record.ut_pid = 0; strcpy (record.ut_line, "~"); strcpy (record.ut_id, "~~"); strncpy (record.ut_user, "shutdown", sizeof record.ut_user); if (uname (&uts) == 0) strncpy (record.ut_host, uts.release, sizeof record.ut_host); gettimeofday (&tv, NULL); record.ut_tv.tv_sec = tv.tv_sec; record.ut_tv.tv_usec = tv.tv_usec; utmpxname (utmp_file); setutxent (); pututxline (&record); endutxent (); updwtmpx (wtmp_file, &record); /* Allow time to pass so that the timestamp for the new * record is guaranteed to be different to the existing * timestamp allowing the test to detect if a record * other than the artificially-created existing one was * read back. */ usleep (200); ret = utmp_write_shutdown (utmp_file, wtmp_file); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "shutdown"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "shutdown"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "shutdown"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); } /* Check that an error writing to the utmp file is returned as * a raised error, but doesn't prevent writing to the wtmp file. */ TEST_FEATURE ("with error writing to utmp file"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); chmod (utmp_file, 0400); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = utmp_write_shutdown (utmp_file, wtmp_file); TEST_LT (ret, 0); /* glibc < 2.10 seem to return EBADF not ACCESS */ err = nih_error_get (); if (err->number != EBADF) TEST_EQ (err->number, EACCES); nih_free (err); utmpxname (utmp_file); utmp = getutxent (); TEST_EQ_P (utmp, NULL); utmpxname (wtmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "shutdown"); } /* Check that an error writing to the wtmp file doesn't prevent * writing to the utmp file and doesn't result in an error. */ TEST_FEATURE ("with error writing to wtmp file"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); chmod (wtmp_file, 0400); ret = utmp_write_shutdown (utmp_file, wtmp_file); TEST_EQ (ret, 0); utmpxname (utmp_file); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "shutdown"); utmpxname (wtmp_file); utmp = getutxent (); TEST_EQ_P (utmp, NULL); } unlink (utmp_file); unlink (wtmp_file); } int main (int argc, char *argv[]) { nih_error_init (); test_read_runlevel (); test_get_runlevel (); test_write_runlevel (); test_write_shutdown (); } upstart-1.13.2/util/tests/test_telinit.c0000664000175000017500000000401012373101356015211 00000000000000/* upstart * * test_utmp.c - test suite for util/utmp.c * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include extern int env_option (NihOption *option, const char *arg); void test_env_option (void) { NihOption opt; char ** value; int ret; TEST_FUNCTION ("env_option"); opt.value = &value; value = NULL; /* Check that the env_option function takes the argument as a string * and appends it to the array, allocating it if necessary. */ TEST_FEATURE ("with first argument"); ret = env_option (&opt, "FOO=BAR"); TEST_EQ (ret, 0); TEST_ALLOC_SIZE (value, sizeof (char *) * 2); TEST_ALLOC_PARENT (value[0], value); TEST_EQ_STR (value[0], "FOO=BAR"); TEST_EQ_P (value[1], NULL); /* Check that a repeated environment option is appended to the * array. */ TEST_FEATURE ("with further argument"); ret = env_option (&opt, "TEA=YES"); TEST_EQ (ret, 0); TEST_ALLOC_SIZE (value, sizeof (char *) * 3); TEST_ALLOC_PARENT (value[0], value); TEST_ALLOC_PARENT (value[1], value); TEST_EQ_STR (value[0], "FOO=BAR"); TEST_EQ_STR (value[1], "TEA=YES"); TEST_EQ_P (value[2], NULL); nih_free (value); } int main (int argc, char *argv[]) { program_name = "test"; test_env_option (); return 0; } upstart-1.13.2/util/tests/test_sysv.c0000664000175000017500000006271612373101356014566 00000000000000/* upstart * * test_sysv.c - test suite for util/sysv.c * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "utmp.h" #include "sysv.h" extern const char *dest_address; static int my_connect_handler_called = FALSE; static DBusConnection *last_connection = NULL; static int my_connect_handler (DBusServer * server, DBusConnection *connection) { my_connect_handler_called++; last_connection = connection; nih_main_loop_exit (0); return TRUE; } void test_change_runlevel (void) { pid_t server_pid; int wait_fd; DBusServer * server = NULL; DBusMessage * method_call; DBusMessage * reply = NULL; const char * name_value; char ** args_value; int args_elements; int wait_value; char utmp_file[PATH_MAX]; char wtmp_file[PATH_MAX]; struct utmpx record; struct utmpx * utmp; struct utsname uts; struct timeval tv; int ret; char * args[3]; NihError * err; NihDBusError * dbus_err; int status; TEST_FUNCTION ("sysv_change_runlevel"); dest_address = "unix:abstract=/com/ubuntu/upstart/test_sysv"; TEST_FILENAME (utmp_file); TEST_FILENAME (wtmp_file); /* Check that we can change the runlevel, the previous runlevel * should be obtained from /var/run/utmp and the utmp record updated * as well as a new record being added to /var/log/wtmp. An event * should be emitted containing both the new and old runlevel * as arguments. */ TEST_FEATURE ("with new runlevel"); unsetenv ("RUNLEVEL"); unsetenv ("PREVLEVEL"); TEST_ALLOC_FAIL { TEST_CHILD_WAIT (server_pid, wait_fd) { TEST_ALLOC_SAFE { server = nih_dbus_server (dest_address, my_connect_handler, NULL); if (! server) { NihError *err = nih_error_get (); NihDBusError *dbus_err = (NihDBusError *)err; nih_message ("%s: %s", dbus_err->name, dbus_err->message); } assert (server != NULL); } my_connect_handler_called = FALSE; last_connection = NULL; TEST_CHILD_RELEASE (wait_fd); /* Wait for a connection from the server */ nih_main_loop (); assert (my_connect_handler_called); assert (last_connection); /* Expect the EmitEvent method call on the manager * object, make sure the arguments are right and * reply to acknowledge. */ TEST_DBUS_MESSAGE (last_connection, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "EmitEvent")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "runlevel"); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "RUNLEVEL=5"); TEST_EQ_STR (args_value[1], "PREVLEVEL=2"); dbus_free_string_array (args_value); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (last_connection, reply, NULL); dbus_connection_flush (last_connection); dbus_message_unref (method_call); dbus_message_unref (reply); dbus_connection_close (last_connection); dbus_connection_unref (last_connection); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); exit (0); } unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); memset (&record, 0, sizeof record); record.ut_type = RUN_LVL; record.ut_pid = '2' + 'S' * 256; strcpy (record.ut_line, "~"); strcpy (record.ut_id, "~~"); strncpy (record.ut_user, "runlevel", sizeof record.ut_user); if (uname (&uts) == 0) strncpy (record.ut_host, uts.release, sizeof record.ut_host); gettimeofday (&tv, NULL); record.ut_tv.tv_sec = tv.tv_sec; record.ut_tv.tv_usec = tv.tv_usec; /* See comment in test_utmp */ usleep(200); utmpxname (utmp_file); setutxent (); pututxline (&record); endutxent (); updwtmpx (wtmp_file, &record); ret = sysv_change_runlevel ('5', NULL, utmp_file, wtmp_file); if (test_alloc_failed && (ret < 0)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); /* Make sure no runlevel was written */ utmpxname (utmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); utmpxname (wtmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); dbus_shutdown (); continue; } TEST_EQ (ret, 0); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); utmpxname (utmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '5' + '2' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); utmpxname (wtmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '5' + '2' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); dbus_shutdown (); } /* Check that when called from the rc-sysvinit script, with the * RUNLEVEL and PREVLEVEL variables empty and no valid information * in the utmp or wtmp files, N is used as the previous runlevel * and reboot is added. */ TEST_FEATURE ("with sysvinit to 2 switch"); setenv ("RUNLEVEL", "", TRUE); setenv ("PREVLEVEL", "", TRUE); TEST_ALLOC_FAIL { TEST_CHILD_WAIT (server_pid, wait_fd) { TEST_ALLOC_SAFE { server = nih_dbus_server (dest_address, my_connect_handler, NULL); assert (server != NULL); } my_connect_handler_called = FALSE; last_connection = NULL; TEST_CHILD_RELEASE (wait_fd); /* Wait for a connection from the server */ nih_main_loop (); assert (my_connect_handler_called); assert (last_connection); /* Expect the EmitEvent method call on the manager * object, make sure the arguments are right and * reply to acknowledge. */ TEST_DBUS_MESSAGE (last_connection, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "EmitEvent")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "runlevel"); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "RUNLEVEL=2"); TEST_EQ_STR (args_value[1], "PREVLEVEL=N"); dbus_free_string_array (args_value); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (last_connection, reply, NULL); dbus_connection_flush (last_connection); dbus_message_unref (method_call); dbus_message_unref (reply); dbus_connection_close (last_connection); dbus_connection_unref (last_connection); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); exit (0); } unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = sysv_change_runlevel ('2', NULL, utmp_file, wtmp_file); if (test_alloc_failed && (ret < 0)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); /* Make sure no runlevel was written */ utmpxname (utmp_file); setutxent (); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); utmpxname (wtmp_file); setutxent (); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); dbus_shutdown (); continue; } TEST_EQ (ret, 0); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); utmpxname (utmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2'); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); utmpxname (wtmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2'); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); dbus_shutdown (); } unsetenv ("RUNLEVEL"); unsetenv ("PREVLEVEL"); /* Check that when called from the rcS script, with the RUNLEVEL * and PREVLEVEL variables set but no valid information in the utmp * or wtmp files, the environment is used and reboot records are * added as well. */ TEST_FEATURE ("with runlevel S to 2 switch"); setenv ("RUNLEVEL", "S", TRUE); setenv ("PREVLEVEL", "", TRUE); TEST_ALLOC_FAIL { TEST_CHILD_WAIT (server_pid, wait_fd) { TEST_ALLOC_SAFE { server = nih_dbus_server (dest_address, my_connect_handler, NULL); assert (server != NULL); } my_connect_handler_called = FALSE; last_connection = NULL; TEST_CHILD_RELEASE (wait_fd); /* Wait for a connection from the server */ nih_main_loop (); assert (my_connect_handler_called); assert (last_connection); /* Expect the EmitEvent method call on the manager * object, make sure the arguments are right and * reply to acknowledge. */ TEST_DBUS_MESSAGE (last_connection, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "EmitEvent")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "runlevel"); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "RUNLEVEL=2"); TEST_EQ_STR (args_value[1], "PREVLEVEL=S"); dbus_free_string_array (args_value); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (last_connection, reply, NULL); dbus_connection_flush (last_connection); dbus_message_unref (method_call); dbus_message_unref (reply); dbus_connection_close (last_connection); dbus_connection_unref (last_connection); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); exit (0); } unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = sysv_change_runlevel ('2', NULL, utmp_file, wtmp_file); if (test_alloc_failed && (ret < 0)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); /* Make sure no runlevel was written */ utmpxname (utmp_file); setutxent (); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); utmpxname (wtmp_file); setutxent (); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); dbus_shutdown (); continue; } TEST_EQ (ret, 0); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); utmpxname (utmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); utmpxname (wtmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, BOOT_TIME); TEST_EQ (utmp->ut_pid, 0); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "reboot"); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); dbus_shutdown (); } unsetenv ("RUNLEVEL"); unsetenv ("PREVLEVEL"); /* Check that additional environment variables are appended to * the environment passed in the event. */ TEST_FEATURE ("with new runlevel"); TEST_ALLOC_FAIL { TEST_CHILD_WAIT (server_pid, wait_fd) { TEST_ALLOC_SAFE { server = nih_dbus_server (dest_address, my_connect_handler, NULL); assert (server != NULL); } my_connect_handler_called = FALSE; last_connection = NULL; TEST_CHILD_RELEASE (wait_fd); /* Wait for a connection from the server */ nih_main_loop (); assert (my_connect_handler_called); assert (last_connection); /* Expect the EmitEvent method call on the manager * object, make sure the arguments are right and * reply to acknowledge. */ TEST_DBUS_MESSAGE (last_connection, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "EmitEvent")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "runlevel"); TEST_EQ (args_elements, 4); TEST_EQ_STR (args_value[0], "RUNLEVEL=0"); TEST_EQ_STR (args_value[1], "PREVLEVEL=2"); TEST_EQ_STR (args_value[2], "INIT_HALT=poweroff"); TEST_EQ_STR (args_value[3], "USER=scott"); dbus_free_string_array (args_value); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (last_connection, reply, NULL); dbus_connection_flush (last_connection); dbus_message_unref (method_call); dbus_message_unref (reply); dbus_connection_close (last_connection); dbus_connection_unref (last_connection); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); exit (0); } unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); memset (&record, 0, sizeof record); record.ut_type = RUN_LVL; record.ut_pid = '2' + 'S' * 256; strcpy (record.ut_line, "~"); strcpy (record.ut_id, "~~"); strncpy (record.ut_user, "runlevel", sizeof record.ut_user); if (uname (&uts) == 0) strncpy (record.ut_host, uts.release, sizeof record.ut_host); gettimeofday (&tv, NULL); record.ut_tv.tv_sec = tv.tv_sec; record.ut_tv.tv_usec = tv.tv_usec; /* See comment in test_utmp */ usleep(200); utmpxname (utmp_file); setutxent (); pututxline (&record); endutxent (); updwtmpx (wtmp_file, &record); args[0] = "INIT_HALT=poweroff"; args[1] = "USER=scott"; args[2] = NULL; ret = sysv_change_runlevel ('0', args, utmp_file, wtmp_file); if (test_alloc_failed && (ret < 0)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); /* Make sure no runlevel was written */ utmpxname (utmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); utmpxname (wtmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); dbus_shutdown (); continue; } TEST_EQ (ret, 0); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); utmpxname (utmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '0' + '2' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); utmpxname (wtmp_file); setutxent (); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '2' + 'S' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); TEST_EQ (utmp->ut_tv.tv_sec, tv.tv_sec); TEST_EQ (utmp->ut_tv.tv_usec, tv.tv_usec); utmp = getutxent (); TEST_NE_P (utmp, NULL); TEST_EQ (utmp->ut_type, RUN_LVL); TEST_EQ (utmp->ut_pid, '0' + '2' * 256); TEST_EQ_STR (utmp->ut_line, "~"); TEST_EQ_STR (utmp->ut_id, "~~"); TEST_EQ_STR (utmp->ut_user, "runlevel"); if (utmp->ut_tv.tv_sec == tv.tv_sec) { TEST_NE (utmp->ut_tv.tv_usec, tv.tv_usec); } else { TEST_NE (utmp->ut_tv.tv_sec, tv.tv_sec); } utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); dbus_shutdown (); } /* Check that an error connecting to the upstart daemon is returned * as a raised error, without writing any runlevel entries to the * logs. */ TEST_FEATURE ("with error connecting"); TEST_ALLOC_FAIL { unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = sysv_change_runlevel ('5', NULL, utmp_file, wtmp_file); TEST_LT (ret, 0); err = nih_error_get (); if ((! test_alloc_failed) || (err->number != ENOMEM)) { TEST_EQ (err->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (err, sizeof (NihDBusError)); dbus_err = (NihDBusError *)err; TEST_EQ_STR (dbus_err->name, DBUS_ERROR_NO_SERVER); } nih_free (err); /* Make sure no runlevel was written */ utmpxname (utmp_file); setutxent (); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); utmpxname (wtmp_file); setutxent (); utmp = getutxent (); TEST_EQ_P (utmp, NULL); endutxent (); dbus_shutdown (); } /* Check that an error reply from the upstart daemon for the * EmitEvent method is returned as a raised error. */ TEST_FEATURE ("with error reply from method"); TEST_ALLOC_FAIL { TEST_CHILD_WAIT (server_pid, wait_fd) { TEST_ALLOC_SAFE { server = nih_dbus_server (dest_address, my_connect_handler, NULL); assert (server != NULL); } my_connect_handler_called = FALSE; last_connection = NULL; TEST_CHILD_RELEASE (wait_fd); /* Wait for a connection from the server */ nih_main_loop (); assert (my_connect_handler_called); assert (last_connection); /* Expect the EmitEvent method call on the manager * object, make sure the arguments are right and * reply with an error. */ TEST_DBUS_MESSAGE (last_connection, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "EmitEvent")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "runlevel"); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "RUNLEVEL=2"); TEST_EQ_STR (args_value[1], "PREVLEVEL=N"); dbus_free_string_array (args_value); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (last_connection, reply, NULL); dbus_connection_flush (last_connection); dbus_message_unref (method_call); dbus_message_unref (reply); dbus_connection_close (last_connection); dbus_connection_unref (last_connection); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); exit (0); } unlink (utmp_file); fclose (fopen (utmp_file, "w")); unlink (wtmp_file); fclose (fopen (wtmp_file, "w")); ret = sysv_change_runlevel ('2', NULL, utmp_file, wtmp_file); TEST_LT (ret, 0); err = nih_error_get (); if (test_alloc_failed && (err->number == ENOMEM)) { nih_free (err); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); dbus_shutdown (); continue; } waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (err->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (err, sizeof (NihDBusError)); dbus_err = (NihDBusError *)err; TEST_EQ_STR (dbus_err->name, DBUS_ERROR_UNKNOWN_METHOD); nih_free (dbus_err); dbus_shutdown (); } unlink (utmp_file); unlink (wtmp_file); } int main (int argc, char *argv[]) { nih_error_init (); nih_timer_init (); nih_signal_init (); nih_child_init (); nih_main_loop_init (); test_change_runlevel (); return 0; } upstart-1.13.2/util/tests/test_initctl.c0000664000175000017500000173351012373101356015226 00000000000000/* upstart * * test_initctl.c - test suite for util/initctl.c * * Copyright © 2010 Canonical Ltd. * Authors: Scott James Remnant , * James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" #include "test_util_common.h" extern int use_dbus; extern int user_mode; extern int dbus_bus_type; extern char *dest_name; extern const char *dest_address; extern int no_wait; extern NihDBusProxy *upstart_open (const void *parent) __attribute__ ((warn_unused_result)); extern char * job_status (const void *parent, NihDBusProxy *job_class, NihDBusProxy *job) __attribute__ ((warn_unused_result)); extern int start_action (NihCommand *command, char * const *args); extern int stop_action (NihCommand *command, char * const *args); extern int restart_action (NihCommand *command, char * const *args); extern int reload_action (NihCommand *command, char * const *args); extern int status_action (NihCommand *command, char * const *args); extern int list_action (NihCommand *command, char * const *args); extern int emit_action (NihCommand *command, char * const *args); extern int reload_configuration_action (NihCommand *command, char * const *args); extern int version_action (NihCommand *command, char * const *args); extern int log_priority_action (NihCommand *command, char * const *args); extern int usage_action (NihCommand *command, char * const *args); static int my_connect_handler_called = FALSE; static DBusConnection *last_connection = NULL; static int my_connect_handler (DBusServer * server, DBusConnection *connection) { my_connect_handler_called++; last_connection = connection; nih_main_loop_exit (0); return TRUE; } void test_upstart_open (void) { DBusServer * server = NULL; pid_t dbus_pid; DBusConnection *server_conn = NULL; NihDBusProxy * proxy = NULL; FILE * output; TEST_FUNCTION ("upstart_open"); output = tmpfile (); /* Check that we can create a proxy to Upstart's private internal * server, and that this is the default behaviour if we don't * fiddle with the other options. The returned proxy should * hold the only reference to the connection. */ TEST_FEATURE ("with private connection"); unsetenv ("UPSTART_SESSION"); TEST_ALLOC_FAIL { use_dbus = FALSE; dest_name = NULL; dest_address = "unix:abstract=/com/ubuntu/upstart/test_initctl"; TEST_ALLOC_SAFE { server = nih_dbus_server (dest_address, my_connect_handler, NULL); assert (server != NULL); } my_connect_handler_called = FALSE; last_connection = NULL; TEST_DIVERT_STDERR (output) { proxy = upstart_open (NULL); } rewind (output); if (test_alloc_failed && (proxy == NULL)) { TEST_FILE_EQ (output, "test: Cannot allocate memory\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); if (last_connection) { dbus_connection_close (last_connection); dbus_connection_unref (last_connection); } dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); continue; } nih_main_loop (); TEST_TRUE (my_connect_handler_called); TEST_NE_P (last_connection, NULL); TEST_NE_P (proxy, NULL); TEST_ALLOC_SIZE (proxy, sizeof (NihDBusProxy)); TEST_NE_P (proxy->connection, NULL); TEST_EQ_P (proxy->name, NULL); TEST_EQ_P (proxy->owner, NULL); TEST_EQ_STR (proxy->path, DBUS_PATH_UPSTART); TEST_ALLOC_PARENT (proxy->path, proxy); TEST_FALSE (proxy->auto_start); TEST_EQ_P (proxy->lost_handler, NULL); TEST_EQ_P (proxy->data, NULL); nih_free (proxy); TEST_FILE_END (output); TEST_FILE_RESET (output); dbus_connection_close (last_connection); dbus_connection_unref (last_connection); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); } /* Check that we can create a proxy to Upstart's private internal * server in user mode, and that this is the default behaviour if we don't * fiddle with the other options. The returned proxy should * hold the only reference to the connection. */ TEST_FEATURE ("with user-mode"); TEST_ALLOC_FAIL { use_dbus = -1; dbus_bus_type = -1; dest_name = NULL; dest_address = DBUS_ADDRESS_UPSTART; user_mode = TRUE; assert0 (setenv ("UPSTART_SESSION", "unix:abstract=/com/ubuntu/upstart/test-session", TRUE)); TEST_ALLOC_SAFE { server = nih_dbus_server (getenv ("UPSTART_SESSION"), my_connect_handler, NULL); assert (server != NULL); } my_connect_handler_called = FALSE; last_connection = NULL; TEST_DIVERT_STDERR (output) { proxy = upstart_open (NULL); } rewind (output); if (test_alloc_failed && (proxy == NULL)) { TEST_FILE_EQ (output, "test: Cannot allocate memory\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); if (last_connection) { dbus_connection_close (last_connection); dbus_connection_unref (last_connection); } dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); continue; } nih_main_loop (); TEST_TRUE (my_connect_handler_called); TEST_NE_P (last_connection, NULL); TEST_NE_P (proxy, NULL); TEST_ALLOC_SIZE (proxy, sizeof (NihDBusProxy)); TEST_NE_P (proxy->connection, NULL); TEST_EQ_P (proxy->name, NULL); TEST_EQ_P (proxy->owner, NULL); TEST_EQ_STR (proxy->path, DBUS_PATH_UPSTART); TEST_ALLOC_PARENT (proxy->path, proxy); TEST_FALSE (proxy->auto_start); TEST_EQ_P (proxy->lost_handler, NULL); TEST_EQ_P (proxy->data, NULL); nih_free (proxy); TEST_FILE_END (output); TEST_FILE_RESET (output); dbus_connection_close (last_connection); dbus_connection_unref (last_connection); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); unsetenv ("UPSTART_SESSION"); user_mode = FALSE; } /* Check that we can create a connection to Upstart via the system * bus. The returned proxy should use the default name on that * bus. */ TEST_FEATURE ("with system bus connection"); TEST_ALLOC_FAIL { use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = NULL; dest_address = DBUS_ADDRESS_UPSTART; TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DIVERT_STDERR (output) { proxy = upstart_open (NULL); } rewind (output); if (test_alloc_failed && (proxy == NULL)) { TEST_FILE_EQ (output, "test: Cannot allocate memory\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); continue; } TEST_NE_P (proxy, NULL); TEST_ALLOC_SIZE (proxy, sizeof (NihDBusProxy)); TEST_NE_P (proxy->connection, NULL); TEST_EQ_STR (proxy->name, DBUS_SERVICE_UPSTART); TEST_ALLOC_PARENT (proxy->name, proxy); TEST_EQ_STR (proxy->owner, dbus_bus_get_unique_name (server_conn)); TEST_ALLOC_PARENT (proxy->owner, proxy); TEST_EQ_STR (proxy->path, DBUS_PATH_UPSTART); TEST_ALLOC_PARENT (proxy->path, proxy); TEST_FALSE (proxy->auto_start); TEST_EQ_P (proxy->lost_handler, NULL); TEST_EQ_P (proxy->data, NULL); nih_free (proxy); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } /* Check that we can create a connection to Upstart via the system * bus and a different well known name. */ TEST_FEATURE ("with system bus connection and different name"); TEST_ALLOC_FAIL { use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = "com.ubuntu.UpstartTest"; dest_address = DBUS_ADDRESS_UPSTART; TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, "com.ubuntu.UpstartTest", 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DIVERT_STDERR (output) { proxy = upstart_open (NULL); } rewind (output); if (test_alloc_failed && (proxy == NULL)) { TEST_FILE_EQ (output, "test: Cannot allocate memory\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); continue; } TEST_NE_P (proxy, NULL); TEST_ALLOC_SIZE (proxy, sizeof (NihDBusProxy)); TEST_NE_P (proxy->connection, NULL); TEST_EQ_STR (proxy->name, "com.ubuntu.UpstartTest"); TEST_ALLOC_PARENT (proxy->name, proxy); TEST_EQ_STR (proxy->owner, dbus_bus_get_unique_name (server_conn)); TEST_ALLOC_PARENT (proxy->owner, proxy); TEST_EQ_STR (proxy->path, DBUS_PATH_UPSTART); TEST_ALLOC_PARENT (proxy->path, proxy); TEST_FALSE (proxy->auto_start); TEST_EQ_P (proxy->lost_handler, NULL); TEST_EQ_P (proxy->data, NULL); nih_free (proxy); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } /* Check that when we attempt to connect to Upstart's private * internal server, and it's not listening, that an appropriate * error is output. */ TEST_FEATURE ("with non-listening private connection"); TEST_ALLOC_FAIL { use_dbus = FALSE; dest_name = NULL; dest_address = "unix:abstract=/com/ubuntu/upstart/test"; TEST_DIVERT_STDERR (output) { proxy = upstart_open (NULL); } rewind (output); TEST_EQ_P (proxy, NULL); TEST_FILE_EQ (output, ("test: Unable to connect to Upstart: " "Failed to connect to socket /com/ubuntu/upstart/test: " "Connection refused\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); dbus_shutdown (); } /* Check that when we attempt to connect to the system bus, * and it's not listening, that an appropriate error is output. */ TEST_FEATURE ("with non-listening system bus"); TEST_ALLOC_FAIL { use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = NULL; dest_address = DBUS_ADDRESS_UPSTART; assert0 (setenv ("DBUS_SYSTEM_BUS_ADDRESS", "unix:abstract=/com/ubuntu/upstart/test", TRUE)); TEST_DIVERT_STDERR (output) { proxy = upstart_open (NULL); } rewind (output); TEST_EQ_P (proxy, NULL); TEST_FILE_EQ (output, ("test: Unable to connect to system bus: " "Failed to connect to socket /com/ubuntu/upstart/test: " "Connection refused\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); dbus_shutdown (); unsetenv ("DBUS_SYSTEM_BUS_ADDRESS"); } /* Check that an error and suggestion for help is output * when --dest is given without --system. */ TEST_FEATURE ("with --dest but without --system"); TEST_ALLOC_FAIL { use_dbus = FALSE; dest_name = "com.ubuntu.Upstart"; dest_address = DBUS_ADDRESS_UPSTART; TEST_DIVERT_STDERR (output) { proxy = upstart_open (NULL); } rewind (output); TEST_EQ_P (proxy, NULL); TEST_FILE_EQ (output, "test: --dest given without --system\n"); TEST_FILE_EQ (output, "Try `test --help' for more information.\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); dbus_shutdown (); } /* Check that when we attempt to connect to Upstart in user mode but * without UPSTART_SESSION set in the environment, an appropriate * error is output. */ TEST_FEATURE ("with user-mode and no target"); TEST_ALLOC_FAIL { use_dbus = -1; dbus_bus_type = -1; dest_name = NULL; dest_address = DBUS_ADDRESS_UPSTART; user_mode = TRUE; unsetenv ("UPSTART_SESSION"); TEST_DIVERT_STDERR (output) { proxy = upstart_open (NULL); } rewind (output); TEST_EQ_P (proxy, NULL); TEST_FILE_EQ (output, ("test: UPSTART_SESSION isn't set in the environment. " "Unable to locate the Upstart instance.\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); dbus_shutdown (); user_mode = FALSE; } fclose (output); } void test_job_status (void) { pid_t dbus_pid; DBusConnection *server_conn; DBusConnection *client_conn; pid_t server_pid; DBusMessage * method_call; const char * interface; const char * property; DBusMessage * reply = NULL; DBusMessageIter iter; DBusMessageIter arrayiter; DBusMessageIter dictiter; DBusMessageIter subiter; DBusMessageIter prociter; DBusMessageIter structiter; const char * str_value; int32_t int32_value; NihDBusProxy * job_class = NULL; NihDBusProxy * job = NULL; char * str; NihError * err; NihDBusError * dbus_err; int status; TEST_FUNCTION ("job_status"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); TEST_DBUS_OPEN (client_conn); /* Check that we can generate a string for a job instance that * is running with a main process. The function should request * the name of the job class, and then request all of the * properties of the job instance. */ TEST_FEATURE ("with running main process"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test start/running, process 3648"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that we can generate a string for a named job instance, * the name should be placed in the returned string in brackets * after the job config name. */ TEST_FEATURE ("with named instance"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/beetroot"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "beetroot"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/beetroot", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test (beetroot) start/running, process 3648"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that we can generate a string for a job instance in a * state that doesn't come with a process, only the goal and * state should be output. */ TEST_FEATURE ("with no process"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "stopping"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test stop/stopping"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that we can generate a string for a job instance with * a running pre-start process, since this is a standard state * with a process, the pid should simply follow the state. */ TEST_FEATURE ("with running pre-start process"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "pre-start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "pre-start"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 1014; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test start/pre-start, process 1014"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that we can generate a string for a job instance with * a running post-stop process, since this is a standard state * with a process, the pid should simply follow the state. */ TEST_FEATURE ("with running post-stop process"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "post-stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "post-stop"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 9764; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test stop/post-stop, process 9764"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that we can generate a string for a job instance with * a running post-start process, but no main process. Since this * is not a standard state process, the process name should be * prefixed. */ TEST_FEATURE ("with running post-start process only"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "post-start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "post-start"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 2137; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test start/post-start, (post-start) process 2137"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that we can generate a string for a job instance with * a running pre-stop process, but no main process. Since this * is not a standard state process, the process name should be * prefixed. */ TEST_FEATURE ("with running pre-stop process only"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "pre-stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "pre-stop"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 7864; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test stop/pre-stop, (pre-stop) process 7864"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that we can generate a string for a job instance that * is running with a main process and a simultaneous post-start * process. The main process should be output on the first line * along with the state, the pid of the post-start process should * follow indented on the next line. */ TEST_FEATURE ("with running main and post-start processes"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "post-start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "post-start"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 2137; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, ("test start/post-start, process 3648\n" "\tpost-start process 2137")); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that we can generate a string for a job instance that * is running with a main process and a simultaneous pre-stop * process. The main process should be output on the first line * along with the state, the pid of the pre-stop process should * follow indented on the next line. */ TEST_FEATURE ("with running main and pre-stop processes"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "pre-stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "pre-stop"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 7864; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, ("test stop/pre-stop, process 3648\n" "\tpre-stop process 7864")); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that we can generate a string for a job instance that * is running with a main process, but in one of the "unusual" * states to catch the process in. The process should be output * as normal. */ TEST_FEATURE ("with running main process in spawned state"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "spawned"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test start/spawned, process 3648"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that the function catches the job instance going away * in the mean time (and the server returning the unknown method * error), and handles that as an instance that has freshly * stopped. */ TEST_FEATURE ("with unknown instance"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the properties, reply * with the unknown method error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test stop/waiting"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } /* Check that NULL can be given as the job instance, and that the * function only requests the name of the job class and outputs * as if there was no instance. */ TEST_FEATURE ("with NULL for instance"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with the * name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); } str = job_status (NULL, job_class, NULL); if (test_alloc_failed && (str == NULL)) { err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ_STR (str, "test stop/waiting"); nih_free (str); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job_class); } /* Check that when the function is passed a bad job class proxy, * it returns the error received from the server. */ TEST_FEATURE ("with bad job class"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the name, reply with an * error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } TEST_ALLOC_SAFE { job_class = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test", NULL, NULL); job = nih_dbus_proxy_new (NULL, client_conn, dbus_bus_get_unique_name (server_conn), DBUS_PATH_UPSTART "/jobs/test/_", NULL, NULL); } str = job_status (NULL, job_class, job); TEST_EQ_P (str, NULL); err = nih_error_get (); if (test_alloc_failed && (err->number == ENOMEM)) { nih_free (err); nih_free (job); nih_free (job_class); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (err->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (err, sizeof (NihDBusError)); dbus_err = (NihDBusError *)err; TEST_EQ_STR (dbus_err->name, DBUS_ERROR_UNKNOWN_METHOD); nih_free (dbus_err); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); nih_free (job_class); } TEST_DBUS_CLOSE (client_conn); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_start_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; DBusMessage * method_call; DBusMessage * reply = NULL; const char * name_value; char ** args_value; int args_elements; int wait_value; const char * str_value; const char * interface; const char * property; DBusMessageIter iter; DBusMessageIter subiter; DBusMessageIter arrayiter; DBusMessageIter dictiter; DBusMessageIter prociter; DBusMessageIter structiter; int32_t int32_value; NihCommand command; char * args[4]; int ret = 0; int status; TEST_FUNCTION ("start_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that the start action with a single argument given looks * up a job with that name, and then calls the Start command * passing a NULL array for the events and TRUE for wait. Once * it receives the reply, it will then make queries to obtain the * status of the command and print the output. */ TEST_FEATURE ("with single argument"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Start method call on the job object, * make sure the environment and wait arguments * are right and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Start")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = start_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that additional arguments to the start action are passed * as entries in the environment argument of the command. */ TEST_FEATURE ("with multiple arguments"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Start method call on the job object, * make sure the environment and wait arguments * are right and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Start")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "FOO=foo"); TEST_EQ_STR (args_value[1], "BAR=bar"); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = "FOO=foo"; args[2] = "BAR=bar"; args[3] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = start_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that the --no-wait option results in the method call * being made with wait as FALSE. */ TEST_FEATURE ("with no wait"); no_wait = TRUE; TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Start method call on the job object, * make sure the environment and wait arguments * are right and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Start")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = start_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } no_wait = FALSE; /* Check that the start action may be called without arguments * when inside an instance process, due to the environment variables * set there. The job should be stilled looked up, but then the * instance should be looked up via GetInstanceByName and the Start * command run directly on the instance instead in a no-wait fashion. */ TEST_FEATURE ("with no arguments when called from job process"); setenv ("UPSTART_JOB", "test", TRUE); setenv ("UPSTART_INSTANCE", "foo", TRUE); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstanceByName method call on the * job object, make sure the instance name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstanceByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "foo"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/foo"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Start method call on the instance object, * make the wait argument is FALSE and reply to * to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_INSTANCE, "Start")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/foo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/foo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "foo"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = start_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test (foo) start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } unsetenv ("UPSTART_JOB"); unsetenv ("UPSTART_INSTANCE"); /* Check that if an error is received from the GetJobByName call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to GetJobByName"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = start_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the Start call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to Start"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Start method call on the job object, * make sure the environment and wait arguments * are right and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Start")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = start_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the status query, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to status query"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Start method call on the job object, * make sure the environment and wait arguments * are right and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Start")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the job name, reply with * an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = start_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that a missing argument results in an error being output * to stderr along with a suggestion of help. */ TEST_FEATURE ("with missing argument"); TEST_ALLOC_FAIL { memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = start_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: missing job name\n"); TEST_FILE_EQ (errors, "Try `test --help' for more information.\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_stop_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; DBusMessage * method_call; DBusMessage * reply = NULL; const char * name_value; char ** args_value; int args_elements; int wait_value; const char * str_value; const char * interface; const char * property; DBusMessageIter iter; DBusMessageIter subiter; NihCommand command; char * args[4]; int ret = 0; int status; TEST_FUNCTION ("stop_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that the stop action with a single argument given looks * up a job with that name, then looks up the instance with a NULL * arguments array (to get the path for later) and then calls the * Stop command passing a NULL array for the events and TRUE for wait. * Once it receives the reply, it will then make queries to obtain the * status of the command and print the output. */ TEST_FEATURE ("with single argument"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Stop method call on the job object, * make sure the environment and wait arguments * are right and reply to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Stop")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with an unknown method error since * there will be no instance at this point. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = stop_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test stop/waiting\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that additional arguments to the stop action are passed * as entries in the environment argument of the command. */ TEST_FEATURE ("with multiple arguments"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "FOO=foo"); TEST_EQ_STR (args_value[1], "BAR=bar"); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Stop method call on the job object, * make sure the environment and wait arguments * are right and reply to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Stop")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "FOO=foo"); TEST_EQ_STR (args_value[1], "BAR=bar"); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with an unknown method error since * there will be no instance at this point. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = "FOO=foo"; args[2] = "BAR=bar"; args[3] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = stop_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test stop/waiting\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that the --no-wait option results in the method call * being made with wait as FALSE. */ TEST_FEATURE ("with no wait"); no_wait = TRUE; TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Stop method call on the job object, * make sure the environment and wait arguments * are right and reply to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Stop")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with an unknown method error since * there will be no instance at this point. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = stop_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test stop/waiting\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } no_wait = FALSE; /* Check that the stop action may be called without arguments * when inside an instance process, due to the environment variables * set there. The job should be still looked up, but then the * instance should be looked up via GetInstanceByName and the Stop * command run directly on the instance instead in a no-wait fashion. */ TEST_FEATURE ("with no arguments when called from job process"); setenv ("UPSTART_JOB", "test", TRUE); setenv ("UPSTART_INSTANCE", "foo", TRUE); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstanceByName method call on the * job object, make sure the instance name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstanceByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "foo"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/foo"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Stop method call on the instance object, * make the wait argument is FALSE and reply to * to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_INSTANCE, "Stop")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/foo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with an unknown method error since * there will be no instance at this point. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/foo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = stop_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test stop/waiting\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } unsetenv ("UPSTART_JOB"); unsetenv ("UPSTART_INSTANCE"); /* Check that if an error is received from the GetJobByName call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to GetJobByName"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = stop_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the GetInstance call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to GetInstance"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = stop_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the Stop call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to Stop"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Stop method call on the job object, * make sure the environment and wait arguments * are right and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Stop")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = stop_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the status query, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to status query"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Stop method call on the job object, * make sure the environment and wait arguments * are right and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Stop")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the job name, reply with * an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = stop_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that a missing argument results in an error being output * to stderr along with a suggestion of help. */ TEST_FEATURE ("with missing argument"); TEST_ALLOC_FAIL { memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = stop_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: missing job name\n"); TEST_FILE_EQ (errors, "Try `test --help' for more information.\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_restart_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; DBusMessage * method_call; DBusMessage * reply = NULL; const char * name_value; char ** args_value; int args_elements; int wait_value; const char * str_value; const char * interface; const char * property; DBusMessageIter iter; DBusMessageIter subiter; DBusMessageIter arrayiter; DBusMessageIter dictiter; DBusMessageIter prociter; DBusMessageIter structiter; int32_t int32_value; NihCommand command; char * args[4]; int ret = 0; int status; TEST_FUNCTION ("restart_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that the restart action with a single argument given looks * up a job with that name, and then calls the Restart command * passing a NULL array for the events and TRUE for wait. Once * it receives the reply, it will then make queries to obtain the * status of the command and print the output. */ TEST_FEATURE ("with single argument"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Start method call on the job object, * make sure the environment and wait arguments * are right and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Restart")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = restart_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that additional arguments to the restart action are passed * as entries in the environment argument of the command. */ TEST_FEATURE ("with multiple arguments"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Restart method call on the job object, * make sure the environment and wait arguments * are right and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Restart")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "FOO=foo"); TEST_EQ_STR (args_value[1], "BAR=bar"); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = "FOO=foo"; args[2] = "BAR=bar"; args[3] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = restart_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that the --no-wait option results in the method call * being made with wait as FALSE. */ TEST_FEATURE ("with no wait"); no_wait = TRUE; TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Restart method call on the job object, * make sure the environment and wait arguments * are right and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Restart")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = restart_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } no_wait = FALSE; /* Check that the restart action may be called without arguments * when inside an instance process, due to the environment variables * set there. The job should be stilled looked up, but then the * instance should be looked up via GetInstanceByName and the Restart * command run directly on the instance instead in a no-wait fashion. */ TEST_FEATURE ("with no arguments when called from job process"); setenv ("UPSTART_JOB", "test", TRUE); setenv ("UPSTART_INSTANCE", "foo", TRUE); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstanceByName method call on the * job object, make sure the instance name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstanceByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "foo"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/foo"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Restart method call on the instance * object, make the wait argument is FALSE and reply to * to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_INSTANCE, "Restart")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/foo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* We allow the client to get the properties as many * times as it likes, since it repeats this in out * of memory cases. */ for (;;) { void hup_handler (int signum) { _exit (0); } signal (SIGHUP, hup_handler); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/foo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "foo"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); } TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = restart_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test (foo) start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGHUP); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } unsetenv ("UPSTART_JOB"); unsetenv ("UPSTART_INSTANCE"); /* Check that if an error is received from the GetJobByName call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to GetJobByName"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = restart_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the Restart call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to Restart"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Restart method call on the job object, * make sure the environment and wait arguments * are right and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Restart")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = restart_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the status query, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to status query"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Restart method call on the job object, * make sure the environment and wait arguments * are right and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "Restart")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the job name, reply with * an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = restart_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that a missing argument results in an error being output * to stderr along with a suggestion of help. */ TEST_FEATURE ("with missing argument"); TEST_ALLOC_FAIL { memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = restart_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: missing job name\n"); TEST_FILE_EQ (errors, "Try `test --help' for more information.\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_reload_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; pid_t proc_pid; DBusMessage * method_call; DBusMessage * reply = NULL; const char * name_value; char ** args_value; int args_elements; const char * str_value; const char * interface; const char * property; DBusMessageIter iter; DBusMessageIter subiter; DBusMessageIter arrayiter; DBusMessageIter structiter; int32_t int32_value; NihCommand command; char * args[4]; int ret = 0; int status; TEST_FUNCTION ("reload_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that the reload action with a single argument given looks * up a job with that name, then requests the list of processes * sending a SIGHUP signal to the main process. */ TEST_FEATURE ("with single argument"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Reload call against job instance * and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_INSTANCE, "Reload")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_INVALID)); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = reload_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that additional arguments to the restart action are passed * as entries in the environment argument of the command. */ TEST_FEATURE ("with multiple arguments"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "FOO=foo"); TEST_EQ_STR (args_value[1], "BAR=bar"); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Reload call against job instance * and reply with an instance path to * acknowledge */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_INSTANCE, "Reload")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_INVALID)); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = "FOO=foo"; args[2] = "BAR=bar"; args[3] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = reload_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that the reload action may be called without arguments * when inside an instance process, due to the environment variables * set there. The job should be stilled looked up, but then the * instance should be looked up via GetInstanceByName instead. */ TEST_FEATURE ("with no arguments when called from job process"); setenv ("UPSTART_JOB", "test", TRUE); setenv ("UPSTART_INSTANCE", "foo", TRUE); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstanceByName method call on the * job object, make sure the instance name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstanceByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "foo"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/foo"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Reload call against job instance * and reply with an instance path to * acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_INSTANCE, "Reload")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/foo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_INVALID)); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = reload_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } unsetenv ("UPSTART_JOB"); unsetenv ("UPSTART_INSTANCE"); /* Check that if an error is received from the GetJobByName call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to GetJobByName"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = reload_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the GetInstance call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to GetInstance"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = reload_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the Reload call, * the fallback path is used to query main pid and SIGHUP * that. */ TEST_FEATURE ("with error reply to Reload"); TEST_ALLOC_FAIL { TEST_CHILD (proc_pid) { pause (); } TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Reload method call against job * instance and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_INSTANCE, "Reload")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_INVALID)); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the processes, reply with * a main process pid. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &arrayiter); dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = proc_pid; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&arrayiter, &structiter); dbus_message_iter_close_container (&subiter, &arrayiter); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = reload_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); kill (proc_pid, SIGTERM); waitpid (proc_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); kill (proc_pid, SIGTERM); waitpid (proc_pid, NULL, 0); continue; } /* Check that a missing argument results in an error being output * to stderr along with a suggestion of help. */ TEST_FEATURE ("with missing argument"); TEST_ALLOC_FAIL { memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = reload_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: missing job name\n"); TEST_FILE_EQ (errors, "Try `test --help' for more information.\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_status_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; DBusMessage * method_call; DBusMessage * reply = NULL; const char * name_value; char ** args_value; int args_elements; const char * str_value; const char * interface; const char * property; DBusMessageIter iter; DBusMessageIter subiter; DBusMessageIter arrayiter; DBusMessageIter dictiter; DBusMessageIter prociter; DBusMessageIter structiter; int32_t int32_value; NihCommand command; char * args[4]; int ret = 0; int status; TEST_FUNCTION ("status_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that the status action with a single argument given looks * up a job with that name, then looks up the instance with a NULL * arguments array (to get the path for later) and then makes * queries to obtain the status of that instance printing the * output. */ TEST_FEATURE ("with single argument"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = status_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that additional arguments to the status action are passed * as entries in the environment to GetInstance. */ TEST_FEATURE ("with multiple arguments"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "FOO=foo"); TEST_EQ_STR (args_value[1], "BAR=bar"); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = "FOO=foo"; args[2] = "BAR=bar"; args[3] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = status_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that the status action may be called without arguments * when inside an instance process, due to the environment variables * set there. The job should be still looked up, but then the * instance should be looked up via GetInstanceByName and the * queries run on that instance. */ TEST_FEATURE ("with no arguments when called from job process"); setenv ("UPSTART_JOB", "test", TRUE); setenv ("UPSTART_INSTANCE", "foo", TRUE); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstanceByName method call on the * job object, make sure the instance name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstanceByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "foo"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/foo"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test/foo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "foo"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = status_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test (foo) start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } unsetenv ("UPSTART_JOB"); unsetenv ("UPSTART_INSTANCE"); /* Check that an unknown instance error from the GetInstance call * is treated as a stopped job; the job name should still be * queried but not the instance properties. */ TEST_FEATURE ("with unknown instance"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with an error */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_INTERFACE_UPSTART ".Error.UnknownInstance", "Unknown instance"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the job name, reply with * the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "test"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = status_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "test stop/waiting\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that if an error is received from the GetJobByName call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to GetJobByName"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = status_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the GetInstance command, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to GetInstance"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = status_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the status query, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to status query"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetJobByName method call on the * manager object, make sure the job name is passed * and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetJobByName")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "test"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetInstance method call on the * job object, make sure the environment args are * passed and reply with a path. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetInstance")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_INVALID)); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); str_value = DBUS_PATH_UPSTART "/jobs/test/_"; dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &str_value, DBUS_TYPE_INVALID); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the job name, reply with * an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/test"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "test"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = status_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that a missing argument results in an error being output * to stderr along with a suggestion of help. */ TEST_FEATURE ("with missing argument"); TEST_ALLOC_FAIL { memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = status_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: missing job name\n"); TEST_FILE_EQ (errors, "Try `test --help' for more information.\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_list (void) { char dirname[PATH_MAX]; nih_local char *cmd = NULL; pid_t upstart_pid = 0; pid_t dbus_pid = 0; char **output; size_t lines; char expected_output[] = "foo stop/waiting"; TEST_GROUP ("list"); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* Use the "secret" interface */ TEST_EQ (setenv ("UPSTART_CONFDIR", dirname, 1), 0); TEST_DBUS (dbus_pid); /*******************************************************************/ TEST_FEATURE ("single job"); CREATE_FILE (dirname, "foo.conf", "exec echo hello"); START_UPSTART (upstart_pid, FALSE); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ (lines, 1); nih_free (output); DELETE_FILE (dirname, "foo.conf"); STOP_UPSTART (upstart_pid); /*******************************************************************/ TEST_FEATURE ("3 jobs and re-exec"); CREATE_FILE (dirname, "foo.conf", "exec echo foo"); CREATE_FILE (dirname, "bar.conf", "exec echo bar"); CREATE_FILE (dirname, "baz.conf", "exec echo bar"); START_UPSTART (upstart_pid, FALSE); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* guarantee output ordering */ qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ_STR (output[0], "bar stop/waiting"); TEST_EQ_STR (output[1], "baz stop/waiting"); TEST_EQ_STR (output[2], "foo stop/waiting"); TEST_EQ (lines, 3); nih_free (output); REEXEC_UPSTART (upstart_pid, FALSE); /* Ensure we can still list jobs after a re-exec */ cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* guarantee output ordering */ qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ_STR (output[0], "bar stop/waiting"); TEST_EQ_STR (output[1], "baz stop/waiting"); TEST_EQ_STR (output[2], "foo stop/waiting"); TEST_EQ (lines, 3); nih_free (output); DELETE_FILE (dirname, "foo.conf"); DELETE_FILE (dirname, "bar.conf"); DELETE_FILE (dirname, "baz.conf"); STOP_UPSTART (upstart_pid); /*******************************************************************/ TEST_EQ (unsetenv ("UPSTART_CONFDIR"), 0); TEST_DBUS_END (dbus_pid); TEST_EQ (rmdir (dirname), 0); } void test_reexec (void) { char confdir[PATH_MAX]; char logdir[PATH_MAX]; char flagfile[PATH_MAX]; nih_local char *cmd = NULL; pid_t job_pid = 0; pid_t tmp = 0; pid_t dbus_pid = 0; pid_t upstart_pid = 0; char **output; size_t lines; nih_local char *logfile = NULL; struct stat statbuf; nih_local char *contents = NULL; FILE *file; int ok; int ret; mode_t expected_umask; size_t len; TEST_GROUP ("re-exec support"); TEST_FILENAME (confdir); TEST_EQ (mkdir (confdir, 0755), 0); TEST_FILENAME (logdir); TEST_EQ (mkdir (logdir, 0755), 0); TEST_FILENAME (flagfile); /* Use the "secret" interface */ TEST_EQ (setenv ("UPSTART_CONFDIR", confdir, 1), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", logdir, 1), 0); TEST_DBUS (dbus_pid); /*******************************************************************/ TEST_FEATURE ("single job producing output across a re-exec"); start_upstart_common (&upstart_pid, FALSE, FALSE, confdir, logdir, NULL); contents = nih_sprintf (NULL, "pre-start exec echo pre-start\n" "script\n" "\n" "# Write first half of data\n" "for i in 1 2 3 4 5\n" "do\n" " echo $i\n" "done\n" "\n" "# hack to wait for notification that Upstart has re-exec'ed\n" "while [ ! -f \"%s\" ]\n" "do\n" " sleep 0.1\n" "done\n" "\n" "# remove flag file\n" "rm -f \"%s\"\n" "\n" "# Write remaining data\n" "for i in 6 7 8 9 10\n" "do\n" " echo $i\n" "done\n" "\n" "# hang around until killed\n" "sleep 999\n" "\n" "end script\n", flagfile, flagfile); TEST_NE_P (contents, NULL); CREATE_FILE (confdir, "foo.conf", contents); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s start foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); nih_free (output); /* check job is running */ job_pid = job_to_pid ("foo"); TEST_NE (job_pid, -1); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "foo.log")); /* Wait for log to be created */ ok = FALSE; for (int i = 0; i < 5; i++) { sleep (1); if (! stat (logfile, &statbuf)) { ok = TRUE; break; } } TEST_EQ (ok, TRUE); file = fopen (logfile, "r"); TEST_NE_P (file, NULL); /* check contents of log file */ TEST_FILE_EQ (file, "pre-start\r\n"); for (int i = 1; i < 6; i++) { nih_local char *line = NIH_MUST (nih_sprintf (NULL, "%d\r\n", i)); TEST_FILE_EQ (file, line); } TEST_FILE_END (file); fclose (file); REEXEC_UPSTART (upstart_pid, FALSE); /* Create flag file to allow job to proceed */ { FILE *f; f = fopen (flagfile, "w"); TEST_NE_P (f, NULL); fclose (f); } /* ensure job is still running */ tmp = job_to_pid ("foo"); TEST_NE (tmp, -1); /* ensure it hasn't changed pid */ TEST_EQ (job_pid, tmp); /* wait for script to remove flag file */ ok = FALSE; for (int i = 1; i < 6; i++) { ret = stat (flagfile, &statbuf); if (ret < 0 && errno == ENOENT) { ok = TRUE; break; } sleep (1); } TEST_EQ (ok, TRUE); cmd = nih_sprintf (NULL, "%s stop %s 2>&1", get_initctl (), "foo"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); nih_free (output); /* Wait for job to finish. We can't waitpid() for it as it's not one * of our children. */ ok = FALSE; for (int i = 0; i < 5; i++) { nih_local char *path = NIH_MUST (nih_sprintf (NULL, "/proc/%d", job_pid)); if (stat (path, &statbuf) < 0 && errno == ENOENT) { ok = TRUE; break; } sleep (1); } TEST_EQ (ok, TRUE); tmp = job_to_pid ("foo"); TEST_EQ (tmp, -1); TEST_EQ (stat (logfile, &statbuf), 0); file = fopen (logfile, "r"); TEST_NE_P (file, NULL); /* check contents of log file */ TEST_FILE_EQ (file, "pre-start\r\n"); for (int i = 1; i < 11; i++) { nih_local char *line = NIH_MUST (nih_sprintf (NULL, "%d\r\n", i)); TEST_FILE_EQ (file, line); } TEST_FILE_END (file); fclose (file); /* ensure script removed flagfile */ TEST_LT (stat (flagfile, &statbuf), 0); DELETE_FILE (confdir, "foo.conf"); DELETE_FILE (logdir, "foo.log"); STOP_UPSTART (upstart_pid); TEST_EQ (unsetenv ("UPSTART_CONFDIR"), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); /*******************************************************************/ TEST_FEATURE ("ensure 'set-env' persists across session-init re-exec"); TEST_TRUE (getenv ("XDG_RUNTIME_DIR")); contents = nih_sprintf (NULL, "start on startup\n" "\n" "pre-start script\n" "%s set-env foo=bar\n" "\n" "# create flag file\n" "touch \"%s\"\n" "\n" "end script\n" "\n" "# a minimal main process\n" "exec true\n" "\n" "post-stop script\n" "\n" "# wait for upstart to notify us that it has re-execed\n" "while [ -f \"%s\" ]\n" "do\n" " sleep 0.1\n" "done\n" "\n" "# query value post-re-exec\n" "%s get-env foo\n" "\n" "end script\n", get_initctl_binary(), flagfile, flagfile, get_initctl_binary()); TEST_NE_P (contents, NULL); CREATE_FILE (confdir, "foo.conf", contents); start_upstart_common (&upstart_pid, TRUE, TRUE, confdir, logdir, NULL); WAIT_FOR_FILE (flagfile); /* check job is running */ job_pid = job_to_pid ("foo"); TEST_NE (job_pid, -1); REEXEC_UPSTART (upstart_pid, TRUE); /* Notify job that upstart has re-exec'd */ assert0 (unlink (flagfile)); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "foo.log")); WAIT_FOR_FILE (logfile); file = fopen (logfile, "r"); TEST_NE_P (file, NULL); TEST_FILE_EQ (file, "bar\r\n"); fclose (file); STOP_UPSTART (upstart_pid); assert0 (unlink (logfile)); DELETE_FILE (confdir, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("ensure 'set-env --global' persists across session-init re-exec"); START_UPSTART (upstart_pid, TRUE); /* Set variable. Use confdir as a random value */ cmd = nih_sprintf (NULL, "%s set-env --global path='%s' 2>&1", get_initctl (), confdir); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); /* Check it */ cmd = nih_sprintf (NULL, "%s get-env --global path 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], confdir); nih_free (output); /* Restart */ REEXEC_UPSTART (upstart_pid, TRUE); /* Re-check */ cmd = nih_sprintf (NULL, "%s get-env --global path 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], confdir); nih_free (output); STOP_UPSTART (upstart_pid); /*******************************************************************/ TEST_FEATURE ("ensure re-exec does not disrupt umask"); contents = nih_sprintf (NULL, "exec sh -c umask"); TEST_NE_P (contents, NULL); CREATE_FILE (confdir, "umask.conf", contents); nih_free (contents); start_upstart_common (&upstart_pid, TRUE, TRUE, confdir, logdir, NULL); cmd = nih_sprintf (NULL, "%s start umask 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); nih_free (output); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "umask.log")); /* Wait for log to be created */ ok = FALSE; for (int i = 0; i < 5; i++) { sleep (1); if (! stat (logfile, &statbuf)) { ok = TRUE; break; } } TEST_EQ (ok, TRUE); contents = nih_file_read (NULL, logfile, &len); TEST_NE_P (contents, NULL); TEST_TRUE (len); /* overwrite '\n' */ contents[len-1] = '\0'; expected_umask = (mode_t)atoi (contents); assert0 (unlink (logfile)); nih_free (contents); /* Restart */ REEXEC_UPSTART (upstart_pid, TRUE); /* Re-run job */ RUN_COMMAND (NULL, cmd, &output, &lines); nih_free (output); /* Wait for log to be recreated */ ok = FALSE; for (int i = 0; i < 5; i++) { sleep (1); if (! stat (logfile, &statbuf)) { ok = TRUE; break; } } TEST_EQ (ok, TRUE); contents = nih_file_read (NULL, logfile, &len); TEST_NE_P (contents, NULL); TEST_TRUE (len); /* overwrite '\n' */ contents[len-1] = '\0'; TEST_EQ (expected_umask, (mode_t)atoi (contents)); STOP_UPSTART (upstart_pid); DELETE_FILE (confdir, "umask.conf"); assert0 (unlink (logfile)); /*******************************************************************/ TEST_DBUS_END (dbus_pid); TEST_EQ (rmdir (confdir), 0); TEST_EQ (rmdir (logdir), 0); /*******************************************************************/ } void test_list_sessions (void) { char dirname[PATH_MAX]; char confdir[PATH_MAX]; nih_local char *cmd = NULL; pid_t upstart_pid = 0; char **output; size_t lines; struct stat statbuf; nih_local char *contents = NULL; nih_local char *session_file = NULL; nih_local char *path = NULL; nih_local char *expected = NULL; nih_local char *original_runtime = NULL; size_t len; char *value; TEST_GROUP ("list-sessions"); original_runtime = nih_strdup (NULL, getenv("XDG_RUNTIME_DIR")); TEST_NE_P (original_runtime, NULL); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); TEST_FILENAME (confdir); TEST_EQ (mkdir (confdir, 0755), 0); /*******************************************************************/ TEST_FEATURE ("with no instances and XDG_RUNTIME_DIR unset"); assert0 (unsetenv ("XDG_RUNTIME_DIR")); cmd = nih_sprintf (NULL, "%s list-sessions 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_EQ_STR (output[0], "initctl: Unable to query session directory"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("with no instances and XDG_RUNTIME_DIR set"); TEST_EQ (setenv ("XDG_RUNTIME_DIR", dirname, 1), 0); cmd = nih_sprintf (NULL, "%s list-sessions 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); /*******************************************************************/ TEST_FEATURE ("with 1 running instance"); /* Use the "secret" interface */ TEST_EQ (setenv ("UPSTART_CONFDIR", confdir, 1), 0); TEST_EQ (setenv ("XDG_RUNTIME_DIR", dirname, 1), 0); /* Reset initctl global from previous tests */ dest_name = NULL; start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, NULL, NULL); session_file = get_session_file (dirname, upstart_pid); /* session file should now have been created by Upstart */ TEST_EQ (stat (session_file, &statbuf), 0); contents = nih_file_read (NULL, session_file, &len); TEST_NE_P (contents, NULL); TEST_TRUE (len); /* overwrite '\n' */ contents[len-1] = '\0'; TEST_EQ_P (strstr (contents, "UPSTART_SESSION="), contents); value = strchr (contents, '='); TEST_NE_P (value, NULL); /* jump over '=' */ value++; TEST_NE_P (value, NULL); expected = nih_sprintf (NULL, "%d %s", (int)upstart_pid, value); cmd = nih_sprintf (NULL, "%s list-sessions 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_EQ_STR (output[0], expected); nih_free (output); STOP_UPSTART (upstart_pid); /* Upstart cannot yet be instructed to shutdown cleanly, so for * now we have to remove the session file manually. */ TEST_EQ (unlink (session_file), 0); /* Remove the directory tree the Session Init created */ path = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions", dirname)); TEST_EQ (rmdir (path), 0); path = NIH_MUST (nih_sprintf (NULL, "%s/upstart", dirname)); TEST_EQ (rmdir (path), 0); /*******************************************************************/ assert0 (unsetenv ("UPSTART_CONFDIR")); TEST_EQ (rmdir (dirname), 0); TEST_EQ (rmdir (confdir), 0); TEST_EQ (setenv ("XDG_RUNTIME_DIR", original_runtime, 1), 0); /*******************************************************************/ } void test_no_dbus (void) { nih_local char *cmd = NULL; char **output; size_t lines; pid_t upstart_pid = 0; pid_t dbus_pid = 0; char *extra[] = { "--no-dbus", NULL }; TEST_GROUP ("Test '--no-dbus'"); TEST_DBUS (dbus_pid); /*******************************************************************/ /* First perform a sanity check */ TEST_FEATURE ("Ensure version can be queried normally"); start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, NULL, NULL); cmd = nih_sprintf (NULL, "%s version 2>/dev/null", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "init*(upstart [0-9]*"); nih_free (output); STOP_UPSTART (upstart_pid); /*******************************************************************/ /* Now, try with dbus disabled */ TEST_FEATURE ("Ensure '--no-dbus' disables D-Bus"); start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, NULL, extra); cmd = nih_sprintf (NULL, "%s version 2>/dev/null", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* No output on stdout expected */ TEST_EQ (lines, 0); /*******************************************************************/ TEST_FEATURE ("Ensure D-Bus still disabled on SIGUSR1"); assert0 (kill (upstart_pid, SIGUSR1)); cmd = nih_sprintf (NULL, "%s version 2>/dev/null", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* No output on stdout expected */ TEST_EQ (lines, 0); STOP_UPSTART (upstart_pid); /*******************************************************************/ TEST_DBUS_END (dbus_pid); } void test_quiesce (void) { char confdir[PATH_MAX]; char logdir[PATH_MAX]; char pid_file[PATH_MAX]; nih_local char *sessiondir; nih_local char *cmd = NULL; pid_t upstart_pid = 0; nih_local char *logfile = NULL; FILE *file; char **output; size_t lines; nih_local NihDBusProxy *upstart = NULL; nih_local char *session_file = NULL; nih_local char *job = NULL; pid_t job_pid; TEST_GROUP ("Session Init quiesce"); TEST_FILENAME (confdir); TEST_EQ (mkdir (confdir, 0755), 0); TEST_FILENAME (logdir); TEST_EQ (mkdir (logdir, 0755), 0); sessiondir = nih_strdup (NULL, getenv ("XDG_RUNTIME_DIR")); TEST_NE_P (sessiondir, NULL); cmd = nih_sprintf (NULL, "rm %s/upstart/sessions/*.session 2>/dev/null", sessiondir); assert0 (system (cmd)); /* Use the "secret" interface */ TEST_EQ (setenv ("UPSTART_CONFDIR", confdir, 1), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", logdir, 1), 0); /* Reset initctl global from previous tests */ dest_name = NULL; /*******************************************************************/ TEST_FEATURE ("system shutdown: no jobs"); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); /* Trigger shutdown */ assert0 (kill (upstart_pid, SIGTERM)); /* Force reset */ test_user_mode = FALSE; TEST_EQ (timed_waitpid (upstart_pid, TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /*******************************************************************/ TEST_FEATURE ("system shutdown: one long-running job"); CREATE_FILE (confdir, "long-running.conf", "exec sleep 999"); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s start %s 2>&1", get_initctl (), "long-running"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); nih_free (output); job_pid = job_to_pid ("long-running"); TEST_NE (job_pid, -1); /* Trigger shutdown */ assert0 (kill (upstart_pid, SIGTERM)); /* Force reset */ test_user_mode = FALSE; /* Wait for longer than we expect the Session Init to take to * shutdown to give it time to send SIGKILL to all job * processes. This is unrealistic, but safer for the tests since * the exact behaviour can be checked. * * In reality, the following steps either side of the markers *will* * occur and those within the markers *may* occur: * * 1) A System Shutdown is triggered. * 2) The Display Manager receives SIGTERM. * 3) The Display Manager sends SIGTERM to all its clients. * (including the Session Init). * 4) The Session Init sends SIGTERM to all running job * processes. * * --- :XXX: START MARKER :XXX: --- * * 5) The Session Init will attempt to wait for * MAX(kill_timeout) seconds. * 6) The Session Init will send all running job processes * SIGKILL. * 7) The Session Init will wait for all remaining job processes * to end. * 8) The Session Init will exit. * * --- :XXX: END MARKER :XXX: --- * * 9) The Display Manager sends SIGKILL to all its clients. * 10) If still running, the Session Init is killed and exits. * * The problem is that the Session Init cannot know when the * Display Manager will kill *it* so it may be that the Session * Init cannot send SIGKILL to each job process instead relying * on the System Init to clean up. */ TEST_EQ (timed_waitpid (upstart_pid, 1+TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); TEST_EQ (errno, ESRCH); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /* pid should no longer exist */ TEST_EQ (kill (job_pid, SIGKILL), -1); TEST_EQ (errno, ESRCH); DELETE_FILE (confdir, "long-running.conf"); /*******************************************************************/ TEST_FEATURE ("system shutdown: one long-running job which ignores SIGTERM"); CREATE_FILE (confdir, "long-running-term.conf", "script\n" " trap '' TERM\n" " sleep 999\n" "end script"); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s start %s 2>&1", get_initctl (), "long-running-term"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); nih_free (output); job_pid = job_to_pid ("long-running-term"); TEST_NE (job_pid, -1); /* Trigger shutdown */ assert0 (kill (upstart_pid, SIGTERM)); /* Force reset */ test_user_mode = FALSE; TEST_EQ (timed_waitpid (upstart_pid, 1+TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); TEST_EQ (errno, ESRCH); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /* pid should no longer exist */ TEST_EQ (kill (job_pid, SIGKILL), -1); TEST_EQ (errno, ESRCH); DELETE_FILE (confdir, "long-running-term.conf"); /*******************************************************************/ TEST_FEATURE ("system shutdown: one job which starts on session-end"); TEST_FILENAME (pid_file); job = NIH_MUST (nih_sprintf (NULL, "start on session-end\n" "\n" "script\n" " echo hello\n" " echo $$ >\"%s\"\n" " exec sleep 999\n" "end script", pid_file)); CREATE_FILE (confdir, "session-end.conf", job); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); /* Trigger shutdown */ assert0 (kill (upstart_pid, SIGTERM)); /* Force reset */ test_user_mode = FALSE; TEST_EQ (timed_waitpid (upstart_pid, 1+TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); TEST_EQ (errno, ESRCH); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "session-end.log")); file = fopen (logfile, "r"); TEST_NE_P (file, NULL); TEST_FILE_EQ (file, "hello\r\n"); TEST_FILE_END (file); TEST_EQ (fclose (file), 0); assert0 (unlink (logfile)); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); file = fopen (pid_file, "r"); TEST_NE_P (file, NULL); TEST_EQ (fscanf (file, "%d", &job_pid), 1); fclose (file); /* pid should be running since Upstart won't have signalled it * to stop (since it started as a result of session-end being * emitted _after_ the job pids were sent SIGTERM). */ TEST_EQ (kill (job_pid, SIGKILL), 0); assert0 (unlink (pid_file)); DELETE_FILE (confdir, "session-end.conf"); /*******************************************************************/ TEST_FEATURE ("system shutdown: one job which starts on session-end and ignores SIGTERM"); TEST_FILENAME (pid_file); job = NIH_MUST (nih_sprintf (NULL, "start on session-end\n" "\n" "script\n" " trap '' TERM\n" " echo hello\n" " echo $$ >\"%s\"\n" " exec sleep 999\n" "end script", pid_file)); CREATE_FILE (confdir, "session-end-term.conf", job); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); /* Trigger shutdown */ assert0 (kill (upstart_pid, SIGTERM)); /* Force reset */ test_user_mode = FALSE; TEST_EQ (timed_waitpid (upstart_pid, 1+TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); TEST_EQ (errno, ESRCH); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "session-end-term.log")); file = fopen (logfile, "r"); TEST_NE_P (file, NULL); TEST_FILE_EQ (file, "hello\r\n"); TEST_FILE_END (file); TEST_EQ (fclose (file), 0); assert0 (unlink (logfile)); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /* kill job pid if not already dead */ file = fopen (pid_file, "r"); TEST_NE_P (file, NULL); TEST_EQ (fscanf (file, "%d", &job_pid), 1); fclose (file); /* pid should still be running */ TEST_EQ (kill (job_pid, SIGKILL), 0); assert0 (unlink (pid_file)); DELETE_FILE (confdir, "session-end-term.conf"); /*******************************************************************/ TEST_FEATURE ("system shutdown: 2 jobs " "(1 long-running job which ignores SIGTERM, " "1 which starts on session-end and ignores SIGTERM)"); CREATE_FILE (confdir, "long-running-term.conf", "script\n" " trap '' TERM\n" " exec sleep 999\n" "end script"); TEST_FILENAME (pid_file); job = NIH_MUST (nih_sprintf (NULL, "start on session-end\n" "\n" "script\n" " trap '' TERM\n" " echo $$ >\"%s\"\n" " exec sleep 999\n" "end script", pid_file)); CREATE_FILE (confdir, "session-end-term.conf", job); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s start %s 2>&1", get_initctl (), "long-running-term"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); nih_free (output); job_pid = job_to_pid ("long-running-term"); TEST_NE (job_pid, -1); /* Trigger shutdown */ assert0 (kill (upstart_pid, SIGTERM)); /* Force reset */ test_user_mode = FALSE; TEST_EQ (timed_waitpid (upstart_pid, 1+TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); TEST_EQ (errno, ESRCH); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /* the long-running job pid should no longer exist */ kill (job_pid, SIGKILL); TEST_EQ (errno, ESRCH); file = fopen (pid_file, "r"); TEST_NE_P (file, NULL); TEST_EQ (fscanf (file, "%d", &job_pid), 1); fclose (file); /* .... but the session-end job pid should still be running */ TEST_EQ (kill (job_pid, SIGKILL), 0); assert0 (unlink (pid_file)); DELETE_FILE (confdir, "long-running-term.conf"); DELETE_FILE (confdir, "session-end-term.conf"); /*******************************************************************/ TEST_FEATURE ("session shutdown: no jobs"); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); /* Further required initctl global resets. Shudder. */ user_mode = TRUE; use_dbus = -1; dbus_bus_type = DBUS_BUS_SESSION; dbus_bus_type = -1; upstart = upstart_open (NULL); TEST_NE_P (upstart, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); /* Force reset */ test_user_mode = FALSE; /* Trigger session shutdown */ assert0 (upstart_end_session_sync (NULL, upstart)); /* no jobs, so Session Init should shutdown "immediately" */ TEST_EQ (timed_waitpid (upstart_pid, TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /*******************************************************************/ TEST_FEATURE ("session shutdown: one long-running job"); CREATE_FILE (confdir, "long-running.conf", "exec sleep 999"); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); cmd = nih_sprintf (NULL, "%s start %s 2>&1", get_initctl (), "long-running"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); nih_free (output); job_pid = job_to_pid ("long-running"); TEST_NE (job_pid, -1); upstart = upstart_open (NULL); TEST_NE_P (upstart, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); /* Force reset */ test_user_mode = FALSE; /* Trigger session shutdown */ assert0 (upstart_end_session_sync (NULL, upstart)); TEST_EQ (timed_waitpid (upstart_pid, TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); TEST_EQ (errno, ESRCH); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /* pid should no longer exist */ TEST_EQ (kill (job_pid, SIGKILL), -1); TEST_EQ (errno, ESRCH); DELETE_FILE (confdir, "long-running.conf"); /*******************************************************************/ TEST_FEATURE ("session shutdown: one long-running job which starts on startup"); CREATE_FILE (confdir, "startup.conf", "start on startup\n" "exec sleep 999"); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); upstart = upstart_open (NULL); TEST_NE_P (upstart, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); job_pid = job_to_pid ("startup"); TEST_NE (job_pid, -1); /* Force reset */ test_user_mode = FALSE; /* Trigger session shutdown */ assert0 (upstart_end_session_sync (NULL, upstart)); /* Session Init should end very quickly since there will be no * wait phase. */ TEST_EQ (timed_waitpid (upstart_pid, TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); TEST_EQ (errno, ESRCH); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /* pid should no longer exist */ TEST_EQ (kill (job_pid, SIGKILL), -1); TEST_EQ (errno, ESRCH); DELETE_FILE (confdir, "startup.conf"); /*******************************************************************/ TEST_FEATURE ("session shutdown: one long-running job which ignores SIGTERM"); CREATE_FILE (confdir, "long-running-term.conf", "script\n" " trap '' TERM\n" " sleep 999\n" "end script"); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); cmd = nih_sprintf (NULL, "%s start %s 2>&1", get_initctl (), "long-running-term"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); nih_free (output); job_pid = job_to_pid ("long-running-term"); TEST_NE (job_pid, -1); upstart = upstart_open (NULL); TEST_NE_P (upstart, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); /* Force reset */ test_user_mode = FALSE; /* Trigger session shutdown */ assert0 (upstart_end_session_sync (NULL, upstart)); TEST_EQ (timed_waitpid (upstart_pid, TEST_QUIESCE_KILL_PHASE), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); TEST_EQ (errno, ESRCH); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /* pid should no longer exist */ TEST_EQ (kill (job_pid, SIGKILL), -1); TEST_EQ (errno, ESRCH); DELETE_FILE (confdir, "long-running-term.conf"); /*******************************************************************/ TEST_FEATURE ("session shutdown: one job which starts on session-end"); TEST_FILENAME (pid_file); job = NIH_MUST (nih_sprintf (NULL, "start on session-end\n" "\n" "script\n" " echo hello\n" " echo $$ >\"%s\"\n" " exec sleep 999\n" "end script", pid_file)); CREATE_FILE (confdir, "session-end.conf", job); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); upstart = upstart_open (NULL); TEST_NE_P (upstart, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); /* Force reset */ test_user_mode = FALSE; /* Trigger session shutdown */ assert0 (upstart_end_session_sync (NULL, upstart)); TEST_EQ (timed_waitpid (upstart_pid, TEST_QUIESCE_TOTAL_WAIT_TIME), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "session-end.log")); file = fopen (logfile, "r"); TEST_NE_P (file, NULL); TEST_FILE_EQ (file, "hello\r\n"); TEST_FILE_END (file); TEST_EQ (fclose (file), 0); assert0 (unlink (logfile)); file = fopen (pid_file, "r"); TEST_NE_P (file, NULL); TEST_EQ (fscanf (file, "%d", &job_pid), 1); fclose (file); /* pid should no longer exist */ TEST_EQ (kill (job_pid, SIGKILL), -1); TEST_EQ (errno, ESRCH); assert0 (unlink (pid_file)); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); DELETE_FILE (confdir, "session-end.conf"); /*******************************************************************/ TEST_FEATURE ("session shutdown: one job which starts on session-end"); TEST_FILENAME (pid_file); job = NIH_MUST (nih_sprintf (NULL, "start on session-end\n" "\n" "script\n" " trap '' TERM\n" " echo hello\n" " echo $$ >\"%s\"\n" " exec sleep 999\n" "end script", pid_file)); CREATE_FILE (confdir, "session-end-term.conf", job); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); upstart = upstart_open (NULL); TEST_NE_P (upstart, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); /* Force reset */ test_user_mode = FALSE; /* Trigger session shutdown */ assert0 (upstart_end_session_sync (NULL, upstart)); TEST_EQ (timed_waitpid (upstart_pid, TEST_QUIESCE_TOTAL_WAIT_TIME), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "session-end-term.log")); file = fopen (logfile, "r"); TEST_NE_P (file, NULL); TEST_FILE_EQ (file, "hello\r\n"); TEST_FILE_END (file); TEST_EQ (fclose (file), 0); assert0 (unlink (logfile)); file = fopen (pid_file, "r"); TEST_NE_P (file, NULL); TEST_EQ (fscanf (file, "%d", &job_pid), 1); fclose (file); /* pid should no longer exist */ TEST_EQ (kill (job_pid, SIGKILL), -1); TEST_EQ (errno, ESRCH); assert0 (unlink (pid_file)); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); DELETE_FILE (confdir, "session-end-term.conf"); /*******************************************************************/ TEST_FEATURE ("session shutdown: 2 jobs " "(1 long-running job which ignores SIGTERM, " "1 which starts on session-end and ignores SIGTERM)"); CREATE_FILE (confdir, "long-running-term.conf", "script\n" " trap '' TERM\n" " sleep 999\n" "end script"); TEST_FILENAME (pid_file); job = NIH_MUST (nih_sprintf (NULL, "start on session-end\n" "\n" "script\n" " trap '' TERM\n" " echo $$ >\"%s\"\n" " sleep 999\n" "end script", pid_file)); CREATE_FILE (confdir, "session-end-term.conf", job); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); cmd = nih_sprintf (NULL, "%s start %s 2>&1", get_initctl (), "long-running-term"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); nih_free (output); job_pid = job_to_pid ("long-running-term"); TEST_NE (job_pid, -1); upstart = upstart_open (NULL); TEST_NE_P (upstart, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); /* Force reset */ test_user_mode = FALSE; /* Trigger session shutdown */ assert0 (upstart_end_session_sync (NULL, upstart)); TEST_EQ (timed_waitpid (upstart_pid, TEST_QUIESCE_TOTAL_WAIT_TIME), upstart_pid); /* Should not now be running */ TEST_EQ (kill (upstart_pid, 0), -1); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", sessiondir, (int)upstart_pid)); unlink (session_file); /* pid should no longer exist */ TEST_EQ (kill (job_pid, SIGKILL), -1); TEST_EQ (errno, ESRCH); file = fopen (pid_file, "r"); TEST_NE_P (file, NULL); TEST_EQ (fscanf (file, "%d", &job_pid), 1); fclose (file); /* pid should no longer exist */ TEST_EQ (kill (job_pid, SIGKILL), -1); TEST_EQ (errno, ESRCH); assert0 (unlink (pid_file)); DELETE_FILE (confdir, "long-running-term.conf"); DELETE_FILE (confdir, "session-end-term.conf"); /*******************************************************************/ assert0 (unsetenv ("UPSTART_CONFDIR")); assert0 (unsetenv ("UPSTART_LOGDIR")); TEST_EQ (rmdir (logdir), 0); TEST_EQ (rmdir (confdir), 0); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions", sessiondir)); TEST_EQ (rmdir (session_file), 0); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart", sessiondir)); TEST_EQ (rmdir (session_file), 0); /*******************************************************************/ } void test_umask (void) { char confdir[PATH_MAX]; char dirname[PATH_MAX]; char logdir[PATH_MAX]; pid_t upstart_pid = 0; nih_local char *logfile = NULL; nih_local char *original_runtime = NULL; mode_t job_umask; nih_local char *job_umask_str = NULL; size_t length; int ret; mode_t original_umask; mode_t test_umask = 0077; mode_t default_umask = 022; original_runtime = nih_strdup (NULL, getenv ("XDG_RUNTIME_DIR")); TEST_NE_P (original_runtime, NULL); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("XDG_RUNTIME_DIR", dirname, 1), 0); TEST_FILENAME (confdir); TEST_EQ (mkdir (confdir, 0755), 0); TEST_EQ (setenv ("UPSTART_CONFDIR", confdir, 1), 0); TEST_FILENAME (logdir); TEST_EQ (mkdir (logdir, 0755), 0); original_umask = umask (test_umask); TEST_GROUP ("Session Init umask value"); /**********************************************************************/ TEST_FEATURE ("ensure Session Init inherits umask by default"); /* Has to be a script since umask is a shell built-in */ CREATE_FILE (confdir, "umask.conf", "start on startup\n" "script\n" "umask\n" "end script"); start_upstart_common (&upstart_pid, TRUE, TRUE, confdir, logdir, NULL); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "umask.log")); WAIT_FOR_FILE (logfile); job_umask_str = nih_file_read (NULL, logfile, &length); ret = sscanf (job_umask_str, "%o", (unsigned int *)&job_umask); TEST_EQ (ret, 1); TEST_EQ (job_umask, test_umask); DELETE_FILE (confdir, "umask.conf"); assert0 (unlink (logfile)); STOP_UPSTART (upstart_pid); /**********************************************************************/ TEST_FEATURE ("ensure Session Init defaults umask with '--no-inherit-env'"); /* Has to be a script since umask is a shell built-in */ CREATE_FILE (confdir, "umask.conf", "start on startup\n" "script\n" "umask\n" "end script"); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "umask.log")); WAIT_FOR_FILE (logfile); job_umask_str = nih_file_read (NULL, logfile, &length); ret = sscanf (job_umask_str, "%o", (unsigned int *)&job_umask); TEST_EQ (ret, 1); TEST_EQ (job_umask, default_umask); DELETE_FILE (confdir, "umask.conf"); assert0 (unlink (logfile)); STOP_UPSTART (upstart_pid); /**********************************************************************/ /* Restore */ (void)umask (original_umask); TEST_EQ (setenv ("XDG_RUNTIME_DIR", original_runtime, 1), 0); assert0 (rmdir (confdir)); assert0 (rmdir (logdir)); } void test_show_config (void) { char dirname[PATH_MAX]; nih_local char *cmd = NULL; pid_t upstart_pid = 0; pid_t dbus_pid = 0; char **output; size_t lines; char expected_output[] = "foo"; TEST_GROUP ("show_config"); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* Use the "secret" interface */ TEST_EQ (setenv ("UPSTART_CONFDIR", dirname, 1), 0); TEST_DBUS (dbus_pid); START_UPSTART (upstart_pid, FALSE); TEST_FEATURE ("no emits, no start on, no stop on"); CREATE_FILE (dirname, "foo.conf", "author \"foo\"\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ (lines, 1); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ (lines, 1); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("1 emits, no start on, no stop on"); CREATE_FILE (dirname, "foo.conf", "author \"foo\"\n" "emits \"thing\"\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits thing"); TEST_EQ (lines, 2); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits thing"); TEST_EQ (lines, 2); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("2 emits, no start on, no stop on"); CREATE_FILE (dirname, "foo.conf", "author \"foo\"\n" "emits \"thing\"\n" "emits \"thong\"\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits thing"); TEST_EQ_STR (output[2], " emits thong"); TEST_EQ (lines, 3); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits thing"); TEST_EQ_STR (output[2], " emits thong"); TEST_EQ (lines, 3); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("no emits, start on, no stop on"); CREATE_FILE (dirname, "foo.conf", "author \"foo\"\n" "start on (A and B)\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " start on (A and B)"); TEST_EQ (lines, 2); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " start on A (job:, env:)"); TEST_EQ_STR (output[2], " start on B (job:, env:)"); TEST_EQ (lines, 3); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("1 emits, start on, no stop on"); CREATE_FILE (dirname, "foo.conf", "author \"foo\"\n" "emits \"bong\"\n" "start on (A and B)\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " start on (A and B)"); TEST_EQ (lines, 3); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " start on A (job:, env:)"); TEST_EQ_STR (output[3], " start on B (job:, env:)"); TEST_EQ (lines, 4); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("2 emits, start on, no stop on"); CREATE_FILE (dirname, "foo.conf", "emits \"bong\"\n" "author \"foo\"\n" "start on (A and B)\n" "emits \"stime\"\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits stime"); TEST_EQ_STR (output[3], " start on (A and B)"); TEST_EQ (lines, 4); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits stime"); TEST_EQ_STR (output[3], " start on A (job:, env:)"); TEST_EQ_STR (output[4], " start on B (job:, env:)"); TEST_EQ (lines, 5); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("no emits, no start on, stop on"); CREATE_FILE (dirname, "foo.conf", "author \"foo\"\n" "stop on (A or B)\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " stop on (A or B)"); TEST_EQ (lines, 2); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " stop on A (job:, env:)"); TEST_EQ_STR (output[2], " stop on B (job:, env:)"); TEST_EQ (lines, 3); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("1 emits, no start on, stop on"); CREATE_FILE (dirname, "foo.conf", "author \"foo\"\n" "emits \"bong\"\n" "stop on (A or B)\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " stop on (A or B)"); TEST_EQ (lines, 3); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " stop on A (job:, env:)"); TEST_EQ_STR (output[3], " stop on B (job:, env:)"); TEST_EQ (lines, 4); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("2 emits, no start on, stop on"); CREATE_FILE (dirname, "foo.conf", "emits \"bong\"\n" "author \"foo\"\n" "stop on (A or B)\n" "emits \"stime\"\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits stime"); TEST_EQ_STR (output[3], " stop on (A or B)"); TEST_EQ (lines, 4); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits stime"); TEST_EQ_STR (output[3], " stop on A (job:, env:)"); TEST_EQ_STR (output[4], " stop on B (job:, env:)"); TEST_EQ (lines, 5); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("2 emits, start on with only initial JOB, stop on with JOB at end of env"); CREATE_FILE (dirname, "foo.conf", "emits \"bong\"\n" "author \"foo\"\n" "stop on (A or stopping c=d e=f g=h JOB=\"bang\")\n" "emits \"stime\"\n" "start on (starting JOB=\"boo\" or B x=y)\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits stime"); TEST_EQ_STR (output[3], " start on (starting JOB=boo or B x=y)"); TEST_EQ_STR (output[4], " stop on (A or stopping c=d e=f g=h JOB=bang)"); TEST_EQ (lines, 5); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits stime"); TEST_EQ_STR (output[3], " start on starting (job: boo, env:)"); TEST_EQ_STR (output[4], " start on B (job:, env: x=y)"); TEST_EQ_STR (output[5], " stop on A (job:, env:)"); TEST_EQ_STR (output[6], " stop on stopping (job: bang, env: c=d e=f g=h)"); TEST_EQ (lines, 7); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("2 emits, start on with initial JOB+env, stop on with JOB at end of env"); CREATE_FILE (dirname, "foo.conf", "emits \"bong\"\n" "author \"foo\"\n" "stop on (A or stopping c=d e=f g=h JOB=\"bang\")\n" "emits \"stime\"\n" "start on (starting JOB=\"boo\" P=Q c=sea or B x=y)\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits stime"); TEST_EQ_STR (output[3], " start on (starting JOB=boo P=Q c=sea or B x=y)"); TEST_EQ_STR (output[4], " stop on (A or stopping c=d e=f g=h JOB=bang)"); TEST_EQ (lines, 5); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits stime"); TEST_EQ_STR (output[3], " start on starting (job: boo, env: P=Q c=sea)"); TEST_EQ_STR (output[4], " start on B (job:, env: x=y)"); TEST_EQ_STR (output[5], " stop on A (job:, env:)"); TEST_EQ_STR (output[6], " stop on stopping (job: bang, env: c=d e=f g=h)"); TEST_EQ (lines, 7); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("3 emits, start on (with env), stop on (with env)"); CREATE_FILE (dirname, "foo.conf", "emits \"bong\"\n" "stop on starting D and (stopping E or F hello=world)\n" "author \"foo\"\n" "emits \"bar\"\n" "emits \"stime\"\n" "start on A and (B FOO=BAR or starting C x=y)\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits bar"); TEST_EQ_STR (output[3], " emits stime"); /* note the extra brackets! */ TEST_EQ_STR (output[4], " start on (A and (B FOO=BAR or starting C x=y))"); /* note the extra brackets! */ TEST_EQ_STR (output[5], " stop on (starting D and (stopping E or F hello=world))"); TEST_EQ (lines, 6); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits bar"); TEST_EQ_STR (output[3], " emits stime"); TEST_EQ_STR (output[4], " start on A (job:, env:)"); TEST_EQ_STR (output[5], " start on B (job:, env: FOO=BAR)"); TEST_EQ_STR (output[6], " start on starting (job: C, env: x=y)"); TEST_EQ_STR (output[7], " stop on starting (job: D, env:)"); TEST_EQ_STR (output[8], " stop on stopping (job: E, env:)"); TEST_EQ_STR (output[9], " stop on F (job:, env: hello=world)"); TEST_EQ (lines, 10); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("3 emits, complex start on (with env), complex stop on (with env)"); CREATE_FILE (dirname, "foo.conf", "emits \"bong\"\n" "stop on runlevel [!2345] colour=blue or starting rocket\n" "author \"foo\"\n" "emits \"bar\"\n" "emits \"stime\"\n" "start on (starting mountall or (runlevel [016] and " "(stopped gdm or stopped kdm or stopped xdm A=B or stopping lxdm)))\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits bar"); TEST_EQ_STR (output[3], " emits stime"); /* note the extra brackets! */ TEST_EQ_STR (output[4], " start on (starting mountall or (runlevel [016] and " "(((stopped gdm or stopped kdm) or stopped xdm A=B) or stopping lxdm)))"); /* note the extra brackets! */ TEST_EQ_STR (output[5], " stop on (runlevel [!2345] colour=blue or starting rocket)"); TEST_EQ (lines, 6); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config -e foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], expected_output); TEST_EQ_STR (output[1], " emits bong"); TEST_EQ_STR (output[2], " emits bar"); TEST_EQ_STR (output[3], " emits stime"); TEST_EQ_STR (output[4], " start on starting (job: mountall, env:)"); TEST_EQ_STR (output[5], " start on runlevel (job:, env: [016])"); TEST_EQ_STR (output[6], " start on stopped (job: gdm, env:)"); TEST_EQ_STR (output[7], " start on stopped (job: kdm, env:)"); TEST_EQ_STR (output[8], " start on stopped (job: xdm, env: A=B)"); TEST_EQ_STR (output[9], " start on stopping (job: lxdm, env:)"); TEST_EQ_STR (output[10], " stop on runlevel (job:, env: [!2345] colour=blue)"); TEST_EQ_STR (output[11], " stop on starting (job: rocket, env:)"); TEST_EQ (lines, 12); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ STOP_UPSTART (upstart_pid); TEST_EQ (unsetenv ("UPSTART_CONFDIR"), 0); TEST_DBUS_END (dbus_pid); TEST_EQ (rmdir (dirname), 0); } void test_check_config (void) { char dirname[PATH_MAX]; nih_local char *cmd = NULL; pid_t upstart_pid = 0; pid_t dbus_pid = 0; char **output; size_t lines; TEST_GROUP ("check_config"); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* Use the "secret" interface */ TEST_EQ (setenv ("UPSTART_CONFDIR", dirname, 1), 0); TEST_DBUS (dbus_pid); START_UPSTART (upstart_pid, FALSE); /*******************************************************************/ TEST_FEATURE ("no unreachable jobs/events (satisfied by job or event)"); CREATE_FILE (dirname, "foo.conf", "start on (starting bar or wibble)"); CREATE_FILE (dirname, "bar.conf", "task\n" "exec true"); CREATE_FILE (dirname, "baz.conf", "emits wibble"); cmd = nih_sprintf (NULL, "%s check-config 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); DELETE_FILE (dirname, "foo.conf"); DELETE_FILE (dirname, "bar.conf"); DELETE_FILE (dirname, "baz.conf"); /*******************************************************************/ TEST_FEATURE ("no unreachable jobs/events (satisfied by job)"); CREATE_FILE (dirname, "foo.conf", "start on (starting bar or wibble)"); CREATE_FILE (dirname, "bar.conf", "task\n" "exec true"); cmd = nih_sprintf (NULL, "%s check-config 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); DELETE_FILE (dirname, "foo.conf"); DELETE_FILE (dirname, "bar.conf"); /*******************************************************************/ TEST_FEATURE ("no unreachable jobs/events (satisfied by event)"); CREATE_FILE (dirname, "foo.conf", "start on (starting bar or wibble)"); CREATE_FILE (dirname, "baz.conf", "emits wibble"); cmd = nih_sprintf (NULL, "%s check-config 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); DELETE_FILE (dirname, "foo.conf"); DELETE_FILE (dirname, "baz.conf"); /*******************************************************************/ TEST_FEATURE ("unreachable event"); CREATE_FILE (dirname, "foo.conf", "start on (starting bar and wibble)"); CREATE_FILE (dirname, "bar.conf", "task\n" "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "foo"); TEST_EQ_STR (output[1], " start on: unknown event wibble"); TEST_EQ (lines, 2); DELETE_FILE (dirname, "foo.conf"); DELETE_FILE (dirname, "bar.conf"); /*******************************************************************/ TEST_FEATURE ("unreachable job"); CREATE_FILE (dirname, "foo.conf", "start on (starting bar and wibble)"); CREATE_FILE (dirname, "baz.conf", "emits wibble"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "foo"); TEST_EQ_STR (output[1], " start on: unknown job bar"); TEST_EQ (lines, 2); DELETE_FILE (dirname, "foo.conf"); DELETE_FILE (dirname, "baz.conf"); /*******************************************************************/ TEST_FEATURE ("unreachable event with forced ignore"); CREATE_FILE (dirname, "foo.conf", "start on (starting bar and wibble)"); CREATE_FILE (dirname, "bar.conf", "task\n" "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config --ignore-events=wibble 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); DELETE_FILE (dirname, "bar.conf"); /*******************************************************************/ TEST_FEATURE ("unreachable events with forced ignores"); CREATE_FILE (dirname, "foo.conf", "start on (fred and wilma)"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config --ignore-events=wilma,foo,fred 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("satisfiable complex start on"); /* Yes folks, it's the classic */ CREATE_FILE (dirname, "plymouth.conf", "start on (starting mountall\n" " or (runlevel [016]\n" " and (stopped gdm\n" " or stopped kdm\n" " or stopped xdm\n" " or stopped lxdm)))"); CREATE_FILE (dirname, "mountall.conf", "exec true"); CREATE_FILE (dirname, "gdm.conf" , "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config --ignore-events=runlevel 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); DELETE_FILE (dirname, "plymouth.conf"); DELETE_FILE (dirname, "mountall.conf"); DELETE_FILE (dirname, "gdm.conf"); /*******************************************************************/ TEST_FEATURE ("unsatisfiable complex start on"); CREATE_FILE (dirname, "plymouth.conf", "start on (starting mountall\n" " or (runlevel [016]\n" " and (stopped gdm\n" " or stopped kdm\n" " or stopped xdm\n" " or stopped lxdm)))"); CREATE_FILE (dirname, "mountall.conf", "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config --ignore-events=runlevel 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "plymouth"); TEST_EQ_STR (output[1], " start on: unknown job lxdm"); TEST_EQ_STR (output[2], " start on: unknown job xdm"); TEST_EQ_STR (output[3], " start on: unknown job kdm"); TEST_EQ_STR (output[4], " start on: unknown job gdm"); TEST_EQ (lines, 5); DELETE_FILE (dirname, "plymouth.conf"); DELETE_FILE (dirname, "mountall.conf"); /*******************************************************************/ TEST_FEATURE ("satisfiable complex stop on"); /* Yes folks, it's the classic */ CREATE_FILE (dirname, "plymouth.conf", "stop on (starting mountall\n" " or (runlevel [016]\n" " and (stopped gdm\n" " or stopped kdm\n" " or stopped xdm\n" " or stopped lxdm)))"); CREATE_FILE (dirname, "mountall.conf", "exec true"); CREATE_FILE (dirname, "gdm.conf" , "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config --ignore-events=runlevel 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); DELETE_FILE (dirname, "plymouth.conf"); DELETE_FILE (dirname, "mountall.conf"); DELETE_FILE (dirname, "gdm.conf"); /*******************************************************************/ TEST_FEATURE ("unsatisfiable complex stop on"); CREATE_FILE (dirname, "plymouth.conf", "stop on (starting mountall\n" " or (runlevel [016]\n" " and (stopped gdm\n" " or stopped kdm\n" " or stopped xdm\n" " or stopped lxdm)))"); CREATE_FILE (dirname, "mountall.conf", "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config --ignore-events=runlevel 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "plymouth"); TEST_EQ_STR (output[1], " stop on: unknown job lxdm"); TEST_EQ_STR (output[2], " stop on: unknown job xdm"); TEST_EQ_STR (output[3], " stop on: unknown job kdm"); TEST_EQ_STR (output[4], " stop on: unknown job gdm"); TEST_EQ (lines, 5); DELETE_FILE (dirname, "plymouth.conf"); DELETE_FILE (dirname, "mountall.conf"); /*******************************************************************/ TEST_FEATURE ("unsatisfiable complex stop on, satisfiable complex start on"); CREATE_FILE (dirname, "plymouth.conf", "stop on (starting mountall\n" " or (runlevel [016]\n" " and (stopped gdm\n" " or stopped kdm\n" " or stopped xdm\n" " or stopped lxdm)))\n" "start on (stopping portmap\n" " or (runlevel [06] or starting beano))\n"); CREATE_FILE (dirname, "mountall.conf", "exec true"); CREATE_FILE (dirname, "portmap.conf", "exec true"); CREATE_FILE (dirname, "beano.conf", "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config --ignore-events=runlevel 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "plymouth"); TEST_EQ_STR (output[1], " stop on: unknown job lxdm"); TEST_EQ_STR (output[2], " stop on: unknown job xdm"); TEST_EQ_STR (output[3], " stop on: unknown job kdm"); TEST_EQ_STR (output[4], " stop on: unknown job gdm"); TEST_EQ (lines, 5); DELETE_FILE (dirname, "plymouth.conf"); DELETE_FILE (dirname, "mountall.conf"); DELETE_FILE (dirname, "portmap.conf"); DELETE_FILE (dirname, "beano.conf"); /*******************************************************************/ TEST_FEATURE ("satisfiable complex start on, unsatisfiable complex stop on"); CREATE_FILE (dirname, "plymouth.conf", "start on (starting mountall\n" " or (hello\n" " and (stopped gdm\n" " or stopped kdm\n" " or stopped xdm\n" " or stopped lxdm)))\n" "stop on (stopping portmap\n" " or (wibble or starting beano))\n"); CREATE_FILE (dirname, "mountall.conf", "exec true"); CREATE_FILE (dirname, "portmap.conf", "exec true\n" "emits hello"); CREATE_FILE (dirname, "gdm.conf", "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config >&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "plymouth"); TEST_EQ_STR (output[1], " stop on: unknown job beano"); TEST_EQ_STR (output[2], " stop on: unknown event wibble"); TEST_EQ (lines, 3); DELETE_FILE (dirname, "plymouth.conf"); DELETE_FILE (dirname, "mountall.conf"); DELETE_FILE (dirname, "portmap.conf"); DELETE_FILE (dirname, "gdm.conf"); /*******************************************************************/ TEST_FEATURE ("unsatisfiable complex start on, unsatisfiable complex stop on"); CREATE_FILE (dirname, "plymouth.conf", "start on (starting mountall\n" " or (hello\n" " and (stopped gdm\n" " or stopped kdm\n" " or stopped xdm\n" " or stopped lxdm)))\n" "stop on (stopping portmap\n" " or (wibble or starting beano))\n"); CREATE_FILE (dirname, "mountall.conf", "exec true"); CREATE_FILE (dirname, "portmap.conf", "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "plymouth"); TEST_EQ_STR (output[1], " start on: unknown job lxdm"); TEST_EQ_STR (output[2], " start on: unknown job xdm"); TEST_EQ_STR (output[3], " start on: unknown job kdm"); TEST_EQ_STR (output[4], " start on: unknown job gdm"); TEST_EQ_STR (output[5], " start on: unknown event hello"); TEST_EQ_STR (output[6], " stop on: unknown job beano"); TEST_EQ_STR (output[7], " stop on: unknown event wibble"); TEST_EQ (lines, 8); DELETE_FILE (dirname, "plymouth.conf"); DELETE_FILE (dirname, "mountall.conf"); DELETE_FILE (dirname, "portmap.conf"); /*******************************************************************/ TEST_FEATURE ("satisfiable complex start on, satisfiable complex stop on"); CREATE_FILE (dirname, "plymouth.conf", "start on (starting mountall\n" " or (hello\n" " and (stopped gdm\n" " or (stopped kdm\n" " or (stopped xdm\n" " or stopped lxdm)))))\n" "stop on (stopping portmap\n" " or (wibble or starting beano))\n"); CREATE_FILE (dirname, "mountall.conf", "exec true\n"); CREATE_FILE (dirname, "portmap.conf", "exec true\n" "emits hello"); CREATE_FILE (dirname, "lxdm.conf", "exec true"); CREATE_FILE (dirname, "wibble.conf", "emits wibble"); CREATE_FILE (dirname, "beano.conf", "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); DELETE_FILE (dirname, "plymouth.conf"); DELETE_FILE (dirname, "mountall.conf"); DELETE_FILE (dirname, "portmap.conf"); DELETE_FILE (dirname, "lxdm.conf"); DELETE_FILE (dirname, "beano.conf"); DELETE_FILE (dirname, "wibble.conf"); /*******************************************************************/ TEST_FEATURE ( "satisfiable complex start on, satisfiable complex stop on with warnings"); CREATE_FILE (dirname, "plymouth.conf", "start on (starting mountall\n" " or (hello\n" " and (stopped gdm\n" " or (stopped kdm\n" " or (stopped xdm\n" " or stopped lxdm)))))\n" "stop on (stopping portmap\n" " or (wibble or starting beano))\n"); CREATE_FILE (dirname, "mountall.conf", "exec true\n"); CREATE_FILE (dirname, "portmap.conf", "exec true\n" "emits hello"); CREATE_FILE (dirname, "lxdm.conf", "exec true"); CREATE_FILE (dirname, "wibble.conf", "emits wibble"); CREATE_FILE (dirname, "beano.conf", "exec true"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s check-config --warn 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "plymouth"); TEST_EQ_STR (output[1], " start on: unknown job xdm"); TEST_EQ_STR (output[2], " start on: unknown job kdm"); TEST_EQ_STR (output[3], " start on: unknown job gdm"); TEST_EQ (lines, 4); DELETE_FILE (dirname, "plymouth.conf"); DELETE_FILE (dirname, "mountall.conf"); DELETE_FILE (dirname, "portmap.conf"); DELETE_FILE (dirname, "lxdm.conf"); DELETE_FILE (dirname, "beano.conf"); DELETE_FILE (dirname, "wibble.conf"); /*******************************************************************/ STOP_UPSTART (upstart_pid); TEST_EQ (unsetenv ("UPSTART_CONFDIR"), 0); TEST_DBUS_END (dbus_pid); TEST_EQ (rmdir (dirname), 0); } void test_notify_disk_writeable (void) { char confdir_name[PATH_MAX]; char logdir_name[PATH_MAX]; nih_local char *logfile_name = NULL; pid_t upstart_pid = 0; pid_t dbus_pid; nih_local char *cmd = NULL; char **output; size_t lines; struct stat statbuf; mode_t old_perms; FILE *file; TEST_FILENAME (confdir_name); TEST_EQ (mkdir (confdir_name, 0755), 0); TEST_FILENAME (logdir_name); TEST_EQ (mkdir (logdir_name, 0755), 0); TEST_EQ (stat (logdir_name, &statbuf), 0); old_perms = statbuf.st_mode; /* Make inaccessible */ TEST_EQ (chmod (logdir_name, 0x0), 0); /* Use the "secret" interfaces */ TEST_EQ (setenv ("UPSTART_CONFDIR", confdir_name, 1), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", logdir_name, 1), 0); TEST_FUNCTION ("notify-disk-writeable"); TEST_FEATURE ("with job ending before log disk writeable"); CREATE_FILE (confdir_name, "foo.conf", "console log\n" "exec echo hello world\n"); logfile_name = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir_name, "foo.log")); TEST_DBUS (dbus_pid); START_UPSTART (upstart_pid, FALSE); cmd = nih_sprintf (NULL, "%s start %s 2>&1", get_initctl (), "foo"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); /* Give Upstart a chance to respond */ { int i = 0; int max = 5; int ret; for (i=0; i < max; ++i) { nih_free (output); cmd = nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), "foo"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); ret = fnmatch ("foo stop/waiting", output[0], 0); if (! ret) { break; } sleep (1); } } TEST_EQ (fnmatch ("foo stop/waiting", output[0], 0), 0); /* Ensure no log file written */ TEST_LT (stat (logfile_name, &statbuf), 0); /* Restore access */ TEST_EQ (chmod (logdir_name, old_perms), 0); /* Ensure again that no log file written */ TEST_LT (stat (logfile_name, &statbuf), 0); /* Must not be run as root */ TEST_TRUE (getuid ()); cmd = nih_sprintf (NULL, "%s notify-disk-writeable 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); /* Ensure file written now */ TEST_EQ (stat (logfile_name, &statbuf), 0); file = fopen (logfile_name, "r"); TEST_NE_P (file, NULL); TEST_FILE_EQ (file, "hello world\r\n"); TEST_FILE_END (file); TEST_EQ (fclose (file), 0); STOP_UPSTART (upstart_pid); TEST_EQ (unsetenv ("UPSTART_CONFDIR"), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); TEST_DBUS_END (dbus_pid); DELETE_FILE (confdir_name, "foo.conf"); DELETE_FILE (logdir_name, "foo.log"); TEST_EQ (rmdir (confdir_name), 0); TEST_EQ (rmdir (logdir_name), 0); } void test_list_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; DBusMessage * method_call; DBusMessage * reply = NULL; const char * str_value; const char * interface; const char * property; DBusMessageIter iter; DBusMessageIter subiter; DBusMessageIter arrayiter; DBusMessageIter dictiter; DBusMessageIter prociter; DBusMessageIter structiter; int32_t int32_value; NihCommand command; char * args[1]; int ret = 0; int status; TEST_FUNCTION ("list_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that the list action makes the GetAllJobs method call * to obtain a list of paths, then for each job calls the * GetAllInstances method call to obtain a list of the instances. * If there are instances, the job name and instance properties are * requested and output; if there are not instances, only the * job name is requested and output. */ TEST_FEATURE ("with valid reply"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetAllJobs method call on the * manager object, reply with a list of interesting * paths. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetAllJobs")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &arrayiter); str_value = DBUS_PATH_UPSTART "/jobs/frodo"; dbus_message_iter_append_basic (&arrayiter, DBUS_TYPE_OBJECT_PATH, &str_value); str_value = DBUS_PATH_UPSTART "/jobs/bilbo"; dbus_message_iter_append_basic (&arrayiter, DBUS_TYPE_OBJECT_PATH, &str_value); str_value = DBUS_PATH_UPSTART "/jobs/drogo"; dbus_message_iter_append_basic (&arrayiter, DBUS_TYPE_OBJECT_PATH, &str_value); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAllInstances method call on the * first job object, reply with an empty list. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetAllInstances")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/frodo"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &arrayiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the name of the * first job, reply with the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/frodo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "frodo"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAllInstances method call on the * second job object, reply with a single instance. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetAllInstances")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/bilbo"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &arrayiter); str_value = DBUS_PATH_UPSTART "/jobs/bilbo/_"; dbus_message_iter_append_basic (&arrayiter, DBUS_TYPE_OBJECT_PATH, &str_value); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the name of the * second job, reply with the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/bilbo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "bilbo"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/bilbo/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAllInstances method call on the * third job object, reply with a couple of * named instances */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetAllInstances")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/drogo"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &arrayiter); str_value = DBUS_PATH_UPSTART "/jobs/drogo/foo"; dbus_message_iter_append_basic (&arrayiter, DBUS_TYPE_OBJECT_PATH, &str_value); str_value = DBUS_PATH_UPSTART "/jobs/drogo/bar"; dbus_message_iter_append_basic (&arrayiter, DBUS_TYPE_OBJECT_PATH, &str_value); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the name of the * third job, reply with the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/drogo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "drogo"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the first of its * instances, reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/drogo/foo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "foo"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "pre-stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 6312; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "pre-stop"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 8609; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the name of the * third job, reply with the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/drogo"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "drogo"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the second of its * instances, reply with its properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/drogo/bar"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "bar"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "post-stop"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "post-stop"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 7465; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = list_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { /* May have had some output */ TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "frodo stop/waiting\n"); TEST_FILE_EQ (output, "bilbo start/running, process 3648\n"); TEST_FILE_EQ (output, "drogo (foo) stop/pre-stop, process 6312\n"); TEST_FILE_EQ (output, "\tpre-stop process 8609\n"); TEST_FILE_EQ (output, "drogo (bar) start/post-stop, process 7465\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that an error reply from the GetAllInstances command * is assumed to mean that the job went away, and thus the job * is simply not printed rather than causing the function to end, */ TEST_FEATURE ("with error reply to GetAllInstances"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetAllJobs method call on the * manager object, reply with a list of interesting * paths. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetAllJobs")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &arrayiter); str_value = DBUS_PATH_UPSTART "/jobs/foo"; dbus_message_iter_append_basic (&arrayiter, DBUS_TYPE_OBJECT_PATH, &str_value); str_value = DBUS_PATH_UPSTART "/jobs/bar"; dbus_message_iter_append_basic (&arrayiter, DBUS_TYPE_OBJECT_PATH, &str_value); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAllInstances method call on the * first job object, reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetAllInstances")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/foo"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAllInstances method call on the * second job object, reply with a single instance. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART_JOB, "GetAllInstances")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/bar"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &arrayiter); str_value = DBUS_PATH_UPSTART "/jobs/bar/_"; dbus_message_iter_append_basic (&arrayiter, DBUS_TYPE_OBJECT_PATH, &str_value); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the Get call for the name of the * second job, reply with the name. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/bar"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_JOB); TEST_EQ_STR (property, "name"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "bar"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); /* Expect the GetAll call for the instance properties, * reply with the properties. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "GetAll")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART "/jobs/bar/_"); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART_INSTANCE); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING), &arrayiter); /* Name */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "name"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = ""; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Goal */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "goal"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "start"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* State */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "state"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "running"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); /* Processes */ dbus_message_iter_open_container (&arrayiter, DBUS_TYPE_DICT_ENTRY, NULL, &dictiter); str_value = "processes"; dbus_message_iter_append_basic (&dictiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_open_container (&dictiter, DBUS_TYPE_VARIANT, (DBUS_TYPE_ARRAY_AS_STRING DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &subiter); dbus_message_iter_open_container (&subiter, DBUS_TYPE_ARRAY, (DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING), &prociter); dbus_message_iter_open_container (&prociter, DBUS_TYPE_STRUCT, NULL, &structiter); str_value = "main"; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_STRING, &str_value); int32_value = 3648; dbus_message_iter_append_basic (&structiter, DBUS_TYPE_INT32, &int32_value); dbus_message_iter_close_container (&prociter, &structiter); dbus_message_iter_close_container (&subiter, &prociter); dbus_message_iter_close_container (&dictiter, &subiter); dbus_message_iter_close_container (&arrayiter, &dictiter); dbus_message_iter_close_container (&iter, &arrayiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = list_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { /* May have had some output */ TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "bar start/running, process 3648\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that if an error is received from the GetAllJobs call, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply to GetAllJobs"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the GetAllJobs method call on the * manager object, reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "GetAllJobs")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = list_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_emit_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; DBusMessage * method_call; DBusMessage * reply = NULL; const char * name_value; char ** args_value; int args_elements; int wait_value; NihCommand command; char * args[4]; int ret = 0; int status; TEST_FUNCTION ("emit_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that the emit action passes a single argument to the * server in the EmitEvent command as the name of the event, * along with a NULL array for the events. Make sure that wait * is TRUE by default. */ TEST_FEATURE ("with single argument"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the EmitEvent method call on the manager * object, make sure the arguments are right and * reply to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "EmitEvent")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "wibble"); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "wibble"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = emit_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that additional arguments to the emit action are passed * as entries in the environment argument of the command. */ TEST_FEATURE ("with multiple arguments"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the EmitEvent method call on the manager * object, make sure the arguments are right and * reply to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "EmitEvent")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "wibble"); TEST_EQ (args_elements, 2); TEST_EQ_STR (args_value[0], "FOO=foo"); TEST_EQ_STR (args_value[1], "BAR=bar"); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "wibble"; args[1] = "FOO=foo"; args[2] = "BAR=bar"; args[3] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = emit_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that the --no-wait option results in the method call * being made with wait as FALSE. */ TEST_FEATURE ("with no wait"); no_wait = TRUE; TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the EmitEvent method call on the manager * object, make sure the arguments are right and * reply to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "EmitEvent")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "wibble"); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_FALSE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "wibble"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = emit_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } no_wait = FALSE; /* Check that if an error is received from the command, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the EmitEvent method call on the manager * object, make sure the arguments are right and * reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "EmitEvent")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &name_value, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &args_value, &args_elements, DBUS_TYPE_BOOLEAN, &wait_value, DBUS_TYPE_INVALID)); TEST_EQ_STR (name_value, "wibble"); TEST_EQ (args_elements, 0); dbus_free_string_array (args_value); TEST_TRUE (wait_value); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "wibble"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = emit_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that a missing argument results in an error being output * to stderr along with a suggestion of help. */ TEST_FEATURE ("with missing argument"); TEST_ALLOC_FAIL { memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = emit_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: missing event name\n"); TEST_FILE_EQ (errors, "Try `test --help' for more information.\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_reload_configuration_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; DBusMessage * method_call; DBusMessage * reply = NULL; NihCommand command; char * args[1]; int ret = 0; int status; TEST_FUNCTION ("reload_configuration_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that the reload_configuration sends the method call to the * server. */ TEST_FEATURE ("with command"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the ReloadConfiguration method call for * the manager object, reply to acknowledge. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "ReloadConfiguration")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = reload_configuration_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that if an error is received from the command, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the ReloadConfiguration method call for * the manager object, reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_UPSTART, "ReloadConfiguration")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = reload_configuration_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_version_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; DBusMessage * method_call; const char * interface; const char * property; DBusMessage * reply = NULL; DBusMessageIter iter; DBusMessageIter subiter; const char * str_value; NihCommand command; char * args[1]; int ret = 0; int status; TEST_FUNCTION ("version_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that the version action queries the server for its * version property, and prints the result to standard output. */ TEST_FEATURE ("with valid reply"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the version property, * reply with the string we want printed. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART); TEST_EQ_STR (property, "version"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "init (upstart 1.0.0)"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = version_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "init (upstart 1.0.0)\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that if an error is received from the query command, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with error reply"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the version property, * reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART); TEST_EQ_STR (property, "version"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = version_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_log_priority_action (void) { pid_t dbus_pid; DBusConnection *server_conn; FILE * output; FILE * errors; pid_t server_pid; DBusMessage * method_call; const char * interface; const char * property; DBusMessage * reply = NULL; DBusMessageIter iter; DBusMessageIter subiter; const char * str_value; char * signature; NihCommand command; char * args[2]; int ret = 0; int status; TEST_FUNCTION ("log_priority_action"); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (server_conn); assert (dbus_bus_request_name (server_conn, DBUS_SERVICE_UPSTART, 0, NULL) == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); TEST_DBUS_MESSAGE (server_conn, method_call); assert (dbus_message_is_signal (method_call, DBUS_INTERFACE_DBUS, "NameAcquired")); dbus_message_unref (method_call); dbus_bus_type = DBUS_BUS_SYSTEM; dest_name = DBUS_SERVICE_UPSTART; dest_address = DBUS_ADDRESS_UPSTART; output = tmpfile (); errors = tmpfile (); /* Check that, when called without arguments, the log_priority action * queries the server for its log_priority property and prints the * result to standard output. */ TEST_FEATURE ("with no arguments"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the log_priority property, * reply with the string we want printed. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART); TEST_EQ_STR (property, "log_priority"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); dbus_message_iter_init_append (reply, &iter); dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &subiter); str_value = "message"; dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, &str_value); dbus_message_iter_close_container (&iter, &subiter); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = log_priority_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_EQ (output, "message\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that, when called with an argument, the log_priority action * passes that to the server to set its log_priority property. */ TEST_FEATURE ("with argument"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Set call for the log_priority property, * send an acknowledgement reply. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Set")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_EQ_STR (dbus_message_get_signature (method_call), (DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING)); dbus_message_iter_init (method_call, &iter); dbus_message_iter_get_basic (&iter, &interface); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART); dbus_message_iter_next (&iter); dbus_message_iter_get_basic (&iter, &property); TEST_EQ_STR (property, "log_priority"); dbus_message_iter_next (&iter); dbus_message_iter_recurse (&iter, &subiter); signature = dbus_message_iter_get_signature (&subiter); TEST_EQ_STR (signature, DBUS_TYPE_STRING_AS_STRING); dbus_free (signature); dbus_message_iter_get_basic (&subiter, &str_value); TEST_EQ_STR (str_value, "info"); TEST_ALLOC_SAFE { reply = dbus_message_new_method_return (method_call); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "info"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = log_priority_action (&command, args); } } rewind (output); rewind (errors); if (test_alloc_failed && (ret != 0)) { TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_EQ (errors, "test: Cannot allocate memory\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); continue; } TEST_EQ (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_END (errors); TEST_FILE_RESET (errors); waitpid (server_pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); } /* Check that if an error is received from the query command, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with no arguments and error reply"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Get call for the log_priority property, * reply with an error. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Get")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_TRUE (dbus_message_get_args (method_call, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, &property, DBUS_TYPE_INVALID)); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART); TEST_EQ_STR (property, "log_priority"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = log_priority_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } /* Check that if an error is received from the query command, * the message attached is printed to standard error and the * command exits. */ TEST_FEATURE ("with argument and error reply"); TEST_ALLOC_FAIL { TEST_CHILD (server_pid) { /* Expect the Set call for the log_priority property, * send an error back. */ TEST_DBUS_MESSAGE (server_conn, method_call); TEST_TRUE (dbus_message_is_method_call (method_call, DBUS_INTERFACE_PROPERTIES, "Set")); TEST_EQ_STR (dbus_message_get_path (method_call), DBUS_PATH_UPSTART); TEST_EQ_STR (dbus_message_get_signature (method_call), (DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING)); dbus_message_iter_init (method_call, &iter); dbus_message_iter_get_basic (&iter, &interface); TEST_EQ_STR (interface, DBUS_INTERFACE_UPSTART); dbus_message_iter_next (&iter); dbus_message_iter_get_basic (&iter, &property); TEST_EQ_STR (property, "log_priority"); dbus_message_iter_next (&iter); dbus_message_iter_recurse (&iter, &subiter); signature = dbus_message_iter_get_signature (&subiter); TEST_EQ_STR (signature, DBUS_TYPE_STRING_AS_STRING); dbus_free (signature); dbus_message_iter_get_basic (&subiter, &str_value); TEST_EQ_STR (str_value, "info"); TEST_ALLOC_SAFE { reply = dbus_message_new_error (method_call, DBUS_ERROR_UNKNOWN_METHOD, "Unknown method"); } dbus_connection_send (server_conn, reply, NULL); dbus_connection_flush (server_conn); dbus_message_unref (method_call); dbus_message_unref (reply); TEST_DBUS_CLOSE (server_conn); dbus_shutdown (); exit (0); } memset (&command, 0, sizeof command); args[0] = "info"; args[1] = NULL; TEST_DIVERT_STDOUT (output) { TEST_DIVERT_STDERR (errors) { ret = log_priority_action (&command, args); } } rewind (output); rewind (errors); TEST_GT (ret, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); TEST_FILE_MATCH (errors, "test: *\n"); TEST_FILE_END (errors); TEST_FILE_RESET (errors); kill (server_pid, SIGTERM); waitpid (server_pid, NULL, 0); } fclose (errors); fclose (output); TEST_DBUS_CLOSE (server_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_usage (void) { char dirname[PATH_MAX]; nih_local char *cmd = NULL; pid_t upstart_pid = 0; pid_t dbus_pid = 0; char **output; size_t lines; FILE *out; FILE *err; NihCommand command; char *args[2]; int ret = 0; TEST_TRUE (getenv ("XDG_RUNTIME_DIR")); TEST_GROUP ("usage"); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* Use the "secret" interface */ TEST_EQ (setenv ("UPSTART_CONFDIR", dirname, 1), 0); TEST_DBUS (dbus_pid); START_UPSTART (upstart_pid, FALSE); TEST_FEATURE ("no usage"); CREATE_FILE (dirname, "foo.conf", "author \"foo\"\n" "description \"wibble\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s usage foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "Usage: "); TEST_EQ (lines, 1); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("with usage"); CREATE_FILE (dirname, "foo.conf", "usage \"this is usage\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s usage foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ_STR (output[0], "Usage: this is usage"); TEST_EQ (lines, 1); nih_free (output); DELETE_FILE (dirname, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("failed status with usage"); CREATE_FILE (dirname, "foo.conf", "instance $FOO\n" "usage \"this is usage\""); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); memset (&command, 0, sizeof command); args[0] = "foo"; args[1] = NULL; out = tmpfile (); err = tmpfile (); TEST_NE_P (out, NULL); TEST_NE_P (err, NULL); TEST_DIVERT_STDOUT (out) { TEST_DIVERT_STDERR (err) { ret = status_action (&command, args); } } rewind (out); rewind (err); TEST_GT (ret, 0); TEST_FILE_END (out); TEST_FILE_RESET (out); TEST_FILE_EQ (err, "test: Unknown parameter: FOO\n"); TEST_FILE_EQ (err, "Usage: this is usage\n"); TEST_FILE_END (err); TEST_FILE_RESET (err); assert0 (fclose (out)); assert0 (fclose (err)); DELETE_FILE (dirname, "foo.conf"); STOP_UPSTART (upstart_pid); TEST_EQ (unsetenv ("UPSTART_CONFDIR"), 0); TEST_DBUS_END (dbus_pid); assert0 (rmdir (dirname)); } void test_default_job_env (const char *confdir, const char *logdir, pid_t upstart_pid, pid_t dbus_pid) { nih_local char *cmd = NULL; char **output; nih_local char *logfile = NULL; size_t line_count; FILE *fi; assert (confdir); assert (logdir); assert (upstart_pid); assert (dbus_pid); cmd = nih_sprintf (NULL, "%s reset-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); assert0 (line_count); /*******************************************************************/ TEST_FEATURE ("ensure list-env returns default environment"); cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_GE (line_count, 2); TEST_STR_ARRAY_CONTAINS (output, "PATH=*"); TEST_STR_ARRAY_CONTAINS (output, "TERM=*"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("ensure 'list-env --global' returns default environment"); cmd = nih_sprintf (NULL, "%s list-env --global 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_GE (line_count, 2); TEST_STR_ARRAY_CONTAINS (output, "PATH=*"); TEST_STR_ARRAY_CONTAINS (output, "TERM=*"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("ensure get-env returns expected TERM variable"); cmd = nih_sprintf (NULL, "%s get-env TERM 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ_STR (output[0], getenv ("TERM")); TEST_EQ (line_count, 1); nih_free (output); /*******************************************************************/ TEST_FEATURE ("ensure 'get-env --global' returns expected TERM variable"); cmd = nih_sprintf (NULL, "%s get-env --global TERM 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ_STR (output[0], getenv ("TERM")); TEST_EQ (line_count, 1); nih_free (output); /*******************************************************************/ TEST_FEATURE ("ensure get-env returns expected PATH variable"); cmd = nih_sprintf (NULL, "%s get-env PATH 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], getenv ("PATH")); nih_free (output); /*******************************************************************/ TEST_FEATURE ("ensure 'get-env --global' returns expected PATH variable"); cmd = nih_sprintf (NULL, "%s get-env --global PATH 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], getenv ("PATH")); nih_free (output); /*******************************************************************/ TEST_FEATURE ("ensure job gets given default environment"); CREATE_FILE (confdir, "foo.conf", "exec env"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s start foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); nih_free (output); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "foo.log")); WAIT_FOR_FILE (logfile); fi = fopen (logfile, "r"); TEST_NE_P (fi, NULL); TEST_FILE_CONTAINS (fi, "PATH=*"); TEST_FILE_CONTAINS (fi, "TERM=*"); /* asterisk required to match '\r\n' */ TEST_FILE_CONTAINS (fi, "UPSTART_JOB=foo*"); TEST_FILE_CONTAINS (fi, "UPSTART_INSTANCE=*"); TEST_FILE_CONTAINS (fi, "UPSTART_SESSION=*"); fclose (fi); DELETE_FILE (confdir, "foo.conf"); TEST_EQ (unlink (logfile), 0); /*******************************************************************/ TEST_FEATURE ("ensure invalid query shows unknown variable"); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), "foo-bar-baz"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo-bar-baz"); /*******************************************************************/ } void clear_job_env (void) { nih_local char *cmd = NULL; char **output; nih_local char *logfile = NULL; size_t line_count; size_t i; cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_GT (line_count, 0); /* Remove all variables from the job environment table */ for (i = 0; i < line_count; i++) { char **output2; size_t line_count2; char *p; nih_local char *name = NULL; /* Every variable is expected to be returned with a * delimiter, even if one was not specified when * variable was set. */ p = strchr (output[i], '='); TEST_NE_P (p, NULL); name = NIH_MUST (nih_strdup (NULL, "")); TEST_TRUE (nih_strncat (&name, NULL, output[i], p - output[i])); /* Clear the variable */ cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output2, &line_count2); TEST_EQ (line_count2, 0); } nih_free (output); /* No variables should remain */ cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); assert0 (line_count); } /** * Clear the job process table, then reset it back to defaults. **/ void test_clear_job_env (const char *confdir, const char *logdir, pid_t upstart_pid, pid_t dbus_pid) { nih_local char *cmd = NULL; char **output; nih_local char *logfile = NULL; nih_local char *contents = NULL; size_t line_count; FILE *fi; assert (confdir); assert (logdir); assert (upstart_pid); assert (dbus_pid); clear_job_env (); /* ensure get-env tolerates empty environment */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), "foo"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); /* ensure unset-env tolerates empty environment */ cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), "foo"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); /* ensure unset-env (multiple variables) tolerates empty environment */ cmd = nih_sprintf (NULL, "%s unset-env %s %s 2>&1", get_initctl (), "foo", "bar"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); /* Although 2 variables have been specified, since neither is * set, we only expect 1 error for the first variable. */ TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); /*******************************************************************/ TEST_FEATURE ("ensure job runs in empty environment"); /* we have to cheat by setting PATH to allow 'env' to be found. * Add a silly entry at the end so we can check our version has * been set. */ contents = nih_sprintf (NULL, "env PATH=%s\n" "exec env", TEST_INITCTL_DEFAULT_PATH); TEST_NE_P (contents, NULL); CREATE_FILE (confdir, "empty-env.conf", contents); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s start empty-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); nih_free (output); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "empty-env.log")); WAIT_FOR_FILE (logfile); fi = fopen (logfile, "r"); TEST_NE_P (fi, NULL); /* Ensure it looks like our PATH */ TEST_FILE_MATCH (fi, "PATH=*/wibble*"); /* Although the environment is empty (except for PATH now), we * still expect the special variables to be set. */ TEST_FILE_MATCH (fi, "UPSTART_JOB=empty-env*"); TEST_FILE_MATCH (fi, "UPSTART_INSTANCE=*"); TEST_FILE_MATCH (fi, "UPSTART_SESSION=*"); TEST_FILE_END (fi); fclose (fi); DELETE_FILE (confdir, "empty-env.conf"); TEST_EQ (unlink (logfile), 0); /* reset environment */ cmd = nih_sprintf (NULL, "%s reset-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); assert0 (line_count); /* re-check */ test_default_job_env (confdir, logdir, upstart_pid, dbus_pid); } void test_modified_job_env (const char *confdir, const char *logdir, pid_t upstart_pid, pid_t dbus_pid) { nih_local char *cmd = NULL; nih_local char *name = NULL; nih_local char *value = NULL; nih_local char *name2 = NULL; nih_local char *value2 = NULL; nih_local char *name3 = NULL; nih_local char *value3 = NULL; nih_local char *name4 = NULL; nih_local char *value4 = NULL; char **output; nih_local char *logfile = NULL; size_t line_count; FILE *fi; assert (confdir); assert (logdir); assert (upstart_pid); assert (dbus_pid); /*******************************************************************/ TEST_FEATURE ("call reset-env with default environment"); cmd = nih_sprintf (NULL, "%s reset-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); nih_free (output); /* Ensure nothing changed */ test_default_job_env (confdir, logdir, upstart_pid, dbus_pid); test_clear_job_env (confdir, logdir, upstart_pid, dbus_pid); /*******************************************************************/ TEST_FEATURE ("set-env in 'name=value' form"); name = NIH_MUST (nih_strdup (NULL, "foo")); value = NIH_MUST (nih_strdup (NULL, "bar")); name2 = NIH_MUST (nih_strdup (NULL, "baz")); value2 = NIH_MUST (nih_strdup (NULL, "qux")); cmd = nih_sprintf (NULL, "%s set-env %s=%s 2>&1", get_initctl (), name, value); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s set-env %s=%s 2>&1", get_initctl (), name2, value2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value2); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s %s 2>&1", get_initctl (), name, name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: baz"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("multiple set-env in 'name=value' form"); name = NIH_MUST (nih_strdup (NULL, "foo")); value = NIH_MUST (nih_strdup (NULL, "bar")); name2 = NIH_MUST (nih_strdup (NULL, "baz")); value2 = NIH_MUST (nih_strdup (NULL, "qux")); cmd = nih_sprintf (NULL, "%s set-env %s=%s %s=%s 2>&1", get_initctl (), name, value, name2, value2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value2); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s %s 2>&1", get_initctl (), name, name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: baz"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("set-env in 'name=' form"); name = NIH_MUST (nih_strdup (NULL, "foo")); cmd = nih_sprintf (NULL, "%s set-env %s= 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); /* nul string value expected if none specified when set */ TEST_EQ_STR (output[0], ""); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("multiple set-env in 'name=' form"); name = NIH_MUST (nih_strdup (NULL, "foo")); name2 = NIH_MUST (nih_strdup (NULL, "baz")); cmd = nih_sprintf (NULL, "%s set-env %s= %s= 2>&1", get_initctl (), name, name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); /* nul string value expected if none specified when set */ TEST_EQ_STR (output[0], ""); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); /* nul string value expected if none specified when set */ TEST_EQ_STR (output[0], ""); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: baz"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("set-env in 'name' form"); name = NIH_MUST (nih_strdup (NULL, "foo")); cmd = nih_sprintf (NULL, "%s set-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); /* nul string value expected if none specified when set */ TEST_EQ_STR (output[0], ""); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("multiple set-env in 'name' form"); name = NIH_MUST (nih_strdup (NULL, "foo")); name2 = NIH_MUST (nih_strdup (NULL, "baz")); cmd = nih_sprintf (NULL, "%s set-env %s %s 2>&1", get_initctl (), name, name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); /* nul string value expected if none specified when set */ TEST_EQ_STR (output[0], ""); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); /* nul string value expected if none specified when set */ TEST_EQ_STR (output[0], ""); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: baz"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("set-env for already set variable"); name = NIH_MUST (nih_strdup (NULL, "foo")); value = NIH_MUST (nih_strdup (NULL, "bar")); /* set it */ cmd = nih_sprintf (NULL, "%s set-env %s=%s 2>&1", get_initctl (), name, value); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check it */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); /* set it again */ cmd = nih_sprintf (NULL, "%s set-env %s=%s 2>&1", get_initctl (), name, value); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check it again */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("set-env for multiple already set variables"); name = NIH_MUST (nih_strdup (NULL, "foo")); value = NIH_MUST (nih_strdup (NULL, "bar")); name2 = NIH_MUST (nih_strdup (NULL, "baz")); value2 = NIH_MUST (nih_strdup (NULL, "qux")); /* set them */ cmd = nih_sprintf (NULL, "%s set-env %s=%s %s=%s 2>&1", get_initctl (), name, value, name2, value2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check them */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value2); nih_free (output); /* set them again */ cmd = nih_sprintf (NULL, "%s set-env %s=%s %s=%s 2>&1", get_initctl (), name, value, name2, value2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check again */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value2); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: baz"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("set-env with multiple variables, some already set"); name = NIH_MUST (nih_strdup (NULL, "foo")); value = NIH_MUST (nih_strdup (NULL, "bar")); name2 = NIH_MUST (nih_strdup (NULL, "baz")); value2 = NIH_MUST (nih_strdup (NULL, "qux")); name3 = NIH_MUST (nih_strdup (NULL, "hello")); value3 = NIH_MUST (nih_strdup (NULL, "world")); name4 = NIH_MUST (nih_strdup (NULL, "bonjour")); value4 = NIH_MUST (nih_strdup (NULL, "tout le monde")); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: hello"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: bonjour"); nih_free (output); /* set 2 variables initially */ cmd = nih_sprintf (NULL, "%s set-env %s='%s' %s='%s' 2>&1", get_initctl (), name3, value3, name4, value4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check them */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value3); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value4); nih_free (output); /* set them all */ cmd = nih_sprintf (NULL, "%s set-env %s='%s' %s='%s' %s='%s' %s='%s' 2>&1", get_initctl (), name, value, name3, value3, name2, value2, name4, value4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check again */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value2); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value3); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value4); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: baz"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: hello"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: bonjour"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("set-env with multiple variables in different forms"); name = NIH_MUST (nih_strdup (NULL, "foo")); value = NIH_MUST (nih_strdup (NULL, "bar")); name2 = NIH_MUST (nih_strdup (NULL, "baz")); value2 = NIH_MUST (nih_strdup (NULL, "qux")); name3 = NIH_MUST (nih_strdup (NULL, "name-equals")); name4 = NIH_MUST (nih_strdup (NULL, "just-name")); /* set them all */ cmd = nih_sprintf (NULL, "%s set-env %s='%s' %s= %s %s='%s' 2>&1", get_initctl (), name, value, name3, name4, name2, value2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value2); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); /* nul string value expected if none specified when set */ TEST_EQ_STR (output[0], ""); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); /* nul string value expected if none specified when set */ TEST_EQ_STR (output[0], ""); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: baz"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: name-equals"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: just-name"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("set-env --retain"); name = NIH_MUST (nih_strdup (NULL, "foo")); value = NIH_MUST (nih_strdup (NULL, "bar")); /* set it */ cmd = nih_sprintf (NULL, "%s set-env %s=%s 2>&1", get_initctl (), name, value); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check it */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s set-env --retain %s=%s 2>&1", get_initctl (), name, "HELLO"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check that value did *NOT* change */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("set-env --retain with multiple variables, some already set"); name = NIH_MUST (nih_strdup (NULL, "foo")); value = NIH_MUST (nih_strdup (NULL, "bar")); name3 = NIH_MUST (nih_strdup (NULL, "hello")); value3 = NIH_MUST (nih_strdup (NULL, "world")); name4 = NIH_MUST (nih_strdup (NULL, "bonjour")); value4 = NIH_MUST (nih_strdup (NULL, "tout le monde")); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: hello"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: bonjour"); nih_free (output); /* set 2 variables initially */ cmd = nih_sprintf (NULL, "%s set-env %s='%s' %s='%s' 2>&1", get_initctl (), name3, value3, name4, value4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check them */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value3); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value4); nih_free (output); /* set them all */ cmd = nih_sprintf (NULL, "%s set-env --retain %s='%s' %s='%s' %s='%s' %s='%s' 2>&1", get_initctl (), name, value, name3, "AAAA", name2, value2, name4, "BBBB"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); /* check that the original values did *NOT* change */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value3); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value4); nih_free (output); /* Check that the initially-not set variables were set */ cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value2); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: baz"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name3); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: hello"); nih_free (output); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name4); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: bonjour"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("set-env with space within value and trailing tab"); name = NIH_MUST (nih_strdup (NULL, "foo")); value = NIH_MUST (nih_sprintf (NULL, "space tab\t")); cmd = nih_sprintf (NULL, "%s set-env %s='%s' 2>&1", get_initctl (), name, value); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], value); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s get-env %s 2>&1", get_initctl (), name); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); TEST_EQ_STR (output[0], "initctl: No such variable: foo"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("list-env output order"); clear_job_env (); cmd = nih_sprintf (NULL, "%s set-env %s='%s' 2>&1", get_initctl (), "zygote", "cell"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s set-env %s='%s' 2>&1", get_initctl (), "median", "middle"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s set-env %s='%s' 2>&1", get_initctl (), "aardvark", "mammal"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ_STR (output[0], "aardvark=mammal"); TEST_EQ_STR (output[1], "median=middle"); TEST_EQ_STR (output[2], "zygote=cell"); TEST_EQ (line_count, 3); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), "aardvark"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ_STR (output[0], "median=middle"); TEST_EQ_STR (output[1], "zygote=cell"); TEST_EQ (line_count, 2); nih_free (output); cmd = nih_sprintf (NULL, "%s unset-env %s 2>&1", get_initctl (), "zygote"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ_STR (output[0], "median=middle"); TEST_EQ (line_count, 1); nih_free (output); /* re-add */ cmd = nih_sprintf (NULL, "%s set-env %s='%s' 2>&1", get_initctl (), "aardvark", "mammal"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s set-env %s='%s' 2>&1", get_initctl (), "zygote", "cell"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ_STR (output[0], "aardvark=mammal"); TEST_EQ_STR (output[1], "median=middle"); TEST_EQ_STR (output[2], "zygote=cell"); TEST_EQ (line_count, 3); nih_free (output); cmd = nih_sprintf (NULL, "%s reset-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); assert0 (line_count); /*******************************************************************/ TEST_FEATURE ("ensure job runs in modified environment"); cmd = nih_sprintf (NULL, "%s set-env %s='%s' 2>&1", get_initctl (), "aardvark", "mammal"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s set-env %s='%s' 2>&1", get_initctl (), "FOO", "BAR"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); cmd = nih_sprintf (NULL, "%s set-env %s='%s' 2>&1", get_initctl (), "_________", "_________"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); CREATE_FILE (confdir, "modified-env.conf", "exec env"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s start modified-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); nih_free (output); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "modified-env.log")); WAIT_FOR_FILE (logfile); fi = fopen (logfile, "r"); TEST_NE_P (fi, NULL); /* defaults */ TEST_FILE_MATCH (fi, "PATH=*"); TEST_FILE_MATCH (fi, "TERM=*"); /* variables we added */ TEST_FILE_MATCH (fi, "aardvark=mammal*"); TEST_FILE_MATCH (fi, "FOO=BAR*"); TEST_FILE_MATCH (fi, "_________=_________*"); /* special vars */ TEST_FILE_MATCH (fi, "UPSTART_JOB=modified-env*"); TEST_FILE_MATCH (fi, "UPSTART_INSTANCE=*"); TEST_FILE_MATCH (fi, "UPSTART_SESSION=*"); TEST_FILE_END (fi); fclose (fi); DELETE_FILE (confdir, "modified-env.conf"); TEST_EQ (unlink (logfile), 0); /* reset environment */ cmd = nih_sprintf (NULL, "%s reset-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); assert0 (line_count); /*******************************************************************/ } void test_job_env_invalid_args (const char *confdir, const char *logdir, pid_t upstart_pid, pid_t dbus_pid) { nih_local char *cmd = NULL; nih_local char *name = NULL; nih_local char *value = NULL; char **output; size_t line_count; assert (confdir); assert (logdir); assert (upstart_pid); assert (dbus_pid); /*******************************************************************/ TEST_FEATURE ("call get-env without specifying a variable"); cmd = nih_sprintf (NULL, "%s get-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 2); TEST_EQ_STR (output[0], "initctl: missing variable name"); TEST_EQ_STR (output[1], "Try `initctl --help\' for more information."); nih_free (output); /*******************************************************************/ TEST_FEATURE ("call set-env without specifying a variable"); cmd = nih_sprintf (NULL, "%s set-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 2); TEST_EQ_STR (output[0], "initctl: missing variable value"); TEST_EQ_STR (output[1], "Try `initctl --help\' for more information."); nih_free (output); /*******************************************************************/ TEST_FEATURE ("call unset-env without specifying a variable"); cmd = nih_sprintf (NULL, "%s unset-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 2); TEST_EQ_STR (output[0], "initctl: missing variable name"); TEST_EQ_STR (output[1], "Try `initctl --help\' for more information."); nih_free (output); /*******************************************************************/ } void test_global_and_local_job_env (const char *confdir, const char *logdir, pid_t upstart_pid, pid_t dbus_pid) { nih_local char *cmd = NULL; nih_local char *name = NULL; nih_local char *value = NULL; nih_local char *logfile = NULL; nih_local char *contents = NULL; char **output; size_t line_count; FILE *fi; assert (confdir); assert (logdir); assert (upstart_pid); assert (dbus_pid); /*******************************************************************/ TEST_FEATURE ("ensure pre-start can inject variable into main process"); contents = nih_sprintf (NULL, "pre-start exec %s set-env hello=world\n" "exec %s list-env\n", get_initctl (), get_initctl ()); TEST_NE_P (contents, NULL); CREATE_FILE (confdir, "foo.conf", contents); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s start foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); nih_free (output); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "foo.log")); WAIT_FOR_FILE (logfile); fi = fopen (logfile, "r"); TEST_FILE_CONTAINS (fi, "hello=world*"); TEST_NE_P (fi, NULL); fclose (fi); TEST_EQ (unlink (logfile), 0); DELETE_FILE (confdir, "foo.conf"); /*******************************************************************/ TEST_FEATURE ("ensure 'set-env --global' can inject a variable into main process"); cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); /* ensure variable not set initially */ TEST_EQ (line_count, 2); TEST_STR_MATCH (output[0], "PATH=*"); TEST_STR_MATCH (output[1], "TERM=*"); nih_free (output); contents = nih_sprintf (NULL, "script\n" " %s set-env --global hello=world\n" " %s get-env hello\n" "end script", get_initctl (), get_initctl ()); TEST_NE_P (contents, NULL); CREATE_FILE (confdir, "foo.conf", contents); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s start foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 1); nih_free (output); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "foo.log")); WAIT_FOR_FILE (logfile); fi = fopen (logfile, "r"); TEST_NE_P (fi, NULL); /* we don't expect output from either set-env or get-env * (since 'hello' variable should not be set). */ TEST_FILE_MATCH (fi, "world*\n"); TEST_FILE_END (fi); fclose (fi); TEST_EQ (unlink (logfile), 0); DELETE_FILE (confdir, "foo.conf"); /* Create a new job */ contents = nih_sprintf (NULL, "exec %s list-env", get_initctl ()); TEST_NE_P (contents, NULL); CREATE_FILE (confdir, "bar.conf", contents); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); TEST_EQ (line_count, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s start bar 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); nih_free (output); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "bar.log")); WAIT_FOR_FILE (logfile); fi = fopen (logfile, "r"); TEST_NE_P (fi, NULL); /* Since foo.conf modified the global table, a subsequent job * should pick up the change. */ TEST_FILE_CONTAINS (fi, "hello=world*"); fclose (fi); cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); /* ensure variable still returned by list-env */ TEST_GT (line_count, 2); TEST_STR_ARRAY_CONTAINS (output, "hello=world"); nih_free (output); /* reset environment */ cmd = nih_sprintf (NULL, "%s reset-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); assert0 (line_count); cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &line_count); /* ensure variable no longer set */ TEST_GT (line_count, 0); TEST_STR_ARRAY_NOT_CONTAINS (output, "hello=world"); nih_free (output); assert0 (unlink (logfile)); DELETE_FILE (confdir, "bar.conf"); /*******************************************************************/ } void test_no_inherit_job_env (const char *runtimedir, const char *confdir, const char *logdir) { nih_local char *cmd = NULL; char **output; size_t lines; pid_t upstart_pid = 0; char *extra[] = { "--no-inherit-env", NULL }; nih_local char *logfile = NULL; nih_local char *session_file = NULL; FILE *fi; start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, extra); /*******************************************************************/ TEST_FEATURE ("ensure list-env in '--user --no-inherit-env' environment gives expected output"); cmd = nih_sprintf (NULL, "%s list-env 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* environment should comprise the default environment only */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "PATH=*"); TEST_STR_MATCH (output[1], "TERM=*"); nih_free (output); /*******************************************************************/ TEST_FEATURE ("ensure '--user --no-inherit-env' provides expected job environment"); CREATE_FILE (confdir, "foo.conf", "exec env"); cmd = nih_sprintf (NULL, "%s reload-configuration 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); nih_free (output); cmd = nih_sprintf (NULL, "%s start foo 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); nih_free (output); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "foo.log")); WAIT_FOR_FILE (logfile); fi = fopen (logfile, "r"); TEST_NE_P (fi, NULL); TEST_FILE_CONTAINS (fi, "PATH=*"); TEST_FILE_CONTAINS (fi, "TERM=*"); /* asterisk required to match '\r\n' */ TEST_FILE_CONTAINS (fi, "UPSTART_JOB=foo*"); TEST_FILE_CONTAINS (fi, "UPSTART_INSTANCE=*"); TEST_FILE_CONTAINS (fi, "UPSTART_SESSION=*"); fclose (fi); DELETE_FILE (confdir, "foo.conf"); TEST_EQ (unlink (logfile), 0); /*******************************************************************/ session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", runtimedir, (int)upstart_pid)); STOP_UPSTART (upstart_pid); unlink (session_file); } /* * Test all the commands which affect the job environment table together * as they are so closely related. */ void test_job_env (void) { char confdir[PATH_MAX]; char logdir[PATH_MAX]; size_t lines; pid_t dbus_pid = 0; pid_t upstart_pid = 0; char *value; nih_local char *cmd = NULL; char **output; nih_local char *session_file = NULL; char *xdg_runtime_dir; xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR"); TEST_TRUE (xdg_runtime_dir); TEST_GROUP ("job process table commands"); TEST_FILENAME (confdir); TEST_EQ (mkdir (confdir, 0755), 0); TEST_FILENAME (logdir); TEST_EQ (mkdir (logdir, 0755), 0); /* Use the "secret" interface */ TEST_EQ (setenv ("UPSTART_CONFDIR", confdir, 1), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", logdir, 1), 0); /*******************************************************************/ /* Ensure basic variables are set in the current environment */ if (! getenv ("TERM")) { fprintf (stderr, "WARNING: setting TERM to '%s' as not set\n", TEST_INITCTL_DEFAULT_TERM); assert0 (setenv ("TERM", TEST_INITCTL_DEFAULT_TERM, 1)); } if (! getenv ("PATH")) { fprintf (stderr, "WARNING: setting PATH to '%s' as not set\n", TEST_INITCTL_DEFAULT_PATH); assert0 (setenv ("PATH", TEST_INITCTL_DEFAULT_PATH, 1)); } TEST_DBUS (dbus_pid); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir, logdir, NULL); cmd = nih_sprintf (NULL, "%s list-sessions 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); /* look for separator between pid and value of * UPSTART_SESSION. */ value = strstr (output[0], " "); TEST_NE_P (value, NULL); /* jump over space */ value += 1; TEST_NE_P (value, NULL); assert0 (setenv ("UPSTART_SESSION", value, 1)); nih_free (output); /*******************************************************************/ test_job_env_invalid_args (confdir, logdir, upstart_pid, dbus_pid); test_default_job_env (confdir, logdir, upstart_pid, dbus_pid); test_modified_job_env (confdir, logdir, upstart_pid, dbus_pid); test_global_and_local_job_env (confdir, logdir, upstart_pid, dbus_pid); /*******************************************************************/ STOP_UPSTART (upstart_pid); session_file = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions/%d.session", xdg_runtime_dir, (int)upstart_pid)); unlink (session_file); /*******************************************************************/ test_no_inherit_job_env (xdg_runtime_dir, confdir, logdir); /*******************************************************************/ TEST_DBUS_END (dbus_pid); assert0 (unsetenv ("UPSTART_CONFDIR")); assert0 (unsetenv ("UPSTART_LOGDIR")); assert0 (unsetenv ("UPSTART_SESSION")); TEST_EQ (rmdir (confdir), 0); TEST_EQ (rmdir (logdir), 0); } void test_dbus_connection (void) { size_t lines; pid_t dbus_pid = 0; pid_t dbus_pid2 = 0; pid_t upstart_pid = 0; nih_local char *cmd = NULL; char **output; nih_local char *dbus_session_address = NULL; nih_local char *dbus_session_address2 = NULL; nih_local char *upstart_session = NULL; nih_local char *original_runtime = NULL; char dirname[PATH_MAX]; char *address; original_runtime = nih_strdup (NULL, getenv("XDG_RUNTIME_DIR")); TEST_NE_P (original_runtime, NULL); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("XDG_RUNTIME_DIR", dirname, 1), 0); TEST_GROUP ("D-Bus connection"); /*********************************************************************/ TEST_FEATURE ("ensure non-priv non-Session Init connects to D-Bus session bus on startup"); /* Start a dbus-daemon */ TEST_DBUS (dbus_pid); /* Not required */ assert0 (unsetenv ("DBUS_SYSTEM_BUS_ADDRESS")); TEST_TRUE (getenv ("DBUS_SESSION_BUS_ADDRESS")); START_UPSTART (upstart_pid, FALSE); cmd = nih_sprintf (NULL, "%s --session version 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "init (upstart [0-9.][0-9.]*"); nih_free (output); STOP_UPSTART (upstart_pid); TEST_DBUS_END (dbus_pid); /*********************************************************************/ TEST_FEATURE ("ensure Session Init does not connect to D-Bus session bus on startup"); /* Start a dbus-daemon */ TEST_DBUS (dbus_pid); /* Not required */ assert0 (unsetenv ("DBUS_SYSTEM_BUS_ADDRESS")); TEST_TRUE (getenv ("DBUS_SESSION_BUS_ADDRESS")); START_UPSTART (upstart_pid, TRUE); address = getenv ("DBUS_SESSION_BUS_ADDRESS"); TEST_NE_P (address, NULL); dbus_session_address = nih_strdup (NULL, address); TEST_NE_P (dbus_session_address, NULL); /* Stop initctl using this route */ assert0 (unsetenv ("DBUS_SESSION_BUS_ADDRESS")); /* Check we can query the version via the private socket */ cmd = nih_sprintf (NULL, "%s version 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "init (upstart [0-9.][0-9.]*"); nih_free (output); /* Unset to stop initctl finding upstart via this route */ assert0 (unsetenv ("UPSTART_SESSION")); /* Re-apply in the test environment */ assert0 (setenv ("DBUS_SESSION_BUS_ADDRESS", dbus_session_address, 1)); /* Although there is a D-Bus session bus available, the Session * Init should not connect to it. Check this by trying to query * the running version via the D-Bus session bus. */ cmd = nih_sprintf (NULL, "%s --session version 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "initctl: Name \"com.ubuntu.Upstart\" does not exist*"); nih_free (output); STOP_UPSTART (upstart_pid); TEST_DBUS_END (dbus_pid); /*********************************************************************/ TEST_FEATURE ("ensure Session Init connects to D-Bus session bus when notified"); /* Start a dbus-daemon */ TEST_DBUS (dbus_pid); address = getenv ("DBUS_SESSION_BUS_ADDRESS"); TEST_NE_P (address, NULL); dbus_session_address = nih_strdup (NULL, address); TEST_NE_P (dbus_session_address, NULL); /* Not required */ assert0 (unsetenv ("DBUS_SYSTEM_BUS_ADDRESS")); assert0 (unsetenv ("DBUS_SESSION_BUS_ADDRESS")); nih_local char **extra = NULL; extra = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (nih_str_array_add (&extra, NULL, NULL,"--no-startup-event")); start_upstart_common (&(upstart_pid), TRUE, FALSE, NULL, NULL, extra); /* Pass the D-Bus session bus address to the Session Init */ cmd = nih_sprintf (NULL, "%s notify-dbus-address \"%s\" 2>&1", get_initctl_binary (), dbus_session_address); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); /* Re-apply in the test environment */ assert0 (setenv ("DBUS_SESSION_BUS_ADDRESS", dbus_session_address, 1)); /* It should now be possible to query the running version via * the D-Bus session bus. */ cmd = nih_sprintf (NULL, "%s --session version 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "init (upstart [0-9.][0-9.]*"); nih_free (output); /*********************************************************************/ TEST_FEATURE ("ensure Session Init retains D-Bus address across a re-exec"); assert0 (unsetenv ("DBUS_SESSION_BUS_ADDRESS")); REEXEC_UPSTART (upstart_pid, TRUE); /* Re-apply in the test environment */ assert0 (setenv ("DBUS_SESSION_BUS_ADDRESS", dbus_session_address, 1)); /* It should still be possible to query the running version via * the D-Bus session bus since Upstart should have reconnected * since it was previously notified of the D-Bus address. */ cmd = nih_sprintf (NULL, "%s --session version 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "init (upstart [0-9.][0-9.]*"); nih_free (output); STOP_UPSTART (upstart_pid); TEST_DBUS_END (dbus_pid); /*********************************************************************/ TEST_FEATURE ("ensure Session Init does not connect to another bus when notified twice"); /* Start first dbus-daemon */ TEST_DBUS (dbus_pid); /* Save its address */ address = getenv ("DBUS_SESSION_BUS_ADDRESS"); TEST_NE_P (address, NULL); dbus_session_address = nih_strdup (NULL, address); TEST_NE_P (dbus_session_address, NULL); /* Start second dbus-daemon */ TEST_DBUS (dbus_pid2); /* Save its address */ address = getenv ("DBUS_SESSION_BUS_ADDRESS"); TEST_NE_P (address, NULL); dbus_session_address2 = nih_strdup (NULL, address); TEST_NE_P (dbus_session_address2, NULL); assert0 (unsetenv ("DBUS_SYSTEM_BUS_ADDRESS")); assert0 (unsetenv ("DBUS_SESSION_BUS_ADDRESS")); start_upstart_common (&(upstart_pid), TRUE, FALSE, NULL, NULL, extra); /* Pass the first D-Bus session bus address to the Session Init */ cmd = nih_sprintf (NULL, "%s notify-dbus-address \"%s\" 2>&1", get_initctl_binary (), dbus_session_address); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); /* Re-apply in the test environment */ assert0 (setenv ("DBUS_SESSION_BUS_ADDRESS", dbus_session_address, 1)); /* It should now be possible to query the running version via * the D-Bus session bus. */ cmd = nih_sprintf (NULL, "%s --session version 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "init (upstart [0-9.][0-9.]*"); nih_free (output); /* Pass the second D-Bus session bus address to the Session Init */ cmd = nih_sprintf (NULL, "%s notify-dbus-address \"%s\" 2>&1", get_initctl_binary (), dbus_session_address2); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); /* Check that the Session Init still responds on the first address */ cmd = nih_sprintf (NULL, "%s --session version 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "init (upstart [0-9.][0-9.]*"); nih_free (output); /* Stop the 1st daemon */ TEST_DBUS_END (dbus_pid); /* Switch to the 2nd daemon */ assert0 (setenv ("DBUS_SESSION_BUS_ADDRESS", dbus_session_address2, 1)); /* Ensure the Session Init isn't responding on this address */ cmd = nih_sprintf (NULL, "%s --session version 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "initctl: Name \"com.ubuntu.Upstart\" does not exist*"); nih_free (output); STOP_UPSTART (upstart_pid); /* Stop the 2nd daemon */ TEST_DBUS_END (dbus_pid2); TEST_EQ (setenv ("XDG_RUNTIME_DIR", original_runtime, 1), 0); } int main (int argc, char *argv[]) { nih_error_init (); nih_timer_init (); nih_signal_init (); nih_child_init (); nih_main_loop_init (); program_name = "test"; test_common_setup (); test_upstart_open (); test_job_status (); test_start_action (); test_stop_action (); test_restart_action (); test_reload_action (); test_status_action (); test_list_action (); test_emit_action (); test_reload_configuration_action (); test_version_action (); test_log_priority_action (); test_usage (); test_job_env (); test_reexec (); test_list_sessions (); if (have_timed_waitpid ()) { test_quiesce (); } else { fprintf (stderr, "\n\n" "WARNING: not running quiesce tests, " "as no precise timing information available " "\n\n"); } test_umask (); test_no_dbus (); if (in_chroot () && !dbus_configured ()) { fprintf (stderr, "\n\n" "WARNING: not running show-config, " "check-config & notify-disk-writeable tests within chroot " "as no D-Bus, or D-Bus not configured (lp:#728988)" "\n\n"); } else { test_list (); test_show_config (); test_check_config (); test_notify_disk_writeable (); } test_dbus_connection (); test_common_cleanup (); return 0; } upstart-1.13.2/util/util.supp0000664000175000017500000000025512373101356013071 00000000000000# This is a valgrind suppressions file. # utmp(x)name leaks the filename we pass { utmpname-filename Memcheck:Leak fun:malloc fun:strdup fun:utmpname } upstart-1.13.2/util/utmp.h0000664000175000017500000000250712373101356012343 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef UTIL_UTMP_H #define UTIL_UTMP_H #include NIH_BEGIN_EXTERN int utmp_read_runlevel (const char *utmp_file, int *prevlevel) __attribute__ ((warn_unused_result)); int utmp_get_runlevel (const char *utmp_file, int *prevlevel) __attribute__ ((warn_unused_result)); int utmp_write_runlevel (const char *utmp_file, const char *wtmp_file, int runlevel, int prevlevel) __attribute__ ((warn_unused_result)); int utmp_write_shutdown (const char *utmp_file, const char *wtmp_file) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* UTIL_UTMP_H */ upstart-1.13.2/util/shutdown.c0000664000175000017500000004526712373101356013236 00000000000000/* upstart * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sysv.h" /** * ETC_NOLOGIN: * * File we write to to prevent logins. **/ #define ETC_NOLOGIN "/etc/nologin" /** * DEV: * * Directory containing tty device nodes. **/ #define DEV "/dev" /** * DEV_INITCTL: * * System V init control socket. **/ #ifndef DEV_INITCTL #define DEV_INITCTL "/dev/initctl" #endif /** * RUN_INITCTL: * * System V init control socket (new location). **/ #ifndef RUN_INITCTL #define RUN_INITCTL "/run/initctl" #endif /* Prototypes for option functions */ static int runlevel_option (NihOption *option, const char *arg); /* Prototypes for static functions */ static void shutdown_now (void) __attribute__ ((noreturn)); static void cancel_callback (void *data, NihSignal *signal) __attribute__ ((noreturn)); static void timer_callback (const char *message); static char *warning_message (const char *message) __attribute__ ((warn_unused_result)); static void wall (const char *message); static void sysvinit_shutdown (void); /** * runlevel: * * Runlevel to switch to. **/ static int runlevel = 0; /** * init_halt: * * Value of init_halt environment variable for event. **/ static const char *init_halt = NULL; /** * cancel: * * TRUE if we should cancel an already running shutdown. **/ static int cancel = FALSE; /** * warn_only: * * TRUE if we should only send the warning, and not perform the actual * shutdown. **/ static int warn_only = FALSE; /** * when: * * Time to shutdown, parsed from the old -g argument. **/ static char *when = NULL; /** * delay: * * How long until we shutdown. **/ static int delay = 0; /** * runlevel_option: * @option: option found in arguments, * @arg: always NULL. * * This function is called whenever one of the -r, -h, -H or -P options * is found in the argument list. It changes the runlevel to that implied * by the option. **/ static int runlevel_option (NihOption *option, const char *arg) { int *value; nih_assert (option != NULL); nih_assert (option->value != NULL); nih_assert (arg == NULL); value = (int *)option->value; switch (option->option) { case 'r': *value = '6'; init_halt = NULL; break; case 'h': *value = '0'; init_halt = NULL; break; case 'H': *value = '0'; init_halt = "HALT"; break; case 'P': *value = '0'; init_halt = "POWEROFF"; break; } return 0; } /** * options: * * Command-line options accepted for all arguments. **/ static NihOption options[] = { { 'r', NULL, N_("reboot after shutdown"), NULL, NULL, &runlevel, runlevel_option }, { 'h', NULL, N_("halt or power off after shutdown"), NULL, NULL, &runlevel, runlevel_option }, { 'H', NULL, N_("halt after shutdown (implies -h)"), NULL, NULL, &runlevel, runlevel_option }, { 'P', NULL, N_("power off after shutdown (implies -h)"), NULL, NULL, &runlevel, runlevel_option }, { 'c', NULL, N_("cancel a running shutdown"), NULL, NULL, &cancel, NULL }, { 'k', NULL, N_("only send warnings, don't shutdown"), NULL, NULL, &warn_only, NULL }, /* Compatibility option for specifying time */ { 'g', NULL, NULL, NULL, "TIME", &when, NULL }, /* Compatibility options, all ignored */ { 'a', NULL, NULL, NULL, NULL, NULL, NULL }, { 'n', NULL, NULL, NULL, NULL, NULL, NULL }, { 'f', NULL, NULL, NULL, NULL, NULL, NULL }, { 'F', NULL, NULL, NULL, NULL, NULL, NULL }, { 'i', NULL, NULL, NULL, "LEVEL", NULL, NULL }, { 't', NULL, NULL, NULL, "SECS", NULL, NULL }, { 'y', NULL, NULL, NULL, NULL, NULL, NULL }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char ** args; nih_local char *message = NULL; size_t messagelen; nih_local char *msg = NULL; int arg; pid_t pid = 0; nih_main_init (argv[0]); nih_option_set_usage (_("TIME [MESSAGE]")); nih_option_set_synopsis (_("Bring the system down.")); nih_option_set_help ( _("TIME may have different formats, the most common is simply " "the word 'now' which will bring the system down " "immediately. Other valid formats are +m, where m is the " "number of minutes to wait until shutting down and hh:mm " "which specifies the time on the 24hr clock.\n" "\n" "Logged in users are warned by a message sent to their " "terminal, you may include an optional MESSAGE included " "with this. Messages can be sent without actually " "bringing the system down by using the -k option.\n" "\n" "If TIME is given, the command will remain in the " "foreground until the shutdown occurs. It can be cancelled " "by Control-C, or by another user using the -c option.\n" "\n" "The system is brought down into maintenance (single-user) " "mode by default, you can change this with either the -r or " "-h option which specify a reboot or system halt " "respectively. The -h option can be further modified with " "-H or -P to specify whether to halt the system, or to " "power it off afterwards. The default is left up to the " "shutdown scripts.")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); /* If the runlevel wasn't given explicitly, set it to 1 so we go * down into single-user mode. */ if (! runlevel) { runlevel = '1'; init_halt = NULL; } /* When may be specified with -g, or must be first argument */ if (! (cancel || when || args[0])) { fprintf (stderr, _("%s: time expected\n"), program_name); nih_main_suggest_help (); exit (1); } else if (! (cancel || when)) { when = NIH_MUST (nih_strdup (NULL, args[0])); arg = 1; } else { arg = 0; } /* Parse the time argument */ if (when) { if (! strcmp (when, "now")) { /* "now" means, err, now */ delay = 0; } else if (strchr (when, ':')) { /* Clock time */ long hours, mins; char *endptr; struct tm *tm; time_t now; hours = strtoul (when, &endptr, 10); if ((*endptr != ':') || (hours < 0) || (hours > 23)) { fprintf (stderr, _("%s: illegal hour value\n"), program_name); nih_main_suggest_help (); exit (1); } mins = strtoul (endptr + 1, &endptr, 10); if (*endptr || (mins < 0) || (mins > 59)) { fprintf (stderr, _("%s: illegal minute value\n"), program_name); nih_main_suggest_help (); exit (1); } /* Subtract the current time to get the delay. * Add a whole day if we go negative */ now = time (NULL); tm = localtime (&now); delay = (((hours * 60) + mins) - ((tm->tm_hour * 60) + tm->tm_min)); if (delay < 0) delay += 1440; } else { /* Delay in minutes */ char *endptr; delay = strtoul (when, &endptr, 10); if (*endptr || (delay < 0)) { fprintf (stderr, _("%s: illegal time value\n"), program_name); nih_main_suggest_help (); exit (1); } } nih_free (when); } /* The rest of the arguments are a message. * Really this should be just the next argument, but that's not * how this has been traditionally done *sigh* */ message = NIH_MUST (nih_strdup (NULL, "")); messagelen = 0; for (; args[arg]; arg++) { message = NIH_MUST (nih_realloc ( message, NULL, messagelen + strlen(args[arg]) + 4)); strcat (message, args[arg]); strcat (message, " "); messagelen += strlen (args[arg]) + 1; } /* Terminate with \r\n */ if (messagelen) strcat (message, "\r\n"); /* Check we're root, or setuid root */ if (setuid (geteuid ()) < 0) nih_warn (_("Couldn't set uid.")); if (getuid ()) { nih_fatal (_("Need to be root")); exit (1); } /* Look for an existing pid file and deal with the existing * process if there is one. */ pid = nih_main_read_pidfile (); if (pid > 0) { if (cancel) { if (kill (pid, SIGINT) < 0) { nih_error (_("Shutdown is not running")); exit (1); } if (messagelen) wall (message); exit (0); } else if (kill (pid, 0) == 0) { nih_error (_("Another shutdown is already running")); exit (1); } } else if (cancel) { nih_error (_("Cannot find pid of running shutdown")); exit (1); } /* Send an initial message */ msg = NIH_MUST (warning_message (message)); wall (msg); if (warn_only) exit (0); /* Give us a sane environment */ if (chdir ("/") < 0) nih_warn ("%s: %s", _("Unable to change directory"), strerror (errno)); umask (022); /* Shutdown now? */ if (! delay) shutdown_now (); /* Save our pid so we can be interrupted later */ if (nih_main_write_pidfile (getpid ()) < 0) { NihError *err; err = nih_error_get (); nih_warn ("%s: %s: %s", nih_main_get_pidfile(), _("Unable to write pid file"), err->message); nih_free (err); } /* Ignore a whole bunch of signals */ nih_signal_set_ignore (SIGCHLD); nih_signal_set_ignore (SIGHUP); nih_signal_set_ignore (SIGTSTP); nih_signal_set_ignore (SIGTTIN); nih_signal_set_ignore (SIGTTOU); /* Catch the usual quit signals */ nih_signal_set_handler (SIGINT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGINT, cancel_callback, NULL)); nih_signal_set_handler (SIGQUIT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGQUIT, cancel_callback, NULL)); nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, cancel_callback, NULL)); /* Call a timer every minute until we shutdown */ NIH_MUST (nih_timer_add_periodic (NULL, 60, (NihTimerCb)timer_callback, message)); /* Hang around */ nih_main_loop (); return 0; } /** * shutdown_now: * * Send a signal to init to shut down the machine. * * This does not return. **/ static void shutdown_now (void) { nih_local char **extra_env = NULL; NihDBusError * dbus_err; int exit_val = 0; if (init_halt) { char *e; e = NIH_MUST (nih_sprintf (NULL, "INIT_HALT=%s", init_halt)); extra_env = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (nih_str_array_addp (&extra_env, NULL, NULL, e)); } if (sysv_change_runlevel (runlevel, extra_env, NULL, NULL) < 0) { dbus_err = (NihDBusError *)nih_error_get (); if ((dbus_err->number != NIH_DBUS_ERROR) || strcmp (dbus_err->name, DBUS_ERROR_NO_SERVER)) { nih_fatal ("%s", dbus_err->message); nih_free (dbus_err); exit (1); } nih_free (dbus_err); /* Connection Refused means that init isn't running, this * might mean we've just upgraded to upstart and haven't * yet rebooted ... so try /dev/initctl */ sysvinit_shutdown (); nih_fatal ("Unable to shutdown system"); exit_val = 1; } unlink (ETC_NOLOGIN); nih_main_unlink_pidfile (); exit (exit_val); } /** * cancel_callback: * @data: not used, * @signal: signal caught. * * This callback is run whenever one of the "cancel running shutdown" * signals is sent to us. * * This does not return. **/ static void cancel_callback (void *data, NihSignal *signal) { nih_error (_("Shutdown cancelled")); unlink (ETC_NOLOGIN); nih_main_unlink_pidfile (); exit (0); } /** * timer_callback: * @message: message to display. * * This callback is run every minute until we are ready to shutdown, it * ensures regular warnings are sent to logged in users and handles * preventing new logins. Once time is up, it handles shutting down. * * This will modify delay each time it is called. **/ static void timer_callback (const char *message) { nih_local char *msg = NULL; int warn = FALSE; delay--; msg = NIH_MUST (warning_message (message)); /* Write /etc/nologin with less than 5 minutes remaining */ if (delay <= 5) { FILE *nologin; nologin = fopen (ETC_NOLOGIN, "w"); if (nologin) { fputs (msg, nologin); fclose (nologin); } } /* Only warn at particular intervals */ if (delay < 10) { warn = TRUE; } else if (delay < 60) { warn = (delay % 15 ? FALSE : TRUE); } else if (delay < 180) { warn = (delay % 30 ? FALSE : TRUE); } else { warn = (delay % 60 ? FALSE : TRUE); } if (warn) wall (msg); /* Shutdown the machine at zero */ if (! delay) shutdown_now (); } /** * warning_message: * @message: user message. * * Prefixes the message with details about how long until the shutdown * completes. * * Returns: newly allocated string. **/ static char * warning_message (const char *message) { nih_local char *banner = NULL; char * msg; nih_assert (message != NULL); if ((runlevel == '0') && init_halt && (! strcmp (init_halt, "POWEROFF"))) { if (delay) { banner = nih_sprintf ( NULL, _n("The system is going down for " "power off in %d minute!", "The system is going down for " "power off in %d minutes!", delay), delay); } else { banner = nih_strdup ( NULL, _("The system is going down for " "power off NOW!")); } } else if (runlevel == '0') { if (delay) { banner = nih_sprintf ( NULL, _n("The system is going down for " "halt in %d minute!", "The system is going down for " "halt in %d minutes!", delay), delay); } else { banner = nih_strdup ( NULL, _("The system is going down for " "halt NOW!")); } } else if (runlevel == '1') { if (delay) { banner = nih_sprintf ( NULL, _n("The system is going down for " "maintenance in %d minute!", "The system is going down for " "maintenance in %d minutes!", delay), delay); } else { banner = nih_strdup ( NULL, _("The system is going down for " "maintenance NOW!")); } } else if (runlevel == '6') { if (delay) { banner = nih_sprintf ( NULL, _n("The system is going down for " "reboot in %d minute!", "The system is going down for " "reboot in %d minutes!", delay), delay); } else { banner = nih_strdup ( NULL, _("The system is going down for " "reboot NOW!")); } } if (! banner) return NULL; msg = nih_sprintf (NULL, "\r%s\r\n%s", banner, message); return msg; } /** * alarm_handler: * @signum: signal called. * * Empty function used to cause the ALRM signal to break a syscall. **/ static void alarm_handler (int signum) { } /** * wall: * @message: message to send. * * Send a message to all logged in users; based largely on the code from * bsdutils. This is done in a child process to stop anything blocking. **/ static void wall (const char *message) { struct sigaction act; struct utmpx * ent; pid_t pid; time_t now; struct tm * tm; char * user; char * tty; char hostname[MAXHOSTNAMELEN]; char * banner1; char * banner2; pid = fork (); if (pid < 0) { nih_warn (_("Unable to fork child-process to warn users: %s"), strerror (errno)); return; } else if (pid > 0) { return; } /* Break syscalls with SIGALRM */ act.sa_handler = alarm_handler; act.sa_flags = 0; sigemptyset (&act.sa_mask); sigaction (SIGALRM, &act, NULL); /* Get username for banner */ user = getlogin (); if (! user) { struct passwd *pw; pw = getpwuid (getuid ()); if (pw) user = pw->pw_name; } if (! user) { if (getuid ()) { user = NIH_MUST (nih_sprintf (NULL, "uid %d", getuid ())); } else { user = "root"; } } /* Get hostname for banner */ gethostname (hostname, sizeof (hostname)); /* Get terminal for banner */ tty = ttyname (0); if (! tty) tty = "unknown"; /* Get time */ now = time (NULL); tm = localtime (&now); /* Construct banner */ banner1 = nih_sprintf (NULL, _("Broadcast message from %s@%s"), user, hostname); banner2 = nih_sprintf (NULL, _("(%s) at %d:%02d ..."), tty, tm->tm_hour, tm->tm_min); /* Iterate entries in the utmp file */ setutxent (); while ((ent = getutxent ()) != NULL) { char dev[PATH_MAX + 1]; int fd; /* Ignore entries without a name, or not a user process */ if ((ent->ut_type != USER_PROCESS) || (! strlen (ent->ut_user))) continue; /* Construct the device path */ if (strncmp (ent->ut_line, DEV "/", 5)) { snprintf (dev, sizeof (dev), "%s/%s", DEV, ent->ut_line); } else { snprintf (dev, sizeof (dev), "%s", ent->ut_line); } alarm (2); fd = open (dev, O_WRONLY | O_NDELAY | O_NOCTTY); if ((fd >= 0) && isatty (fd)) { FILE *term; term = fdopen (fd, "w"); if (term) { fprintf (term, "\007\r\n%s\r\n\t%s\r\n\r\n", banner1, banner2); fputs (message, term); fflush (term); fclose (term); } } alarm (0); } endutxent (); nih_free (banner1); nih_free (banner2); exit (0); } /** * struct request: * * This is the structure passed across /dev/initctl. **/ struct request { int magic; int cmd; int runlevel; int sleeptime; char data[368]; }; /** * sysvinit_shutdown: * * Attempt to shutdown a running sysvinit /sbin/init using its /dev/initctl * socket. **/ static void sysvinit_shutdown (void) { struct sigaction act; struct request request; int fd; /* Fill in the magic values */ memset (&request, 0, sizeof (request)); request.magic = 0x03091969; request.sleeptime = 5; request.cmd = 1; /* Select a runlevel based on the event name */ request.runlevel = runlevel; /* Break syscalls with SIGALRM */ act.sa_handler = alarm_handler; act.sa_flags = 0; sigemptyset (&act.sa_mask); sigaction (SIGALRM, &act, NULL); alarm (3); /* Try and open /run/initctl */ fd = open (RUN_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY); if (fd < 0) { /* Fall back to /dev/initctl */ fd = open (DEV_INITCTL, O_WRONLY | O_NDELAY | O_NOCTTY); } if (fd >= 0) { if (write (fd, &request, sizeof (request)) == sizeof (request)) exit (0); close (fd); } alarm (0); } upstart-1.13.2/util/man/0000775000175000017500000000000012402042412012022 500000000000000upstart-1.13.2/util/man/telinit.80000664000175000017500000000570512373101356013524 00000000000000.TH telinit 8 2009-07-09 "Upstart" .\" .SH NAME telinit \- change system runlevel .\" .SH SYNOPSIS .B telinit .RI [ OPTION ]... .I RUNLEVEL .\" .SH DESCRIPTION .B telinit may be used to change the system runlevel. The .I RUNLEVEL argument should be one of the multi-user runlevels .BR 2-5 , .B 0 to halt the system, .B 6 to reboot the system or .B 1 to bring the system down into single-user mode. Normally you would use the .BR shutdown (8) tool to halt or reboot the system, or to bring it down to single-user mode. .I RUNLEVEL may also be .BR S " or " s which will place the system directly into single-user mode without actually stopping processes first, you probably won't want that. The runlevel is changed by emitting the .BR runlevel (7) event, which includes the new runlevel in the .B RUNLEVEL environment variable as well as the previous runlevel (obtained from the environment or from .IR /var/run/utmp ) in the .B PREVLEVEL variable. .B telinit will write the new runlevel to .I /var/run/utmp and append a new entry to .I /var/log/wtmp. \" .SS Other commands .B telinit may be also used to send basic commands to the .BR init (8) daemon for compatibility with System V. These are: .\" .TP .BR Q " or " q to request that .BR init (8) reload its configuration. This is rarely necessary since Upstart watches its configuration with .BR inotify (7) and is deprecated by the .BR initctl (8) .B reload-configuration command. .\" .TP .BR U " or " u to request that the .BR init (8) daemon re-execute itself. This is necessary when upgrading the Upstart .BR init (8) daemon itself or any of its dependent system libraries to ensure disks can be unmounted cleanly on shutdown. Note that if the init daemon is .I not Upstart, this option will have no effect on the running .BR init (8) daemon. .\" .SH OPTIONS .TP .BI "-e " KEY=VALUE This specifies an additional environment variable to be included in the event along with .B RUNLEVEL and .BR PREVLEVEL . .\" .SH ENVIRONMENT .TP .B RUNLEVEL .B telinit will read the current runlevel from this environment variable if set in preference to reading from .I /var/run/utmp .\" .SH FILES .TP .I /var/run/utmp Where the current runlevel will be read from; this file will also be updated with the new runlevel. .\" .TP .I /var/log/wtmp A new runlevel record will be appended to this file for the new runlevel. .\" .SH NOTES The Upstart .BR init (8) daemon does not keep track of runlevels itself, instead they are implemented entirely by its userspace tools. See .BR runlevel (7) for more details. .\" .SH AUTHOR Written by Scott James Remnant .RB < scott@netsplit.com > .\" .SH REPORTING BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2009 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR runlevel (7) .BR init (8) .BR initctl (8) .BR shutdown (8) .BR runlevel (8) upstart-1.13.2/util/man/shutdown.80000664000175000017500000000571212373101356013725 00000000000000.TH shutdown 8 2009-07-09 "Upstart" .\" .SH NAME shutdown \- bring the system down .\" .SH SYNOPSIS .B shutdown .RI [ OPTION ]... .I TIME .RI [ MESSAGE ] .\" .SH DESCRIPTION .B shutdown arranges for the system to be brought down in a safe way. All logged-in users are notified that the system is going down and, within the last five minutes of .IR TIME , new logins are prevented. .I TIME may have different formats, the most common is simply the word .RI ' now ' which will bring the system down immediately. Other valid formats are .IR +m , where .I m is the number of minutes to wait until shutting down and .I hh:mm which specifies the time on the 24hr clock. If no option is specified, the default action is to bring the system down into single-user mode. Once .I TIME has elapsed, .B shutdown sends a request to the .BR init (8) daemon to bring the system down into the appropriate runlevel. This is performed by emitting the .BR runlevel (7) event, which includes the new runlevel in the .B RUNLEVEL environment variable as well as the previous runlevel (obtained from the environment or from .IR /var/run/utmp ) in the .B PREVLEVEL variable. An additional .B INIT_HALT variable may be set, this will contain the value .I HALT when bringing the system down for halt and .I POWEROFF when bringing the system down for power off. .\" .SH OPTIONS .TP .BR -r Requests that the system be rebooted after it has been brought down. .\" .TP .BR -h Requests that the system be either halted or powered off after it has been brought down, with the choice as to which left up to the system. .\" .TP .BR -H Requests that the system be halted after it has been brought down. .\" .TP .BR -P Requests that the system be powered off after it has been brought down. .\" .TP .BR -c Cancels a running shutdown. .I TIME is not specified with this option, the first argument is .I MESSAGE. .\" .TP .BR -k Only send out the warning messages and disable logins, do not actually bring the system down. .\" .SH ENVIRONMENT .TP .B RUNLEVEL .B shutdown will read the current runlevel from this environment variable if set in preference to reading from .I /var/run/utmp .\" .SH FILES .TP .I /var/run/utmp Where the current runlevel will be read from; this file will also be updated with the new runlevel. .\" .TP .I /var/log/wtmp A new runlevel record will be appended to this file for the new runlevel. .\" .SH NOTES The Upstart .BR init (8) daemon does not keep track of runlevels itself, instead they are implemented entirely by its userspace tools. See .BR runlevel (7) for more details. .\" .SH AUTHOR Written by Scott James Remnant .RB < scott@netsplit.com > .\" .SH REPORTING BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2009 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR runlevel (7) .BR init (8) .BR telinit (8) .BR reboot (8) upstart-1.13.2/util/man/initctl.80000664000175000017500000005151012373101356013515 00000000000000.TH initctl 8 2014-05-09 "Upstart" .\" .SH NAME initctl \- init daemon control tool .\" .SH SYNOPSIS .B initctl .RI [ OPTION ]... .I COMMAND .RI [ OPTION ]... .IR ARG ... .\" .SH DESCRIPTION .B initctl allows a system administrator to communicate and interact with the Upstart .BR init (8) daemon. If D\-Bus has been configured to allow non\-privileged users to invoke all Upstart D\-Bus methods, this command is also able to manage user jobs. See .BR init (5) for further details. When run as .BR initctl , the first non\-option argument is the .IR COMMAND . Global options may be specified before or after the command. You may also create symbolic or hard links to .B initctl named after commands. When invoked through these links the tool will behave only as that command, with global and command\-specific options intermixed. The default installation supplies such links for the .BR start ", " stop ", " restart ", " reload " and " status commands. .\" .SH OPTIONS .TP .B \-\-user User mode. In this mode, initctl will talk to the .BR init (8) daemon using the D\-Bus private socket defined in the .B UPSTART_SESSION environment variable. Note that if the .B UPSTART_SESSION variable is defined, this option is implied. .\" .TP .B \-\-session Connect to .BR init (8) daemon using the existing D\-Bus session bus (for testing purposes only). .\" .TP .B \-\-system Communication with the .BR init (8) daemon is normally performed over a private socket connection. This has the advantage of speed and robustness, when issuing commands to start or stop services or even reboot the system you do not want to be affected by changes to the D\-Bus system bus daemon. The disadvantage to using the private socket however is security, .BR init (8) only permits the root user to communicate over this socket which means that read\-only commands such as .BR status " and " list cannot be made by other users. The .B \-\-system option instructs .BR initctl to communicate via the D\-Bus system bus rather than over the private socket. This is only possible if the system bus daemon is running and if .BR init (8) is connected to it. The advantage is that the default security configuration allows non\-root users to use read\-only commands. .\" .TP .B \-\-dest Specifies the well\-known name of the .BR init (8) daemon when using .BR \-\-system . There is normally no need to use this option since the .BR init (8) daemon uses the default .B com.ubuntu.Upstart name. However it may be useful for debugging. .\" .TP .B \-\-no\-wait Applies to the .BR start ", " stop ", " restart " and " emit commands. Normally .B initctl will wait for the command to finish before returning. For the .BR start ", " stop " and " restart commands, finishing means that the named job is running (or has finished for tasks) or has been fully stopped. For the .B emit command, finishing means that all of the jobs affected by the event are running (or have finished for tasks) or have been fully stopped. This option instead causes these commands to only wait for the goal change or event to be queued. .\" .TP .B \-\-quiet Reduces output of all commands to errors only. .\" .SH COMMANDS .TP .B start .I JOB .RI [ KEY=VALUE ]... Requests that a new instance of the named .I JOB be started by changing its goal to .BR start "." The status of the job is displayed on standard output when the command completes. See .B status for a description of the output format. The optional .I KEY=VALUE arguments specify environment variables to be passed to the starting job, and placed in its environment. They also serve to specify which instance of multi\-instance jobs should be started. Most jobs only permit a single instance; those that use the .B instance stanza in their configuration define a string expanded from environment variables to name the instance. As many unique instances may be started as unique names may be generated by the stanza. Thus the environment variables also serve to select which instance of .I JOB is to be acted upon. If the job is already running, .B start will return an error. When called from the .IR pre\-stop stanza of a job configuration, .B start may be called without argument to cancel the .B stop. .\" .TP .B stop .I JOB .RI [ KEY=VALUE ]... Requests that an instance of the named .I JOB be stopped by changing its goal to .BR stop "." The status of the job is displayed on standard output when the command completes. See .B status for a description of the output format and .B start for a discussion on instances. When called from the .IR pre\-start stanza of a job configuration, .B stop may be called without an argument to cancel the .B start. By default .B SIGTERM is sent to the job process. If it does not respond within a reasonable period, it will be forcibly stopped by sending .B SIGKILL. This behaviour can be changed using the .B kill signal and .B kill timeout stanzas. See .BR init (5) for further details. .\" .TP .B restart .I JOB .RI [ KEY=VALUE ]... Requests that an instance of the named .I JOB be restarted by first changing its goal to .BR stop ", " and then changing its goal to .BR start "." The status of the job is displayed on standard output when the command completes. This command is .I similar to running .B stop followed by .B start with one exception: the job instance being restarted will retain its original configuration. To have the new instance run with the latest job configuration, .B stop the job and then .B start it again instead. See .B status for a description of the output format and .B start for a discussion on instances. Note that this command can only be used when there is an instance of .IR JOB , if there is none then it returns an error instead of starting a new one. .\" .TP .B reload .I JOB .RI [ KEY=VALUE ]... Sends the .I SIGHUP signal to running process of the named .I JOB instance. See .B start for a discussion on instances. .\" .TP .B status .I JOB .RI [ KEY=VALUE ]... Requests the status an instance of the named .IR JOB , outputting to standard output. See .B start for a discussion on instances. For a single\-instance job a line like the following is output: .nf job start/running, process 1234 .fi The job name is given first followed by the current goal and state of the selected instance. The goal is either .IR start " or " stop , the status may be one of .IR waiting ", " starting ", " pre\-start ", " spawned ", " post\-start ", " .IR running ", " pre\-stop ", " stopping ", " killed " or " post\-stop . Table 1 in the .B Job States section of .BR init (8) summarises job goal and state transitions. If the job has an active process, the process id will follow on the same line. If the state is .IR pre\-start " or " post\-stop this will be the process id of the equivalent process, otherwise it will be the process id of the main process. .nf job start/pre\-start, process 902 .fi The .IR post\-start " and " pre\-stop states may have multiple processes attached, the extra processes will follow on consecutive lines indented by a tab: .nf job start/post\-start, process 1234 post\-start process 1357 .fi If there is no main process, they may follow on the same line but will be prefixed to indicate that it is not the main process id being given: .nf job start/post\-start, (post\-start) process 1357 .fi Jobs that permit multiple instances have names for each instance, the output is otherwise identical to the above except that the instance name follows the job name in parentheses: .nf job (tty1) start/post\-start, process 1234 post\-start process 1357 .fi .\" .TP .B list Requests a list of the known jobs and instances, outputs the status of each to standard output. Note that this command includes in the enumeration as\-yet\-to\-run jobs (in other words configuration files for which no job instances have yet been created) in the output with status "stop/waiting". In effect such entries denote configuration files which represent potential future jobs. See .B status for a description of the output format and .B start for a discussion on instances. No particular order is used for the output, and there is no difference in the output (other than the instance name appearing in parentheses) between single\-instance and multiple\-instance jobs. .\" .TP .B emit .I EVENT .RI [ KEY=VALUE ]... Requests that the named .I EVENT be emitted, potentially causing jobs to be started and stopped depending on their use of the .BR "start on" " and " "stop on" stanzas in their configuration. The optional .I KEY=VALUE arguments specify environment variables to be included with the event and thus exported into the environment of any jobs started and stopped by the event. The environment may also serve to specify which instance of multi\-instance jobs should be started or stopped. See .B start for a discussion on instances. There is no limitation on the event names that may be emitted with this command, you are free to invent new events and use them in your job configurations. The most well\-known event used by the default Upstart configuration is the .BR runlevel (7) event. This is normally emitted by the .BR telinit (8) and .BR shutdown (8) tools. .\" .TP .B reload\-configuration Requests that the .BR init (8) daemon reloads its configuration. This command is generally not necessary since .BR init (8) watches its configuration directories with .BR inotify (7) and automatically reloads in cases of changes. No jobs will be started by this command. \" .TP .B version Requests and outputs the version of the running init daemon. .\" .TP .B log\-priority .RI [ PRIORITY ] When called with a .I PRIORITY argument, it requests that the .BR init (8) daemon log all messages with that priority or greater. This may be used to both increase and decrease the volume of logged messages. .I PRIORITY may be one of .IR debug ", " info ", " message ", " warn ", " error " or " fatal . When called without argument, it requests the current minimum message priority that the .BR init (8) daemon will log and outputs to standard output. .\" .TP .B show\-config .RI [ OPTIONS "] [" CONF "]" Display emits, start on and stop on job configuration details (in that order) for specified job configuration, \fICONF\fP. If \fICONF\fP is not specified, list information for all valid job configurations. Note that a job configuration is the name of a job configuration file, without the extension. Note too that this information is static: it does not refer to any running job. For each event emitted, a separate line is displayed beginning with two space characters followed by, \(aqemits \fIevent\fP\(aq where \(aq\fIevent\fP\(aq denotes a single emitted event. The \fBstart on\fP and \fBstop on\fP conditions are listed on separate lines beginning with two space characters and followed by \(aqstart on\(aq and \(aqstop on\(aq respectively and ending with the appropriate condition. If a job configuration has no emits, start on, or stop on conditions, the name of the job configuration will be displayed with no further details. Note that the \fBstart on\fP and \fBstop on\fP conditions will be fully bracketed, regardless of whether they appear like this in the job configuration file. This is useful to see how the .BR init (8) daemon perceives the condition. Example output: .nf foo emits boing emits blip start on (starting A and (B or C var=2)) stop on (bar HELLO=world testing=123 or stopping wibble) .fi .B OPTIONS .RS .IP "\fB\-e\fP, \fB\-\-enumerate\fP" If specified, rather than listing the precise \fBstart on\fP and \fBstop on\fP conditions, outputs the emits lines along with one line for each event or job the \fICONF\fP in question \fImay\fP be started or stopped by if it were to become a job. If the start on condition specifies a non\-job event, this will be listed verbatim, whereas for a job event, the name of the \fIjob\fP as opposed to the event the job emits will be listed. The type of entity, its triggering event (if appropriate) and its full environment is displayed in brackets following its name for clarity. This option is useful for tools which generate graphs of relationships between jobs and events. It is also instructive since it shows how the .BR init (8) daemon has parsed the job configuration file. Example output (an analog of the default output format above): .nf foo emits boing emits blip start on starting (job: A, env:) start on B (job:, env:) start on C (job:, env: var=2) stop on bar (job:, env: HELLO=world testing=123) stop on stopping (job: wibble, event: stopping, env:) .fi .RE .\" .TP .B check\-config .RI [ OPTIONS "] [" CONF "]" Considers all job configurations looking for jobs that cannot be started or stopped, given the currently available job configurations. This is achieved by considering the start on, stop on and emits stanzas for each job configuration and identifying unreachable scenarios. This option is useful for determining the impact of adding or removing job configuration files. Note that to use this command, it is necessary to ensure that all job configuration files advertise the events they emit correctly. If errors are identified, the name of the job configuration will be displayed. Subsequent lines will show the failed conditions for the job configuration, one per line. Condition lines begin with two spaces and are followed with either "start on: " or "stop on: ", the word "unknown", the type of entity that is not known and finally its name. Note that only job configurations that are logically in error (those with unsatisfiable conditions) will be displayed. Note too that job configurations that are syntactically invalid may trigger an error if they would cause a condition to be in error. Assuming job configuration file \fI/etc/init/foo.conf\fP contains the following: .nf start on starting grape stop on peach .fi The check\-config command might display: .nf foo start on: unknown job grape stop on: unknown event peach .fi If any errors are detected, the exit code will be 1 (one). If all checks pass, the exit code will be 0 (zero). Note that for complex start on and stop on conditions, this command may give what appears to be misleading output when an error condition is found since all expressions in the failing condition that are in error will generate error output. For example, if job configuration \fI/etc/init/bar.conf\fP contains the following: .nf start on (A and (started B or (starting C or D))) .fi And only event A can be satisfied, the output will be: .nf bar start on: unknown job B start on: unknown job C start on: unknown event D .fi .B OPTIONS .RS .IP "\fB-i\fP \fI[EVENTS]\fP, \fB\-\-ignore\-events\fP \fI[EVENTS]\fP" If specified, the argument should be a list of comma\-separated events to ignore when checking the job configuration files. This option may be useful to ignore errors if a particular job configuration file does not advertise it emits an event. Note that internal events (such as \fBstartup\fP(7) and \fBstarting\fP(7)) are automatically ignored. .IP "\fB-w\fP, \fB\-\-warn\fP" If specified, treat \fIany\fP unknown jobs and events as errors. .RE .\" .TP .B notify\-cgroup\-manager\-address .I ADDRESS Specify the D-Bus address on which the cgroup manager can be contacted. This command should only be run when the cgroup manager has started to accept connections. .\" .TP .B notify\-disk\-writeable Notify the .BR init (8) daemon that the disk is now writeable. This currently causes the .BR init (8) daemon to flush its internal cache of \(aqearly job\(aq output data. An early job is any job which .I finishes before the log disk becomes writeable. If job logging is not disabled, this command should be called once the log disk becomes writeable to ensure that output from all early jobs is flushed. If the data is written successfully to disk, the internal cache is deleted. .RE .\" .TP .B notify\-dbus\-address Notify the .BR init (8) daemon of the D\-Bus address it should use to connect to. This command is only permitted when running in .B User Session Mode. See .BR init (5) for further details. .\" .TP .B list\-env .RI [ OPTIONS "] Display a lexicographically sorted list of all variables and their values in a job environment table. When run from within a job, this command will automatically query the job-specific environment table; otherwise the global environment table that is applied to all jobs when they first start is queried. Note that the global job environment table comprises those variables already set in the .BR init (8) daemons environment at startup, the minimal set of standard system variables added by the .BR init (8) daemon, and any variables set using .BR set\-env "." See .BR init (5) for further details. .B OPTIONS .RS .IP "\fB\-g\fP, \fB\-\-global\fP" Operate on the global job environment table. This option is implied when not run from within a job. .RE .\" .TP .B get\-env .RI [ OPTIONS "] " VARIABLE Display the value of the specified variable in a job environment table. When run from within a job, this command will automatically query the job-specific environment table; otherwise the global environment table that is applied to all jobs when they first start is queried. .B OPTIONS .RS .IP "\fB\-g\fP, \fB\-\-global\fP" Operate on the global job environment table. This option is implied when not run from within a job. .RE .\" .TP .B set\-env .RI [ OPTIONS "] " VARIABLE[=VALUE] " ..." Adds or updates one or more variables in a job environment table. Variables set in this way will apply to all the subsequently-starting processes for a job. This command is only permitted when running in .B User Session Mode. See .BR init (5) for further details. .B OPTIONS .RS .IP "\fB\-r\fP, \fB\-\-retain\fP" If any of the specified variables are already set, do not modify them. .RE .RS .IP "\fB\-g\fP, \fB\-\-global\fP" Operate on the global job environment table and all existing running job environment tables. This option is implied when not run from within a job. .sp This is an advanced option whose use is discouraged since it can change the environment of a job as it moves between different process stages (for example between .B pre\-start and the main process). See .BR init (5) for further details. .RE .\" .TP .B unset\-env .RI [ OPTIONS "] " VARIABLE " ..." Remove the specified variables from a job environment table. If any of the variables specified do not already exist in the table, those variables will be ignored. This command is only permitted when running in .B User Session Mode. See .BR init (5) for further details. .B OPTIONS .RS .IP "\fB\-r\fP, \fB\-\-retain\fP" If any of the specified variables are already set, do not unset them. .RE .RS .IP "\fB\-g\fP, \fB\-\-global\fP" Operate on the global job environment table and all existing running jobenvironment tables. This option is implied when not run from within a job. .sp This is an advanced option whose use is discouraged since it can change the environment of a job as it moves between different process stages (for example between .B pre\-start and the main process). See .BR init (5) for further details. .RE .\" .TP .B reset\-env .RI [ OPTIONS ] Discards all changes make to a job environment table, setting it back to its default set of variables and values. This command is only permitted when running in .B User Session Mode. See .BR init (5) for further details. Note that the effect of the Session Init process that manages the User Session Mode restarting is equivalent to this command having been called. .B OPTIONS .RS .IP "\fB\-r\fP, \fB\-\-retain\fP" If the specified variable is already set, do not modify it. .RE .RS .IP "\fB\-g\fP, \fB\-\-global\fP" Operate on the global job environment table. This option is implied when not run from within a job. .sp Note that unlike \fBset\-env\fR and \fBunset\-env\fR, this option does not modify running job environment tables. .RE .\" .TP .B list\-sessions List the pid of the Session Init process followed by the value of .B UPSTART_SESSION in use for that session separted by a space character. Session files relating to non-longer running Session Init processes are considered \(aqstale\(aq and are not listed (although when run using .BR \-\-verbose "," the full path of the stale session file is displayed). .\" .TP .B usage .I JOB .RI [ KEY=VALUE ]... Show usage information for the named .IR JOB "." If the job specified does not define the .BR usage stanza, a blank usage will be displayed. Example output for a job that specifies the .BR usage stanza is shown below. See .BR init (5) for further details of the .B usage stanza: .nf Usage: tty DEV=ttyX - where X is console id .fi .\" .SH AUTHOR Written by Scott James Remnant .RB < scott@netsplit.com > and James Hunt .RB < james.hunt@canonical.com > . .\" .SH REPORTING BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2009\-2013 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR cgmanager (8) .BR init (5) .BR init (8) .BR telinit (8) .BR shutdown (8) upstart-1.13.2/util/man/runlevel.80000664000175000017500000000561512373101356013710 00000000000000.TH runlevel 8 2009-07-09 "Upstart" .\" .SH NAME runlevel \- output previous and current runlevel .\" .SH SYNOPSIS .B runlevel .RI [ OPTION ]... .RI [ UTMP ] .\" .SH DESCRIPTION .B runlevel reads the system .I UTMP file, which defaults to .I /var/run/utmp when no alternate filename is given, to locate the most recent runlevel record. The previous and current runlevel from that record are output separated by a single space. If there is no previous runlevel in the record, the letter .I N will be substituted. If no runlevel record can be found, .B runlevel outputs the word .B unknown and exits with an error. During system boot, the environment variables .B RUNLEVEL and .B PREVLEVEL will be set by the .BR init (8) daemon, these come from the .BR runlevel (7) event generated by .BR telinit (8) or .BR shutdown (8). When these environment variables are set, .B runlevel will output the values from these instead. Thus .B runlevel can be used in .I rc scripts as a replacement for the System-V .BR who(1) .B -r command. .\" .SH OPTIONS .TP .B --quiet Does not output the current and previous runlevel, nor does it output .B unknown in the case of error (but it will exit with an error code). This may be used to test for the presence of a runlevel entry, or to check for errors reading from the file. .\" .SH EXIT STATUS .B runlevel will exit with status .I 0 if a .I UTMP record was found, otherwise it will exit with status .IR 1 . .\" .SH ENVIRONMENT .TP .B RUNLEVEL .B runlevel will read the current runlevel from this environment variable if set in preference to reading from .I /var/run/utmp .\" .TP .B PREVLEVEL .B runlevel will read the previous runlevel from this environment variable if .B RUNLEVEL was given, in preference to reading from .I /var/run/utmp .\" .SH FILES .TP .I /var/run/utmp Where the current and previous runlevels will be read from. .\" .SH NOTES The Upstart .BR init (8) daemon does not keep track of runlevels itself, instead they are implemented entirely by its userspace tools. A change of runlevel is signalled by the .BR runlevel (7) event, generated by either the .BR telinit (8) or .BR shutdown (8) tools. This event includes the new runlevel in the .B RUNLEVEL environment variable, as well as the previous runlevel (obtained from their own environment or from .IR /var/run/utmp ) in the .B PREVLEVEL variable. As well as generating the event, both tools write the new runlevel back to .I /var/run/utmp and append a new entry to .I /var/log/wtmp. .\" .SH AUTHOR Written by Scott James Remnant .RB < scott@netsplit.com > .\" .SH REPORTING BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2009 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR runlevel (7) .BR init (8) .BR telinit (8) .BR shutdown (8) .BR who (1) upstart-1.13.2/util/man/runlevel.70000664000175000017500000001321412373101356013701 00000000000000.TH runlevel 7 2009-07-09 "Upstart" .\" .SH NAME runlevel \- event signalling change of system runlevel .\" .SH SYNOPSIS .B runlevel .BI RUNLEVEL\fR= RUNLEVEL .BI PREVLEVEL\fR= PREVLEVEL .RI [ ENV ]... .\" .SH DESCRIPTION This page describes the .B runlevel Upstart event, and the general implementation of runlevels in the Upstart system. For the runlevel tool, see .BR runlevel (8) .\" .SS The runlevel event The .B runlevel event signals a change of system runlevel. The new system runlevel is given in the .B RUNLEVEL argument, and the previous system runlevel in the .B PREVLEVEL argument (which may be empty). Additional environment may follow these depending on the runlevel, and the tool that emitted the event. The .BR shutdown (8) tool will supply an .B INIT_HALT variable set to either .I HALT or .I POWEROFF when called with .B -H or .B -P respectively. .\" .SS Runlevels .\" Runlevels are a concept from UNIX\*R System V used by the .BR init (8) daemon or other system initialisation system to define modes of system operation. Eight runlevels are permitted, the first seven are numbered .BR 0 - 6 and the eighth is named .B S or .B s (both are permitted). Services and other system components are said to exist in one or more runlevels. When switching from one runlevel to another, the services that should not exist in the new runlevel are stopped and the services that only exist in the new runlevel are started. This is performed by the .B /etc/init.d/rc script executed on a change of runlevel (by jobs run on the .B runlevel event in the Upstart system). This script examines symlinks in the .I /etc/rc?.d directories, symlinks beginning .B K are services to be stopped and symlinks beginning .B S are services to be started. The authoritative documentation for this process can be found in the .I System run levels and init.d scripts section of the .I Debian Policy Manual. This may be currently found at .RB < http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit > Runlevels .BR 0 , .BR 1 " and" .B 6 are reserved. Runlevel .B 0 is used to halt the system and .B 6 to reboot the system. Runlevel .B 1 is used to bring the system back down into single-user mode, after which the runlevel will be .BR S . .\" .SS System V initialisation in Upstart The compatible implementation of runlevels permits Upstart jobs to be run on the .B runlevel event that perform the same functionality as the original System V .BR init (8) daemon. The .I /etc/init/rc.conf job is run on the .B runlevel event, thus receiving the .B RUNLEVEL and .B PREVLEVEL environment variables. Its sole job is to execute the .B /etc/init.d/rc script, passing the new runlevel as an argument. Initial system startup is provided by the .I /etc/init/rc-sysinit.conf job. This is run on the .BR startup (7) event, and is primarily responsible for running the .B /etc/init.d/rc script with the special .B S argument and calling .BR telinit (8) to switch into the default runlevel when done. This also handles the .BR -b , .BR emergency , .B -s and .B single kernel command-line options as well as specifying an alternate runlevel on the kernel command-line. Finally the .I /etc/init/rcS.conf job handles the special case of entering the single-user runlevel and providing a login shell. Once that shell terminates, this restarts the .I rc-sysinit job to re-enter the default runlevel. .\" .SS Implementation of runlevels in Upstart The Upstart .BR init (8) daemon has no native concepts of runlevel, and unlike the System V daemon, makes no attempt to keep track of the current runlevel. Instead a compatible implementation is provided by the .BR runlevel (8), .BR telinit (8) and .BR shutdown (8) tools supplied with Upstart. The .BR telinit (8) and .BR shutdown (8) tools are used by system administrators to change the runlevel, thus they both generate this .B runlevel event obtaining the value for the .B PREVLEVEL environment variable from their own environment (the .B RUNLEVEL variable) or the .I /var/run/utmp file. Additionally they update the .I /var/run/utmp file with the new runlevel, and append a log entry to the .I /var/log/wtmp file. The .BR runlevel (8) tool may be used by system administrators to obtain the current runlevel, this reads the .B RUNLEVEL and .B PREVLEVEL variables from its own environment or reads the current and previous runlevel from .IR /var/run/utmp . The .BR who (1) .B -r command may also be used to read the current runlevel from .IR /var/run/utmp . This provides full compatibility with System V. During the boot scripts, where the .I /var/run/utmp file may not yet be writable, the .B RUNLEVEL and .B PREVLEVEL environment variables will be available so .BR telinit (8) will still provide the correct values. Once the boot scripts have finished, while the environment variables may no longer be available, the .I /var/run/utmp file will be and the most recent .BR telinit (8) invocation should have successfully written to it. .\" .SS Boot time records The .BR telinit (8) tool also takes care of writing the boot time record to both .I /var/run/utmp and .IR /var/log/wtmp . This is written if the previous runlevel in these files does not match the previous runlevel obtained from its environment. In general this occurs when switching from runlevel .B S to the default runlevel, at which point the .I /var/run/utmp and .I /var/log/wtmp files are both writable, and the .BR telinit (8) invocation to do the switch has .BI RUNLEVEL\fR= S in its environment. .\" .SH EXAMPLE A service running in the typical multi-user runlevels might use: .RS .nf start on runlevel [2345] stop on runlevel [!2345] .fi .RE .\" .SH SEE ALSO .BR runlevel (8) .BR init (8) .BR telinit (8) .BR shutdown (8) .BR who (1) upstart-1.13.2/util/man/reboot.80000664000175000017500000000415112373101356013340 00000000000000.TH reboot 8 2009-07-09 "Upstart" .\" .SH NAME reboot, halt, poweroff \- reboot or stop the system .\" .SH SYNOPSIS \fBreboot\fR [\fIOPTION\fR]... .RI [ REBOOTCOMMAND ] \fBhalt\fR [\fIOPTION\fR]... \fBpoweroff\fR [\fIOPTION\fR]... .\" .SH DESCRIPTION These programs allow a system administrator to .BR reboot ", " halt " or " poweroff the system. When called with .I --force or when in runlevel .B 0 or .BR 6 , this tool invokes the .BR reboot (2) system call itself (with REBOOTCOMMAND argument passed) and directly reboots the system. Otherwise this simply invokes the .BR shutdown (8) tool with the appropriate arguments without passing REBOOTCOMMAND argument. Before invoking .BR reboot (2), a shutdown time record is first written to .I /var/log/wtmp .\" .SH OPTIONS .TP .BR -f ", " --force Does not invoke .BR shutdown (8) and instead performs the actual action you would expect from the name. .\" .TP .BR -p ", " --poweroff Instructs the .B halt command to instead behave as .BR poweroff . .\" .TP .BR -w ", " --wtmp-only Does not call .BR shutdown(8) or the .BR reboot(2) system call and instead only writes the shutdown record to .I /var/log/wtmp .\" .TP .B --verbose Outputs slightly more verbose messages when rebooting, useful for debugging problems with shutdown. .\" .SH ENVIRONMENT .TP .B RUNLEVEL .B reboot will read the current runlevel from this environment variable if set in preference to reading from .I /var/run/utmp .\" .SH FILES .TP .I /var/run/utmp Where the current runlevel will be read from; this file will also be updated with the runlevel record being replaced by a shutdown time record. .\" .TP .I /var/log/wtmp A new runlevel record for the shutdown time will be appended to this file. .\" .SH AUTHOR Written by Scott James Remnant .RB < scott@netsplit.com > .\" .SH REPORTING BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2009 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR shutdown (8) .BR telinit (8) .BR runlevel (8) upstart-1.13.2/util/initctl.c0000664000175000017500000023507112373101356013023 00000000000000/* upstart * * Copyright 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" #include "com.ubuntu.Upstart.Job.h" #include "com.ubuntu.Upstart.Instance.h" #include "init/events.h" #include "init/xdg.h" #include "initctl.h" /* Prototypes for local functions */ NihDBusProxy *upstart_open (const void *parent) __attribute__ ((warn_unused_result)); char * job_status (const void *parent, NihDBusProxy *job_class, NihDBusProxy *job) __attribute__ ((warn_unused_result)); char * job_usage (const void *parent, NihDBusProxy *job_class) __attribute__ ((warn_unused_result)); /* Prototypes for static functions */ static void start_reply_handler (char **job_path, NihDBusMessage *message, const char *instance); static void reply_handler (int *ret, NihDBusMessage *message); static void error_handler (void *data, NihDBusMessage *message); static void job_class_condition_handler (void *data, NihDBusMessage *message, char ** const *value); static void job_class_condition_err_handler (void *data, NihDBusMessage *message); static void job_class_parse_events (const ConditionHandlerData *data, char ** const *variant_array); static void job_class_show_emits (const void *parent, NihDBusProxy *job_class_proxy, const char *job_class_name); static void job_class_show_conditions (NihDBusProxy *job_class_proxy, const char *job_class_name); static void eval_expr_tree (const char *expr, NihList **stack); static int check_condition (const char *job_class, const char *condition, NihList *condition_list, int *job_class_displayed) __attribute__ ((warn_unused_result)); static int tree_filter (void *data, NihTree *node); static void display_check_errors (const char *job_class, const char *condition, NihTree *node); static int allow_job (const char *job); static int allow_event (const char *event); static char **get_job_details (void) __attribute__ ((warn_unused_result)); #ifndef TEST static int dbus_bus_type_setter (NihOption *option, const char *arg); static int ignored_events_setter (NihOption *option, const char *arg); #endif /* Prototypes for option and command functions */ int start_action (NihCommand *command, char * const *args); int stop_action (NihCommand *command, char * const *args); int restart_action (NihCommand *command, char * const *args); int reload_action (NihCommand *command, char * const *args); int status_action (NihCommand *command, char * const *args); int list_action (NihCommand *command, char * const *args); int emit_action (NihCommand *command, char * const *args); int reload_configuration_action (NihCommand *command, char * const *args); int version_action (NihCommand *command, char * const *args); int log_priority_action (NihCommand *command, char * const *args); int show_config_action (NihCommand *command, char * const *args); int check_config_action (NihCommand *command, char * const *args); int usage_action (NihCommand *command, char * const *args); int notify_disk_writeable_action (NihCommand *command, char * const *args); int notify_dbus_address_action (NihCommand *command, char * const *args); int notify_cgroup_manager_address_action (NihCommand *command, char * const *args); int get_env_action (NihCommand *command, char * const *args); int set_env_action (NihCommand *command, char * const *args); int list_env_action (NihCommand *command, char * const *args); int unset_env_action (NihCommand *command, char * const *args); int reset_env_action (NihCommand *command, char * const *args); int list_sessions_action (NihCommand *command, char * const *args); /** * use_dbus: * * If 1, connect using a D-Bus bus. * If 0, connect using private connection. * If -1, determine appropriate connection based on UID. */ int use_dbus = -1; /** * dbus_bus_type: * * D-Bus bus to connect to (DBUS_BUS_SYSTEM or DBUS_BUS_SESSION), or -1 * to have an appropriate bus selected. */ int dbus_bus_type = -1; /** * user_mode: * * If TRUE, talk to Upstart over the private socket defined in UPSTART_SESSION * if UPSTART_SESSION isn't defined, then fallback to the session bus. **/ int user_mode = FALSE; /** * dest_name: * * Name on the D-Bus system bus that the message should be sent to when * system is TRUE. **/ char *dest_name = NULL; /** * dest_address: * * Address for private D-Bus connection. **/ const char *dest_address = DBUS_ADDRESS_UPSTART; /** * no_wait: * * Whether to wait for a job or event to be finished before existing or not. **/ int no_wait = FALSE; /** * enumerate_events: * * If TRUE, list out all events/jobs that a particular job *may require* to * be run: essentially any event/job mentioned in a job configuration files * "start on" / "stop on" condition. Used for showing dependencies * between jobs and events. **/ int enumerate_events = FALSE; /** * retain_var: * * If FALSE, the set-env command will replace any existing variable of * the same name in the job environment table. If TRUE, the original * value will be retained. **/ int retain_var = FALSE; /** * check_config_mode: * * If TRUE, parse all job configuration files looking for unreachable * jobs/events. **/ int check_config_mode = FALSE; /** * check_config_warn: * * If TRUE, check-config will generate a warning for *any* unreachable * events/jobs. **/ int check_config_warn = FALSE; /** * check_config_data: * * Used to record details of all known jobs and events. **/ CheckConfigData check_config_data; /** * apply_globally: * * If TRUE, make changes to global job environment table rather than the * running jobs instances environment table. **/ int apply_globally = FALSE; /** * NihOption setter function to handle selection of appropriate D-Bus * bus. * * Always returns 1 denoting success. **/ int dbus_bus_type_setter (NihOption *option, const char *arg) { nih_assert (option); if (! strcmp (option->long_option, "system")) { use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SYSTEM; } else if (! strcmp (option->long_option, "session")) { use_dbus = TRUE; dbus_bus_type = DBUS_BUS_SESSION; } return 1; } /** * NihOption setter function to handle specification of events to * ignore. * * Returns 1 on success, else 0. **/ int ignored_events_setter (NihOption *option, const char *arg) { NihError *err; char **events; char **event; NihListEntry *entry; nih_assert (option); nih_assert (arg); if (! check_config_data.ignored_events_hash) check_config_data.ignored_events_hash = NIH_MUST (nih_hash_string_new (NULL, 0)); events = nih_str_split (NULL, arg, ",", TRUE); if (!events) { goto error; } for (event = events; event && *event; ++event) { entry = NIH_MUST (nih_list_entry_new (check_config_data.ignored_events_hash)); entry->str = NIH_MUST (nih_strdup (entry, *event)); nih_hash_add (check_config_data.ignored_events_hash, &entry->entry); } nih_free (events); return 1; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 0; } /** * upstart_open: * @parent: parent object for new proxy. * * Opens a connection to the init daemon and returns a proxy to the manager * object. If @dest_name is not NULL, a connection is instead opened to * the system bus and the proxy linked to the well-known name given. * * Error messages are output to standard error. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned proxy. When all parents * of the returned proxy are freed, the returned proxy will also be * freed. * * Returns: newly allocated D-Bus proxy or NULL on error. **/ NihDBusProxy * upstart_open (const void *parent) { DBusError dbus_error; DBusConnection *connection; NihDBusProxy * upstart; char * user_addr; user_addr = getenv ("UPSTART_SESSION"); if (user_addr && user_addr[0] && dbus_bus_type < 0) { user_mode = TRUE; } if (! user_mode) { if (use_dbus < 0) use_dbus = getuid () ? TRUE : FALSE; if (use_dbus >= 0 && dbus_bus_type < 0) dbus_bus_type = DBUS_BUS_SYSTEM; } else { if (! user_addr) { nih_error ("UPSTART_SESSION isn't set in the environment. " "Unable to locate the Upstart instance."); return NULL; } dest_address = user_addr; use_dbus = FALSE; } dbus_error_init (&dbus_error); if (use_dbus) { if (! dest_name) dest_name = DBUS_SERVICE_UPSTART; connection = dbus_bus_get (dbus_bus_type, &dbus_error); if (! connection) { nih_error ("%s: %s", dbus_bus_type == DBUS_BUS_SYSTEM ? _("Unable to connect to system bus") : _("Unable to connect to session bus"), dbus_error.message); dbus_error_free (&dbus_error); return NULL; } dbus_connection_set_exit_on_disconnect (connection, FALSE); } else { if (dest_name && ! user_mode) { fprintf (stderr, _("%s: --dest given without --system\n"), program_name); nih_main_suggest_help (); return NULL; } connection = dbus_connection_open (dest_address, &dbus_error); if (! connection) { nih_error ("%s: %s", _("Unable to connect to Upstart"), dbus_error.message); dbus_error_free (&dbus_error); return NULL; } } dbus_error_free (&dbus_error); upstart = nih_dbus_proxy_new (parent, connection, dest_name, DBUS_PATH_UPSTART, NULL, NULL); if (! upstart) { NihError *err; err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); dbus_connection_unref (connection); return NULL; } upstart->auto_start = FALSE; /* Drop initial reference now the proxy holds one */ dbus_connection_unref (connection); return upstart; } /** * job_status: * @parent: parent object for new string, * @job_class: proxy for remote job class object, * @job: proxy for remote instance object. * * Queries the job object @job and contructs a string defining the status * of that instance, containing the name of the @job_class and @job, * the goal, state and any running processes. * * @job may be NULL in which case a non-running job is assumed, the * function also catches the remote object no longer existing. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned string. When all parents * of the returned string are freed, the returned string will also be * freed. * * Returns: newly allocated string or NULL on raised error. **/ char * job_status (const void * parent, NihDBusProxy *job_class, NihDBusProxy *job) { nih_local char * job_class_name = NULL; nih_local JobProperties *props = NULL; char * str = NULL; nih_assert (job_class != NULL); /* Get the job name */ if (job_class_get_name_sync (NULL, job_class, &job_class_name) < 0) return NULL; /* Get the instance properties, catching the instance going away * between the time we got it and this call. */ if (job) { if (job_get_all_sync (NULL, job, &props) < 0) { NihDBusError *dbus_err; dbus_err = (NihDBusError *)nih_error_get (); if ((dbus_err->number != NIH_DBUS_ERROR) || strcmp (dbus_err->name, DBUS_ERROR_UNKNOWN_METHOD)) { return NULL; } else { nih_free (dbus_err); } } } if (props && *props->name) { str = nih_sprintf (parent, "%s (%s)", job_class_name, props->name); if (! str) nih_return_no_memory_error (NULL); } else { str = nih_strdup (parent, job_class_name); if (! str) nih_return_no_memory_error (NULL); } if (props) { if (! nih_strcat_sprintf (&str, parent, " %s/%s", props->goal, props->state)) { nih_error_raise_no_memory (); nih_free (str); return NULL; } /* The first process returned is always the main process, * which is the process we always want to display alongside * the state if there is one. Prefix if it's not one of * the standard processes. */ if (props->processes[0]) { if (strcmp (props->processes[0]->item0, "main") && strcmp (props->processes[0]->item0, "pre-start") && strcmp (props->processes[0]->item0, "post-stop")) { if (! nih_strcat_sprintf (&str, parent, ", (%s) process %d", props->processes[0]->item0, props->processes[0]->item1)) { nih_error_raise_no_memory (); nih_free (str); return NULL; } } else { if (! nih_strcat_sprintf (&str, parent, ", process %d", props->processes[0]->item1)) { nih_error_raise_no_memory (); nih_free (str); return NULL; } } /* Append a line for each additional process */ for (JobProcessesElement **p = &props->processes[1]; p && *p; p++) { if (! nih_strcat_sprintf (&str, parent, "\n\t%s process %d", (*p)->item0, (*p)->item1)) { nih_error_raise_no_memory (); nih_free (str); return NULL; } } } } else { if (! nih_strcat (&str, parent, " stop/waiting")) { nih_error_raise_no_memory (); nih_free (str); return NULL; } } return str; } /** * job_usage: * @parent: parent object, * @job_class_proxy: D-Bus proxy for job class, * @job_class_name: Name of job class. * * Display usage of job class. * * Returns: newly allocated string or NULL on raised error. **/ char * job_usage (const void *parent, NihDBusProxy *job_class_proxy) { char *usage = NULL; nih_assert (job_class_proxy); if (job_class_get_usage_sync (parent, job_class_proxy, &usage) < 0) { return NULL; } return usage; } /** * start_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "start" command. * * Returns: command exit status. **/ int start_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; const char * upstart_job = NULL; const char * upstart_instance = NULL; nih_local char * job_class_path = NULL; nih_local NihDBusProxy *job_class = NULL; nih_local char * job_path = NULL; nih_local NihDBusProxy *job = NULL; DBusPendingCall * pending_call; int ret = 1; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); if (args[0]) { upstart_job = args[0]; } else { upstart_job = getenv ("UPSTART_JOB"); upstart_instance = getenv ("UPSTART_INSTANCE"); if (! (upstart_job && upstart_instance)) { fprintf (stderr, _("%s: missing job name\n"), program_name); nih_main_suggest_help (); return 1; } } upstart = upstart_open (NULL); if (! upstart) return 1; /* Obtain a proxy to the job */ if (upstart_get_job_by_name_sync (NULL, upstart, upstart_job, &job_class_path) < 0) goto error; job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_class_path, NULL, NULL); if (! job_class) goto error; job_class->auto_start = FALSE; /* When called from a job handler, we directly change the goal * so we need the instance. These calls are always made without * waiting, since otherwise we'd block the job we're called from. */ if (upstart_instance) { if (job_class_get_instance_by_name_sync (NULL, job_class, upstart_instance, &job_path) < 0) goto error; job = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_path, NULL, NULL); if (! job) goto error; job->auto_start = FALSE; pending_call = job_start (job, FALSE, (JobStartReply)reply_handler, error_handler, &ret, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) goto error; } else { /* job_path is nih_local, so whatever gets filled in will * be automatically freed. */ pending_call = job_class_start (job_class, &args[1], (! no_wait), (JobClassStartReply)start_reply_handler, error_handler, &job_path, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) goto error; } dbus_pending_call_block (pending_call); dbus_pending_call_unref (pending_call); /* Make sure we got a valid job path, and in the case of the instance * path, no error message. Then display the current job status. */ if (job_path && ((job == NULL) || (ret == 0))) { nih_local char *status = NULL; if (! job) { job = NIH_SHOULD (nih_dbus_proxy_new ( NULL, upstart->connection, upstart->name, job_path, NULL, NULL)); if (! job) goto error; job->auto_start = FALSE; } status = NIH_SHOULD (job_status (NULL, job_class, job)); if (! status) goto error; nih_message ("%s", status); ret = 0; } else { ret = 1; } return ret; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * stop_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "stop" command. * * Returns: command exit status. **/ int stop_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; const char * upstart_job = NULL; const char * upstart_instance = NULL; nih_local char * job_class_path = NULL; nih_local NihDBusProxy *job_class = NULL; nih_local char * job_path = NULL; nih_local NihDBusProxy *job = NULL; DBusPendingCall * pending_call; int ret = 1; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); if (args[0]) { upstart_job = args[0]; } else { upstart_job = getenv ("UPSTART_JOB"); upstart_instance = getenv ("UPSTART_INSTANCE"); if (! (upstart_job && upstart_instance)) { fprintf (stderr, _("%s: missing job name\n"), program_name); nih_main_suggest_help (); return 1; } } upstart = upstart_open (NULL); if (! upstart) return 1; /* Obtain a proxy to the job */ if (upstart_get_job_by_name_sync (NULL, upstart, upstart_job, &job_class_path) < 0) goto error; job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_class_path, NULL, NULL); if (! job_class) goto error; job_class->auto_start = FALSE; /* When called from a job handler, we directly change the goal * so need the instance. These calls are always made without * waiting, since otherwise we'd block the job we're called from. */ if (upstart_instance) { if (job_class_get_instance_by_name_sync (NULL, job_class, upstart_instance, &job_path) < 0) goto error; job = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_path, NULL, NULL); if (! job) goto error; job->auto_start = FALSE; pending_call = job_stop (job, FALSE, (JobStopReply)reply_handler, error_handler, &ret, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) goto error; } else { /* Lookup the instance that we'll end up stopping */ if (job_class_get_instance_sync (NULL, job_class, &args[1], &job_path) < 0) goto error; job = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_path, NULL, NULL); if (! job) goto error; job->auto_start = FALSE; pending_call = job_class_stop (job_class, &args[1], (! no_wait), (JobClassStopReply)reply_handler, error_handler, &ret, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) goto error; } dbus_pending_call_block (pending_call); dbus_pending_call_unref (pending_call); /* Display the current job status */ if (ret == 0) { nih_local char *status = NULL; status = NIH_SHOULD (job_status (NULL, job_class, job)); if (! status) goto error; nih_message ("%s", status); } return ret; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * restart_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "restart" command. * * Returns: command exit status. **/ int restart_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; const char * upstart_job = NULL; const char * upstart_instance = NULL; nih_local char * job_class_path = NULL; nih_local NihDBusProxy *job_class = NULL; nih_local char * job_path = NULL; nih_local NihDBusProxy *job = NULL; DBusPendingCall * pending_call; int ret = 1; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); if (args[0]) { upstart_job = args[0]; } else { upstart_job = getenv ("UPSTART_JOB"); upstart_instance = getenv ("UPSTART_INSTANCE"); if (! (upstart_job && upstart_instance)) { fprintf (stderr, _("%s: missing job name\n"), program_name); nih_main_suggest_help (); return 1; } } upstart = upstart_open (NULL); if (! upstart) return 1; /* Obtain a proxy to the job */ if (upstart_get_job_by_name_sync (NULL, upstart, upstart_job, &job_class_path) < 0) goto error; job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_class_path, NULL, NULL); if (! job_class) goto error; job_class->auto_start = FALSE; /* When called from a job handler, we directly toggle the goal * so we need the instance. These calls are always made without * waiting, since otherwise we'd block the job we're called from. */ if (upstart_instance) { if (job_class_get_instance_by_name_sync (NULL, job_class, upstart_instance, &job_path) < 0) goto error; job = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_path, NULL, NULL); if (! job) goto error; job->auto_start = FALSE; pending_call = job_restart (job, FALSE, (JobRestartReply)reply_handler, error_handler, &ret, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) goto error; } else { /* job_path is nih_local, so whatever gets filled in will * be automatically freed. */ pending_call = job_class_restart (job_class, &args[1], (! no_wait), (JobClassRestartReply)start_reply_handler, error_handler, &job_path, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) goto error; } dbus_pending_call_block (pending_call); dbus_pending_call_unref (pending_call); /* Make sure we got a valid job path, and in the case of the instance * path, no error message. Then display the current job status. */ if (job_path && ((job == NULL) || (ret == 0))) { nih_local char *status = NULL; if (! job) { job = NIH_SHOULD (nih_dbus_proxy_new ( NULL, upstart->connection, upstart->name, job_path, NULL, NULL)); if (! job) goto error; job->auto_start = FALSE; } status = NIH_SHOULD (job_status (NULL, job_class, job)); if (! status) goto error; nih_message ("%s", status); ret = 0; } else { ret = 1; } return ret; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * reload_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "reload" command. * * Returns: command exit status. **/ int reload_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; const char * upstart_job = NULL; const char * upstart_instance = NULL; nih_local char * job_class_path = NULL; nih_local NihDBusProxy *job_class = NULL; nih_local char * job_path = NULL; nih_local NihDBusProxy *job = NULL; nih_local JobProcessesElement **processes = NULL; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); if (args[0]) { upstart_job = args[0]; } else { upstart_job = getenv ("UPSTART_JOB"); upstart_instance = getenv ("UPSTART_INSTANCE"); if (! (upstart_job && upstart_instance)) { fprintf (stderr, _("%s: missing job name\n"), program_name); nih_main_suggest_help (); return 1; } } upstart = upstart_open (NULL); if (! upstart) return 1; /* Obtain a proxy to the job */ if (upstart_get_job_by_name_sync (NULL, upstart, upstart_job, &job_class_path) < 0) goto error; job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_class_path, NULL, NULL); if (! job_class) goto error; job_class->auto_start = FALSE; /* Obtain a proxy to the specific instance. Catch the case where * we were just given a job name, and there was no single instance * running. */ if (upstart_instance) { if (job_class_get_instance_by_name_sync (NULL, job_class, upstart_instance, &job_path) < 0) goto error; } else { if (job_class_get_instance_sync (NULL, job_class, &args[1], &job_path) < 0) goto error; } job = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_path, NULL, NULL); if (! job) goto error; job->auto_start = FALSE; if (job_reload_sync (NULL, job) < 0) { /* well reload_sync call should always work... unless we * didn't reboot since upgrade and pid1 is still old * upstart that does not have reload_sync call, fallback * to sending SIGHUP to main process */ err = nih_error_get (); if (strcmp(((NihDBusError *)err)->name, DBUS_ERROR_UNKNOWN_METHOD)) { nih_error ("%s", err->message); nih_free (err); return 1; } nih_free (err); if (job_get_processes_sync (NULL, job, &processes) < 0) goto error; if ((! processes[0]) || strcmp (processes[0]->item0, "main")) { nih_error (_("Not running")); return 1; } if (kill (processes[0]->item1, SIGHUP) < 0) { nih_error_raise_system (); goto error; } } return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * status_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "status" command. * * Returns: command exit status. **/ int status_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; const char * upstart_job = NULL; const char * upstart_instance = NULL; nih_local char * job_class_path = NULL; nih_local NihDBusProxy *job_class = NULL; nih_local char * job_path = NULL; nih_local NihDBusProxy *job = NULL; nih_local char * status = NULL; NihError * err; NihDBusError * dbus_err; nih_assert (command != NULL); nih_assert (args != NULL); if (args[0]) { upstart_job = args[0]; } else { upstart_job = getenv ("UPSTART_JOB"); upstart_instance = getenv ("UPSTART_INSTANCE"); if (! (upstart_job && upstart_instance)) { fprintf (stderr, _("%s: missing job name\n"), program_name); nih_main_suggest_help (); return 1; } } upstart = upstart_open (NULL); if (! upstart) return 1; /* Obtain a proxy to the job */ if (upstart_get_job_by_name_sync (NULL, upstart, upstart_job, &job_class_path) < 0) goto error; job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_class_path, NULL, NULL); if (! job_class) goto error; job_class->auto_start = FALSE; /* Obtain a proxy to the specific instance. Catch the case where * we were just given a job name, and there was no single instance * running. */ if (upstart_instance) { if (job_class_get_instance_by_name_sync (NULL, job_class, upstart_instance, &job_path) < 0) goto error; } else { if (job_class_get_instance_sync (NULL, job_class, &args[1], &job_path) < 0) { dbus_err = (NihDBusError *)nih_error_get (); if (args[1] || (dbus_err->number != NIH_DBUS_ERROR) || strcmp (dbus_err->name, DBUS_INTERFACE_UPSTART ".Error.UnknownInstance")) goto error; nih_free (dbus_err); } } if (job_path) { job = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_path, NULL, NULL); if (! job) goto error; job->auto_start = FALSE; } else { job = NULL; } status = job_status (NULL, job_class, job); if (! status) goto error; nih_message ("%s", status); return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * list_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "list" command. * * Returns: command exit status. **/ int list_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; nih_local char ** job_class_paths = NULL; NihError * err; NihDBusError * dbus_err; nih_assert (command != NULL); nih_assert (args != NULL); upstart = upstart_open (NULL); if (! upstart) return 1; /* Obtain a list of jobs */ if (upstart_get_all_jobs_sync (NULL, upstart, &job_class_paths) < 0) goto error; for (char **job_class_path = job_class_paths; job_class_path && *job_class_path; job_class_path++) { nih_local NihDBusProxy *job_class = NULL; nih_local char ** job_paths = NULL; job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, *job_class_path, NULL, NULL); if (! job_class) goto error; job_class->auto_start = FALSE; /* Obtain a list of instances, catch an error from the * command and assume the job just went away. */ if (job_class_get_all_instances_sync (NULL, job_class, &job_paths) < 0) { dbus_err = (NihDBusError *)nih_error_get (); if ((dbus_err->number != NIH_DBUS_ERROR) || strcmp (dbus_err->name, DBUS_ERROR_UNKNOWN_METHOD)) goto error; nih_free (dbus_err); continue; } /* Handle no running instances by assuming that the * job is just stopped, again catch an error and assume * the job went away. */ if (! *job_paths) { nih_local char *status = NULL; status = job_status (NULL, job_class, NULL); if (! status) { dbus_err = (NihDBusError *)nih_error_get (); if ((dbus_err->number != NIH_DBUS_ERROR) || strcmp (dbus_err->name, DBUS_ERROR_UNKNOWN_METHOD)) goto error; nih_free (dbus_err); continue; } nih_message ("%s", status); } /* Otherwise iterate the instances and output the status * of each. */ for (char **job_path = job_paths; job_path && *job_path; job_path++) { nih_local NihDBusProxy *job = NULL; nih_local char * status = NULL; job = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, *job_path, NULL, NULL); if (! job) goto error; job->auto_start = FALSE; status = job_status (NULL, job_class, job); if (! status) { dbus_err = (NihDBusError *)nih_error_get (); if ((dbus_err->number != NIH_DBUS_ERROR) || strcmp (dbus_err->name, DBUS_ERROR_UNKNOWN_METHOD)) goto error; nih_free (dbus_err); continue; } nih_message ("%s", status); } } return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * show_config_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "show-config" command. * * Returns: command exit status. **/ int show_config_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; nih_local char **job_class_paths = NULL; const char *upstart_job_class = NULL; NihError *err; nih_assert (command != NULL); nih_assert (args != NULL); upstart = upstart_open (NULL); if (! upstart) return 1; if (args[0]) { /* Single job specified */ upstart_job_class = args[0]; job_class_paths = NIH_MUST (nih_alloc (NULL, 2*sizeof (char *))); job_class_paths[1] = NULL; if (upstart_get_job_by_name_sync (NULL, upstart, upstart_job_class, job_class_paths) < 0) goto error; } else { /* Obtain a list of jobs */ if (upstart_get_all_jobs_sync (NULL, upstart, &job_class_paths) < 0) goto error; } for (char **job_class_path = job_class_paths; job_class_path && *job_class_path; job_class_path++) { nih_local NihDBusProxy *job_class = NULL; nih_local char *job_class_name = NULL; job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, *job_class_path, NULL, NULL); if (! job_class) goto error; job_class->auto_start = FALSE; if (job_class_get_name_sync (NULL, job_class, &job_class_name) < 0) goto error; if (! check_config_mode) nih_message ("%s", job_class_name); job_class_show_emits (NULL, job_class, job_class_name); job_class_show_conditions (job_class, job_class_name); /* Add any jobs *without* "start on"/"stop on" conditions * to ensure we have a complete list of jobs for check-config to work with. */ if (check_config_mode) { JobCondition *entry; entry = (JobCondition *)nih_hash_lookup (check_config_data.job_class_hash, job_class_name); if (!entry) { MAKE_JOB_CONDITION (check_config_data.job_class_hash, entry, job_class_name); nih_hash_add (check_config_data.job_class_hash, &entry->list); } } } return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * get_env_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "get-env" command. * * Returns: command exit status. **/ int get_env_action (NihCommand *command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; nih_local char *envvar = NULL; nih_local char **job_details = NULL; NihError *err; char *name; nih_assert (command != NULL); nih_assert (args != NULL); name = args[0]; if (! name) { fprintf (stderr, _("%s: missing variable name\n"), program_name); nih_main_suggest_help (); return 1; } job_details = get_job_details (); if (! job_details) return 1; upstart = upstart_open (NULL); if (! upstart) return 1; if (upstart_get_env_sync (NULL, upstart, job_details, name, &envvar) < 0) goto error; nih_message ("%s", envvar); return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * set_env_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "set-env" command. * * Returns: command exit status. **/ int set_env_action (NihCommand *command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; NihError *err; nih_local char **job_details = NULL; int ret; nih_assert (command != NULL); nih_assert (args != NULL); if (! args[0]) { fprintf (stderr, _("%s: missing variable value\n"), program_name); nih_main_suggest_help (); return 1; } job_details = get_job_details (); if (! job_details) return 1; upstart = upstart_open (NULL); if (! upstart) return 1; ret = upstart_set_env_list_sync (NULL, upstart, job_details, args, ! retain_var); if (ret < 0) goto error; return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * unset_env_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "unset-env" command. * * Returns: command exit status. **/ int unset_env_action (NihCommand *command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; NihError *err; nih_local char **job_details = NULL; nih_assert (command != NULL); nih_assert (args != NULL); if (! args[0]) { fprintf (stderr, _("%s: missing variable name\n"), program_name); nih_main_suggest_help (); return 1; } job_details = get_job_details (); if (! job_details) return 1; upstart = upstart_open (NULL); if (! upstart) return 1; if (upstart_unset_env_list_sync (NULL, upstart, job_details, args) < 0) goto error; return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * reset_env_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "reset-env" command. * * Returns: command exit status. **/ int reset_env_action (NihCommand *command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; NihError *err; nih_local char **job_details = NULL; nih_assert (command != NULL); nih_assert (args != NULL); job_details = get_job_details (); if (! job_details) return 1; upstart = upstart_open (NULL); if (! upstart) return 1; if (upstart_reset_env_sync (NULL, upstart, job_details) < 0) goto error; return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * list_env_qsort_compar: * * @a: first string to compare, * @b: second string to compare. * * qsort() function to sort environment variables for list_env_action(). **/ static int list_env_qsort_compar (const void *a, const void *b) { return strcoll (*(char * const *)a, *(char * const *)b); } /** * list_env_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "list-env" command. * * Output is in lexicographically sorted order. * * Returns: command exit status. **/ int list_env_action (NihCommand *command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; nih_local char **env = NULL; char **e; NihError *err; size_t len; nih_local char **job_details = NULL; nih_assert (command != NULL); nih_assert (args != NULL); job_details = get_job_details (); if (! job_details) return 1; upstart = upstart_open (NULL); if (! upstart) return 1; if (upstart_list_env_sync (NULL, upstart, job_details, &env) < 0) goto error; /* Determine array size */ for (len = 0; env[len]; len++) ; qsort (env, len, sizeof (env[0]), list_env_qsort_compar); for (e = env; e && *e; e++) nih_message ("%s", *e); return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * usage_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "usage" command. * * Returns: command exit usage. **/ int usage_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; const char * upstart_job = NULL; const char * upstart_instance = NULL; nih_local char * job_class_name = NULL; nih_local char * job_class_path = NULL; nih_local NihDBusProxy *job_class = NULL; nih_local char * job_path = NULL; nih_local NihDBusProxy *job = NULL; nih_local char * usage = NULL; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); if (args[0]) { upstart_job = args[0]; } else { upstart_job = getenv ("UPSTART_JOB"); upstart_instance = getenv ("UPSTART_INSTANCE"); if (! (upstart_job && upstart_instance)) { fprintf (stderr, _("%s: missing job name\n"), program_name); nih_main_suggest_help (); return 1; } } upstart = upstart_open (NULL); if (! upstart) return 1; /* Obtain a proxy to the job */ if (upstart_get_job_by_name_sync (NULL, upstart, upstart_job, &job_class_path) < 0) goto error; job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_class_path, NULL, NULL); if (! job_class) goto error; job_class->auto_start = FALSE; if (job_class_get_name_sync (NULL, job_class, &job_class_name) < 0) goto error; usage = job_usage (NULL, job_class); if (! usage) goto error; nih_message ("%s: %s", _("Usage"), usage); return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * emit_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "emit" command. * * Returns: command exit status. **/ int emit_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; DBusPendingCall * pending_call; int ret = 1; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); if (! args[0]) { fprintf (stderr, _("%s: missing event name\n"), program_name); nih_main_suggest_help (); return 1; } upstart = upstart_open (NULL); if (! upstart) return 1; pending_call = upstart_emit_event (upstart, args[0], &args[1], (! no_wait), (UpstartEmitEventReply)reply_handler, error_handler, &ret, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) goto error; dbus_pending_call_block (pending_call); dbus_pending_call_unref (pending_call); return ret; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * reload_configuration_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "reload-configuration" command. * * Returns: command exit status. **/ int reload_configuration_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); upstart = upstart_open (NULL); if (! upstart) return 1; if (upstart_reload_configuration_sync (NULL, upstart) < 0) goto error; return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * version_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "version" command. * * Returns: command exit status. **/ int version_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; nih_local char * version = NULL; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); upstart = upstart_open (NULL); if (! upstart) return 1; if (upstart_get_version_sync (NULL, upstart, &version) < 0) goto error; nih_message ("%s", version); return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * log_priority_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "log-priority" command. * * Returns: command exit status. **/ int log_priority_action (NihCommand * command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); upstart = upstart_open (NULL); if (! upstart) return 1; if (args[0]) { if (upstart_set_log_priority_sync (NULL, upstart, args[0]) < 0) goto error; } else { nih_local char *log_priority = NULL; if (upstart_get_log_priority_sync (NULL, upstart, &log_priority) < 0) goto error; nih_message ("%s", log_priority); } return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * check_config_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "check-config" command. * * Returns: command exit status. **/ int check_config_action (NihCommand *command, char * const *args) { int ret; char *no_args[1] = { NULL }; char *job_class = NULL; check_config_data.job_class_hash = NIH_MUST (nih_hash_string_new (NULL, 0)); check_config_data.event_hash = NIH_MUST (nih_hash_string_new (NULL, 0)); if (! check_config_data.ignored_events_hash) check_config_data.ignored_events_hash = NIH_MUST (nih_hash_string_new (NULL, 0)); /* Tell other functions we are running in a special mode */ check_config_mode = TRUE; /* Obtain emits, start on and stop on data. * * Note: we pass null args since we always want details of all jobs. */ ret = show_config_action (command, no_args); if (ret) return 0; if (args[0]) { NihList *entry; job_class = args[0]; entry = nih_hash_lookup (check_config_data.job_class_hash, job_class); if (! entry) { nih_error ("%s: %s", _("Invalid job class"), job_class); return 1; } } NIH_HASH_FOREACH (check_config_data.job_class_hash, iter) { JobCondition *j = (JobCondition *)iter; int job_class_displayed = FALSE; if (job_class && strcmp (job_class, j->job_class) != 0) { /* user specified a job on the command-line, * so only show that one. */ continue; } ret += check_condition (j->job_class, "start on", j->start_on, &job_class_displayed); ret += check_condition (j->job_class, "stop on" , j->stop_on, &job_class_displayed); } nih_free (check_config_data.job_class_hash); nih_free (check_config_data.event_hash); if (check_config_data.ignored_events_hash) nih_free (check_config_data.ignored_events_hash); return ret ? 1 : 0; } /** * notify_disk_writeable_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "notify-disk-writeable" command. * * Returns: command exit status. **/ int notify_disk_writeable_action (NihCommand *command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; NihError * err; nih_assert (command != NULL); nih_assert (args != NULL); upstart = upstart_open (NULL); if (! upstart) return 1; if (upstart_notify_disk_writeable_sync (NULL, upstart) < 0) goto error; return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * notify_dbus_address_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "notify-dbus-address" command. * * Returns: command exit status. **/ int notify_dbus_address_action (NihCommand *command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; NihError *err; char *address = NULL; nih_assert (command != NULL); nih_assert (args != NULL); if (! args[0]) { fprintf (stderr, _("%s: missing D-Bus address\n"), program_name); nih_main_suggest_help (); return 1; } address = args[0]; upstart = upstart_open (NULL); if (! upstart) return 1; if (upstart_notify_dbus_address_sync (NULL, upstart, address) < 0) goto error; return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * notify_cgroup_manager_address_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "notify-cgroup-manager-address" command. * * Returns: command exit status. **/ int notify_cgroup_manager_address_action (NihCommand *command, char * const *args) { nih_local NihDBusProxy *upstart = NULL; NihError *err; char *address = NULL; nih_assert (command != NULL); nih_assert (args != NULL); if (! args[0]) { fprintf (stderr, _("%s: missing address\n"), program_name); nih_main_suggest_help (); return 1; } address = args[0]; upstart = upstart_open (NULL); if (! upstart) return 1; if (upstart_notify_cgroup_manager_address_sync (NULL, upstart, address) < 0) goto error; return 0; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); return 1; } /** * list_sessions_action: * @command: NihCommand invoked, * @args: command-line arguments. * * This function is called for the "list-sessions" command. * * Unlike other commands, this does not attempt to connect to Upstart. * * Returns: command exit status. **/ int list_sessions_action (NihCommand *command, char * const *args) { nih_local const char *session_dir = NULL; DIR *dir; struct dirent *ent; nih_assert (command); nih_assert (args); session_dir = get_session_dir (); if (! session_dir) { nih_error (_("Unable to query session directory")); return 1; } dir = opendir (session_dir); if (! dir) goto error; while ((ent = readdir (dir))) { nih_local char *contents = NULL; size_t len; nih_local char *path = NULL; pid_t pid; nih_local char *name = NULL; char *session; char *p; char *ext; char *file; int all_digits = TRUE; file = ent->d_name; if (! strcmp (file, ".") || ! strcmp (file, "..")) continue; ext = p = strchr (file, '.'); /* No extension */ if (! ext) continue; /* Invalid extension */ if (strcmp (ext, ".session")) continue; NIH_MUST (nih_strncat (&name, NULL, file, (p - file))); for (p = name; p && *p; p++) { if (! isdigit (*p)) { all_digits = FALSE; break; } } /* Invalid name */ if (! all_digits) continue; pid = (pid_t) atol (name); NIH_MUST (nih_strcat_sprintf (&path, NULL, "%s/%s", session_dir, file)); if (kill (pid, 0)) { nih_info ("%s: %s", _("Ignoring stale session file"), path); continue; } contents = nih_file_read (NULL, path, &len); if (! contents) continue; if (contents[len-1] == '\n') contents[len-1] = '\0'; p = strstr (contents, "UPSTART_SESSION" "="); if (p != contents) continue; session = p + strlen ("UPSTART_SESSION") + 1; if (! session || ! *session) continue; nih_message ("%d %s", (int)pid, session); } closedir (dir); return 0; error: nih_error ("unable to determine sessions"); return 1; } static void start_reply_handler (char ** job_path, NihDBusMessage *message, const char * instance) { nih_assert (message != NULL); nih_assert (instance != NULL); /* Return the job path */ *job_path = NIH_MUST (nih_strdup (NULL, instance)); } static void reply_handler (int * ret, NihDBusMessage *message) { nih_assert (message != NULL); *ret = 0; } static void error_handler (void * data, NihDBusMessage *message) { NihError *err; nih_assert (message != NULL); err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); } /** * job_class_parse_events: * @condition_data: type of condition we are parsing (used as an indicator to * user) and name of job, * @variant_array: pointer to array of variants. * * The array of variants encodes the event operator tree in * Reverse Polish Notation (RPN). * * Each variant is itself an array. There are two types: * * - An "Operator" (array length == 1). * * Operators are: "/AND" and "/OR". * * - An "Event" (array length >= 1). * * Each Event comprises a name (array element zero), followed by zero or * more "Event Matches". If the first Event Match is of the form "JOB=name", * or is a single token "name" (crucially not containining "="), then * 'name' refers to the job which emitted the event. **/ void job_class_parse_events (const ConditionHandlerData *data, char ** const *variant_array) { char ** const *variant; char **arg; char *token; nih_local NihList *rpn_stack = NULL; char *name = NULL; const char *stanza_name; const char *job_class_name; nih_assert (data); stanza_name = ((ConditionHandlerData *)data)->condition_name; job_class_name = ((ConditionHandlerData *)data)->job_class_name; if (! variant_array || ! *variant_array || ! **variant_array) return; STACK_CREATE (rpn_stack); STACK_SHOW (rpn_stack); for (variant = variant_array; variant && *variant && **variant; variant++, name = NULL) { /* token is either the first token beyond the stanza name (ie the event name), * or an operator. */ token = **variant; if (IS_OPERATOR (token)) { /* Used to hold result of combining top two stack elements. */ nih_local char *new_token = NULL; nih_local NihList *first = NULL; nih_local NihList *second = NULL; if (enumerate_events) { /* We only care about operands in this mode. */ continue; } if (check_config_mode) { /* Save token verbatim. */ new_token = NIH_MUST (nih_strdup (NULL, token)); STACK_PUSH_NEW_ELEM (rpn_stack, new_token); continue; } first = NIH_MUST (nih_list_new (NULL)); second = NIH_MUST (nih_list_new (NULL)); /* Found an operator, so pop 2 values off stack, * combine them and push back onto stack. */ STACK_POP (rpn_stack, first); STACK_POP (rpn_stack, second); new_token = NIH_MUST (nih_strdup (NULL, "")); new_token = NIH_MUST (nih_strcat_sprintf (&new_token, NULL, "(%s %s %s)", ((NihListEntry *)second)->str, IS_OP_AND (token) ? "and" : "or", ((NihListEntry *)first)->str)); STACK_PUSH_NEW_ELEM (rpn_stack, new_token); } else { /* Save operand token (event or job), add * arguments (job names and env vars) and push * onto stack. If we are enumerating_events, * this records the environment only. */ nih_local char *element = NULL; int i; element = NIH_MUST (nih_strdup (NULL, enumerate_events ? "" : token)); /* Handle arguments (job names and env vars). */ arg = (*variant)+1; for (i=0; arg[i] && *arg[i]; i++) { if ((enumerate_events || check_config_mode) && IS_JOB_EVENT (token)) { if (!name) { GET_JOB_NAME (name, i, arg[i]); if (name) continue; } } if (! check_config_mode) { element = NIH_MUST (nih_strcat (&element, NULL, " ")); element = NIH_MUST (nih_strcat (&element, NULL, arg[i])); } } if (enumerate_events) { nih_message (" %s %s (job:%s%s, env:%s)", stanza_name, token, name ? " " : "", name ? name : "", element); } else { if (check_config_mode) { element = NIH_MUST (nih_sprintf (NULL, "%s%s%s", token, name ? " " : "", name ? name : "")); } STACK_PUSH_NEW_ELEM (rpn_stack, element); } } } if (enumerate_events) return; if (check_config_mode) { int add = 0; JobCondition *entry; /* Create job class entry if necessary */ entry = (JobCondition *)nih_hash_lookup (check_config_data.job_class_hash, job_class_name); if (!entry) { add = 1; MAKE_JOB_CONDITION (check_config_data.job_class_hash, entry, job_class_name); } /* Unstitch the conditions from the stack and stash them * in the appropriate list for the job in question. */ NIH_LIST_FOREACH_SAFE (rpn_stack, iter) { NihListEntry *node = (NihListEntry *)iter; NihList *l = !strcmp (stanza_name, "start on") ? entry->start_on : entry->stop_on; nih_ref (node, l); nih_unref (node, rpn_stack); nih_list_add_after (l, &node->entry); } if (add) nih_hash_add (check_config_data.job_class_hash, &entry->list); return; } /* Handle case where a single event was specified (there * was no operator to pop the entry off the stack). */ if (! STACK_EMPTY (rpn_stack)) { if (! enumerate_events) { /* Our job is done: show the user what we found. */ nih_message (" %s %s", stanza_name, STACK_PEEK (rpn_stack)); } } } /** * job_class_show_conditions: * @job_class_proxy: D-Bus proxy for job class. * @job_class_name: Name of config whose conditions we wish to display. * * Register D-Bus call-backs to display job classes start on and stop on * conditions. **/ void job_class_show_conditions (NihDBusProxy *job_class_proxy, const char *job_class_name) { DBusPendingCall *pending_call; NihError *err; ConditionHandlerData start_data, stop_data; nih_assert (job_class_proxy); nih_assert (job_class_name); start_data.condition_name = "start on"; start_data.job_class_name = job_class_name; stop_data.condition_name = "stop on"; stop_data.job_class_name = job_class_name; pending_call = job_class_get_start_on (job_class_proxy, job_class_condition_handler, job_class_condition_err_handler, &start_data, NIH_DBUS_TIMEOUT_NEVER); if (!pending_call) goto error; /* wait for completion */ dbus_pending_call_block (pending_call); dbus_pending_call_unref (pending_call); pending_call = job_class_get_stop_on (job_class_proxy, job_class_condition_handler, job_class_condition_err_handler, &stop_data, NIH_DBUS_TIMEOUT_NEVER); if (!pending_call) goto error; /* wait for completion */ dbus_pending_call_block (pending_call); dbus_pending_call_unref (pending_call); return; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); } /** * job_class_show_emits: * @parent: parent object, * @job_class_proxy: D-Bus proxy for job class, * @job_class_name: Name of job class that emits an event. * * Display events job class emits to user. **/ void job_class_show_emits (const void *parent, NihDBusProxy *job_class_proxy, const char *job_class_name) { NihError *err; nih_local char **job_emits = NULL; nih_assert (job_class_proxy); if (job_class_get_emits_sync (parent, job_class_proxy, &job_emits) < 0) { goto error; } if (job_emits && *job_emits) { char **p = job_emits; while (*p) { if (check_config_mode) { /* Record event for later */ NihListEntry *node = NIH_MUST (nih_list_entry_new (check_config_data.event_hash)); node->str = NIH_MUST (nih_strdup (node, *p)); nih_hash_add_unique (check_config_data.event_hash, &node->entry); } else { nih_message (" emits %s", *p); } p++; } } return; error: err = nih_error_get (); nih_error ("%s", err->message); nih_free (err); } /** * job_class_condition_handler: * @data: data passed via job_class_get_start_on() or job_class_get_stop_on(), * @message: D-Bus message received, * @value: array of variants generated by D-Bus call we are registering * with. * * Handler for D-Bus message encoding a job classes "start on" or * "stop on" condtions. **/ void job_class_condition_handler (void *data, NihDBusMessage *message, char ** const *value) { job_class_parse_events ((const ConditionHandlerData *)data, value); } /** * job_class_condition_err_handler: * * @data data passed via job_class_get_start_on() or job_class_get_stop_on(), * @message: D-Bus message received. * * Error handler for D-Bus message encoding a job classes "start on" or * "stop on" conditions. **/ void job_class_condition_err_handler (void *data, NihDBusMessage *message) { /* no remedial action possible */ } /** * eval_expr_tree: * * @expr: expression to consider (see ExprNode), * @stack: stack used to hold evaluated expressions. * * Evaluate @expr, in the context of @stack, creating ExprNode * nodes as necessary. * * See ExprNode for details of @token. **/ void eval_expr_tree (const char *expr, NihList **stack) { NihList *s; nih_assert (stack); s = *stack; if (IS_OPERATOR (expr)) { ExprNode *node, *first, *second; NihListEntry *tmp = NULL; NihListEntry *le; /* make node for operator */ MAKE_EXPR_NODE (NULL, node, expr); /* pop */ nih_assert (! NIH_LIST_EMPTY (s)); tmp = (NihListEntry *)nih_list_remove (s->next); /* re-parent */ nih_ref (tmp, node); nih_unref (tmp, s); first = (ExprNode *)tmp->data; nih_assert (first->value != -1); /* attach to operator node */ nih_tree_add (&node->node, &first->node, NIH_TREE_LEFT); /* pop */ nih_assert (! NIH_LIST_EMPTY (s)); tmp = (NihListEntry *)nih_list_remove (s->next); /* re-parent */ nih_ref (tmp, node); nih_unref (tmp, s); second = (ExprNode *)tmp->data; nih_assert (second->value != -1); /* attach to operator node */ nih_tree_add (&node->node, &second->node, NIH_TREE_RIGHT); /* Determine truth value for * this node based on children * and type of operator. */ if (IS_OP_AND (expr) || check_config_warn) node->value = first->value && second->value; else node->value = first->value || second->value; /* Create list entry and hook * node onto it. */ le = NIH_MUST (nih_new (s, NihListEntry)); nih_list_init (&le->entry); le->data = node; /* push operator node */ nih_list_add_after (s, &le->entry); } else { char *event = NULL; char *job = NULL; NihListEntry *le; ExprNode *en; int errors = 0; le = NIH_MUST (nih_new (s, NihListEntry)); nih_list_init (&le->entry); MAKE_EXPR_NODE (le, en, expr); le->data = en; event = en->expr; /* Determine the type of operand node we * have. */ job = strchr (en->expr, ' '); /* found a job */ if (job) { job++; *(job-1) = '\0'; if (! allow_job (job)) { errors++; /* remember the error for later */ en->job_in_error = job; } } /* handle event */ if (! allow_event (event)) { errors++; /* remember the error for later */ en->event_in_error = en->expr; } /* Determine if this this node is in error (0 means yes) */ en->value = errors ? 0 : 1; nih_list_add_after (s, &le->entry); } } /** * check_condition: * * @job_class: name of job class, * @condition: name of condition, * @condition_list: conditions to check. * @job_class_displayed: Will be set to TRUE when an error node is found * and the job class has been displayed to the user. * * Evaluate all expression tree nodes in @condition_list looking for * errors. * * Returns error count. **/ int check_condition (const char *job_class, const char *condition, NihList *condition_list, int *job_class_displayed) { nih_local NihList *stack = NULL; NihTree *root = NULL; int errors = 0; nih_assert (job_class); nih_assert (condition); if (! condition_list || NIH_LIST_EMPTY (condition_list)) return 0; STACK_CREATE (stack); STACK_SHOW (stack); NIH_LIST_FOREACH (condition_list, iter) { NihListEntry *e = (NihListEntry *)iter; eval_expr_tree (e->str, &stack); } root = &(((ExprNode *)((NihListEntry *)stack->next)->data)->node); if (! root) /* no conditions found */ return 0; /* Look through the expression tree for nodes in error and * display them. */ NIH_TREE_FOREACH_PRE_FULL (root, iter, tree_filter, root) { ExprNode *e = (ExprNode *)iter; if ( e->value != 1 ) { errors++; if ( *job_class_displayed == FALSE) { nih_message ("%s", job_class); *job_class_displayed = TRUE; } display_check_errors (job_class, condition, iter); break; } } return errors; } /** * display_check_errors: * * @job_class: name of job class, * @condition: name of condition, * @node: tree node that is in error. * * Display error details from expression tree nodes * that are in error. * * Note that this function should only be passed operand nodes or the * root node. **/ void display_check_errors (const char *job_class, const char *condition, NihTree *node) { nih_assert (job_class); nih_assert (node); NIH_TREE_FOREACH_POST (node, iter) { ExprNode *expr = (ExprNode *)iter; const char *event = expr->event_in_error; const char *job = expr->job_in_error; if (event) nih_message (" %s: %s %s", condition, _("unknown event"), event); if (job) nih_message (" %s: %s %s", condition, _("unknown job"), job); } } /** * tree_filter: * * @data: node representing root of tree, * @node: node to consider. * * Node filter for NIH_TREE_FOREACH_PRE_FULL that ensures only * operator nodes and the root node are to be considered. * * Returns FALSE if node should be considered, else TRUE. * **/ int tree_filter (void *data, NihTree *node) { NihTree *root = (NihTree *)data; ExprNode *e = (ExprNode *)node; nih_assert (root); nih_assert (e); if (IS_OPERATOR (e->expr) || node == root) return FALSE; /* ignore */ return TRUE; } /** * allow_job: * * @job: name of job to check. * * Returns TRUE if @job is recognized or can be ignored, * else FALSE. **/ int allow_job (const char *job) { NihList *found; nih_assert (job); found = nih_hash_lookup (check_config_data.job_class_hash, job); /* The second part of this test ensures we ignore the (unusual) * situation whereby the condition references a * variable (for example an instance). */ if (!found && job[0] != '$') return FALSE; return TRUE; } /** * allow_event: * * @event: name of event to check. * * Returns TRUE if @event is recognized or can be ignored, * else FALSE. **/ int allow_event (const char *event) { nih_assert (event); NIH_HASH_FOREACH (check_config_data.event_hash, iter) { NihListEntry *entry = (NihListEntry *)iter; /* handles expansion of any globs */ if (fnmatch (entry->str, event, 0) == 0) goto out; } if (IS_INIT_EVENT (event) || nih_hash_lookup (check_config_data.ignored_events_hash, event)) goto out; return FALSE; out: return TRUE; } /** * get_job_details: * * Determine the job and job instance name that the caller should act * upon. Used by the job environment commands. The caller can determine * how to react based on the values in the returned array: * * - If user has requested global operation via the command line, return * an allocated array with zero elements. * * - If user has specified a job name and possible instance value via the * command line, return an array containing first the job name, then the * instance value. * * - If no command-line options have been specified, try to extract the * job and instance names from the environment variables set within a * jobs environment. * * Returns: Newly-allocated array containing job name and job * instance, or an empty array if job and instance cannot be resolved, * or NULL on error. **/ char ** get_job_details (void) { char **details; const char *upstart_job = NULL; const char *upstart_instance = NULL; details = nih_str_array_new (NULL); if (! details) return NULL; if (apply_globally) { upstart_job = upstart_instance = NULL; } else if ((upstart_job = getenv ("UPSTART_JOB")) != NULL) { upstart_instance = getenv ("UPSTART_INSTANCE"); if (! (upstart_job && upstart_instance)) { fprintf (stderr, _("%s: missing job name\n"), program_name); nih_main_suggest_help (); return NULL; } } else { /* Running outside of job implies global */ apply_globally = TRUE; upstart_job = upstart_instance = NULL; } if (upstart_job) { NIH_MUST (nih_str_array_add (&details, NULL, NULL, upstart_job)); NIH_MUST (nih_str_array_add (&details, NULL, NULL, upstart_instance)); } return details; } #ifndef TEST /** * options: * * Command-line options accepted for all arguments. **/ static NihOption options[] = { { 0, "session", N_("use existing D-Bus session bus to connect to init daemon (for testing)"), NULL, NULL, NULL, dbus_bus_type_setter }, { 0, "system", N_("use D-Bus system bus to connect to init daemon"), NULL, NULL, NULL, dbus_bus_type_setter }, { 0, "dest", N_("destination well-known name on D-Bus bus"), NULL, "NAME", &dest_name, NULL }, { 0, "user", N_("run in user mode (as used for user sessions)"), NULL, NULL, &user_mode, NULL }, NIH_OPTION_LAST }; /** * start_options: * * Command-line options accepted for the start command. **/ NihOption start_options[] = { { 'n', "no-wait", N_("do not wait for job to start before exiting"), NULL, NULL, &no_wait, NULL }, NIH_OPTION_LAST }; /** * stop_options: * * Command-line options accepted for the stop command. **/ NihOption stop_options[] = { { 'n', "no-wait", N_("do not wait for job to stop before exiting"), NULL, NULL, &no_wait, NULL }, NIH_OPTION_LAST }; /** * restart_options: * * Command-line options accepted for the restart command. **/ NihOption restart_options[] = { { 'n', "no-wait", N_("do not wait for job to restart before exiting"), NULL, NULL, &no_wait, NULL }, NIH_OPTION_LAST }; /** * reload_options: * * Command-line options accepted for the reload command. **/ NihOption reload_options[] = { NIH_OPTION_LAST }; /** * status_options: * * Command-line options accepted for the status command. **/ NihOption status_options[] = { NIH_OPTION_LAST }; /** * list_options: * * Command-line options accepted for the list command. **/ NihOption list_options[] = { NIH_OPTION_LAST }; /** * emit_options: * * Command-line options accepted for the emit command. **/ NihOption emit_options[] = { { 'n', "no-wait", N_("do not wait for event to finish before exiting"), NULL, NULL, &no_wait, NULL }, NIH_OPTION_LAST }; /** * reload_configuration_options: * * Command-line options accepted for the reload-configuration command. **/ NihOption reload_configuration_options[] = { NIH_OPTION_LAST }; /** * version_options: * * Command-line options accepted for the version command. **/ NihOption version_options[] = { NIH_OPTION_LAST }; /** * log_priority_options: * * Command-line options accepted for the log-priority command. **/ NihOption log_priority_options[] = { NIH_OPTION_LAST }; /** * show_config_options: * * Command-line options accepted for the show-config command. **/ NihOption show_config_options[] = { { 'e', "enumerate", N_("enumerate list of events and jobs causing job " "created from job config to start/stop"), NULL, NULL, &enumerate_events, NULL }, NIH_OPTION_LAST }; /** * check_config_options: * * Command-line options accepted for the check-config command. **/ NihOption check_config_options[] = { { 'i', "ignore-events", N_("ignore specified list of events (comma-separated)"), NULL, "EVENT_LIST", NULL, ignored_events_setter }, { 'w', "warn", N_("Generate warning for any unreachable events/jobs"), NULL, NULL, &check_config_warn, NULL }, NIH_OPTION_LAST }; /** * set_env_options: * * Command-line options accepted for the set-env command. **/ NihOption set_env_options[] = { { 'g', "global", N_("apply to global job environment table"), NULL, NULL, &apply_globally, NULL }, { 'r', "retain", N_("do not replace the value of the variable if already set"), NULL, NULL, &retain_var, NULL }, NIH_OPTION_LAST }; /** * get_env_options: * * Command-line options accepted for the get-env command. **/ NihOption get_env_options[] = { { 'g', "global", N_("apply to global job environment table"), NULL, NULL, &apply_globally, NULL }, NIH_OPTION_LAST }; /** * unset_env_options: * * Command-line options accepted for the unset-env command. **/ NihOption unset_env_options[] = { { 'g', "global", N_("apply to global job environment table"), NULL, NULL, &apply_globally, NULL }, NIH_OPTION_LAST }; /** * list_env_options: * * Command-line options accepted for the list-env command. **/ NihOption list_env_options[] = { { 'g', "global", N_("apply to global job environment table"), NULL, NULL, &apply_globally, NULL }, NIH_OPTION_LAST }; /** * reset_env_options: * * Command-line options accepted for the reset-env command. **/ NihOption reset_env_options[] = { { 'g', "global", N_("apply to global job environment table"), NULL, NULL, &apply_globally, NULL }, NIH_OPTION_LAST }; /** * usage_options: * * Command-line options accepted for the usage command. **/ NihOption usage_options[] = { NIH_OPTION_LAST }; /** * job_group: * * Group of commands related to jobs. **/ static NihCommandGroup job_commands = { N_("Job") }; /** * event_group: * * Group of commands related to events. **/ static NihCommandGroup event_commands = { N_("Event") }; /** * env_group: * * Group of commands related to Job environment variables. **/ static NihCommandGroup env_group = { N_("Environment") }; /** * commands: * * Commands accepts as the first non-option argument, or program name. **/ static NihCommand commands[] = { { "start", N_("JOB [KEY=VALUE]..."), N_("Start job."), N_("JOB is the name of the job that is to be started, this may " "be followed by zero or more environment variables to be " "defined in the new job.\n" "\n" "The environment may also serve to distinguish between job " "instances, and thus decide whether a new instance will be " "started or an error returned if an existing instance is " "already running."), &job_commands, start_options, start_action }, { "stop", N_("JOB [KEY=VALUE]..."), N_("Stop job."), N_("JOB is the name of the job that is to be stopped, this may " "be followed by zero or more environment variables to be " "passed to the job's pre-stop and post-stop processes.\n" "\n" "The environment also serves to distinguish between job " "instances, and thus decide which of multiple instances will " "be stopped."), &job_commands, stop_options, stop_action }, { "restart", N_("JOB [KEY=VALUE]..."), N_("Restart job."), N_("JOB is the name of the job that is to be restarted, this may " "be followed by zero or more environment variables to be " "defined in the job after restarting.\n" "\n" "The environment also serves to distinguish between job " "instances, and thus decide which of multiple instances will " "be restarted."), &job_commands, restart_options, restart_action }, { "reload", N_("JOB [KEY=VALUE]..."), N_("Send HUP signal to job."), N_("JOB is the name of the job that is to be sent the signal, " "this may be followed by zero or more environment variables " "to distinguish between job instances.\n"), &job_commands, reload_options, reload_action }, { "status", N_("JOB [KEY=VALUE]..."), N_("Query status of job."), N_("JOB is the name of the job that is to be queried, this may " "be followed by zero or more environment variables to " "distguish between job instances.\n" ), &job_commands, status_options, status_action }, { "list", NULL, N_("List known jobs."), N_("The known jobs and their current status will be output."), &job_commands, list_options, list_action }, { "emit", N_("EVENT [KEY=VALUE]..."), N_("Emit an event."), N_("EVENT is the name of an event the init daemon should emit, " "this may be followed by zero or more environment variables " "to be included in the event.\n"), &event_commands, emit_options, emit_action }, { "reload-configuration", NULL, N_("Reload the configuration of the init daemon."), NULL, NULL, reload_configuration_options, reload_configuration_action }, { "version", NULL, N_("Request the version of the init daemon."), NULL, NULL, version_options, version_action }, { "log-priority", N_("[PRIORITY]"), N_("Change the minimum priority of log messages from the init " "daemon."), N_("PRIORITY may be one of:\n" " `debug' (messages useful for debugging upstart are logged, " "equivalent to --debug on kernel command-line);\n" " `info' (messages about job goal and state changes, as well " "as event emissions are logged, equivalent to --verbose on the " "kernel command-line);\n" " `message' (informational and debugging messages are suppressed, " "the default); " " `warn' (ordinary messages are suppressed whilst still " "logging warnings and errors);\n" " `error' (only errors are logged, equivalent to --quiet on " "the kernel command-line) or\n" " `fatal' (only fatal errors are logged).\n" "\n" "Without arguments, this outputs the current log priority."), NULL, log_priority_options, log_priority_action }, { "show-config", N_("[CONF]"), N_("Show emits, start on and stop on details for job configurations."), N_("If CONF specified, show configuration details for single job " "configuration, else show details for all jobs configurations.\n"), NULL, show_config_options, show_config_action }, { "check-config", N_("[CONF]"), N_("Check for unreachable jobs/event conditions."), N_("List all jobs and events which cannot be satisfied by " "currently available job configuration files."), NULL, check_config_options, check_config_action }, { "get-env", N_("VARIABLE"), N_("Retrieve value of a job environment variable."), N_("Display the value of a variable from the job environment table."), &env_group, get_env_options, get_env_action }, { "list-env", NULL, N_("Show all job environment variables."), N_("Displays sorted list of variables and their values from the job environment table."), &env_group, list_env_options, list_env_action }, { "reset-env", N_("VARIABLE"), N_("Revert all job environment variable changes."), N_("Discards all changes make to the job environment table, setting it back to its default value."), &env_group, reset_env_options, reset_env_action }, { "set-env", N_("VARIABLE[=VALUE]"), N_("Set one or more job environment variables."), N_("Adds or updates variables in the job environment table."), &env_group, set_env_options, set_env_action }, { "unset-env", N_("VARIABLE"), N_("Remove one or more job environment variables."), N_("Discards variables from the job environment table."), &env_group, unset_env_options, unset_env_action }, { "usage", N_("JOB"), N_("Show job usage message if available."), N_("JOB is the name of the job which usage is to be shown.\n" ), NULL, usage_options, usage_action }, { "notify-cgroup-manager-address", NULL, N_("Inform Upstart of D-Bus address cgroup manager is available on."), N_("Run to allow Upstart to provide cgroup stanza support."), NULL, NULL, notify_cgroup_manager_address_action }, { "notify-dbus-address", NULL, N_("Inform Upstart of D-Bus address to connect to."), N_("Run to allow Upstart to provide services over D-Bus."), NULL, NULL, notify_dbus_address_action }, { "notify-disk-writeable", NULL, N_("Inform Upstart that disk is now writeable."), N_("Run to ensure output from jobs ending before " "disk is writeable are flushed to disk."), NULL, NULL, notify_disk_writeable_action }, { "list-sessions", NULL, N_("List all sessions."), N_("Displays list of running Session Init sessions"), NULL, NULL, list_sessions_action }, NIH_COMMAND_LAST }; int main (int argc, char *argv[]) { int ret; nih_main_init (argv[0]); ret = nih_command_parser (NULL, argc, argv, options, commands); if (ret < 0) exit (1); dbus_shutdown (); return ret; } #endif upstart-1.13.2/util/sysv.c0000664000175000017500000001154412373101356012356 00000000000000/* upstart * * sysv.c - System V compatibility * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "utmp.h" #include "sysv.h" #include "com.ubuntu.Upstart.h" /** * RUNLEVEL_EVENT: * * Name of the event we emit on a runlevel change. **/ #define RUNLEVEL_EVENT "runlevel" /* Prototypes for static functions */ static void error_handler (NihError **err, NihDBusMessage *message); /** * dest_address: * * Address for private D-Bus connection. **/ const char *dest_address = DBUS_ADDRESS_UPSTART; /** * sysv_change_runlevel: * @runlevel: new runlevel, * @extra_env: NULL-terminated array of additional environment. * * Returns: zero on success, negative value on raised error. **/ int sysv_change_runlevel (int runlevel, char * const *extra_env, const char * utmp_file, const char * wtmp_file) { int prevlevel; DBusError dbus_error; DBusConnection * connection; nih_local NihDBusProxy *upstart = NULL; nih_local char ** env = NULL; char * e; DBusPendingCall * pending_call; NihError * err; nih_assert (runlevel > 0); /* Get the previous runlevel from the environment or utmp */ prevlevel = utmp_get_runlevel (utmp_file, NULL); if (prevlevel < 0) { nih_free (nih_error_get ()); prevlevel = 'N'; } /* Connect to Upstart via the private socket, establish a proxy and * drop the initial connection reference since the proxy will hold * one. */ dbus_error_init (&dbus_error); connection = dbus_connection_open (dest_address, &dbus_error); if (! connection) { nih_dbus_error_raise (dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); return -1; } dbus_error_free (&dbus_error); upstart = nih_dbus_proxy_new (NULL, connection, NULL, DBUS_PATH_UPSTART, NULL, NULL); if (! upstart) { dbus_connection_unref (connection); return -1; } upstart->auto_start = FALSE; dbus_connection_unref (connection); /* Construct the environment to the event, which must include the * new runlevel and previous runlevel as the first two arguments * followed by any additional environment. */ env = nih_str_array_new (NULL); if (! env) nih_return_no_memory_error (-1); e = nih_sprintf (NULL, "RUNLEVEL=%c", runlevel); if (! e) nih_return_no_memory_error (-1); if (! nih_str_array_addp (&env, NULL, NULL, e)) { nih_error_raise_no_memory (); nih_free (e); return -1; } e = nih_sprintf (NULL, "PREVLEVEL=%c", prevlevel); if (! e) nih_return_no_memory_error (-1); if (! nih_str_array_addp (&env, NULL, NULL, e)) { nih_error_raise_no_memory (); nih_free (e); return -1; } if (extra_env) { if (! nih_str_array_append (&env, NULL, NULL, extra_env)) nih_return_no_memory_error (-1); } /* Write out the new runlevel record to utmp and wtmp, do this * before calling EmitEvent so that the records are correct. */ if (utmp_write_runlevel (utmp_file, wtmp_file, runlevel, prevlevel) < 0) nih_free (nih_error_get ()); /* Make the EmitEvent call, we don't wait for the event to finish * because sysvinit never did. */ err = NULL; pending_call = NIH_SHOULD (upstart_emit_event ( upstart, "runlevel", env, FALSE, NULL, (NihDBusErrorHandler)error_handler, &err, NIH_DBUS_TIMEOUT_NEVER)); if (! pending_call) return -1; dbus_pending_call_block (pending_call); dbus_pending_call_unref (pending_call); if (err) { nih_error_raise_error (err); return -1; } return 0; } /** * error_handler: * @err: pointer to store error into, * @message: D-Bus message received. * * This function is called in the event of an error from a D-Bus method * call, it stashes the raised error in @err. **/ static void error_handler (NihError ** err, NihDBusMessage *message) { *err = nih_error_steal (); } upstart-1.13.2/util/initctl.h0000664000175000017500000003353212373101356013026 00000000000000/* upstart * * Copyright © 2011 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INITCTL_H #define INITCTL_H /** * IS_OP_AND: * @token: string token to check. * * Return TRUE if @token is an 'AND' operator, else FALSE. **/ #define IS_OP_AND(token) \ (! strcmp ((token), "/AND")) /** * IS_OP_OR: * @token: string token to check. * * Return TRUE if @token is an 'OR' operator, else FALSE. **/ #define IS_OP_OR(token) \ (! strcmp ((token), "/OR")) /** * IS_OPERATOR * @token: string token to check. * * Return TRUE if @token is either an 'AND' or an 'OR' operator, * else FALSE. **/ #define IS_OPERATOR(token) \ IS_OP_AND (token) || IS_OP_OR (token) /** * GET_JOB_NAME: * * @var: char pointer variable which will be set to the name * of a job, or NULL, * @index: zero-based index of tokens where zero represents * the first token after the initial token, * @token: string to check. * * Determine name of job considering the specified token and its * index. If not a job, sets @name to NULL. * * Handles the following cases: * * [start|stop] on foo * (index==0, job="foo" => name="foo") * * [start|stop] on JOB=foo * (index==0, job="JOB=foo" => name="foo") * * [start|stop] on A=B JOB=foo * (index==1, job="JOB=foo" => name="foo") * * [start|stop] on A=B c=hello JOB=foo * (index==2, job="JOB=foo" => name="foo") * * [start|stop] on $JOB A=B c=hello * (index==0, job="$JOB" => name="$JOB") * **/ #define GET_JOB_NAME(var, index, token) \ { \ char *_##var; \ \ nih_assert (index >= 0); \ nih_assert (token); \ \ var = NULL; \ \ _##var = strstr (token, "JOB="); \ \ if (_##var && _##var == token) \ var = _##var + strlen ("JOB="); \ else if (index == 0 ) { \ if (!strstr (token, "=")) \ var = token; \ } \ } /** * IS_JOB_EVENT: * @token: string to check. * * Return TRUE if specified token refers to a standard job event, else * FALSE. **/ #define IS_JOB_EVENT(token) \ (!strcmp (token, JOB_STARTING_EVENT) || \ !strcmp (token, JOB_STARTED_EVENT) || \ !strcmp (token, JOB_STOPPING_EVENT) || \ !strcmp (token, JOB_STOPPED_EVENT)) /** * IS_INIT_EVENT: * @token: string to check. * * Return TRUE if specified token refers to an event emitted internally, * else FALSE. * * Note: the raw string entries below are required to accommodate * production versus debug builds (STARTUP_EVENT changes name depending * on build type). **/ #define IS_INIT_EVENT(token) \ (!strcmp (token, STARTUP_EVENT) || \ !strcmp (token, "debug") || \ !strcmp (token, "startup") || \ !strcmp (token, CTRLALTDEL_EVENT) || \ !strcmp (token, KBDREQUEST_EVENT) || \ !strcmp (token, PWRSTATUS_EVENT) || \ (!strcmp (token, SESSION_END_EVENT) && user_mode) || \ IS_JOB_EVENT (token)) /** * STACK_EMPTY: * @stack: address of stack to check. * * Return TRUE if @stack is empty, else FALSE. **/ #define STACK_EMPTY(stack) \ (NIH_LIST_EMPTY (stack)) /** * STACK_CREATE: * @name: nih_list variable to assign stack to. **/ #define STACK_CREATE(name) \ name = NIH_MUST (nih_list_new (NULL)) /** * STACK_SHOW_POP: * @stack: Address of stack, * @str: string representing element popped off stack. * * Display message to denote that @str has been popped off @stack. * Does nothing if debug build not enabled. * * Note: we cannot assert that stack is not empty since a caller may * have just removed the last entry before calling us. Thus, it is up to * the caller to perform such checks. * * Does nothing if debug build not enabled. **/ #ifdef DEBUG_STACK #define STACK_SHOW_POP(stack, str) \ STACK_SHOW_CHANGE (stack, "popped", str) #else #define STACK_SHOW_POP(stack, str) #endif /** * STACK_SHOW_PUSH: * @stack: Address of stack, * @str: string representing element pushed onto stack. * * Display message to denote that @str has been pushed onto @stack. * * Does nothing if debug build not enabled. **/ #ifdef DEBUG_STACK #define STACK_SHOW_PUSH(stack, str) \ STACK_SHOW_CHANGE (stack, "pushed", str) \ \ nih_assert (! STACK_EMPTY (stack)) #else #define STACK_SHOW_PUSH(stack, str) #endif /** * STACK_SHOW: * @stack: Address of stack. * * Display contents of @stack. * * Does nothing if debug build not enabled. **/ #ifdef DEBUG_STACK #define STACK_SHOW(stack) \ { \ size_t depth = 0; \ \ nih_assert (stack); \ \ NIH_LIST_FOREACH (stack, iter) { \ depth++; \ } \ \ if (STACK_EMPTY (stack)) { \ nih_message ("STACK@%p: empty", stack); \ } else { \ for (NihList *iter = (stack)->next; \ iter != (stack) && \ ((NihListEntry *)iter)->str; \ iter = iter->next, depth--) { \ nih_message ("STACK@%p[%u]='%s'", \ (void *)stack, \ (unsigned int)(depth-1), \ ((NihListEntry *)iter)->str); \ } \ } \ } #else #define STACK_SHOW(stack) #endif /** * STACK_SHOW_CHANGE: * @stack: Address of stack, * @msg: message to show a stack change, * @element_str: string representing element changed on @stack. * * Display a message showing that the stack has been changed. * * Does nothing if debug build not enabled. **/ #ifdef DEBUG_STACK #define STACK_SHOW_CHANGE(stack, msg, element_str) \ nih_assert (msg); \ nih_assert (element_str); \ \ nih_message ("STACK@%p: %s '%s'", \ (void *)stack, msg, element_str); \ \ STACK_SHOW (stack); \ \ nih_message (" "); /* spacer */ #else #define STACK_SHOW_CHANGE(stack, msg, element_str) #endif /** * STACK_PUSH: * @stack: Address of stack, * @elem: element of type NihListEntry to add to stack. * * Add @elem to @stack and display message showing how stack changed. **/ #define STACK_PUSH(stack, elem) \ nih_list_add_after (stack, &(elem)->entry); \ \ STACK_SHOW_PUSH (stack, \ ((NihListEntry *)(elem))->str); \ \ nih_assert (! STACK_EMPTY (stack)) /** * STACK_PUSH_NEW_ELEM: * @stack: Address of stack, * @string: String to convert into a new NihListEntry * stack element and push onto @stack. * * Create new stack element from @string and push onto @stack, * displaying a message showing how stack changed. **/ #define STACK_PUSH_NEW_ELEM(stack, string) \ { \ NihListEntry *e; \ \ nih_assert (stack); \ nih_assert (string); \ \ e = NIH_MUST (nih_new (stack, NihListEntry)); \ nih_list_init (&e->entry); \ e->str = NIH_MUST (nih_strdup (e, string)); \ STACK_PUSH (stack, e); \ } /** * STACK_POP: * @stack: Address of stack, * @list: list which top stack element will be added to. * * Remove top element from @stack, returning to caller as @list * and display message showing how stack changed. * * Note that @list is assumed to have had nih_list_new() called * on it already. **/ #define STACK_POP(stack, list) \ nih_assert (stack); \ nih_assert ((stack)->next); \ \ list = nih_list_add (list, (stack)->next); \ STACK_SHOW_POP (stack, \ ((NihListEntry *)(list))->str) /** * STACK_PEEK: * @stack: Address of stack. * * Return string value of top element on stack. **/ #define STACK_PEEK(stack) \ (((NihListEntry *)(stack)->next)->str) /** * JobCondition: * * @list: list that @list lives on, * @job_class: name of job class, * @start_on: start on conditions, * @stop_on: stop on conditions. * * Structure used to represent a job classes start on and stop on * conditions. * * Note that @start_on and @stop_on are lists of NihListEntry * objects containing string data. * * **/ typedef struct condition { NihList list; const char *job_class; NihList *start_on; NihList *stop_on; } JobCondition; /** * CheckConfigData: * * @job_class_hash: Job classes (.conf files) * currently installed, * @event_hash: Events that are documented * as being emitted, * @ignored_events_hash: Rvents we wish to ignore. * * Notes: * * Keys for @job_class_hash are job class names and values * are of type JobCondition. * * Keys of @event_hash are event names and values are of type * NihListEntry holding the event name as a string. * * Keys of @ignored_events_hash are event names and values are of type * NihListEntry holding the event name as a string. **/ typedef struct check_config_data { NihHash *job_class_hash; NihHash *event_hash; NihHash *ignored_events_hash; } CheckConfigData; /** * ConditionHandlerData: * * @condition_name: "start on" or "stop on", * @job_class_name: name of *.conf file less the extension. * * Used to pass multiple values to job_class_get_start_on() / * job_class_get_stop_on() handlers. * **/ typedef struct condition_handler_data { const char *condition_name; const char *job_class_name; } ConditionHandlerData; /** * ExprNode: * * @node: tree which node lives in, * @expr: string representing the expression, * @job_in_error: if not NULL, points to the appropriate portion of * @expr where the erroneous job is, * @event_in_error: if not NULL, points to the appropriate portion of * @expr where the erroneous event is, * @value: Truth value of this node (and its children, if any). * * Node representing an expression. * * Notes: * * @expr can be one of: * * - operator: * - IS_OP_AND() * - IS_OP_OR() * - operand: * - "" * - " " * * @value can be: * * - 0 denoting node (and its children) are in error. * - 1 denoting no errors in this node or its children. * - -1 denoting an uninitialized value. */ typedef struct expression_node { NihTree node; char *expr; const char *job_in_error; const char *event_in_error; int value; } ExprNode; /** * MAKE_EXPR_NODE: * * @parent: parent object, * @entry: pointer to ExprNode to initialize, * @str: string expression which will be copied into @entry. * * Allocate storage for an ExprNode pointer and initialize. **/ #define MAKE_EXPR_NODE(parent, entry, str) \ entry = NIH_MUST (nih_new (parent, ExprNode)); \ nih_tree_init (&(entry)->node); \ (entry)->expr = (str) \ ? NIH_MUST (nih_strdup (entry, (str))) \ : NULL; \ (entry)->job_in_error = NULL; \ (entry)->event_in_error = NULL; \ (entry)->value = -1 /** * MAKE_JOB_CONDITION: * * @parent: parent object, * @entry: pointer to JobCondition to initialize, * @str: string expression which will be copied into @entry. * * Allocate storage for an JobCondition pointer and initialize. **/ #define MAKE_JOB_CONDITION(parent, entry, str) \ entry = NIH_MUST (nih_new (parent, JobCondition)); \ nih_list_init (&(entry)->list); \ (entry)->job_class = NIH_MUST (nih_strdup (entry, str)); \ (entry)->start_on = NIH_MUST (nih_list_new (entry)); \ (entry)->stop_on = NIH_MUST (nih_list_new (entry)) #endif /* INITCTL_H */ upstart-1.13.2/util/runlevel.c0000664000175000017500000000377512373101356013215 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include "utmp.h" /** * options: * * Command-line options accepted. **/ static NihOption options[] = { NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char **args; int runlevel; int prevlevel; nih_main_init (argv[0]); nih_option_set_usage (_("[UTMP]")); nih_option_set_synopsis (_("Output previous and current runlevel.")); nih_option_set_help ( _("The system /var/run/utmp file is used unless the alternate " "file UTMP is given.\n")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); runlevel = NIH_SHOULD (utmp_get_runlevel (args[0], &prevlevel)); if (runlevel < 0) { NihError *err; err = nih_error_get (); if (err->number == ESRCH) { nih_message ("unknown"); } else { nih_error ("%s: %s", args[0] ?: _PATH_UTMPX, err->message); } nih_free (err); exit (1); } else if (runlevel == 'N') { nih_message ("unknown"); exit (1); } nih_message ("%c %c", prevlevel, runlevel); return 0; } upstart-1.13.2/util/utmp.c0000664000175000017500000002046612373101356012342 00000000000000/* upstart * * utmp.c - utmp and wtmp handling * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include "utmp.h" /* Prototypes for static functions */ static void utmp_entry (struct utmpx *utmp, short type, pid_t pid, const char *line, const char *id, const char *user); static int utmp_write (const char *utmp_file, const struct utmpx *utmp) __attribute__ ((warn_unused_result)); static void wtmp_write (const char *wtmp_file, const struct utmpx *utmp); /** * SHUTDOWN_TIME: * * The sysvinit last utility expects a special "shutdown" RUN_LVL entry, * and abuses the type to distinguish that. We'll do the same. **/ #define SHUTDOWN_TIME 254 /** * utmp_read_runlevel: * @utmp_file: utmp or wtmp file to read from, * @prevlevel: pointer to store previous runlevel in. * * Reads the the most recent runlevel entry from @utmp_file, returning * the runlevel from it. If @prevlevel is not NULL, the previous runlevel * will be stored in that variable. * * @utmp_file may be either a utmp or wtmp file, if NULL the default * /var/run/utmp is used. * * Returns: runlevel on success, negative value on raised error. **/ int utmp_read_runlevel (const char *utmp_file, int * prevlevel) { struct utmpx utmp; struct utmpx *lvl; int runlevel; memset (&utmp, 0, sizeof utmp); utmp.ut_type = RUN_LVL; if (utmp_file) utmpxname (utmp_file); setutxent (); lvl = getutxid (&utmp); if (! lvl) { nih_error_raise_system (); endutxent (); return -1; } runlevel = lvl->ut_pid % 256 ?: 'N'; if (runlevel < 0) runlevel = 'N'; if (prevlevel) { *prevlevel = lvl->ut_pid / 256 ?: 'N'; if (*prevlevel < 0) *prevlevel = 'N'; } endutxent (); return runlevel; } /** * utmp_get_runlevel: * @utmp_file: utmp or wtmp file to read from, * @prevlevel: pointer to store previous runlevel in. * * If the RUNLEVEL and PREVLEVEL environment variables are set, returns * the current and previous runlevels from those otherwise calls * utmp_read_runlevel() to read the most recent runlevel entry from * @utmp_file. * * Returns: runlevel on success, negative value on raised error. **/ int utmp_get_runlevel (const char *utmp_file, int * prevlevel) { const char *renv; const char *penv; renv = getenv ("RUNLEVEL"); penv = getenv ("PREVLEVEL"); if (renv) { if (prevlevel) *prevlevel = penv && penv[0] ? penv[0] : 'N'; return renv[0] ?: 'N'; } return utmp_read_runlevel (utmp_file, prevlevel); } /** * utmp_write_runlevel: * @utmp_file: utmp file, * @wtmp_file: wtmp file, * @runlevel: new runlevel, * @prevlevel: previous runlevel. * * Write a runlevel change record from @prevlevel to @runlevel to @utmp_file, * or /var/run/utmp if @utmp_file is NULL, and to @wtmp_file, or /var/log/wtmp * if @wtmp_file is NULL. * * Errors writing to the wtmp file are ignored. * * Returns: zero on success, negative value on raised error. **/ int utmp_write_runlevel (const char *utmp_file, const char *wtmp_file, int runlevel, int prevlevel) { struct utmpx reboot; struct utmpx utmp; int savedlevel; int ret; nih_assert (runlevel > 0); nih_assert (prevlevel >= 0); if (prevlevel == 'N') prevlevel = 0; utmp_entry (&reboot, BOOT_TIME, 0, NULL, NULL, NULL); /* Check for the previous runlevel entry in utmp, if it doesn't * match then we assume a missed reboot so write the boot time * record out first. */ savedlevel = utmp_read_runlevel (utmp_file, NULL); if (savedlevel != prevlevel) { if (savedlevel < 0) nih_free (nih_error_get ()); if (utmp_write (utmp_file, &reboot) < 0) nih_free (nih_error_get ()); } /* Check for the previous runlevel entry in wtmp, if it doesn't * match then we assume a missed reboot so write the boot time * record out first. */ savedlevel = utmp_read_runlevel (wtmp_file, NULL); if (savedlevel != prevlevel) { if (savedlevel < 0) nih_free (nih_error_get ()); wtmp_write (wtmp_file, &reboot); } /* Write the runlevel change record */ utmp_entry (&utmp, RUN_LVL, runlevel + prevlevel * 256, NULL, NULL, NULL); ret = utmp_write (utmp_file, &utmp); wtmp_write (wtmp_file, &utmp); return ret; } /** * utmp_write_shutdown: * @utmp_file: utmp file to write to, * @wtmp_file: wtmp file to write to. * * Write a shutdown utmp record to @utmp_file, or /var/run/utmp if * @utmp_file is NULL, and to @wtmp_file, or /var/log/wtmp if @wtmp_file * is NULL. * * Errors writing to the wtmp file are ignored. * * Returns: zero on success, negative value on raised error. **/ int utmp_write_shutdown (const char *utmp_file, const char *wtmp_file) { struct utmpx utmp; int ret; utmp_entry (&utmp, SHUTDOWN_TIME, 0, NULL, NULL, NULL); ret = utmp_write (utmp_file, &utmp); wtmp_write (wtmp_file, &utmp); return ret; } /** * utmp_entry: * @utmp: utmp entry to fill, * @type: type of record, * @pid: process id of login process, * @line: device name of tty, * @id: terminal name suffix, * @user: username. * * Fill the utmp entry @utmp with the details passed, setting the auxiliary * information such as host and time to sensible defaults. Depending on * @type, the other arguments may be ignored. * * When @type is BOOT_TIME, or the special SHUTDOWN_TIME, all arguments * are ignored. When @type is RUN_LVL, the @line, @id and @user lines are * ignored. * * Any existing values in @utmp before this call will be lost. **/ static void utmp_entry (struct utmpx *utmp, short type, pid_t pid, const char * line, const char * id, const char * user) { struct utsname uts; struct timeval tv; nih_assert (utmp != NULL); nih_assert (type != EMPTY); switch (type) { case BOOT_TIME: pid = 0; line = "~"; id = "~~"; user = "reboot"; break; case SHUTDOWN_TIME: type = RUN_LVL; pid = 0; line = "~"; id = "~~"; user = "shutdown"; break; case RUN_LVL: nih_assert (pid != 0); line = "~"; id = "~~"; user = "runlevel"; break; default: nih_assert (line != NULL); nih_assert (id != NULL); nih_assert (user != NULL); } memset (utmp, 0, sizeof (struct utmpx)); utmp->ut_type = type; utmp->ut_pid = pid; strncpy (utmp->ut_line, line, sizeof utmp->ut_line); strncpy (utmp->ut_id, id, sizeof utmp->ut_id); strncpy (utmp->ut_user, user, sizeof utmp->ut_user); if (uname (&uts) == 0) strncpy (utmp->ut_host, uts.release, sizeof utmp->ut_host); gettimeofday (&tv, NULL); utmp->ut_tv.tv_sec = tv.tv_sec; utmp->ut_tv.tv_usec = tv.tv_usec; } /** * utmp_write: * @utmp_file: utmp file to write to, * @utmp: utmp entry to write. * * Write the utmp entry @utmp to @utmp_file, or /var/run/utmp if @utmp_file * is NULL. * * Returns: zero on success, negative value on raised error. **/ static int utmp_write (const char * utmp_file, const struct utmpx *utmp) { nih_assert (utmp != NULL); utmpxname (utmp_file ?: _PATH_UTMPX); setutxent (); if (! pututxline (utmp)) { nih_error_raise_system (); endutxent (); return -1; } endutxent (); return 0; } /** * wtmp_write: * @wtmp_file: wtmp file to write to, * @utmp: utmp entry to write. * * Write the utmp entry @utmp to @wtmp_file, or /var/log/wtmp if @utmp_file * is NULL. **/ static void wtmp_write (const char * wtmp_file, const struct utmpx *utmp) { nih_assert (utmp != NULL); updwtmpx (wtmp_file ?: _PATH_WTMPX, utmp); } upstart-1.13.2/Makefile.in0000664000175000017500000006445012402042374012277 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in ABOUT-NLS COPYING TODO compile \ config.guess config.rpath config.sub depcomp install-sh \ missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = test dbus init util extra lib conf doc contrib po scripts EXTRA_DIST = HACKING README.tests ACLOCAL_AMFLAGS = --install -I m4 # Broken with gcc-4.8 on ubuntu saucy at the moment AM_DISTCHECK_CONFIGURE_FLAGS = --disable-abi-check all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) @case `sed 15q $(srcdir)/NEWS` in \ *"$(VERSION)"*) : ;; \ *) \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1;; \ esac $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/README.tests0000664000175000017500000000365312373101356012254 00000000000000Unit Tests ========== Upstarts unit tests are run via:: make check Integration Tests ================= Python 3 scripts that make use of the ``pyupstart.py`` test module. There are 2 classes of integration tests: Session-level Integration Tests ------------------------------- These can be run as a non-root user or as root. Ideally, run them as both users. To run the tests:: $ cd scripts/tests && ./test_pyupstart_session_init.py The tests make use of some of the sample Job Configuration (``.conf``) files shipped with Upstart. However, if the ``UPSTART_TEST_USE_INSTALLED_CONF`` variable is set to any value, if the tests find an *installed* session job of the same name, they will use those jobs instead. The current sample jobs the tests use are: - ``re-exec.conf`` - ``upstart-file-bridge.conf`` System-level Integration Tests ------------------------------ These tests must be run as ``root`` (the tests will be skipped if called by a non-root user) and operate on the PID 1 executable. The tests will create a subdirectory below ``/etc/init/`` in an attempt to isolate themselves from the rest of the system. However, these tests are designed to be run *on test systems only*. The tests also exercise the chroot abilities of Upstart. If the environment variable ``UPSTART_TEST_CHROOT_PATH`` is set and points to a valid chroot in which Upstart is installed this chroot will participate in the tests. To run the system-level integration tests:: $ su # export UPSTART_TEST_CHROOT_PATH=/full/path/to/chroot # cd scripts/tests && ./test_pyupstart_system_init.py Running All the Tests Together ------------------------------ WARNING: Running the tests as ``root`` in this way will modify your ``/etc/init/`` directory. See `System-level Integration Tests`_. You can make use of python3's unittest module to run all the tests in the normal fashion: $ cd scripts && python3 -munittest $ su # cd scripts && python3 -munittest upstart-1.13.2/Makefile.am0000664000175000017500000000045512373101356012264 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = test dbus init util extra lib conf doc contrib po scripts EXTRA_DIST = HACKING README.tests ACLOCAL_AMFLAGS = --install -I m4 # Broken with gcc-4.8 on ubuntu saucy at the moment AM_DISTCHECK_CONFIGURE_FLAGS = --disable-abi-check upstart-1.13.2/README0000664000175000017500000000360412373101356011107 00000000000000Upstart is an event-based replacement for the /sbin/init daemon which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running. It is intended to be suitable for deployment in all Linux distributions as a replacement for the venerable sysvinit package. Feature highlights: * Tasks and Services are started and stopped by events; * Events are generated as tasks and services are started and stopped; * Events may be received from any other process on the system; * Services may be respawned if they die unexpectedly; * Supervision and respawning of daemons which separate from their parent process; * Communication with the init daemon over D-Bus. Dependencies ------------ Since Upstart's primary usage will be on distributions that utilise the user-space event mechanisms only found in recent Linux kernel versions, it has been developed to take advantage of other operating system and language features that may not be available in older releases of the kernel, C library or compiler. Upstart uses the libnih library to provide a standard set of utility functions used throughout the source. The recommended versions are: * Linux 2.6.24 or later * GCC 4.1 or later * GNU C Library (glibc) 2.4 or later * libnih 1.0.2 or later Communication with other processes utilises the D-Bus messaging system, abstracted through the libnih-dbus library and with bindings automatically generated by nih-dbus-tool. The recommended versions are: * pkg-config 0.22 or later * libnih-dbus 1.0.1 or later * nih-dbus-tool 1.0.1 or later * D-Bus 1.2.16 or later These should all be available from the current release of any modern Linux distribution. For detailed compilation and installation instructions see the INSTALL file. If you've checked Upstart out from revision control, or want to hack on Upstart, see the HACKING file. upstart-1.13.2/COPYING0000664000175000017500000004310312373101356011260 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. upstart-1.13.2/config.h.in0000664000175000017500000000772312402042410012244 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Build with Cgroup CGManager support */ #undef ENABLE_CGROUPS /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Directory to append to path. */ #undef EXTRA_PATH /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PRCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VALGRIND_VALGRIND_H_ /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the copyright message of this package. */ #undef PACKAGE_COPYRIGHT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `mode_t', as computed by sizeof. */ #undef SIZEOF_MODE_T /* The size of `pid_t', as computed by sizeof. */ #undef SIZEOF_PID_T /* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T /* The size of `ssize_t', as computed by sizeof. */ #undef SIZEOF_SSIZE_T /* The size of `time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T /* The size of `uid_t', as computed by sizeof. */ #undef SIZEOF_UID_T /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `__thread' is not supported. */ #undef __thread upstart-1.13.2/config.rpath0000755000175000017500000004364712373101360012543 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2007 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case $cc_basename in xlc*) wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case $cc_basename in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix4* | aix5*) library_names_spec='$libname$shrext' ;; amigaos*) library_names_spec='$libname.a' ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd1*) ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; nto-qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = scripts DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_man_MANS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 am__installdirs = "$(DESTDIR)$(man8dir)" NROFF = nroff MANS = $(dist_man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ UPSTART_BINARY = $(abs_top_builddir)/init/init INITCTL_BINARY = $(abs_top_builddir)/util/initctl FILE_BRIDGE_BINARY = $(abs_top_builddir)/extra/upstart-file-bridge SUBDIRS = data install_scripts = \ initctl2dot.py \ init-checkconf.sh \ upstart-monitor.py noinst_SCRIPTS = \ pyupstart.py \ pyupstartvars.py CLEANFILES = \ pyupstartvars.py pyupstartvars.py.tmp EXTRA_DIST = \ $(install_scripts) \ pyupstart.py \ tests/__init__.py \ tests/test_pyupstart_session_init.py \ tests/test_pyupstart_system_init.py dist_man_MANS = \ man/initctl2dot.8 \ man/init-checkconf.8 \ man/upstart-monitor.8 all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man8 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: $(am__recursive_targets) install-am install-exec-am \ install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-man8 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-hook uninstall-man uninstall-man8 pyupstartvars.py: Makefile echo "BUILT_UPSTART = '$(UPSTART_BINARY)'" > pyupstartvars.py.tmp echo "BUILT_INITCTL = '$(INITCTL_BINARY)'" >> pyupstartvars.py.tmp echo "BUILT_FILE_BRIDGE = '$(FILE_BRIDGE_BINARY)'" >> pyupstartvars.py.tmp mv pyupstartvars.py.tmp pyupstartvars.py install-exec-hook: $(install_scripts) [ ! -d "$(DESTDIR)/$(bindir)" ] && mkdir -p "$(DESTDIR)/$(bindir)"; \ for file in $(install_scripts); do \ from=`echo "$$file" | sed '$(transform)'`; \ to=`basename $$from | cut -d. -f1`; \ echo " cp '$(srcdir)/$$from' '$(DESTDIR)$(bindir)/$$to'"; \ cp "$(srcdir)/$$from" "$(DESTDIR)$(bindir)/$$to"; \ done uninstall-hook: for file in $(install_scripts); do \ inst=`basename $$file | cut -d. -f1`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$inst'"; \ rm -f "$(DESTDIR)$(bindir)/$$inst"; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/scripts/Makefile.am0000664000175000017500000000273512373101356013756 00000000000000## Process this file with automake to produce Makefile.in UPSTART_BINARY = $(abs_top_builddir)/init/init INITCTL_BINARY = $(abs_top_builddir)/util/initctl FILE_BRIDGE_BINARY = $(abs_top_builddir)/extra/upstart-file-bridge SUBDIRS = data install_scripts = \ initctl2dot.py \ init-checkconf.sh \ upstart-monitor.py noinst_SCRIPTS = \ pyupstart.py \ pyupstartvars.py CLEANFILES = \ pyupstartvars.py pyupstartvars.py.tmp EXTRA_DIST = \ $(install_scripts) \ pyupstart.py \ tests/__init__.py \ tests/test_pyupstart_session_init.py \ tests/test_pyupstart_system_init.py pyupstartvars.py: Makefile echo "BUILT_UPSTART = '$(UPSTART_BINARY)'" > pyupstartvars.py.tmp echo "BUILT_INITCTL = '$(INITCTL_BINARY)'" >> pyupstartvars.py.tmp echo "BUILT_FILE_BRIDGE = '$(FILE_BRIDGE_BINARY)'" >> pyupstartvars.py.tmp mv pyupstartvars.py.tmp pyupstartvars.py dist_man_MANS = \ man/initctl2dot.8 \ man/init-checkconf.8 \ man/upstart-monitor.8 install-exec-hook: $(install_scripts) [ ! -d "$(DESTDIR)/$(bindir)" ] && mkdir -p "$(DESTDIR)/$(bindir)"; \ for file in $(install_scripts); do \ from=`echo "$$file" | sed '$(transform)'`; \ to=`basename $$from | cut -d. -f1`; \ echo " cp '$(srcdir)/$$from' '$(DESTDIR)$(bindir)/$$to'"; \ cp "$(srcdir)/$$from" "$(DESTDIR)$(bindir)/$$to"; \ done uninstall-hook: for file in $(install_scripts); do \ inst=`basename $$file | cut -d. -f1`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$inst'"; \ rm -f "$(DESTDIR)$(bindir)/$$inst"; \ done upstart-1.13.2/scripts/init-checkconf.sh0000664000175000017500000001540712373101356015142 00000000000000#!/bin/bash #--------------------------------------------------------------------- # Script to determine if specified config file is valid or not. # By default, two checks are performed: # # - Ensure Upstart can parse overall file successfully # - Ensure all script sections are parseable by shell # #--------------------------------------------------------------------- # # Copyright (C) 2011-2013 Canonical Ltd. # # Author: James Hunt # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # #--------------------------------------------------------------------- script_name=${0##*/} confdir=$(mktemp -d /tmp/${script_name}.XXXXXXXXXX) xdg_runtime_dir=$(mktemp -d /tmp/${script_name}.XXXXXXXXXX) upstart_path=/sbin/init initctl_path=/sbin/initctl debug_enabled=n file_valid=n running=n set_session=n check_scripts=y cleanup() { # Restore [ -n "$saved_xdg_runtime_dir" ] && \ debug "Restoring XDG_RUNTIME_DIR to '$saved_xdg_runtime_dir'" export XDG_RUNTIME_DIR="$saved_xdg_runtime_dir" [ -n "$saved_upstart_session" ] && \ debug "Restoring UPSTART_SESSION to '$saved_upstart_session'" export UPSTART_SESSION="$saved_upstart_session" if [ ! -z "$upstart_pid" ] then debug "Stopping secondary Upstart (running with PID $upstart_pid)" kill -9 "$upstart_pid" >/dev/null 2>&1 fi [ -d "$confdir" ] && rm -rf "$confdir" dir="$xdg_runtime_dir/upstart/sessions" [ -d "$dir" ] && rm -rf "$xdg_runtime_dir" [ "$file_valid" = y ] && exit 0 exit 1 } usage() { cat < $script_name [options] Options: -d, --debug : Show some debug output. -f , : Job configuration file to check. --file= (no default). -i , : Specify path to initctl binary --initctl-path= (default=$initctl_path). -s, --noscript : Do not check script sections. -x : Specify path to init daemon binary --upstart-path= (default=$upstart_path). -h, --help : Show this help. EOT } debug() { msg="$*" [ $debug_enabled = y ] && echo "DEBUG: $msg" } error() { msg="$*" printf "ERROR: %s\n" "$msg" >&2 } die() { error "$*" exit 1 } # Return 0 if Upstart is running, else 1 upstart_running() { initctl --user version >/dev/null 2>&1 } trap cleanup EXIT INT TERM args=$(getopt \ -n "$script_name" \ -a \ --options="df:hi:sx:" \ --longoptions="debug file: help initctl-path: noscript upstart-path:" \ -- "$@") eval set -- "$args" [ $? -ne 0 ] && { usage; exit 1; } [ $# -eq 0 ] && { usage; exit 0; } while [ $# -gt 0 ] do case "$1" in -d|--debug) debug_enabled=y ;; -f|--file) file="$2" shift ;; -h|--help) usage exit 0 ;; -i|--initctl-path) initctl_path="$2" shift ;; -s|--noscript) check_scripts=n ;; -x|--upstart-path) upstart_path="$2" shift ;; --) shift break ;; esac shift done [ -z "$file" ] && file="$1" [ -z "$file" ] && die "Must specify configuration file" [ ! -f "$file" ] && die "File $file does not exist" debug "upstart_path=$upstart_path" debug "initctl_path=$initctl_path" for cmd in "$upstart_path" "$initctl_path" do [ -f "$cmd" ] || die "Path $cmd does not exist" [ -x "$cmd" ] || die "File $cmd not executable" "$cmd" --help | grep -q -- --user || die "version of $cmd too old" done export saved_xdg_runtime_dir="$XDG_RUNTIME_DIR" debug "Setting XDG_RUNTIME_DIR='$xdg_runtime_dir'" export XDG_RUNTIME_DIR="$xdg_runtime_dir" export saved_upstart_session="$UPSTART_SESSION" [ -n "$UPSTART_SESSION" ] \ && debug "Unsetting UPSTART_SESSION ($UPSTART_SESSION)" \ && unset UPSTART_SESSION # this is the only safe way to run another instance of Upstart "$upstart_path" --help|grep -q -- --no-startup-event || die "$upstart_path too old" debug "confdir=$confdir" debug "file=$file" filename=$(basename $file) echo "$filename" | egrep -q '\.conf$' || die "File must end in .conf" job="${filename%.conf}" cp "$file" "$confdir" || die "Failed to copy file $file to $confdir" debug "job=$job" upstart_out="$(mktemp --tmpdir "${script_name}-upstart-output.XXXXXXXXXX")" debug "upstart_out=$upstart_out" upstart_cmd=$(printf \ "%s --user --no-dbus --no-startup-event --verbose --confdir %s" \ "$upstart_path" \ "$confdir") debug "upstart_cmd=$upstart_cmd" nohup $upstart_cmd >"$upstart_out" 2>&1 & upstart_pid=$! debug "Upstart pid=$upstart_pid" # Stop the shell outputting a message when Upstart is killed. # We handle this ourselves in cleanup(). disown # wait for Upstart to initialise for i in $(seq 1 5) do sessions=$("$initctl_path" list-sessions) if [ "$set_session" = n ] && [ -n "$sessions" ] then count=$(echo "$sessions"|wc -l) [ "$count" -gt 1 ] && die "Got unexpected session count: $count" session=$(echo "$sessions"|awk '{print $2}') debug "Joining Upstart session '$session'" export UPSTART_SESSION="$session" set_session=y fi debug "Waiting for Upstart to initialise (attempt $i)" upstart_running if [ $? -eq 0 ] then running=y break fi sleep 1 done [ $running = n ] && die "Failed to ask Upstart to check conf file" debug "Secondary Upstart ($upstart_cmd) running with PID $upstart_pid" if [ "$check_scripts" = y ] then for section in pre-start post-start script pre-stop post-stop do if egrep -q "\<${section}\>" "$file" then cmd='sed -n "/^ *${section}/,/^ *end script/p" $file | /bin/sh -n 2>&1' errors=$(eval "$cmd") [ $? -ne 0 ] && \ die "$(printf "File $file: shell syntax invalid in $section section:\n${errors}")" fi done fi "$initctl_path" --user list|grep -q "^${job}" if [ $? -eq 0 ] then file_valid=y echo "File $file: syntax ok" exit 0 fi errors=$(grep "$job" "$upstart_out"|sed "s,${confdir}/,,g") die "$(printf "File $file: syntax invalid:\n${errors}")" upstart-1.13.2/scripts/tests/0000775000175000017500000000000012402042421013123 500000000000000upstart-1.13.2/scripts/tests/__init__.py0000664000175000017500000000000012373101356015154 00000000000000upstart-1.13.2/scripts/tests/test_pyupstart_system_init.py0000775000175000017500000001460412373101356021200 00000000000000#!/usr/bin/python3 # -*- coding: utf-8 -*- #--------------------------------------------------------------------- # Copyright © 2013 Canonical Ltd. # # Author: James Hunt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #--------------------------------------------------------------------- #--------------------------------------------------------------------- # Description: System-level Upstart tests for the pyupstart module. # # Notes: Can only be run as the root user. #--------------------------------------------------------------------- import os import sys base_dir = os.path.abspath(os.path.dirname(__file__)) module_dir = os.path.normpath(os.path.realpath(base_dir + os.sep + '..')) # top-level unpacked source directory top_srcdir = os.path.normpath(os.path.realpath(module_dir + os.sep + '..')) # Tell Python where the uninstalled module lives in the source tree sys.path.append(module_dir) from pyupstart import * import unittest class TestSystemUpstart(unittest.TestCase): def setUp(self): if os.geteuid(): raise unittest.SkipTest('Need root for System-level Upstart tests') # Tests must not operate within a session self.assertEqual(None, os.environ.get('UPSTART_SESSION', None)) self.upstart = SystemInit() def tearDown(self): # Ensure no state file exists state_file = '{}{}{}'.format(SYSTEM_LOG_DIR, os.sep, UPSTART_STATE_FILE) self.assertFalse(os.path.exists(state_file)) class TestSystemInitReExec(TestSystemUpstart): def test_pid1_reexec(self): version = self.upstart.version() self.assertTrue(version) # Create an invalid job to ensure this causes no problems for # the re-exec. Note that we cannot use job_create() since # that validates the syntax of the .conf file). # # We create this file before any other to allow time for Upstart # to _attempt to parse it_ by the time the re-exec is initiated. invalid_conf = "{}/invalid.conf".format(self.upstart.test_dir) with open(invalid_conf, 'w', encoding='utf-8') as fh: print("invalid", file=fh) # create a job and start it, marking it such that the .conf file # will be retained when object becomes unusable (after re-exec). job = self.upstart.job_create('connected-job', ['exec upstart-udev-bridge', 'respawn'], retain=True) self.assertTrue(job) # Used when recreating the job conf_path = job.conffile inst = job.start() self.assertTrue(inst) pids = job.pids() self.assertEqual(len(pids), 1) pid = pids['main'] self.upstart.reexec() # PID 1 Upstart is now in the process of starting, but we need to # reconnect to it via D-Bus since it cannot yet retain client # connections. However, since the re-exec won't be instantaneous, # try a few times. self.upstart.polling_connect(force=True) # Since the parent job was created with 'retain', this is actually # a NOP but is added to denote that the old instance is dead. inst.destroy() # check that we can still operate on the re-exec'd Upstart version_postexec = self.upstart.version() self.assertTrue(version_postexec) self.assertEqual(version, version_postexec) # Ensure the job is still running with the same PID self.assertRaises(ProcessLookupError, os.kill, pid, 0) # XXX: The re-exec will have severed the D-Bus connection to # Upstart. Hence, revivify the job with some magic. job = self.upstart.job_recreate('connected-job', conf_path) self.assertTrue(job) # Recreate the instance inst = job.get_instance() self.assertTrue(inst) self.assertTrue(job.running('_')) pids = job.pids() self.assertEqual(len(pids), 1) self.assertTrue(pids['main']) # The pid _must_ have changed after a restart self.assertNotEqual(pid, pids['main']) job.stop() # Ensure the pid has gone with self.assertRaises(ProcessLookupError): os.kill(pid, 0) os.remove(invalid_conf) # Clean up self.upstart.destroy() class TestSystemInitChrootSession(TestSystemUpstart): CHROOT_ENVVAR = 'UPSTART_TEST_CHROOT_PATH' def test_chroot_session_reexec(self): chroot_path = os.environ.get(self.CHROOT_ENVVAR, None) if not chroot_path: raise unittest.SkipTest('{} variable not set'.format(self.CHROOT_ENVVAR)) # Ensure the chroot exists self.assertTrue(os.path.exists(chroot_path)) # Ensure Upstart is installed in the chroot chroot_initctl = '{}{}{}'.format(chroot_path, os.sep, get_initctl()) self.assertTrue(os.path.exists(chroot_initctl)) # No sessions should exist before the test starts self.assertFalse(self.upstart.sessions_exist()) # Create an Upstart chroot session by talking from the chroot # back to PID 1. ret = subprocess.call(['chroot', chroot_path, get_initctl(), 'list']) self.assertEqual(0, ret) # Ensure a session now exists self.assertTrue(self.upstart.sessions_exist()) # Restart self.upstart.reexec() # Ensure Upstart responds self.upstart.polling_connect(force=True) self.assertTrue(self.upstart.version()) def main(): kwargs = {} format = \ '%(asctime)s:' \ '%(filename)s:' \ '%(name)s:' \ '%(funcName)s:' \ '%(levelname)s:' \ '%(message)s' kwargs['format'] = format # We want to see what's happening kwargs['level'] = logging.DEBUG logging.basicConfig(**kwargs) unittest.main( testRunner=unittest.TextTestRunner( stream=sys.stdout, verbosity=2 ) ) sys.exit(0) if __name__ == '__main__': main() upstart-1.13.2/scripts/tests/test_pyupstart_session_init.py0000775000175000017500000004644612373101356021350 00000000000000#!/usr/bin/python3 # -*- coding: utf-8 -*- #--------------------------------------------------------------------- # Copyright 2013 Canonical Ltd. # # Author: James Hunt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #--------------------------------------------------------------------- #--------------------------------------------------------------------- # Description: Session-level Upstart tests for the pyupstart module. # # Notes: Should be run both as a non-privileged user and then again # as the root user; in both cases, an Upstart user session # will be created. #--------------------------------------------------------------------- import os import sys import re base_dir = os.path.abspath(os.path.dirname(__file__)) module_dir = os.path.normpath(os.path.realpath(base_dir + os.sep + '..')) # top-level unpacked source directory top_srcdir = os.path.normpath(os.path.realpath(module_dir + os.sep + '..')) bridge_session_conf_dir = top_srcdir + os.sep + 'extra/conf-session' # Tell Python where the uninstalled module lives in the source tree sys.path.append(module_dir) from pyupstart import * import unittest class TestSessionUpstart(unittest.TestCase): FILE_BRIDGE_CONF = 'upstart-file-bridge.conf' REEXEC_CONF = 're-exec.conf' PSCMD_FMT = 'ps --no-headers -p %d -o pid,comm,args' def setUp(self): # If this test is run as root, chances are that user won't have # an XDG_RUNTIME_DIR, so create a temporary one and set the # variable since this is required by the Session Init. xdg_runtime_dir = os.environ.get('XDG_RUNTIME_DIR', None) if not xdg_runtime_dir or not os.path.exists(xdg_runtime_dir): tmp_xdg_runtime_dir = tempfile.mkdtemp(prefix='tmp-xdg-runtime-dir') os.environ['XDG_RUNTIME_DIR'] = tmp_xdg_runtime_dir print('INFO: User has no XDG_RUNTIME_DIR so created one: {}'.format(tmp_xdg_runtime_dir)) self.file_bridge_conf = '{}{}{}'.format(bridge_session_conf_dir, os.sep, self.FILE_BRIDGE_CONF) self.reexec_conf = '{}{}{}'.format(bridge_session_conf_dir, os.sep, self.REEXEC_CONF) # Prefer to use the installed job files if available and the # appropriate environment variable is set since they are going # to be more current and appropriate for the environment under # test. if os.environ.get('UPSTART_TEST_USE_INSTALLED_CONF', None): tmp = '{}{}{}'.format(DEFAULT_SESSION_INSTALL_PATH, os.sep, self.FILE_BRIDGE_CONF) if os.path.exists(tmp): print('INFO: UPSTART_TEST_USE_INSTALLED_CONF set - using {} rather than {}'.format(tmp, self.file_bridge_conf)) self.file_bridge_conf = tmp tmp = '{}{}{}'.format(DEFAULT_SESSION_INSTALL_PATH, os.sep, self.REEXEC_CONF) if os.path.exists(tmp): print('INFO: UPSTART_TEST_USE_INSTALLED_CONF set - using {} rather than {}'.format(tmp, self.reexec_conf)) self.reexec_conf = tmp self.assertTrue(os.path.exists(self.file_bridge_conf)) self.assertTrue(os.path.exists(self.reexec_conf)) self.upstart = None self.logger = logging.getLogger(self.__class__.__name__) for cmd in get_init(), get_initctl(): if not os.path.exists(cmd): raise UpstartException('Command %s not found' % cmd) def tearDown(self): # Ensure no state file exists state_file = '{}{}{}'.format(self.log_dir, os.sep, UPSTART_STATE_FILE) self.assertFalse(os.path.exists(state_file)) def start_session_init(self): """ Start a Session Init. """ self.assertFalse(self.upstart) extra_args = ['--no-startup-event', '--debug'] self.upstart = \ SessionInit(extra=extra_args, capture=DEFAULT_LOGFILE) self.assertTrue(self.upstart) # save log location to allow it to be checked for state files at # the end of the tests (after the Upstart objects have been # destroyed). self.log_dir = self.upstart.log_dir # Check it's running os.kill(self.upstart.pid, 0) # Checks it responds self.assertTrue(self.upstart.version()) def stop_session_init(self): """ Stop a Session Init. """ self.assertTrue(self.upstart) pid = self.upstart.pid # Check it's running os.kill(pid, 0) self.upstart.destroy() self.assertRaises(ProcessLookupError, os.kill, pid, 0) self.upstart = None class TestFileBridge(TestSessionUpstart): def test_init_start_file_bridge(self): self.start_session_init() # Create upstart-file-bridge.conf # # Note that we do not use the bundled user job due to our # requirement for a different start condition and different # command options. cmd = '{} --daemon --user --debug'.format(get_file_bridge()) lines = """ start on startup stop on session-end emits file expect daemon respawn exec {} """.format(cmd) file_bridge = self.upstart.job_create('upstart-file-bridge', lines) self.assertTrue(file_bridge) file_bridge.start() pids = file_bridge.pids() self.assertEqual(len(pids.keys()), 1) for proc, pid in pids.items(): self.assertEqual(proc, 'main') self.assertIsInstance(pid, int) os.kill(pid, 0) target_dir = tempfile.mkdtemp() file = target_dir + os.sep + 'foo' dir = target_dir + os.sep + 'bar' # Create a job that makes use of the file event to watch a # file in a newly-created directory. file_msg = 'got file %s' % file lines = [] lines.append('start on file FILE=%s EVENT=create' % file) lines.append('exec echo %s' % file_msg) create_file_job = self.upstart.job_create('wait-for-file-creation', lines) self.assertTrue(create_file_job) # Create job that waits for a file modification lines = [] lines.append('start on file FILE=%s EVENT=modify' % file) lines.append('exec echo %s' % file_msg) modify_file_job = self.upstart.job_create('wait-for-file-modify', lines) self.assertTrue(modify_file_job) # Create another job that triggers when the same file is deleted lines = [] lines.append('start on file FILE=%s EVENT=delete' % file) lines.append('exec echo %s' % file_msg) delete_file_job = self.upstart.job_create('wait-for-file-deletion', lines) self.assertTrue(delete_file_job) # Create job that triggers on directory creation dir_msg = 'got directory %s' % dir lines = [] # XXX: note the trailing slash to force a directory watch lines.append('start on file FILE=%s/ EVENT=create' % dir) lines.append('exec echo %s' % dir_msg) create_dir_job = self.upstart.job_create('wait-for-dir-creation', lines) self.assertTrue(create_dir_job) # Create job that triggers on directory modification lines = [] # XXX: note the trailing slash to force a directory watch lines.append('start on file FILE=%s/ EVENT=modify' % dir) lines.append('exec echo %s' % dir_msg) modify_dir_job = self.upstart.job_create('wait-for-dir-modify', lines) self.assertTrue(modify_dir_job) # Create job that triggers on directory deletion lines = [] # XXX: note the trailing slash to force a directory watch lines.append('start on file FILE=%s/ EVENT=delete' % dir) lines.append('exec echo %s' % dir_msg) delete_dir_job = self.upstart.job_create('wait-for-dir-delete', lines) self.assertTrue(delete_dir_job) # Create empty file open(file, 'w').close() # Create directory os.mkdir(dir) # No need to start the jobs of course as the file-bridge handles that! # Identify full path to job logfiles create_file_job_logfile = create_file_job.logfile_name(dbus_encode('')) self.assertTrue(create_file_job_logfile) modify_file_job_logfile = modify_file_job.logfile_name(dbus_encode('')) self.assertTrue(modify_file_job_logfile) delete_file_job_logfile = delete_file_job.logfile_name(dbus_encode('')) self.assertTrue(delete_file_job_logfile) create_dir_job_logfile = create_dir_job.logfile_name(dbus_encode('')) self.assertTrue(create_dir_job_logfile) modify_dir_job_logfile = modify_dir_job.logfile_name(dbus_encode('')) self.assertTrue(modify_dir_job_logfile) delete_dir_job_logfile = delete_dir_job.logfile_name(dbus_encode('')) self.assertTrue(delete_dir_job_logfile) #-------------------- # Wait for the create file job to run and produce output self.assertTrue(wait_for_file(create_file_job_logfile)) # Check the output with open(create_file_job_logfile, 'r', encoding='utf-8') as f: lines = f.readlines() self.assertTrue(len(lines) == 1) self.assertEqual(file_msg, lines[0].rstrip()) #-------------------- # Wait for the create directory job to run and produce output self.assertTrue(wait_for_file(create_dir_job_logfile)) # Check the output with open(create_dir_job_logfile, 'r', encoding='utf-8') as f: lines = f.readlines() self.assertTrue(len(lines) == 1) self.assertEqual(dir_msg, lines[0].rstrip()) #-------------------- # Modify the file open(file, 'w').close() # Wait for the create file job to run and produce output self.assertTrue(wait_for_file(modify_file_job_logfile)) # Check the output with open(modify_file_job_logfile, 'r', encoding='utf-8') as f: lines = f.readlines() self.assertTrue(len(lines) == 1) self.assertEqual(file_msg, lines[0].rstrip()) #-------------------- # Modify the directory by creating a new file in it. dir_file = dir + os.sep + 'baz' open(dir_file, 'w').close() # Wait for the modify directory job to run and produce output self.assertTrue(wait_for_file(modify_dir_job_logfile)) # Check the output with open(modify_dir_job_logfile, 'r', encoding='utf-8') as f: lines = f.readlines() self.assertTrue(len(lines) == 1) self.assertEqual(dir_msg, lines[0].rstrip()) #-------------------- os.remove(dir_file) os.rmdir(dir) # Wait for the delete directory job to run and produce output self.assertTrue(wait_for_file(delete_dir_job_logfile)) # Check the output with open(delete_dir_job_logfile, 'r', encoding='utf-8') as f: lines = f.readlines() self.assertTrue(len(lines) == 1) self.assertEqual(dir_msg, lines[0].rstrip()) #-------------------- shutil.rmtree(target_dir) # Wait for the delete job to run and produce output self.assertTrue(wait_for_file(delete_file_job_logfile)) # Check the output with open(delete_file_job_logfile, 'r', encoding='utf-8') as f: lines = f.readlines() self.assertTrue(len(lines) == 1) self.assertEqual(file_msg, lines[0].rstrip()) #-------------------- os.remove(create_file_job_logfile) os.remove(modify_file_job_logfile) os.remove(delete_file_job_logfile) os.remove(create_dir_job_logfile) os.remove(modify_dir_job_logfile) os.remove(delete_dir_job_logfile) file_bridge.stop() self.stop_session_init() class TestSessionInitReExec(TestSessionUpstart): def test_session_init_reexec(self): self.start_session_init() self.assertTrue(self.upstart.pid) cmd = self.PSCMD_FMT % self.upstart.pid output = subprocess.getoutput(cmd) # Ensure no stateful-reexec already performed. self.assertFalse(re.search('state-fd', output)) version = self.upstart.version() self.assertTrue(version) # Create an invalid job to ensure this causes no problems for # the re-exec. Note that we cannot use job_create() since # that validates the syntax of the .conf file). # # We create this file before any other to allow time for Upstart # to _attempt to parse it_ by the time the re-exec is initiated. invalid_conf = "{}/invalid.conf".format(self.upstart.test_dir) with open(invalid_conf, 'w', encoding='utf-8') as fh: print("invalid", file=fh) # create a job and start it, marking it such that the .conf file # will be retained when object becomes unusable (after re-exec). job = self.upstart.job_create('sleeper', 'exec sleep 123', retain=True) self.assertTrue(job) # Used when recreating the job conf_path = job.conffile inst = job.start() self.assertTrue(inst) pids = job.pids() self.assertEqual(len(pids), 1) pid = pids['main'] # Trigger re-exec and catch the D-Bus exception resulting # from disconnection from Session Init when it severs client # connections. with self.assertRaises(dbus.exceptions.DBusException): self.upstart.reexec() os.kill(self.upstart.pid, 0) # SessionInit does not sanitise its command-line and will show # the fd used to read state from after a re-exec. output = subprocess.getoutput(cmd) result = re.search('--state-fd\s+(\d+)', output) self.assertTrue(result) # Upstart is now in the process of starting, but we need to # reconnect to it via D-Bus since it cannot yet retain # client connections. However, since the re-exec won't be # instantaneous, try a few times. self.upstart.polling_connect(force=True) # Since the parent job was created with 'retain', this is actually # a NOP but is added to denote that the old instance is dead. inst.destroy() # check that we can still operate on the re-exec'd Upstart version_postexec = self.upstart.version() self.assertTrue(version_postexec) self.assertEqual(version, version_postexec) # Ensure the job is still running with the same PID os.kill(pid, 0) # XXX: The re-exec will have severed the D-Bus connection to # Upstart. Hence, revivify the job with some magic. job = self.upstart.job_recreate('sleeper', conf_path) self.assertTrue(job) # Recreate the instance inst = job.get_instance() self.assertTrue(inst) self.assertTrue(job.running('_')) pids = job.pids() self.assertEqual(len(pids), 1) self.assertTrue(pids['main']) # The pid should not have changed after a restart self.assertEqual(pid, pids['main']) job.stop() # Ensure the pid has gone with self.assertRaises(ProcessLookupError): os.kill(pid, 0) os.remove(invalid_conf) self.stop_session_init() def test_session_init_reexec_when_pid1_does(self): timeout = 5 self.start_session_init() self.assertTrue(self.upstart.pid) # Create the REEXEC_CONF job in the correct test location by copying # the system-provided session job. with open(self.reexec_conf, 'r', encoding='utf-8') as f: lines = f.readlines() reexec_job = self.upstart.job_create('re-exec', lines) self.assertTrue(reexec_job) cmd = self.PSCMD_FMT % self.upstart.pid output = subprocess.getoutput(cmd) # Ensure no stateful-reexec already performed. self.assertFalse(re.search('state-fd', output)) # Simulate a PID 1 restart event. self.upstart.emit(':sys:restarted') # Wait for a reasonable period of time for the stateful re-exec # to occur. until = datetime.now() + timedelta(seconds=timeout) while datetime.now() < until: output = subprocess.getoutput(cmd) result = re.search('--state-fd\s+(\d+)', output) if result: break time.sleep(0.1) else: raise AssertionError('Failed to detect re-exec') # Upstart is now in the process of starting, but we need to # reconnect to it via D-Bus since it cannot yet retain # client connections. However, since the re-exec won't be # instantaneous, try a few times. self.upstart.polling_connect(force=True) # check that we can still operate on the re-exec'd Upstart self.assertTrue(self.upstart.version()) self.stop_session_init() class TestSessionInit(TestSessionUpstart): def test_session_init(self): self.start_session_init() job = self.upstart.job_create('zebra', 'exec sleep 999') self.assertTrue(job) inst = job.start() pids = job.pids() self.assertEqual(len(pids), 1) for key, value in pids.items(): self.assertEqual(key, 'main') self.assertTrue(isinstance(value, int)) # expected since there is only a single instance of the job self.assertEqual(inst.pids(), pids) inst.stop() self.stop_session_init() class TestState(TestSessionUpstart): def test_state(self): """ Create a job and perform some basics checks on Upstarts internal state for that job. """ self.start_session_init() job = self.upstart.job_create('foo', 'exec sleep 666') self.assertTrue(job) state = self.upstart.get_state() conf_sources = state['conf_sources'] self.assertTrue(conf_sources) self.assertTrue(len(conf_sources) == 1) conf_files = conf_sources[0]['conf_files'] self.assertTrue(conf_files) self.assertTrue(len(conf_files) == 1) conf_file = conf_files[0] self.assertTrue(conf_file) path = conf_file['path'] self.assertTrue(path) full_job_path = '{}{}{}.conf'.format(job.job_dir, os.sep, job.name) self.assertEqual(path, full_job_path) self.stop_session_init() def main(): kwargs = {} format = \ '%(asctime)s:' \ '%(filename)s:' \ '%(name)s:' \ '%(funcName)s:' \ '%(levelname)s:' \ '%(message)s' kwargs['format'] = format # We want to see what's happening kwargs['level'] = logging.DEBUG logging.basicConfig(**kwargs) unittest.main( testRunner=unittest.TextTestRunner( stream=sys.stdout, verbosity=2 ) ) sys.exit(0) if __name__ == '__main__': main() upstart-1.13.2/scripts/upstart-monitor.py0000775000175000017500000005150712373101356015467 00000000000000#!/usr/bin/python3 # -*- coding: utf-8 -*- # vim: set fileencoding=utf-8 #--------------------------------------------------------------------- # Copyright © 2013 Canonical Ltd. # # Author: James Hunt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #--------------------------------------------------------------------- # TODO: # # - misc # - handle_clear_data() default message should use gettext # - gui # - Gtk.STOCK_MEDIA_PLAY toggle # - menus # - Edit->Copy # - Edit->Select # - Edit->Select All # - Edit->Copy All # - Connection # - Choose from 4 connection types. # - View # - Show/Hide index+time columns # - Pause of auto-scroll #--------------------------------------------------------------------- import os import sys import gettext from gettext import gettext as _ import argparse import signal import dbus import dbus.mainloop.glib from datetime import datetime VERSION = 0.1 COPYRIGHT = 'Copyright © 2013 Canonical Ltd.' DESCRIPTION = 'Simple Upstart Event Monitor' NAME = 'upstart-monitor' AUTHORS = [ 'James Hunt ' ] WEBSITE = 'http://upstart.ubuntu.com' cli = False try: from gi.repository import Gtk, Gdk, GLib except ImportError: gettext.install(NAME) print("%s: %s" % (_('WARNING'), _('GUI modules not available - falling back to CLI')), file=sys.stderr) cli = True """ Simple command-line and GUI event monitor for Upstart. """ # If this file does not exist or is not readable... LICENSE_FILE = 'aa/usr/share/common-licenses/GPL-2' # ... display this text instead. LICENSE = """ http://www.gnu.org/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. """ #------------------------------ DEFAULT_WIN_SIZE_WIDTH = 600 DEFAULT_WIN_SIZE_HEIGHT = 200 DEFAULT_LOGO_SIZE_WIDTH = 150 DEFAULT_LOGO_SIZE_HEIGHT = 150 DEFAULT_OUTPUT_FILE = 'upstart-events.txt' # key=type : value=description destinations = \ { 'system-bus' : 'D-Bus system bus', 'session-bus' : 'D-Bus session bus', 'system-socket' : 'D-Bus system socket', 'session-socket' : 'D-Bus session socket' } #------------------------------ # well-known address for Upstart running as PID 1 INIT_SOCKET = 'unix:abstract=/com/ubuntu/upstart' # Address of Session Inits private socket SESSION_SOCKET = os.environ.get('UPSTART_SESSION') UI_INFO = """ """ def format_event(*args): """ Format raw D-Bus event details. Returns: event and quoted event environment tuple. """ quoted_env = [] event = args[0] # unfortunately, quotes are stripped so they need to be re-added # to preserve whitespace in the environment variable values. raw_env = args[1] for e in raw_env: f = e.split('=') quoted_env.append("%s='%s'" % (f[0], ''.join(f[1:]))) env = ' '.join(str(e) for e in quoted_env) return event, env def cmdline_event_handler(*args): """ format event data for command-line display """ global cmdline_args event, env = format_event(*args) now = datetime.now().strftime("%F %T.%f") event_str = "%s %s" % (event, env) if env else event sep = cmdline_args.separator if cmdline_args.separator else "\t" print("%s%s%s" % (now, sep, event_str)) class UpstartEventsGui(Gtk.Window): """ GUI Upstart Event monitor. """ global bus global cmdline_args def add_row(self, event, event_env): """ Add new row to view. """ self.data_index += 1 now = datetime.now().strftime("%F %T.%f") event_str = "%s %s" % (event, event_env) if event_env else event row = [self.data_index, now, event_str] self.liststore.append(row) def event_handler(self, *args): """ Upstart has emitted an event so create a new row in the view. """ event, env = format_event(*args) self.add_row(event, env) # New data arrived since last save (if any). self.need_save = True def register_cb(self): """ Callback to register a D-Bus callback whenever Upstart emits an event. """ # register a D-Bus handler bus.add_signal_receiver(self.event_handler, dbus_interface='com.ubuntu.Upstart0_6', signal_name="EventEmitted") # deregister this callback return False def treeview_changed(self, widget, event, data=None): """ Allow GUI to auto-scroll. """ adj = self.scrolled_window.get_vadjustment() adj.set_value(adj.get_upper() - adj.get_page_size()) def ask_question(self, msg): """ Ask a question. @msg: message to display. Returns: True if user answered positively, else False. """ dialog = Gtk.MessageDialog(self, Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, msg) response = dialog.run() dialog.destroy() return True if response == Gtk.ResponseType.YES else False def show_dialog(self, msg): """ Display an "ok" dialog which the user must click. @msg: message to display. """ dialog = Gtk.MessageDialog(self, Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, msg) dialog.run() dialog.destroy() def show_about(self): """ Show an About dialog. """ about = Gtk.AboutDialog() about.set_program_name(NAME) about.set_version("%s %s" % (_('Version'), VERSION)) about.set_copyright(COPYRIGHT) about.set_comments(DESCRIPTION) about.set_authors(AUTHORS) about.set_website(WEBSITE) try: with open(LICENSE_FILE, 'r') as f: license = f.read() except IOError: license = LICENSE about.set_license(license) about.set_logo(self.icon_pixbuf) about.run() about.destroy() def on_button_clear_clicked(self, widget): """ Clear cached event data (also clears GUI window). """ if self.handle_clear_data(): self.liststore.clear() self.data_index = 1 self.need_save = False def on_button_pause_clicked(self, widget): """ Toggle auto-scroll. """ if self.auto_scroll: self.treeview.disconnect(self.auto_scroll_handler) self.auto_scroll = False else: self.auto_scroll_handler = \ self.treeview.connect('size-allocate', self.treeview_changed) self.auto_scroll = True def save_data(self, path): """ Write received event data to specified path. """ try: fh = open(path, 'w') except IOError: self.show_dialog('%s: %s' % (_('Error saving file'), path)) for row in self.liststore: fh.write("%d\t%s\t%s\n" % (row[0], row[1], row[2])) fh.close() # All data was written self.need_save = False def handle_save(self, filename=None): """ Display a file chooser dialog to allow user to select a filename to hold the cached event data. """ # no data yet if not len(self.liststore): self.show_dialog(_('No events to save')) return if filename != None: path = filename self.save_data(path) return file_chooser = Gtk.FileChooserDialog(_('Save File'), self.get_toplevel(), Gtk.FileChooserAction.SAVE, (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_SAVE, Gtk.ResponseType.ACCEPT)) file_chooser.set_current_name(DEFAULT_OUTPUT_FILE) response = file_chooser.run() if response != Gtk.ResponseType.ACCEPT: file_chooser.destroy() return path = file_chooser.get_filename() self.save_data(path) file_chooser.destroy() def handle_quit(self): """ Quit application; if unsaved data exists, prompt user. """ if self.handle_clear_data('Quit without saving?'): Gtk.main_quit() def on_button_quit_clicked(self, widget): """ Handle quit request. """ self.handle_quit() def on_button_save_clicked(self, widget): """ Handle save request. """ self.handle_save() # FIXME: default message should use gettext def handle_clear_data(self, message='Clear data without saving?'): """ Handle potentially clearing of cached events. Returns: True if user is happy to clear the data, else False. """ if len(self.liststore) and self.need_save: answer = self.ask_question(message) return answer else: # no data would be lost so allow action return True def activate_action(self, action, user_data=None): """ Main menu-callback-handling method. """ name = action.get_name() if name == 'FileNew': if self.handle_clear_data(): self.liststore.clear() self.data_index = 1 self.need_save = False elif name == 'FileSave': self.handle_save(DEFAULT_OUTPUT_FILE) elif name == 'FileSaveAs': self.handle_save() elif name == 'FileQuit': self.handle_quit() elif name == 'HelpAbout': self.show_about() elif name == 'ContextCopy': # Save event details from cell text to clipboard clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) clipboard.set_text(self.context_value, -1) def create_ui_manager(self): """ Errrm... create the UI Manager. """ ui_manager = Gtk.UIManager() # Throws exception if something went wrong ui_manager.add_ui_from_string(UI_INFO) # Add the accelerator group to the toplevel window accelgroup = ui_manager.get_accel_group() self.add_accel_group(accelgroup) return ui_manager def on_button_press_event(self, treeview, event): """ Handle mouse button press events. """ if event.type == Gdk.EventType.BUTTON_PRESS and event.button == 3: x = int(event.x) y = int(event.y) path_info = treeview.get_path_at_pos(x, y) if not path_info: return path, col, cell_x, cell_y = path_info model = treeview.get_model() model_iter = model.get_iter(path) # Save the event details from the selected cell # (event is 3rd column (zero-indexed)). self.context_value = model.get_value (model_iter, 2) treeview.grab_focus() treeview.set_cursor(path, col, 0) # Display context menu self.popup.popup(None, None, None, None, event.button, event.time) return True def __init__(self): """ Setup. """ Gtk.Window.__init__(self, title=DESCRIPTION) main_menu_action_entries = ( ('FileMenu', None, 'File'), ('FileNew', Gtk.STOCK_NEW, 'New', 'N', _('Clear events'), self.activate_action), ('FileSave', Gtk.STOCK_SAVE, 'Save', 'S', _('Save events to default file'), self.activate_action), ('FileSaveAs', Gtk.STOCK_SAVE_AS, 'Save As', None, _('Save events to specified file'), self.activate_action), ('FileQuit', Gtk.STOCK_QUIT, 'Quit', 'Q', _('Exit application'), self.activate_action), ('HelpMenu', None, 'Help'), ('HelpAbout', Gtk.STOCK_HELP, 'About', 'A', _('Application details'), self.activate_action), ) context_menu_action_entries = ( ('ContextCopy', Gtk.STOCK_COPY, 'Copy', 'C', _('Copy'), self.activate_action), ) self.auto_scroll = True self.need_save = False # value of cell containing event details that user has # right-clicked over self.context_value = None self.data_index = 0 self.set_default_size(DEFAULT_WIN_SIZE_WIDTH, DEFAULT_WIN_SIZE_HEIGHT) self.set_resizable(True) theme = Gtk.IconTheme.get_default() self.icon_pixbuf = theme.load_icon(NAME, 128, Gtk.IconLookupFlags.GENERIC_FALLBACK) self.set_icon(self.icon_pixbuf) action_group = Gtk.ActionGroup('UpstartMonitorActions') action_group.add_actions(main_menu_action_entries) action_group.add_actions(context_menu_action_entries) ui_manager = self.create_ui_manager() ui_manager.insert_action_group(action_group) menubar = ui_manager.get_widget("/MenuBar") # data types we'll be using in each column self.liststore = Gtk.ListStore(int, str, str) GLib.idle_add(self.register_cb) self.box = Gtk.Box(spacing=6, orientation=Gtk.Orientation.VERTICAL) self.scrolled_window = Gtk.ScrolledWindow() self.scrolled_window.set_policy(Gtk.PolicyType.ALWAYS, Gtk.PolicyType.ALWAYS) self.treeview = Gtk.TreeView(model=self.liststore) # columns are zero-based self.treeview.set_search_column(2) self.treeview.set_headers_clickable(True) if self.auto_scroll: self.auto_scroll_handler = \ self.treeview.connect('size-allocate', self.treeview_changed) renderer_text = Gtk.CellRendererText() # XXX: mark column as editable, but do NOT connect the 'edited' # signal. This allows the user to select the text and copy it, # but they cannot modify it. renderer_editabletext = Gtk.CellRendererText() renderer_editabletext.set_property('editable', True) column_index = Gtk.TreeViewColumn(_('Index'), renderer_text, text=0) column_index.set_resizable(True) self.treeview.append_column(column_index) column_time = Gtk.TreeViewColumn(_('Time'), renderer_text, text=1) column_time.set_resizable(True) self.treeview.append_column(column_time) column_event = Gtk.TreeViewColumn(_('Event and environment'), renderer_editabletext, text=2) column_event.set_resizable(True) self.popup = ui_manager.get_widget("/ContextMenu") self.treeview.connect('button-press-event', self.on_button_press_event) self.treeview.append_column(column_event) # stops column titles from scrolling along with the data self.scrolled_window.add(self.treeview) self.button_clear = Gtk.Button(stock=Gtk.STOCK_CLEAR) self.button_clear.connect('clicked', self.on_button_clear_clicked) # FIXME: toggle to Gtk.STOCK_MEDIA_PLAY self.button_pause = Gtk.Button(stock=Gtk.STOCK_MEDIA_PAUSE) self.button_pause.connect('clicked', self.on_button_pause_clicked) self.button_save = Gtk.Button(stock=Gtk.STOCK_SAVE) self.button_save.connect('clicked', self.on_button_save_clicked) self.button_quit = Gtk.Button(stock=Gtk.STOCK_QUIT) self.button_quit.connect('clicked', self.on_button_quit_clicked) self.label_connected = Gtk.Label('%s %s' % (_('Connected to'), destinations[cmdline_args.destination])) self.label_connected.set_justify(Gtk.Justification.RIGHT) self.buttons_box = Gtk.Box(spacing=6, orientation=Gtk.Orientation.HORIZONTAL) self.buttons_box.pack_start(self.button_clear, False, True, 0) self.buttons_box.pack_start(self.button_pause, False, True, 0) self.buttons_box.pack_start(self.button_save, False, True, 0) self.buttons_box.pack_start(self.button_quit, False, True, 0) self.buttons_box.pack_start(self.label_connected, True, True, 0) self.box.pack_start(menubar, False, False, 0) self.box.pack_start(self.scrolled_window, True, True, 0) self.box.pack_end(self.buttons_box, False, False, 0) self.add(self.box) def text_edited(self, widget, path, text): self.liststore[path][1] = text def main(): """ Parse arguments and run either the command-line or the GUI monitor. """ global bus global cmdline_args global cli gettext.install(NAME) parser = argparse.ArgumentParser(description=_('Upstart Event Monitor')) parser.add_argument('-n', '--no-gui', action='store_true', help=_('run in command-line mode')) parser.add_argument('-s', '--separator', help=_('field separator to use for command-line output')) parser.add_argument('-d', '--destination', choices=destinations.keys(), help=_('connect to Upstart via specified D-Bus route')) cmdline_args = parser.parse_args() # allow interrupt signal.signal(signal.SIGINT, signal.SIG_DFL) dbus.set_default_main_loop(dbus.mainloop.glib.DBusGMainLoop()) if not cmdline_args.destination: # If no destination specified, attempt to connect to session # if running under a Session Init, else connect to the system # bus (since this allows even non-priv users to see events). if SESSION_SOCKET: cmdline_args.destination = 'session-socket' else: cmdline_args.destination = 'system-bus' if cmdline_args.destination == 'system-bus': bus = dbus.SystemBus() elif cmdline_args.destination == 'session-bus': bus = dbus.SessionBus() elif cmdline_args.destination == 'system-socket': socket = INIT_SOCKET bus = dbus.connection.Connection(socket) elif cmdline_args.destination == 'session-socket': socket = SESSION_SOCKET bus = dbus.connection.Connection(socket) if cmdline_args.no_gui or not os.environ.get('DISPLAY'): cli = True # dynamically load GUI elements so we can fall back to the # command-line version if we cannot display a GUI if cli == True: # register a D-Bus handler bus.add_signal_receiver(cmdline_event_handler, dbus_interface='com.ubuntu.Upstart0_6', signal_name='EventEmitted') loop = GLib.MainLoop() print('# Upstart Event Monitor (%s)' % _('console mode')) print('#') print('# %s %s' % (_('Connected to'), destinations[cmdline_args.destination])) print('#') print('# %s' % _('Columns: time, event and environment')) print('') loop.run() else: win = UpstartEventsGui() win.connect('delete-event', Gtk.main_quit) win.show_all() Gtk.main() if __name__ == '__main__': # Allow _() to be called from this point onwards gettext.install(NAME) main() upstart-1.13.2/scripts/initctl2dot.py0000775000175000017500000004444512373101356014542 00000000000000#!/usr/bin/python3 # -*- coding: utf-8 -*- #--------------------------------------------------------------------- # # Copyright © 2011 Canonical Ltd. # # Author: James Hunt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #--------------------------------------------------------------------- #--------------------------------------------------------------------- # Script to take output of "initctl show-config -e" and convert it into # a Graphviz DOT language (".dot") file for procesing with dot(1), etc. # # Notes: # # - Slightly laborious logic used to satisfy graphviz requirement that # all nodes be defined before being referenced. # # Usage: # # initctl show-config -e > initctl.out # initctl2dot -f initctl.out -o upstart.dot # dot -Tpng -o upstart.png upstart.dot # # Or more simply: # # initctl2dot -o - | dot -Tpng -o upstart.png # # See also: # # - dot(1). # - initctl(8). # - http://www.graphviz.org. #--------------------------------------------------------------------- import sys import re import fnmatch import os import datetime from subprocess import Popen, PIPE from argparse import ArgumentParser options = None jobs = {} events = {} script_name = os.path.basename(sys.argv[0]) cmd = None use_system = True upstart_session = None # list of jobs to restict output to restrictions_list = [] sanitise_table = str.maketrans({ '-': '_', '$': 'dollar_', '[': 'lbracker', ']': 'rbracker', '!': 'bang', ':': 'colon', '*': 'star', '?': 'question', '.': 'dot', '/': 'slash', }) default_color_emits = 'green' default_color_start_on = 'blue' default_color_stop_on = 'red' default_color_event = 'thistle' default_color_job = '#DCDCDC' # "Gainsboro" default_color_text = 'black' default_color_bg = 'white' default_outfile = 'upstart.dot' def header(ofh): ofh.write("""digraph upstart {{ node [shape=\"diamond\", fontcolor=\"{options.color_event_text}\", """ """fillcolor=\"{options.color_event}\", style=\"filled\"]; rankdir=LR; overlap=false; bgcolor=\"{options.color_bg}\"; fontcolor=\"{options.color_text}\"; """.format(options=options)) def footer(ofh): global upstart_session global use_system details = '' if use_system: details += "\\nfor the system\\n" else: details += "\\nfor session '%s'\\n" % upstart_session if options.restrictions: details += "(subset, " else: details += "(" if options.infile: details += "from file data)." else: details += "from '%s' on host %s)." % (cmd, os.uname()[1]) ofh.write(" overlap=false;\n" " label=\"Generated on {datenow} by {script_name} {details}\\n" "Boxes of color {options.color_job} denote jobs.\\n" "Solid diamonds of color {options.color_event} denote events.\\n" "Dotted diamons denote 'glob' events.\\n" "Emits denoted by {options.color_emits} lines.\\n" "Start on denoted by {options.color_start_on} lines.\\n" "Stop on denoted by {options.color_stop_on} lines.\\n" "\";\n" "}}\n".format(options=options, datenow=datetime.datetime.now(), script_name=script_name, details=details)) # Map punctuation to symbols palatable to graphviz # (which amongst other things dislikes dashes in node names) def sanitise(s): global sanitise_table return s.translate(sanitise_table) # Convert a dollar in @name to a unique-ish new name, based on @job and # return it. Used for very rudimentary instance handling. def encode_dollar(job, name): if name[0] == '$': name = job + ':' + name return name # Jobs and events can have identical names, so prefix them to namespace # them off. def mk_job_node_name(name): return sanitise('job_' + name) def mk_event_node_name(name): return sanitise('event_' + name) def show_event(ofh, name): str = " %s [label=\"%s\", shape=diamond, fontcolor=\"%s\", " \ "fillcolor=\"%s\"," % (mk_event_node_name(name), name, options.color_event_text, options.color_event) if '*' in name: str += " style=\"dotted\"" else: str += " style=\"filled\"" str += "];\n" ofh.write(str) def show_events(ofh): events_to_show = [] if restrictions_list: for job in restrictions_list: # We want all events emitted by the jobs in the restrictions_list. events_to_show += jobs[job]['emits'] # We also want all events that jobs in restrictions_list start/stop # on. events_to_show += jobs[job]['start on']['event'] events_to_show += jobs[job]['stop on']['event'] # We also want all events emitted by all jobs that jobs in the # restrictions_list start/stop on. Finally, we want all events # emmitted by those jobs in the restrictions_list that we # start/stop on. for j in jobs[job]['start on']['job']: if j in jobs and 'emits' in jobs[j]: events_to_show += jobs[j]['emits'] for j in jobs[job]['stop on']['job']: if j in jobs and 'emits' in jobs[j]: events_to_show += jobs[j]['emits'] else: events_to_show = events for e in events_to_show: show_event(ofh, e) def show_job(ofh, name): ofh.write(" %s [shape=\"record\", label=\" %s | { start on |" " stop on }\", fontcolor=\"%s\", style=\"filled\", " " fillcolor=\"%s\"];\n" % (mk_job_node_name(name), name, options.color_job_text, options.color_job)) def show_jobs(ofh): if restrictions_list: jobs_to_show = restrictions_list else: jobs_to_show = jobs for j in jobs_to_show: show_job(ofh, j) # add those jobs which are referenced by existing jobs, but which # might not be available as .conf files. For example, plymouth.conf # references gdm *or* kdm, but you are unlikely to have both # installed. for s in jobs[j]['start on']['job']: if s not in jobs_to_show: show_job(ofh, s) for s in jobs[j]['stop on']['job']: if s not in jobs_to_show: show_job(ofh, s) # Having displayed the jobs in restrictions_list, # we now need to display all jobs that *those* jobs # start on/stop on. for j in restrictions_list: for job in jobs[j]['start on']['job']: show_job(ofh, job) for job in jobs[j]['stop on']['job']: show_job(ofh, job) # Finally, show all jobs which emit events that jobs in the # restrictions_list care about. for j in restrictions_list: for e in jobs[j]['start on']['event']: for k in jobs: if e in jobs[k]['emits']: show_job(ofh, k) for e in jobs[j]['stop on']['event']: for k in jobs: if e in jobs[k]['emits']: show_job(ofh, k) def show_edge(ofh, from_node, to_node, color): ofh.write(" %s -> %s [color=\"%s\"];\n" % (from_node, to_node, color)) def show_start_on_job_edge(ofh, from_job, to_job, relation): if relation == 'starting': show_edge(ofh, "%s:start" % mk_job_node_name(from_job), "%s:job" % mk_job_node_name(to_job),options.color_start_on) else: show_edge(ofh, "%s:job" % mk_job_node_name(to_job), "%s:start" % mk_job_node_name(from_job), options.color_start_on) def show_start_on_event_edge(ofh, from_job, to_event): show_edge(ofh, mk_event_node_name(to_event), "%s:start" % mk_job_node_name(from_job), options.color_start_on) def show_stop_on_job_edge(ofh, from_job, to_job): show_edge(ofh, "%s:job" % mk_job_node_name(to_job), "%s:stop" % mk_job_node_name(from_job), options.color_stop_on) def show_stop_on_event_edge(ofh, from_job, to_event): show_edge(ofh, mk_event_node_name(to_event), "%s:stop" % mk_job_node_name(from_job), options.color_stop_on) def show_job_emits_edge(ofh, from_job, to_event): show_edge(ofh, "%s:job" % mk_job_node_name(from_job), mk_event_node_name(to_event), options.color_emits) def show_edges(ofh): glob_jobs = {} if restrictions_list: jobs_list = restrictions_list else: jobs_list = jobs for job in jobs_list: for s in jobs[job]['start on']['job']: show_start_on_job_edge(ofh, job, s, jobs[job]['start on']['job'][s]) for s in jobs[job]['start on']['event']: show_start_on_event_edge(ofh, job, s) for s in jobs[job]['stop on']['job']: show_stop_on_job_edge(ofh, job, s) for s in jobs[job]['stop on']['event']: show_stop_on_event_edge(ofh, job, s) for e in jobs[job]['emits']: if '*' in e: # handle glob patterns in 'emits' glob_events = [] for _e in events: if e != _e and fnmatch.fnmatch(_e, e): glob_events.append(_e) glob_jobs[job] = glob_events show_job_emits_edge(ofh, job, e) if not restrictions_list: continue # Add links to events emitted by all jobs which current job # start/stops on for j in jobs[job]['start on']['job']: if j not in jobs: continue for e in jobs[j]['emits']: show_job_emits_edge(ofh, j, e) for j in jobs[job]['stop on']['job']: for e in jobs[j]['emits']: show_job_emits_edge(ofh, j, e) # Create links from jobs (which advertise they emits a class of # events, via the glob syntax) to all the events they create. for g in glob_jobs: for ge in glob_jobs[g]: show_job_emits_edge(ofh, g, ge) if not restrictions_list: return # Add jobs->event links to jobs which emit events that current job # start/stops on. for j in restrictions_list: for e in jobs[j]['start on']['event']: for k in jobs: if e in jobs[k]['emits'] and e not in restrictions_list: show_job_emits_edge(ofh, k, e) for e in jobs[j]['stop on']['event']: for k in jobs: if e in jobs[k]['emits'] and e not in restrictions_list: show_job_emits_edge(ofh, k, e) def read_data(): global cmd global upstart_session global use_system if options.infile: try: ifh = open(options.infile, 'r') except: sys.exit("ERROR: cannot read file '%s'" % options.infile) else: try: ifh = Popen(cmd.split(), stdout=PIPE, universal_newlines=True).stdout except: sys.exit("ERROR: cannot run '%s'" % cmd) job = None for line in ifh: line = line.rstrip() result = re.match('^\s+start on ([^,]+) \(job:\s*([^,]*), env:', line) if result: _event = encode_dollar(job, result.group(1)) _job = result.group(2) if _job: jobs[job]['start on']['job'][_job] = _event else: jobs[job]['start on']['event'][_event] = 1 events[_event] = 1 continue result = re.match('^\s+stop on ([^,]+) \(job:\s*([^,]*), env:', line) if result: _event = encode_dollar(job, result.group(1)) _job = result.group(2) if _job: jobs[job]['stop on']['job'][_job] = 1 else: jobs[job]['stop on']['event'][_event] = 1 events[_event] = 1 continue if re.match('^\s+emits', line): event = line.lstrip().split()[1] event = encode_dollar(job, event) events[event] = 1 jobs[job]['emits'][event] = 1 else: tokens = line.lstrip().split() if len(tokens) != 1: sys.exit("ERROR: invalid line: %s" % line.lstrip()) job_record = {} start_on = {} start_on_jobs = {} start_on_events = {} stop_on = {} stop_on_jobs = {} stop_on_events = {} emits = {} start_on['job'] = start_on_jobs start_on['event'] = start_on_events stop_on['job'] = stop_on_jobs stop_on['event'] = stop_on_events job_record['start on'] = start_on job_record['stop on'] = stop_on job_record['emits'] = emits job = (tokens)[0] jobs[job] = job_record def main(): global options global restrictions_list global cmd global use_system global upstart_session description = "Convert initctl(8) output to GraphViz dot(1) format." epilog = "See http://www.graphviz.org/doc/info/colors.html " \ "for available colours." parser = ArgumentParser(description=description, epilog=epilog) parser.add_argument("-r", "--restrict-to-jobs", dest="restrictions", help="Limit display of 'start on' and 'stop on' " "conditions to specified jobs (comma-separated list).") parser.add_argument("-f", "--infile", dest="infile", help="File to read output from. If not specified" ", initctl will be run automatically.") parser.add_argument("-o", "--outfile", dest="outfile", help="File to write output to (default=%s)" % default_outfile) parser.add_argument("--color-emits", dest="color_emits", help="Specify color for 'emits' lines (default=%s)." % default_color_emits) parser.add_argument("--color-start-on", dest="color_start_on", help="Specify color for 'start on' lines " "(default=%s)." % default_color_start_on) parser.add_argument("--color-stop-on", dest="color_stop_on", help="Specify color for 'stop on' lines " "(default=%s)." % default_color_stop_on) parser.add_argument("--color-event", dest="color_event", help="Specify color for event boxes (default=%s)." % default_color_event) parser.add_argument("--color-text", dest="color_text", help="Specify color for summary text (default=%s)." % default_color_text) parser.add_argument("--color-bg", dest="color_bg", help="Specify background color for diagram " "(default=%s)." % default_color_bg) parser.add_argument("--color-event-text", dest="color_event_text", help="Specify color for text in event boxes " "(default=%s)." % default_color_text) parser.add_argument("--color-job-text", dest="color_job_text", help="Specify color for text in job boxes " "(default=%s)." % default_color_text) parser.add_argument("--color-job", dest="color_job", help="Specify color for job boxes (default=%s)." % default_color_job) parser.add_argument("--user", dest="system", default=None, action='store_false', help="Connect to Upstart user session (default if running within a user session).") parser.add_argument("--system", dest="system", default=None, action='store_true', help="Connect to Upstart system session.") parser.set_defaults(color_emits=default_color_emits, color_start_on=default_color_start_on, color_stop_on=default_color_stop_on, color_event=default_color_event, color_job=default_color_job, color_job_text=default_color_text, color_event_text=default_color_text, color_text=default_color_text, color_bg=default_color_bg, outfile=default_outfile) options = parser.parse_args() if options.outfile == '-': ofh = sys.stdout else: try: ofh = open(options.outfile, "w") except: sys.exit("ERROR: cannot open file %s for writing" % options.outfile) if options.restrictions: restrictions_list = options.restrictions.split(",") upstart_session = os.environ.get('UPSTART_SESSION', False) if options.system == None: if upstart_session: use_system = False else: use_system = True else: use_system = options.system or not upstart_session if use_system: cmd = "initctl --system show-config -e" else: cmd = "initctl show-config -e" read_data() for job in restrictions_list: if not job in jobs: sys.exit("ERROR: unknown job %s" % job) header(ofh) show_events(ofh) show_jobs(ofh) show_edges(ofh) footer(ofh) if __name__ == "__main__": main() upstart-1.13.2/scripts/man/0000775000175000017500000000000012402042421012534 500000000000000upstart-1.13.2/scripts/man/upstart-monitor.80000664000175000017500000000406512373101356015753 00000000000000.TH upstart\-monitor 8 2013-03-13 upstart .\" .SH NAME upstart\-monitor \- Display system and session Upstart events .\" .SH SYNOPSIS .B upstart\-monitor .RI [ OPTIONS ]... .\" .SH DESCRIPTION .B upstart\-monitor displays Upstart system events or Upstart session events using either a command-line or graphical interface. .\" .SH OPTIONS .\" .TP .BR \-d " \fIdestination\fP" " , " \-\-destination=\fIdestination\fP Specify the endpoint to connect to. Valid destinations are .IR session\-socket ", " .IR session\-bus ", " .IR system\-socket " and " .IR system-bus "." .\" .TP .B \-\-help Show brief usage summary. .\" .TP .BR \-n " , " \-\-no-gui Run in command-line mode. .\" .TP .BR \-s " , " \-\-separator Specify alternate field separator to use for command-line output (default is a single tab character). .\" .SH NOTES .\" .IP \(bu 4 By default, .B upstart\-monitor will attempt to start in a graphical mode unless .B \-\-no\-gui is specified. However, if it is unable to display a graphical interface, it will display a warning message and automatically revert to the command-line interface. .\" .IP \(bu 4 When no command-line option (that affects the destination) is specified, .B upstart\-monitor will attempt to connect to the Session Init (destination \fIsession\-socket\fR) and display session events. In this mode, it will display both session events .I and system events, assuming the .BR upstart-event-bridge (8) is running. If invoked with no arguments from within a non-Upstart session environment it will attempt to connect to Upstart running as process ID 1 (destination \fIsystem\-bus\fR) and will only display system events. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@ubuntu.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/ubuntu/+source/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2013 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO .BR init (5) .BR init (8) .BR upstart-events (7) .BR upstart-event-bridge (8) upstart-1.13.2/scripts/man/init-checkconf.80000664000175000017500000000271712373101356015452 00000000000000.TH init\-checkconf 8 2013-11-19 "Upstart" .\" .SH NAME init\-checkconf \- manual page for init-checkconf .\" .SH SYNOPSIS .B init\-checkconf .RI [ OPTIONS ] " file " .B init\-checkconf .RI [ OPTIONS ] " " "\-f" " file " .\" .SH DESCRIPTION Determine if specified Upstart .BR init (8) job configuration file is valid. .P By default, two checks are performed: .IP \(bu 4 Ensure Upstart can parse overall file successfully .IP \(bu 4 Ensure all script sections are parseable by shell .P .\" .SH OPTIONS .TP .BR \-d " , " \-\-debug Show some debug output. .TP .BR \-f " \fIfile\fP" " , " \-\-file=\fIfile\fP Specify job configuration file to check. .TP .BR \-i " \fIpath\fP" " , " \-\-initctl\-path=\fIpath\fP Specify path to .BR initctl (8) binary. .TP .BR \-s " , " \-\-noscript Do not check script sections. .TP .BR \-x " \fIpath\fP" " , " \-\-upstart\-path=\fIpath\fP Specify path to .BR init (8) binary. .TP .BR \-h " , " \-\-help Display usage statement. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@ubuntu.com > .\" .SH LIMITATIONS .IP \(bu 4 .B exec stanzas containing shell meta-characters will not be checked as scripts. .\" .SH REPORTING BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2011-2013 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR sh (1) .BR init (5) .BR init (8) upstart-1.13.2/scripts/man/initctl2dot.80000664000175000017500000000423412373101356015021 00000000000000.TH initctl2dot 8 2013-03-22 "Upstart" .\" .SH NAME initctl2dot \- manual page for initctl2dot .\" .SH SYNOPSIS .B initctl2dot .RI [ OPTIONS ] .\" .SH DESCRIPTION Convert .BR initctl (8) output to GraphViz .BR dot (1) format. With no options, .BR initctl (8) will be invoked automatically and the output written to file \fIupstart.dot\fP. If run from within an Upstart user session, unless .B \-\-system is specified, the data generated will be for the user session. .\" .SH OPTIONS .TP \fB\-f\fP \fIINFILE\fP , \fP\-\-infile\fP=\fIINFILE\fP File to read .BR initctl (8) output from ("initctl show-config -e"). If not specified, .BR initctl (8) will be run automatically. .TP .B \-h Display usage statement. .TP \fB\-r\fP \fIRESTRICTIONS\fP , \fP\-\-restrict-to-jobs\fP=\fIRESTRICTIONS\fP Limit display of .B start on and .B stop on conditions to comma-separated list of jobs. .TP \fB\-w\fP \fIOUTFILE\fP , \fP\-\-outfile\fP=\fIOUTFILE\fP File to write output to. .TP \fB\-\-color-emits\fP=\fICOLOR_EMITS\fP Specify color for 'emits' lines. .TP \fB\-\-color-start-on\fP=\fICOLOR_START_ON\fP Specify color for 'start on' lines. .TP \fB\-\-color-stop-on\fP=\fICOLOR_STOP_ON\fP Specify color for 'stop on' lines. .TP \fB\-\-color-event\fP=\fICOLOR_EVENT\fP Specify color for event boxes. .TP \fB\-\-color-text\fP=\fICOLOR_TEXT\fP Specify color for summary text. .TP \fB\-\-color-bg\fP=\fICOLOR_BG\fP Specify background color for diagram. .TP \fB\-\-color-event-text\fP=\fICOLOR_EVENT_TEXT\fP Specify color for text in event boxes. .TP \fB\-\-color-job-text\fP=\fICOLOR_JOB_TEXT\fP Specify color for text in job boxes. .TP \fB\-\-color-job\fP=\fICOLOR_JOB\fP Specify color for job boxes. .TP \fB\-\-system\fP Connect to the Upstart system session. .TP \fB\-\-user\fP Connect to the Upstart user session. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@ubuntu.com > .\" .SH REPORTING BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2011 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR init (8) .BR initctl (8) upstart-1.13.2/scripts/data/0000775000175000017500000000000012402042421012672 500000000000000upstart-1.13.2/scripts/data/Makefile.in0000664000175000017500000004104612402042375014674 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = scripts/data DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(icondir)" DATA = $(desktop_DATA) $(icon_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ desktopdir = $(datadir)/applications desktop_DATA = upstart-monitor.desktop icondir = $(datadir)/icons/hicolor/scalable/apps icon = upstart-monitor.svg icon_DATA = $(icon) EXTRA_DIST = $(desktop_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-desktopDATA: $(desktop_DATA) @$(NORMAL_INSTALL) @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(desktopdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(desktopdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(desktopdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(desktopdir)" || exit $$?; \ done uninstall-desktopDATA: @$(NORMAL_UNINSTALL) @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(desktopdir)'; $(am__uninstall_files_from_dir) install-iconDATA: $(icon_DATA) @$(NORMAL_INSTALL) @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icondir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ done uninstall-iconDATA: @$(NORMAL_UNINSTALL) @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icondir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(icondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-desktopDATA \ install-iconDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-desktopDATA uninstall-iconDATA uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-desktopDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-iconDATA install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-desktopDATA \ uninstall-iconDATA uninstall-local $(icon): $(top_srcdir)/doc/upstart-logo.svg cp $< $@ install-icon: mkdir -p $(DESTDIR)$(pkgdatadir)/icons/ $(INSTALL_DATA) $(icon) $(DESTDIR)$(pkgdatadir)/icons/ uninstall-icon: rm -f $(DESTDIR)$(pkgdatadir)/icons/$(icon) install-data-local: install-icon uninstall-local: uninstall-icon clean-local: rm -f $(icon) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/scripts/data/Makefile.am0000664000175000017500000000102012373101356014651 00000000000000desktopdir = $(datadir)/applications desktop_DATA = upstart-monitor.desktop icondir = $(datadir)/icons/hicolor/scalable/apps icon = upstart-monitor.svg icon_DATA = $(icon) $(icon): $(top_srcdir)/doc/upstart-logo.svg cp $< $@ EXTRA_DIST = $(desktop_DATA) install-icon: mkdir -p $(DESTDIR)$(pkgdatadir)/icons/ $(INSTALL_DATA) $(icon) $(DESTDIR)$(pkgdatadir)/icons/ uninstall-icon: rm -f $(DESTDIR)$(pkgdatadir)/icons/$(icon) install-data-local: install-icon uninstall-local: uninstall-icon clean-local: rm -f $(icon) upstart-1.13.2/scripts/data/upstart-monitor.desktop0000664000175000017500000000025312373101356017406 00000000000000[Desktop Entry] Encoding=UTF-8 Comment=Upstart Event Monitor Name=upstart-monitor Exec=upstart-monitor Icon=upstart-monitor Type=Application Categories=GNOME;GTK;Utility; upstart-1.13.2/scripts/pyupstart.py0000775000175000017500000010270512373101356014350 00000000000000#!/usr/bin/python3 #--------------------------------------------------------------------- # = Limitations = # # - Override files are not currently supported. # # Note that you can make use of Upstart.test_dir to determine # where to create the override but be aware that after creating a # '.override' file, you must wait until Upstart has re-parsed the job. # #--------------------------------------------------------------------- """ Upstart test module. """ import os import logging import tempfile import pyinotify import subprocess import shutil import dbus import dbus.service import dbus.mainloop.glib import time import json from datetime import datetime, timedelta from gi.repository import GLib from pyupstartvars import * VERSION = '0.1' NAME = 'TestUpstart' # FIXME: should really take account of autoconf prefix SYSTEM_UPSTART = '/sbin/init' SYSTEM_INITCTL = '/sbin/initctl' SYSTEM_FILE_BRIDGE = '/sbin/upstart-file-bridge' UPSTART_SESSION_ENV = 'UPSTART_SESSION' USE_SYSTEM_BINARIES_ENV = 'UPSTART_TEST_USE_SYSTEM_BINARIES' UPSTART_STATE_FILE = 'upstart.state' INIT_SOCKET = 'unix:abstract=/com/ubuntu/upstart' SYSTEM_JOB_DIR = '/etc/init' SYSTEM_LOG_DIR = '/var/log/upstart' # used to log session init output DEFAULT_LOGFILE = '/tmp/upstart.log' DEFAULT_SESSION_INSTALL_PATH = '/usr/share/upstart/sessions' SESSION_DIR_FMT = 'upstart/sessions' BUS_NAME = 'com.ubuntu.Upstart' INTERFACE_NAME = 'com.ubuntu.Upstart0_6' JOB_INTERFACE_NAME = 'com.ubuntu.Upstart0_6.Job' INSTANCE_INTERFACE_NAME = 'com.ubuntu.Upstart0_6.Instance' OBJECT_PATH = '/com/ubuntu/Upstart' FREEDESKTOP_PROPERTIES = 'org.freedesktop.DBus.Properties' # Maximum number of seconds to wait for Upstart to detect a new job # has been created JOB_WAIT_SECS = 5 # Maximum number of seconds to wait for session file to appear after # startup of Session Init SESSION_FILE_WAIT_SECS = 5 # Maximum number of seconds to wait for Upstart to complete a re-exec REEXEC_WAIT_SECS = 5 # Maximum number of seconds to wait for Upstart to create a file FILE_WAIT_SECS = 5 # Maximum number of seconds to wait for Upstart to create a logfile LOGFILE_WAIT_SECS = 5 #--------------------------------------------------------------------- def get_init(): """ Return full path to an appropriate init daemon binary. """ if os.environ.get(USE_SYSTEM_BINARIES_ENV, None): binary = SYSTEM_UPSTART else: binary = BUILT_UPSTART assert (os.path.exists(binary)) return binary def get_initctl(): """ Return full path to an appropriate initctl binary. """ if os.environ.get(USE_SYSTEM_BINARIES_ENV, None): binary = SYSTEM_INITCTL else: binary = BUILT_INITCTL assert (os.path.exists(binary)) return binary def get_file_bridge(): """ Return full path to an appropriate upstart-file-bridge binary. """ if os.environ.get(USE_SYSTEM_BINARIES_ENV, None): binary = SYSTEM_FILE_BRIDGE else: binary = BUILT_FILE_BRIDGE assert (os.path.exists(binary)) return binary def dbus_encode(str): """ Simulate nih_dbus_path() which Upstart uses to convert a job path into one suitable for use as a D-Bus object path. This entails converting all non-alpha-numeric bytes in the string into a 3 byte string comprising an underscore ('_'), followed by the 2 byte lower-case hex representation of the byte in question. Alpha-numeric bytes are left unmolested. Note that in the special case of the specified string being None or the nul string, it is encoded as '_'. Examples: 'hello-world' would be encoded as 'hello_2dworld' since '-' is 2d in hex (resulting in '_2d'). Similarly, '_2f' would be the encoding for '/' since that character has hex value 2f. """ if not str: return '_' hex = [] for ch in str: if ch.isalpha() or ch.isdigit(): hex.append(ch) else: hex.append("_%02x" % ord(ch)) # convert back into a string return ''.join(hex) def secs_to_milli(secs): """ Convert @secs seconds to milli-seconds. """ return secs * 1000 def wait_for_file(path, timeout=FILE_WAIT_SECS): """ Wait for a specified file to exist. @path: Full path to file to wait for. Returns: True if file was created within @timeout seconds, else False. """ until = datetime.now() + timedelta(seconds=timeout) while datetime.now() < until: if os.path.exists(path): return True time.sleep(0.1) return False class InotifyHandler(pyinotify.ProcessEvent): # We don't actually do anything here since all we care # about is whether we timed-out. def process_IN_CREATE(self, event): pass class UpstartException(Exception): """ An Upstart Exception. """ pass class Upstart: """ Upstart Class. conf_dir: Full path to job configuration file directory. test_dir: Full path to directory below @conf_dir used to store test jobs. test_dir_name: Relative directory of @test_dir below @conf_dir (effectively '@conf_dir - @test_dir'). log_dir: Full path to job log files directory. """ def __init__(self): self.logger = logging.getLogger(self.__class__.__name__) self.jobs = [] self.conf_dir = None self.test_dir = None self.test_dir_name = None self.log_dir = None self.socket = None self.connection = None # Set to True when a new job is created self.job_seen = False self.new_job = None self.mainloop = None self.timeout_source = None dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) self.create_dirs() def connect(self, force=False): """ Connect to Upstart. @force: if True, connect regardless of whether already connected. Notes: - Raises an UpstartException() if already connected. """ if self.connection and not force: raise UpstartException('Already connected') # Create appropriate D-Bus connection self.connection = dbus.connection.Connection(self.socket) self.remote_object = self.connection.get_object( object_path=OBJECT_PATH) self.proxy = dbus.Interface(self.remote_object, INTERFACE_NAME) def reconnect(self): """ Forcibly reconnect to Upstart. """ self.connect(force=True) def polling_connect(self, timeout=REEXEC_WAIT_SECS, force=False): """ Attempt to connect to Upstart repeatedly for up to @timeout seconds. Useful after a re-exec since that operation although fast takes an indeterminate amount of time to complete. @timeout: seconds to wait for successful connection. @force: if True, force a reconnection. """ for i in range(timeout): try: self.connect(force=force) self.version() return except dbus.exceptions.DBusException: time.sleep(1) raise UpstartException( 'Failed to reconnect to Upstart after %d seconds' % timeout) def _timeout_cb(self): """ Handle timeout if job not seen in a reasonable amount of time. """ self.mainloop.quit() def _idle_create_job_cb(self, name, body, *args): """ Handler to create a Job Configuration File as soon as the main loop starts. """ self.new_job = Job(self, self.test_dir, self.test_dir_name, name, body=body, retain=self.retain) # deregister return False def _job_added_cb(self, path): """ Handle the 'JobAdded(Object path)' signal. """ # ignore signals that don't match the job we care about. if path != self.job_object_path: return True self.job_seen = True assert self.timeout_source, 'Expected timeout source to be defined' # remove timeout handler GLib.source_remove(self.timeout_source) self.mainloop.quit() # deregister return False def set_test_dir(self): """ Create a directory to hold the test jobs beneath the job configuration directory. """ self.test_dir = tempfile.mkdtemp(prefix=NAME + '-', dir=self.conf_dir) self.test_dir_name = self.test_dir.replace("%s/" % self.conf_dir, '') def create_dirs(self): """ Create the directories required to store job configuration files and log job output. """ for dir in (self.conf_dir, self.test_dir, self.log_dir): if dir: try: os.makedirs(dir) except FileExistsError: pass def destroy(self): """ Remove all jobs. """ for job in self.jobs: job.destroy() if self.test_dir: shutil.rmtree(self.test_dir) # invalidate self.connection = None self.remote_object = None self.proxy = None def emit(self, event, env=None, wait=True): """ @event: Name of event to emit. @env: optional environment for event. @wait: if True, wait for event to be fully emitted (synchronous), else async. Emit event @event with optional environment @env. """ if env is None: env = [] self.proxy.EmitEvent(event, dbus.Array(env, 's'), wait) def version(self, raw=False): """ Determine version of running instance of Upstart. @raw: if True, return full version string, else just the version in the form 'x.y'. Returns: Version as a string. """ properties = dbus.Interface(self.remote_object, FREEDESKTOP_PROPERTIES) version_string = properties.Get(INTERFACE_NAME, 'version') if raw: return version_string return version_string.split()[2].strip(')') def get_state_json(self): """ Obtain Upstart internal state in JSON format. """ return self.proxy.GetState() def get_state(self): """ Obtain Upstart internal state (JSON) and convert to Python dictionary format before returning. """ return json.loads(self.get_state_json()) def get_sessions(self): """ Returns dictionary of session details. """ state = self.get_state() sessions = state['sessions'] return sessions def session_count(self): """ Returns number of chroot sessions. """ return len(self.get_sessions()) def sessions_exist(self): """ Returns True if sessions exist, else False. """ return self.session_count() > 0 def reexec(self): """ Request Upstart re-exec itself. Note that after a re-exec, it is necessary to reconnect to Upstart. """ raise NotImplementedError('method must be implemented by subclass') def job_create(self, name, body, retain=False): """ Create a Job Configuration File. @name: Name to give the job. @body: String representation of configuration file, or list of strings. @retain: if True, don't remove the Job Configuration File when object is cleaned up. Strategy: Arranging for this method to detect that Upstart has registered this job in an efficient manner is tricky. The approach adopted is to: - Create a glib main loop. - Register a D-Bus signal handler which looks for the 'JobAdded' signal emitted by Upstart when a new job is available (in other words when Upstart has parsed its job configuration file successfully). - Create a glib main loop idle handler that will be called as soon as the loop starts and will actually create the job. - Add a glib main loop timeout handler which will detect if the job failed to be registered. - Run the main loop, which performs the following steps: - Calls the idle handler immediately. This creates the job configuration file, then deregisters itself so it is never called again. - If Upstart fails to parse the job, the timeout handler gets called which causes the main loop to exit. job_seen will not be set. - If Upstart does parse the file, the _job_added_cb() callback gets called as a result of the 'JobAdded' D-Bus signal being emitted. This will set job_seen and request the main loop exits. - Check the job_seen variable and react accordingly. """ # Create a new mainloop self.mainloop = GLib.MainLoop() # reset self.job_seen = False self.new_job = None self.retain = retain # construct the D-Bus path for the new job job_path = '{}/{}'.format(self.test_dir_name, name) self.job_object_path = '{}/{}/{}'.format( OBJECT_PATH, 'jobs', dbus_encode(job_path) ) self.connection.add_signal_receiver( self._job_added_cb, dbus_interface=INTERFACE_NAME, path=OBJECT_PATH, signal_name='JobAdded') GLib.idle_add(self._idle_create_job_cb, name, body) self.timeout_source = GLib.timeout_add( secs_to_milli(JOB_WAIT_SECS), self._timeout_cb ) self.mainloop.run() if not self.job_seen: return None # reset self.job_seen = False self.mainloop = None self.jobs.append(self.new_job) return self.new_job def job_recreate(self, name, conf_path): """ Create a job object from an existing Job Configuration File. @name: Name prefix of existing job configuration file. @conf_path: Full path to *existing* Job Configuration File. """ assert (name) assert (conf_path) job_path = '{}/{}'.format(self.test_dir_name, name) self.job_object_path = '{}/{}/{}'.format( OBJECT_PATH, 'jobs', dbus_encode(job_path) ) self.new_job = Job(self, self.test_dir, self.test_dir_name, name, body=None, reuse_path=conf_path) self.jobs.append(self.new_job) return self.new_job class Job: """ Representation of an Upstart Job. This equates to the Job Configuration file and details of the running instances. For single-instance jobs (those that do not specify the 'instance' stanza), this object is sufficient to control the job. For multi-instance jobs, manipulating this object will operate on *all* the instances where it makes sense to do so. If this is not desired behaviour, capture the JobInstance() returned from start() and operate on that instead. """ def __init__(self, upstart, dir_name, subdir_name, job_name, body=None, reuse_path=None, retain=False): """ @upstart: Upstart() parent object. @dir_name: Full path to job configuration files directory. @subdir_name: Relative directory of test_dir below job configuration file directory. @job_name: Name of job. @body: Contents of job configuration file (either a string, or a list of strings). @reuse_path: If set and @body is None, (re)create the job object using the existing specified job configuration file path. @retain: If True, don't delete the Job Configuration File on object destruction. """ self.logger = logging.getLogger(self.__class__.__name__) self.instances = [] self.instance_names = [] self.upstart = upstart self.subdir_name = subdir_name self.name = job_name self.job_dir = dir_name self.body = body self.reuse_path = reuse_path self.retain = retain self.instance_name = None # proxy to job instance self.instance = None self.properties = None # need some way to create the job if not self.body and not self.reuse_path: raise UpstartException('No body or reusable path specified') if self.reuse_path: self.conffile = self.reuse_path else: self.conffile = os.path.join(self.job_dir, self.name + '.conf') if self.body and isinstance(self.body, str): # Assume body cannot be a bytes object. body = body.splitlines() if not self.body and self.reuse_path: # Just check conf file exists if not os.path.exists(self.conffile): raise UpstartException( 'File {} does not exist for reuse'.format(self.conffile)) else: # Create conf file with open(self.conffile, 'w', encoding='utf-8') as fh: for line in body: print(line.strip(), file=fh) print(file=fh) self.valid = True subdir_object_path = dbus_encode( "%s/%s" % (self.subdir_name, self.name) ) self.object_path = "%s/%s/%s" % \ (OBJECT_PATH, 'jobs', subdir_object_path) self.remote_object = \ self.upstart.connection.get_object(BUS_NAME, self.object_path) self.interface = dbus.Interface(self.remote_object, JOB_INTERFACE_NAME) def destroy(self): """ Stop all instances and cleanup. """ try: for instance in self.instances: instance.destroy() if not self.retain: os.remove(self.conffile) except FileNotFoundError: pass self.valid = False def start(self, env=None, wait=True): """ Start the job. For multi-instance jobs (those that specify the 'instance' stanza), you will need to use the returned JobInstance object to manipulate the individual instance. Returns: JobInstance. """ if env is None: env = [] instance_path = self.interface.Start(dbus.Array(env, 's'), wait) instance_name = instance_path.replace("%s/" % self.object_path, '') # store the D-Bus encoded instance name ('_' for single-instance jobs) if instance_name not in self.instance_names: self.instance_names.append(instance_name) instance = JobInstance(self, instance_name, instance_path) self.instances.append(instance) return instance def get_instance(self): """ Returns: JobInstance of calling Job. """ # construct the D-Bus path for the new job job_path = '{}/{}'.format(self.upstart.test_dir_name, self.name) instance_path = '{}/{}/{}/{}'.format( OBJECT_PATH, 'jobs', dbus_encode(job_path), # XXX: LIMITATION - only support default instance. '_' ) instance_name = instance_path.replace("%s/" % self.object_path, '') # store the D-Bus encoded instance name ('_' for single-instance jobs) if instance_name not in self.instance_names: self.instance_names.append(instance_name) instance = JobInstance(self, instance_name, instance_path) self.instances.append(instance) return instance def _get_dbus_instance(self, name): """ Retrieve D-Bus job instance and its properties. @name: D-Bus encoded instance name. """ assert name, 'Name must not be None' object_path = '{}/{}'.format(self.object_path, name) remote_object = \ self.upstart.connection.get_object(BUS_NAME, object_path) return dbus.Interface(remote_object, INSTANCE_INTERFACE_NAME) def stop(self, wait=True): """ Stop all running instance of the job. @wait: if False, stop job instances asynchronously. """ for name in self.instance_names: instance = self._get_dbus_instance(name) try: instance.Stop(wait) except dbus.exceptions.DBusException: # job has already stopped pass def restart(self, wait=True): """ Restart all running instance of the job. @wait: if False, stop job instances asynchronously. """ for name in self.instance_names: instance = self._get_dbus_instance(name) instance.Restart(wait) def instance_object_paths(self): """ Returns a list of instance object paths. """ return ["%s/%s" % (self.object_path, instance) for instance in self.instance_names] def pids(self, name=None): """ @name: D-Bus encoded instance name. Returns: Map of job processes: name=job process name value=pid Notes: If your job has multiple instances, call the method of the same name on the individual instance objects. """ name = ('_' if name is None else name) if len(self.instance_names) > 1: raise UpstartException('Cannot handle multiple instances') assert(name in self.instance_names) instance = self._get_dbus_instance(name) assert (instance) properties = dbus.Interface(instance, FREEDESKTOP_PROPERTIES) assert (properties) # don't assert as there may not be any processes procs = properties.Get(INSTANCE_INTERFACE_NAME, 'processes') pid_map = {} for proc in procs: # convert back to natural types job_proc = str(proc[0]) job_pid = int(proc[1]) pid_map[job_proc] = job_pid return pid_map def running(self, name): """ @name: D-Bus encoded name of job instance. Determine if an instance is currently running. Returns: True if @name is running, else false. """ if len(self.instance_names) > 1: raise UpstartException('Cannot handle multiple instances') if name not in self.instance_names: return False return len(self.pids(name)) > 0 def logfile_name(self, instance_name): """ Determine full path to logfile for job instance. @instance_name: D-Bus encoded job instance name. Note: it is up to the caller to ensure the logfile exists. Returns: full path to logfile. """ if instance_name != '_': filename = '{}_{}-{}.log'.format( self.subdir_name, self.name, instance_name ) else: # Note the underscore that Upstart auto-maps from the subdirectory # slash (see init(5)). filename = '{}_{}.log'.format(self.subdir_name, self.name) logfile = os.path.join(self.upstart.log_dir, filename) return logfile class LogFile: """ Representation of an Upstart job logfile. """ def __init__(self, path): """ @path: full path to logfile. """ self.logger = logging.getLogger(self.__class__.__name__) self.path = path self.valid = True def destroy(self): """ Clean up: *MUST* be called by caller! """ try: os.remove(self.path) self.valid = False except OSError: pass def exists(self): """ Determine if logfile exists. Returns: True or False. """ return os.path.exists(self.path) def _get_lines(self): """ Get contents of log. Notes: '\r' characters added by pty() are removed by readlines(). Returns: List of lines in logfile. """ assert self.path, 'Path not set' with open(self.path, 'r', encoding='utf-8') as fh: return fh.readlines() def readlines(self, timeout=LOGFILE_WAIT_SECS): """ Read logfile. A timeout has to be used to avoid "hanging" since the job associated with this logfile: - may not create any output. - may produce output only after a long period of time. @timeout: seconds to wait file to be created. Notes: - Raises an UpstartException() on timeout. - '\r' characters added by pty() will be removed. Returns: Array of lines in logfile or None if logfile was not created in @timeout seconds. """ self.timeout = timeout # Polling - ugh. However, arranging for an inotify watch # at this level is tricky since the watch cannot be created here # as by the time the watch is in place, the logfile may already # have been created, which not only nullifies the reason for # adding the watch in the first place, but also results in an # impotent watch (unless a timeout on the watch is specified). # The correct place to create the watch is in one of the Upstart # classes. However, even then, timing issues result wrt to # calling the appropriate inotify APIs. # # Hence, altough polling is gross it has the advantage of # simplicity and reliability in this instance. until = datetime.now() + timedelta(seconds=self.timeout) while datetime.now() < until: try: return self._get_lines() except FileNotFoundError: time.sleep(0.1) return None class JobInstance: """ Representation of a running Upstart Job Instance. """ def __init__(self, job, instance_name, object_path): """ @instance_name: D-Bus encoded instance name. @object_path: D-Bus object path. """ self.logger = logging.getLogger(self.__class__.__name__) self.job = job self.instance_name = instance_name self.object_path = object_path self.remote_object = \ self.job.upstart.connection.get_object(BUS_NAME, self.object_path) self.instance = \ dbus.Interface(self.remote_object, INSTANCE_INTERFACE_NAME) self.properties = dbus.Interface(self.instance, FREEDESKTOP_PROPERTIES) # all jobs are expected to be created in a subdirectory. assert(self.job.subdir_name) logfile = job.logfile_name(instance_name) self.logfile = LogFile(logfile) def stop(self, wait=True): """ Stop instance. @wait: if True, wait for job, else perform operation asynchronously. """ try: self.instance.Stop(wait) except dbus.exceptions.DBusException: # job has already stopped pass def restart(self, wait=True): """ Restart instance. @wait: if True, wait for job, else perform operation asynchronously. """ self.instance.Restart(wait) def pids(self): procs = self.properties.Get(INSTANCE_INTERFACE_NAME, 'processes') pid_map = {} for proc in procs: # convert back to natural types job_proc = str(proc[0]) job_pid = int(proc[1]) pid_map[job_proc] = job_pid return pid_map def destroy(self): """ Stop the instance and cleanup. Note: If the instance specified retain when created, this will be a NOP. """ if not self.job.retain: self.stop() self.logfile.destroy() class SystemInit(Upstart): def __init__(self): super().__init__() self.logger = logging.getLogger(self.__class__.__name__) self.socket = INIT_SOCKET self.conf_dir = SYSTEM_JOB_DIR self.log_dir = SYSTEM_LOG_DIR self.set_test_dir() self.connect() def reexec(self): if not self.proxy: raise UpstartException('Not yet connected') # Use the official system interface os.system('telinit u') class SessionInit(Upstart): """ Create a new Upstart Session or join an existing one. """ timeout = SESSION_FILE_WAIT_SECS def _get_sessions(self): """ Obtain a list of running sessions. Returns: Map of sessions: name=pid value=socket address """ sessions = {} args = [get_initctl(), 'list-sessions'] for line in subprocess.check_output(args, universal_newlines=True).splitlines(): pid, socket = line.split() sessions[pid] = socket return sessions def __init__(self, join=False, capture=None, extra=None): """ @join: If False, start a new session. If TRUE join the existing main (non-test) session. @capture: Set to the name of a file to capture all stdout and stderr output. @extra: Array of extra arguments (only used when @join is False). Notes: - If @join is True, an UpstartException is raised if either no existing session is found, or multiple existing sessions are found. - Joining implies joining the main Upstart session, not a test session. """ super().__init__() self.logger = logging.getLogger(self.__class__.__name__) self.join = join self.capture = capture self.socket = os.environ.get(UPSTART_SESSION_ENV) sessions = self._get_sessions() if self.join and len(sessions) > 1: raise UpstartException('Multiple existing sessions') if self.join and not self.socket: raise UpstartException('No existing session') if self.join: self.session = self.socket # We are joining the main desktop session. # # Multiple conf file directories are supported, but we'll # stick with the default. config_home = os.environ.get('XDG_CONFIG_HOME', "%s/%s" % (os.environ.get('HOME'), '.config')) cache_home = os.environ.get('XDG_CACHE_HOME', "%s/%s" % (os.environ.get('HOME'), '.cache')) self.conf_dir = "%s/%s" % (config_home, 'upstart') self.log_dir = "%s/%s" % (cache_home, 'upstart') else: args = [] pid = os.getpid() init_binary = get_init() self.logger.debug('Using init binary %s' % init_binary) self.conf_dir = \ tempfile.mkdtemp(prefix="%s-confdir-%d-" % (NAME, pid)) self.log_dir = \ tempfile.mkdtemp(prefix="%s-logdir-%d-" % (NAME, pid)) args.extend([init_binary, '--user', '--confdir', self.conf_dir, '--logdir', self.log_dir]) if extra: args.extend(extra) self.logger.debug( 'Starting Session Init with arguments: %s' % " ".join(args) ) watch_manager = pyinotify.WatchManager() mask = pyinotify.IN_CREATE notifier = \ pyinotify.Notifier(watch_manager, InotifyHandler()) session = os.path.join(os.environ['XDG_RUNTIME_DIR'], SESSION_DIR_FMT) watch_manager.add_watch(session, mask) notifier.process_events() if self.capture: self.out = open(self.capture, 'w') else: self.out = subprocess.DEVNULL self.proc = \ subprocess.Popen(args=args, stdout=self.out, stderr=self.out) self.pid = self.proc.pid self.logger.debug('Session Init running with pid %d' % self.pid) millisecs_timeout = secs_to_milli(self.timeout) if not notifier.check_events(timeout=millisecs_timeout): msg = \ "Timed-out waiting for session file after %d seconds" \ % self.timeout raise UpstartException(msg) # consume notifier.read_events() notifier.stop() if self.capture: self.out.flush() # Activity has been seen in the session file directory, so # our Session Init should now have written the session file # (although this assumes no other Session Inits are being # started). sessions = self._get_sessions() if not str(self.pid) in sessions: msg = "Session with pid %d not found" % self.pid raise UpstartException(msg) self.socket = sessions[str(self.pid)] self.logger.debug("Created Upstart Session '%s'" % self.socket) os.putenv(UPSTART_SESSION_ENV, self.socket) self.set_test_dir() self.connect() def destroy(self): """ Stop the SessionInit (if session was not joined) and cleanup. """ super().destroy() if self.capture: self.out.close() if not self.join: self.logger.debug( 'Stopping Session Init running with pid %d' % self.pid ) self.proc.terminate() self.proc.wait() os.rmdir(self.log_dir) shutil.rmtree(self.conf_dir) os.unsetenv(UPSTART_SESSION_ENV) def reexec(self): if not self.proxy: raise UpstartException('Not yet connected') self.logger.debug("Restarting Session Init") self.proxy.Restart() upstart-1.13.2/extra/0000775000175000017500000000000012402042412011415 500000000000000upstart-1.13.2/extra/Makefile.in0000664000175000017500000014703512402042374013423 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = upstart-event-bridge$(EXEEXT) \ upstart-file-bridge$(EXEEXT) upstart-dbus-bridge$(EXEEXT) \ $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ $(am__EXEEXT_4) @ENABLE_SOCKET_BRIDGE_TRUE@am__append_1 = \ @ENABLE_SOCKET_BRIDGE_TRUE@ upstart-socket-bridge @ENABLE_SOCKET_BRIDGE_FALSE@am__append_2 = \ @ENABLE_SOCKET_BRIDGE_FALSE@ upstart-socket-bridge.c @ENABLE_LOCAL_BRIDGE_TRUE@am__append_3 = \ @ENABLE_LOCAL_BRIDGE_TRUE@ upstart-local-bridge @ENABLE_LOCAL_BRIDGE_FALSE@am__append_4 = \ @ENABLE_LOCAL_BRIDGE_FALSE@ upstart-local-bridge.c @ENABLE_DCONF_BRIDGE_TRUE@am__append_5 = \ @ENABLE_DCONF_BRIDGE_TRUE@ upstart-dconf-bridge @ENABLE_DCONF_BRIDGE_FALSE@am__append_6 = \ @ENABLE_DCONF_BRIDGE_FALSE@ upstart-dconf-bridge.c @ENABLE_UDEV_BRIDGE_TRUE@am__append_7 = \ @ENABLE_UDEV_BRIDGE_TRUE@ upstart-udev-bridge @ENABLE_UDEV_BRIDGE_FALSE@am__append_8 = \ @ENABLE_UDEV_BRIDGE_FALSE@ upstart-udev-bridge.c \ @ENABLE_UDEV_BRIDGE_FALSE@ man/upstart-udev-bridge.8 subdir = extra DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(dist_man_MANS) $(dist_init_DATA) \ $(dist_sessions_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @ENABLE_SOCKET_BRIDGE_TRUE@am__EXEEXT_1 = \ @ENABLE_SOCKET_BRIDGE_TRUE@ upstart-socket-bridge$(EXEEXT) @ENABLE_LOCAL_BRIDGE_TRUE@am__EXEEXT_2 = \ @ENABLE_LOCAL_BRIDGE_TRUE@ upstart-local-bridge$(EXEEXT) @ENABLE_DCONF_BRIDGE_TRUE@am__EXEEXT_3 = \ @ENABLE_DCONF_BRIDGE_TRUE@ upstart-dconf-bridge$(EXEEXT) @ENABLE_UDEV_BRIDGE_TRUE@am__EXEEXT_4 = upstart-udev-bridge$(EXEEXT) am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man7dir)" \ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(initdir)" \ "$(DESTDIR)$(sessionsdir)" PROGRAMS = $(sbin_PROGRAMS) am_upstart_dbus_bridge_OBJECTS = upstart-dbus-bridge.$(OBJEXT) am__objects_1 = com.ubuntu.Upstart.$(OBJEXT) am__objects_2 = com.ubuntu.Upstart.Job.$(OBJEXT) nodist_upstart_dbus_bridge_OBJECTS = $(am__objects_1) $(am__objects_2) upstart_dbus_bridge_OBJECTS = $(am_upstart_dbus_bridge_OBJECTS) \ $(nodist_upstart_dbus_bridge_OBJECTS) am__DEPENDENCIES_1 = upstart_dbus_bridge_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__upstart_dconf_bridge_SOURCES_DIST = upstart-dconf-bridge.c @ENABLE_DCONF_BRIDGE_TRUE@am_upstart_dconf_bridge_OBJECTS = upstart_dconf_bridge-upstart-dconf-bridge.$(OBJEXT) am__objects_3 = upstart_dconf_bridge-com.ubuntu.Upstart.$(OBJEXT) @ENABLE_DCONF_BRIDGE_TRUE@nodist_upstart_dconf_bridge_OBJECTS = \ @ENABLE_DCONF_BRIDGE_TRUE@ $(am__objects_3) upstart_dconf_bridge_OBJECTS = $(am_upstart_dconf_bridge_OBJECTS) \ $(nodist_upstart_dconf_bridge_OBJECTS) @ENABLE_DCONF_BRIDGE_TRUE@upstart_dconf_bridge_DEPENDENCIES = \ @ENABLE_DCONF_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) upstart_dconf_bridge_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(upstart_dconf_bridge_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_upstart_event_bridge_OBJECTS = upstart-event-bridge.$(OBJEXT) nodist_upstart_event_bridge_OBJECTS = $(am__objects_1) \ $(am__objects_2) upstart_event_bridge_OBJECTS = $(am_upstart_event_bridge_OBJECTS) \ $(nodist_upstart_event_bridge_OBJECTS) upstart_event_bridge_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_upstart_file_bridge_OBJECTS = upstart-file-bridge.$(OBJEXT) nodist_upstart_file_bridge_OBJECTS = $(am__objects_1) $(am__objects_2) upstart_file_bridge_OBJECTS = $(am_upstart_file_bridge_OBJECTS) \ $(nodist_upstart_file_bridge_OBJECTS) upstart_file_bridge_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am__upstart_local_bridge_SOURCES_DIST = upstart-local-bridge.c @ENABLE_LOCAL_BRIDGE_TRUE@am_upstart_local_bridge_OBJECTS = \ @ENABLE_LOCAL_BRIDGE_TRUE@ upstart-local-bridge.$(OBJEXT) @ENABLE_LOCAL_BRIDGE_TRUE@nodist_upstart_local_bridge_OBJECTS = \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(am__objects_1) $(am__objects_2) upstart_local_bridge_OBJECTS = $(am_upstart_local_bridge_OBJECTS) \ $(nodist_upstart_local_bridge_OBJECTS) @ENABLE_LOCAL_BRIDGE_TRUE@upstart_local_bridge_DEPENDENCIES = \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) am__upstart_socket_bridge_SOURCES_DIST = upstart-socket-bridge.c @ENABLE_SOCKET_BRIDGE_TRUE@am_upstart_socket_bridge_OBJECTS = \ @ENABLE_SOCKET_BRIDGE_TRUE@ upstart-socket-bridge.$(OBJEXT) @ENABLE_SOCKET_BRIDGE_TRUE@nodist_upstart_socket_bridge_OBJECTS = \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(am__objects_1) $(am__objects_2) upstart_socket_bridge_OBJECTS = $(am_upstart_socket_bridge_OBJECTS) \ $(nodist_upstart_socket_bridge_OBJECTS) @ENABLE_SOCKET_BRIDGE_TRUE@upstart_socket_bridge_DEPENDENCIES = \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) am__upstart_udev_bridge_SOURCES_DIST = upstart-udev-bridge.c @ENABLE_UDEV_BRIDGE_TRUE@am_upstart_udev_bridge_OBJECTS = upstart_udev_bridge-upstart-udev-bridge.$(OBJEXT) am__objects_4 = upstart_udev_bridge-com.ubuntu.Upstart.$(OBJEXT) @ENABLE_UDEV_BRIDGE_TRUE@nodist_upstart_udev_bridge_OBJECTS = \ @ENABLE_UDEV_BRIDGE_TRUE@ $(am__objects_4) upstart_udev_bridge_OBJECTS = $(am_upstart_udev_bridge_OBJECTS) \ $(nodist_upstart_udev_bridge_OBJECTS) @ENABLE_UDEV_BRIDGE_TRUE@upstart_udev_bridge_DEPENDENCIES = \ @ENABLE_UDEV_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(am__DEPENDENCIES_1) upstart_udev_bridge_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(upstart_udev_bridge_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(upstart_dbus_bridge_SOURCES) \ $(nodist_upstart_dbus_bridge_SOURCES) \ $(upstart_dconf_bridge_SOURCES) \ $(nodist_upstart_dconf_bridge_SOURCES) \ $(upstart_event_bridge_SOURCES) \ $(nodist_upstart_event_bridge_SOURCES) \ $(upstart_file_bridge_SOURCES) \ $(nodist_upstart_file_bridge_SOURCES) \ $(upstart_local_bridge_SOURCES) \ $(nodist_upstart_local_bridge_SOURCES) \ $(upstart_socket_bridge_SOURCES) \ $(nodist_upstart_socket_bridge_SOURCES) \ $(upstart_udev_bridge_SOURCES) \ $(nodist_upstart_udev_bridge_SOURCES) DIST_SOURCES = $(upstart_dbus_bridge_SOURCES) \ $(am__upstart_dconf_bridge_SOURCES_DIST) \ $(upstart_event_bridge_SOURCES) $(upstart_file_bridge_SOURCES) \ $(am__upstart_local_bridge_SOURCES_DIST) \ $(am__upstart_socket_bridge_SOURCES_DIST) \ $(am__upstart_udev_bridge_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man_MANS) DATA = $(dist_init_DATA) $(dist_sessions_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Required to allow conditional appends below EXTRA_DIST = $(am__append_2) $(am__append_4) $(am__append_6) \ $(am__append_8) AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) AM_CPPFLAGS = \ -DLOCALEDIR="\"$(localedir)\"" \ -DSBINDIR="\"$(sbindir)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ -I$(top_srcdir)/intl initdir = $(sysconfdir)/init sessionsdir = $(datadir)/upstart/sessions dist_sessions_DATA = conf-session/upstart-event-bridge.conf \ conf-session/upstart-file-bridge.conf \ conf-session/re-exec.conf \ conf-session/upstart-dbus-session-bridge.conf \ conf-session/upstart-dbus-system-bridge.conf \ conf-session/upstart-dconf-bridge.conf dist_init_DATA = conf/upstart-socket-bridge.conf \ conf/upstart-event-bridge.conf conf/upstart-file-bridge.conf \ conf/upstart-dbus-bridge.conf conf/upstart-udev-bridge.conf dist_man_MANS = man/upstart-socket-bridge.8 man/upstart-event-bridge.8 \ man/upstart-file-bridge.8 man/upstart-dbus-bridge.8 \ man/upstart-local-bridge.8 man/socket-event.7 man/file-event.7 \ man/dbus-event.7 man/upstart-dconf-bridge.8 man/dconf-event.7 \ man/upstart-udev-bridge.8 @ENABLE_SOCKET_BRIDGE_TRUE@upstart_socket_bridge_SOURCES = \ @ENABLE_SOCKET_BRIDGE_TRUE@ upstart-socket-bridge.c @ENABLE_SOCKET_BRIDGE_TRUE@nodist_upstart_socket_bridge_SOURCES = \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(com_ubuntu_Upstart_OUTPUTS) \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(com_ubuntu_Upstart_Job_OUTPUTS) @ENABLE_SOCKET_BRIDGE_TRUE@upstart_socket_bridge_LDADD = \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(LTLIBINTL) \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(NIH_LIBS) \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(NIH_DBUS_LIBS) \ @ENABLE_SOCKET_BRIDGE_TRUE@ $(DBUS_LIBS) upstart_event_bridge_SOURCES = \ upstart-event-bridge.c nodist_upstart_event_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) upstart_event_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) upstart_file_bridge_SOURCES = \ upstart-file-bridge.c nodist_upstart_file_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) upstart_file_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) upstart_dbus_bridge_SOURCES = \ upstart-dbus-bridge.c nodist_upstart_dbus_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) upstart_dbus_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) @ENABLE_LOCAL_BRIDGE_TRUE@upstart_local_bridge_SOURCES = \ @ENABLE_LOCAL_BRIDGE_TRUE@ upstart-local-bridge.c @ENABLE_LOCAL_BRIDGE_TRUE@nodist_upstart_local_bridge_SOURCES = \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(com_ubuntu_Upstart_OUTPUTS) \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(com_ubuntu_Upstart_Job_OUTPUTS) @ENABLE_LOCAL_BRIDGE_TRUE@upstart_local_bridge_LDADD = \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(LTLIBINTL) \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(NIH_LIBS) \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(NIH_DBUS_LIBS) \ @ENABLE_LOCAL_BRIDGE_TRUE@ $(DBUS_LIBS) @ENABLE_DCONF_BRIDGE_TRUE@upstart_dconf_bridge_SOURCES = \ @ENABLE_DCONF_BRIDGE_TRUE@ upstart-dconf-bridge.c @ENABLE_DCONF_BRIDGE_TRUE@nodist_upstart_dconf_bridge_SOURCES = \ @ENABLE_DCONF_BRIDGE_TRUE@ $(com_ubuntu_Upstart_OUTPUTS) @ENABLE_DCONF_BRIDGE_TRUE@upstart_dconf_bridge_LDADD = \ @ENABLE_DCONF_BRIDGE_TRUE@ $(LTLIBINTL) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(NIH_LIBS) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(NIH_DBUS_LIBS) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(DBUS_LIBS) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(GIO_LIBS) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(DCONF_LIBS) @ENABLE_DCONF_BRIDGE_TRUE@upstart_dconf_bridge_CFLAGS = \ @ENABLE_DCONF_BRIDGE_TRUE@ $(NIH_CFLAGS) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(NIH_DBUS_CFLAGS) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(DBUS_CFLAGS) \ @ENABLE_DCONF_BRIDGE_TRUE@ $(DCONF_CFLAGS) @ENABLE_UDEV_BRIDGE_TRUE@upstart_udev_bridge_SOURCES = \ @ENABLE_UDEV_BRIDGE_TRUE@ upstart-udev-bridge.c @ENABLE_UDEV_BRIDGE_TRUE@nodist_upstart_udev_bridge_SOURCES = \ @ENABLE_UDEV_BRIDGE_TRUE@ $(com_ubuntu_Upstart_OUTPUTS) @ENABLE_UDEV_BRIDGE_TRUE@upstart_udev_bridge_LDADD = \ @ENABLE_UDEV_BRIDGE_TRUE@ $(LTLIBINTL) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(NIH_LIBS) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(NIH_DBUS_LIBS) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(DBUS_LIBS) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(UDEV_LIBS) @ENABLE_UDEV_BRIDGE_TRUE@upstart_udev_bridge_CFLAGS = \ @ENABLE_UDEV_BRIDGE_TRUE@ $(NIH_CFLAGS) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(NIH_DBUS_CFLAGS) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(DBUS_CFLAGS) \ @ENABLE_UDEV_BRIDGE_TRUE@ $(UDEV_CFLAGS) com_ubuntu_Upstart_OUTPUTS = \ com.ubuntu.Upstart.c \ com.ubuntu.Upstart.h com_ubuntu_Upstart_XML = \ ../dbus/com.ubuntu.Upstart.xml com_ubuntu_Upstart_Job_OUTPUTS = \ com.ubuntu.Upstart.Job.c \ com.ubuntu.Upstart.Job.h com_ubuntu_Upstart_Job_XML = \ ../dbus/com.ubuntu.Upstart.Job.xml # These have to be built sources because we can't compile object files # without the header file existing first BUILT_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) CLEANFILES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu extra/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu extra/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list upstart-dbus-bridge$(EXEEXT): $(upstart_dbus_bridge_OBJECTS) $(upstart_dbus_bridge_DEPENDENCIES) $(EXTRA_upstart_dbus_bridge_DEPENDENCIES) @rm -f upstart-dbus-bridge$(EXEEXT) $(AM_V_CCLD)$(LINK) $(upstart_dbus_bridge_OBJECTS) $(upstart_dbus_bridge_LDADD) $(LIBS) upstart-dconf-bridge$(EXEEXT): $(upstart_dconf_bridge_OBJECTS) $(upstart_dconf_bridge_DEPENDENCIES) $(EXTRA_upstart_dconf_bridge_DEPENDENCIES) @rm -f upstart-dconf-bridge$(EXEEXT) $(AM_V_CCLD)$(upstart_dconf_bridge_LINK) $(upstart_dconf_bridge_OBJECTS) $(upstart_dconf_bridge_LDADD) $(LIBS) upstart-event-bridge$(EXEEXT): $(upstart_event_bridge_OBJECTS) $(upstart_event_bridge_DEPENDENCIES) $(EXTRA_upstart_event_bridge_DEPENDENCIES) @rm -f upstart-event-bridge$(EXEEXT) $(AM_V_CCLD)$(LINK) $(upstart_event_bridge_OBJECTS) $(upstart_event_bridge_LDADD) $(LIBS) upstart-file-bridge$(EXEEXT): $(upstart_file_bridge_OBJECTS) $(upstart_file_bridge_DEPENDENCIES) $(EXTRA_upstart_file_bridge_DEPENDENCIES) @rm -f upstart-file-bridge$(EXEEXT) $(AM_V_CCLD)$(LINK) $(upstart_file_bridge_OBJECTS) $(upstart_file_bridge_LDADD) $(LIBS) upstart-local-bridge$(EXEEXT): $(upstart_local_bridge_OBJECTS) $(upstart_local_bridge_DEPENDENCIES) $(EXTRA_upstart_local_bridge_DEPENDENCIES) @rm -f upstart-local-bridge$(EXEEXT) $(AM_V_CCLD)$(LINK) $(upstart_local_bridge_OBJECTS) $(upstart_local_bridge_LDADD) $(LIBS) upstart-socket-bridge$(EXEEXT): $(upstart_socket_bridge_OBJECTS) $(upstart_socket_bridge_DEPENDENCIES) $(EXTRA_upstart_socket_bridge_DEPENDENCIES) @rm -f upstart-socket-bridge$(EXEEXT) $(AM_V_CCLD)$(LINK) $(upstart_socket_bridge_OBJECTS) $(upstart_socket_bridge_LDADD) $(LIBS) upstart-udev-bridge$(EXEEXT): $(upstart_udev_bridge_OBJECTS) $(upstart_udev_bridge_DEPENDENCIES) $(EXTRA_upstart_udev_bridge_DEPENDENCIES) @rm -f upstart-udev-bridge$(EXEEXT) $(AM_V_CCLD)$(upstart_udev_bridge_LINK) $(upstart_udev_bridge_OBJECTS) $(upstart_udev_bridge_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upstart-dbus-bridge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upstart-event-bridge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upstart-file-bridge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upstart-local-bridge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upstart-socket-bridge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upstart_dconf_bridge-com.ubuntu.Upstart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upstart_dconf_bridge-upstart-dconf-bridge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upstart_udev_bridge-com.ubuntu.Upstart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upstart_udev_bridge-upstart-udev-bridge.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< upstart_dconf_bridge-upstart-dconf-bridge.o: upstart-dconf-bridge.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_dconf_bridge_CFLAGS) $(CFLAGS) -MT upstart_dconf_bridge-upstart-dconf-bridge.o -MD -MP -MF $(DEPDIR)/upstart_dconf_bridge-upstart-dconf-bridge.Tpo -c -o upstart_dconf_bridge-upstart-dconf-bridge.o `test -f 'upstart-dconf-bridge.c' || echo '$(srcdir)/'`upstart-dconf-bridge.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/upstart_dconf_bridge-upstart-dconf-bridge.Tpo $(DEPDIR)/upstart_dconf_bridge-upstart-dconf-bridge.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upstart-dconf-bridge.c' object='upstart_dconf_bridge-upstart-dconf-bridge.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_dconf_bridge_CFLAGS) $(CFLAGS) -c -o upstart_dconf_bridge-upstart-dconf-bridge.o `test -f 'upstart-dconf-bridge.c' || echo '$(srcdir)/'`upstart-dconf-bridge.c upstart_dconf_bridge-upstart-dconf-bridge.obj: upstart-dconf-bridge.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_dconf_bridge_CFLAGS) $(CFLAGS) -MT upstart_dconf_bridge-upstart-dconf-bridge.obj -MD -MP -MF $(DEPDIR)/upstart_dconf_bridge-upstart-dconf-bridge.Tpo -c -o upstart_dconf_bridge-upstart-dconf-bridge.obj `if test -f 'upstart-dconf-bridge.c'; then $(CYGPATH_W) 'upstart-dconf-bridge.c'; else $(CYGPATH_W) '$(srcdir)/upstart-dconf-bridge.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/upstart_dconf_bridge-upstart-dconf-bridge.Tpo $(DEPDIR)/upstart_dconf_bridge-upstart-dconf-bridge.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upstart-dconf-bridge.c' object='upstart_dconf_bridge-upstart-dconf-bridge.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_dconf_bridge_CFLAGS) $(CFLAGS) -c -o upstart_dconf_bridge-upstart-dconf-bridge.obj `if test -f 'upstart-dconf-bridge.c'; then $(CYGPATH_W) 'upstart-dconf-bridge.c'; else $(CYGPATH_W) '$(srcdir)/upstart-dconf-bridge.c'; fi` upstart_dconf_bridge-com.ubuntu.Upstart.o: com.ubuntu.Upstart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_dconf_bridge_CFLAGS) $(CFLAGS) -MT upstart_dconf_bridge-com.ubuntu.Upstart.o -MD -MP -MF $(DEPDIR)/upstart_dconf_bridge-com.ubuntu.Upstart.Tpo -c -o upstart_dconf_bridge-com.ubuntu.Upstart.o `test -f 'com.ubuntu.Upstart.c' || echo '$(srcdir)/'`com.ubuntu.Upstart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/upstart_dconf_bridge-com.ubuntu.Upstart.Tpo $(DEPDIR)/upstart_dconf_bridge-com.ubuntu.Upstart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='com.ubuntu.Upstart.c' object='upstart_dconf_bridge-com.ubuntu.Upstart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_dconf_bridge_CFLAGS) $(CFLAGS) -c -o upstart_dconf_bridge-com.ubuntu.Upstart.o `test -f 'com.ubuntu.Upstart.c' || echo '$(srcdir)/'`com.ubuntu.Upstart.c upstart_dconf_bridge-com.ubuntu.Upstart.obj: com.ubuntu.Upstart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_dconf_bridge_CFLAGS) $(CFLAGS) -MT upstart_dconf_bridge-com.ubuntu.Upstart.obj -MD -MP -MF $(DEPDIR)/upstart_dconf_bridge-com.ubuntu.Upstart.Tpo -c -o upstart_dconf_bridge-com.ubuntu.Upstart.obj `if test -f 'com.ubuntu.Upstart.c'; then $(CYGPATH_W) 'com.ubuntu.Upstart.c'; else $(CYGPATH_W) '$(srcdir)/com.ubuntu.Upstart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/upstart_dconf_bridge-com.ubuntu.Upstart.Tpo $(DEPDIR)/upstart_dconf_bridge-com.ubuntu.Upstart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='com.ubuntu.Upstart.c' object='upstart_dconf_bridge-com.ubuntu.Upstart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_dconf_bridge_CFLAGS) $(CFLAGS) -c -o upstart_dconf_bridge-com.ubuntu.Upstart.obj `if test -f 'com.ubuntu.Upstart.c'; then $(CYGPATH_W) 'com.ubuntu.Upstart.c'; else $(CYGPATH_W) '$(srcdir)/com.ubuntu.Upstart.c'; fi` upstart_udev_bridge-upstart-udev-bridge.o: upstart-udev-bridge.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_udev_bridge_CFLAGS) $(CFLAGS) -MT upstart_udev_bridge-upstart-udev-bridge.o -MD -MP -MF $(DEPDIR)/upstart_udev_bridge-upstart-udev-bridge.Tpo -c -o upstart_udev_bridge-upstart-udev-bridge.o `test -f 'upstart-udev-bridge.c' || echo '$(srcdir)/'`upstart-udev-bridge.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/upstart_udev_bridge-upstart-udev-bridge.Tpo $(DEPDIR)/upstart_udev_bridge-upstart-udev-bridge.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upstart-udev-bridge.c' object='upstart_udev_bridge-upstart-udev-bridge.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_udev_bridge_CFLAGS) $(CFLAGS) -c -o upstart_udev_bridge-upstart-udev-bridge.o `test -f 'upstart-udev-bridge.c' || echo '$(srcdir)/'`upstart-udev-bridge.c upstart_udev_bridge-upstart-udev-bridge.obj: upstart-udev-bridge.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_udev_bridge_CFLAGS) $(CFLAGS) -MT upstart_udev_bridge-upstart-udev-bridge.obj -MD -MP -MF $(DEPDIR)/upstart_udev_bridge-upstart-udev-bridge.Tpo -c -o upstart_udev_bridge-upstart-udev-bridge.obj `if test -f 'upstart-udev-bridge.c'; then $(CYGPATH_W) 'upstart-udev-bridge.c'; else $(CYGPATH_W) '$(srcdir)/upstart-udev-bridge.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/upstart_udev_bridge-upstart-udev-bridge.Tpo $(DEPDIR)/upstart_udev_bridge-upstart-udev-bridge.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upstart-udev-bridge.c' object='upstart_udev_bridge-upstart-udev-bridge.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_udev_bridge_CFLAGS) $(CFLAGS) -c -o upstart_udev_bridge-upstart-udev-bridge.obj `if test -f 'upstart-udev-bridge.c'; then $(CYGPATH_W) 'upstart-udev-bridge.c'; else $(CYGPATH_W) '$(srcdir)/upstart-udev-bridge.c'; fi` upstart_udev_bridge-com.ubuntu.Upstart.o: com.ubuntu.Upstart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_udev_bridge_CFLAGS) $(CFLAGS) -MT upstart_udev_bridge-com.ubuntu.Upstart.o -MD -MP -MF $(DEPDIR)/upstart_udev_bridge-com.ubuntu.Upstart.Tpo -c -o upstart_udev_bridge-com.ubuntu.Upstart.o `test -f 'com.ubuntu.Upstart.c' || echo '$(srcdir)/'`com.ubuntu.Upstart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/upstart_udev_bridge-com.ubuntu.Upstart.Tpo $(DEPDIR)/upstart_udev_bridge-com.ubuntu.Upstart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='com.ubuntu.Upstart.c' object='upstart_udev_bridge-com.ubuntu.Upstart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_udev_bridge_CFLAGS) $(CFLAGS) -c -o upstart_udev_bridge-com.ubuntu.Upstart.o `test -f 'com.ubuntu.Upstart.c' || echo '$(srcdir)/'`com.ubuntu.Upstart.c upstart_udev_bridge-com.ubuntu.Upstart.obj: com.ubuntu.Upstart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_udev_bridge_CFLAGS) $(CFLAGS) -MT upstart_udev_bridge-com.ubuntu.Upstart.obj -MD -MP -MF $(DEPDIR)/upstart_udev_bridge-com.ubuntu.Upstart.Tpo -c -o upstart_udev_bridge-com.ubuntu.Upstart.obj `if test -f 'com.ubuntu.Upstart.c'; then $(CYGPATH_W) 'com.ubuntu.Upstart.c'; else $(CYGPATH_W) '$(srcdir)/com.ubuntu.Upstart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/upstart_udev_bridge-com.ubuntu.Upstart.Tpo $(DEPDIR)/upstart_udev_bridge-com.ubuntu.Upstart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='com.ubuntu.Upstart.c' object='upstart_udev_bridge-com.ubuntu.Upstart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(upstart_udev_bridge_CFLAGS) $(CFLAGS) -c -o upstart_udev_bridge-com.ubuntu.Upstart.obj `if test -f 'com.ubuntu.Upstart.c'; then $(CYGPATH_W) 'com.ubuntu.Upstart.c'; else $(CYGPATH_W) '$(srcdir)/com.ubuntu.Upstart.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man7: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.7[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-man8: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) install-dist_initDATA: $(dist_init_DATA) @$(NORMAL_INSTALL) @list='$(dist_init_DATA)'; test -n "$(initdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(initdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(initdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(initdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(initdir)" || exit $$?; \ done uninstall-dist_initDATA: @$(NORMAL_UNINSTALL) @list='$(dist_init_DATA)'; test -n "$(initdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(initdir)'; $(am__uninstall_files_from_dir) install-dist_sessionsDATA: $(dist_sessions_DATA) @$(NORMAL_INSTALL) @list='$(dist_sessions_DATA)'; test -n "$(sessionsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sessionsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sessionsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sessionsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(sessionsdir)" || exit $$?; \ done uninstall-dist_sessionsDATA: @$(NORMAL_UNINSTALL) @list='$(dist_sessions_DATA)'; test -n "$(sessionsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(sessionsdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sessionsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) @ENABLE_UDEV_BRIDGE_FALSE@install-data-hook: clean: clean-am clean-am: clean-generic clean-libtool clean-local clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_initDATA install-dist_sessionsDATA \ install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man7 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_initDATA uninstall-dist_sessionsDATA \ uninstall-man uninstall-sbinPROGRAMS uninstall-man: uninstall-man7 uninstall-man8 .MAKE: all check install install-am install-data-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-local clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-hook install-dist_initDATA \ install-dist_sessionsDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man7 \ install-man8 install-pdf install-pdf-am install-ps \ install-ps-am install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic maintainer-clean-local mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-dist_initDATA uninstall-dist_sessionsDATA \ uninstall-man uninstall-man7 uninstall-man8 \ uninstall-sbinPROGRAMS @ENABLE_UDEV_BRIDGE_TRUE@install-data-hook: @ENABLE_UDEV_BRIDGE_TRUE@ src=`echo upstart-udev-bridge| sed '$(transform)'`.8; \ @ENABLE_UDEV_BRIDGE_TRUE@ for symlink in \ @ENABLE_UDEV_BRIDGE_TRUE@ net-device-added \ @ENABLE_UDEV_BRIDGE_TRUE@ net-device-removed \ @ENABLE_UDEV_BRIDGE_TRUE@ graphics-device-added \ @ENABLE_UDEV_BRIDGE_TRUE@ drm-device-added; do \ @ENABLE_UDEV_BRIDGE_TRUE@ inst=`echo $$symlink | sed '$(transform)'`.7; \ @ENABLE_UDEV_BRIDGE_TRUE@ echo " ln -sf '$(man8dir)/$$src' '$(DESTDIR)$(man7dir)/$$inst'"; \ @ENABLE_UDEV_BRIDGE_TRUE@ ln -sf "$(man8dir)/$$src" "$(DESTDIR)$(man7dir)/$$inst"; \ @ENABLE_UDEV_BRIDGE_TRUE@ done $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=upstart \ --default-interface=com.ubuntu.Upstart0_6 \ --output=$@ $< $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job_class \ --default-interface=com.ubuntu.Upstart0_6.Job \ --output=$@ $< clean-local: rm -f *.gcno *.gcda maintainer-clean-local: rm -f *.gcov # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/extra/Makefile.am0000664000175000017500000001235012373101356013404 00000000000000## Process this file with automake to produce Makefile.in # Required to allow conditional appends below EXTRA_DIST = AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) AM_CPPFLAGS = \ -DLOCALEDIR="\"$(localedir)\"" \ -DSBINDIR="\"$(sbindir)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ -I$(top_srcdir)/intl initdir = $(sysconfdir)/init sessionsdir = $(datadir)/upstart/sessions dist_sessions_DATA = \ conf-session/upstart-event-bridge.conf \ conf-session/upstart-file-bridge.conf \ conf-session/re-exec.conf \ conf-session/upstart-dbus-session-bridge.conf \ conf-session/upstart-dbus-system-bridge.conf sbin_PROGRAMS = \ upstart-event-bridge \ upstart-file-bridge \ upstart-dbus-bridge dist_init_DATA = \ conf/upstart-socket-bridge.conf \ conf/upstart-event-bridge.conf \ conf/upstart-file-bridge.conf \ conf/upstart-dbus-bridge.conf dist_man_MANS = \ man/upstart-socket-bridge.8 \ man/upstart-event-bridge.8 \ man/upstart-file-bridge.8 \ man/upstart-dbus-bridge.8 \ man/upstart-local-bridge.8 \ man/socket-event.7 \ man/file-event.7 \ man/dbus-event.7 if ENABLE_SOCKET_BRIDGE sbin_PROGRAMS += \ upstart-socket-bridge upstart_socket_bridge_SOURCES = \ upstart-socket-bridge.c nodist_upstart_socket_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) upstart_socket_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) else EXTRA_DIST += \ upstart-socket-bridge.c endif upstart_event_bridge_SOURCES = \ upstart-event-bridge.c nodist_upstart_event_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) upstart_event_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) upstart_file_bridge_SOURCES = \ upstart-file-bridge.c nodist_upstart_file_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) upstart_file_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) upstart_dbus_bridge_SOURCES = \ upstart-dbus-bridge.c nodist_upstart_dbus_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) upstart_dbus_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) if ENABLE_LOCAL_BRIDGE sbin_PROGRAMS += \ upstart-local-bridge upstart_local_bridge_SOURCES = \ upstart-local-bridge.c nodist_upstart_local_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) upstart_local_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) else EXTRA_DIST += \ upstart-local-bridge.c endif dist_sessions_DATA += \ conf-session/upstart-dconf-bridge.conf dist_man_MANS += \ man/upstart-dconf-bridge.8 \ man/dconf-event.7 if ENABLE_DCONF_BRIDGE sbin_PROGRAMS += \ upstart-dconf-bridge upstart_dconf_bridge_SOURCES = \ upstart-dconf-bridge.c nodist_upstart_dconf_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) upstart_dconf_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(GIO_LIBS) \ $(DCONF_LIBS) upstart_dconf_bridge_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) \ $(DCONF_CFLAGS) else EXTRA_DIST += \ upstart-dconf-bridge.c endif dist_init_DATA += \ conf/upstart-udev-bridge.conf dist_man_MANS += \ man/upstart-udev-bridge.8 if ENABLE_UDEV_BRIDGE sbin_PROGRAMS += \ upstart-udev-bridge upstart_udev_bridge_SOURCES = \ upstart-udev-bridge.c nodist_upstart_udev_bridge_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) upstart_udev_bridge_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(UDEV_LIBS) upstart_udev_bridge_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) \ $(UDEV_CFLAGS) install-data-hook: src=`echo upstart-udev-bridge| sed '$(transform)'`.8; \ for symlink in \ net-device-added \ net-device-removed \ graphics-device-added \ drm-device-added; do \ inst=`echo $$symlink | sed '$(transform)'`.7; \ echo " ln -sf '$(man8dir)/$$src' '$(DESTDIR)$(man7dir)/$$inst'"; \ ln -sf "$(man8dir)/$$src" "$(DESTDIR)$(man7dir)/$$inst"; \ done else EXTRA_DIST += \ upstart-udev-bridge.c \ man/upstart-udev-bridge.8 endif com_ubuntu_Upstart_OUTPUTS = \ com.ubuntu.Upstart.c \ com.ubuntu.Upstart.h com_ubuntu_Upstart_XML = \ ../dbus/com.ubuntu.Upstart.xml $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=upstart \ --default-interface=com.ubuntu.Upstart0_6 \ --output=$@ $< com_ubuntu_Upstart_Job_OUTPUTS = \ com.ubuntu.Upstart.Job.c \ com.ubuntu.Upstart.Job.h com_ubuntu_Upstart_Job_XML = \ ../dbus/com.ubuntu.Upstart.Job.xml $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job_class \ --default-interface=com.ubuntu.Upstart0_6.Job \ --output=$@ $< # These have to be built sources because we can't compile object files # without the header file existing first BUILT_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) CLEANFILES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) clean-local: rm -f *.gcno *.gcda maintainer-clean-local: rm -f *.gcov upstart-1.13.2/extra/upstart-dconf-bridge.c0000664000175000017500000003563612373101356015553 00000000000000/* upstart-dconf-bridge * * Copyright © 2012-2013 Canonical Ltd. * Author: Stéphane Graber . * Author: Thomas Bechtold . * Author: James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" #include "com.ubuntu.Upstart.Job.h" /** * DCONF_EVENT: * * Name of event this program emits. **/ #define DCONF_EVENT "dconf" /* Prototypes for static functions */ static void dconf_changed (DConfClient *client, const gchar *prefix, const gchar * const *changes, const gchar *tag, GDBusProxy *upstart); static void handle_upstart_job (GDBusProxy *proxy, gchar *sender_name, gchar *signal_name, GVariant *parameters, gpointer user_data); static int handle_existing_jobs (GDBusProxy *upstart_proxy) __attribute__ ((warn_unused_result)); static int job_needs_event (const char *object_path) __attribute__ ((warn_unused_result)); static int jobs_need_event (void) __attribute__ ((warn_unused_result)); /** * Structure we use for tracking jobs * * @entry: list header, * @path: D-Bus path of job being tracked. **/ typedef struct job { NihList entry; char *path; } Job; /** * daemonise: * * Set to TRUE if we should become a daemon, rather than just running * in the foreground. **/ static int daemonise = FALSE; /** * always: * * If TRUE, always emit Upstart events, regardless of whether * existing jobs care about DBUS_EVENT. */ static int always = FALSE; /** * jobs: * * Jobs that we're monitoring. **/ static NihHash *jobs = NULL; /** * connection: * * D-Bus connection to Upstart. **/ GDBusConnection *connection = NULL; /** * options: * * Command-line options accepted by this program. **/ static NihOption options[] = { { 0, "always", N_("Always emit an event on a dconf change"), NULL, NULL, &always, NULL }, { 0, "daemon", N_("Detach and run in the background"), NULL, NULL, &daemonise, NULL }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char **args; DConfClient *client; GMainLoop *mainloop; GDBusProxy *upstart_proxy; GError *error = NULL; char *user_session_addr = NULL; nih_local char **user_session_path = NULL; char *path_element = NULL; char *pidfile_path = NULL; char *pidfile = NULL; client = dconf_client_new (); mainloop = g_main_loop_new (NULL, FALSE); /* Use NIH to parse the arguments */ nih_main_init (argv[0]); nih_option_set_synopsis (_("Bridge dconf events into upstart")); nih_option_set_help ( _("By default, upstart-dconf-bridge does not detach from the " "console and remains in the foreground. Use the --daemon " "option to have it detach.")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); user_session_addr = getenv ("UPSTART_SESSION"); if (! user_session_addr) { nih_fatal (_("UPSTART_SESSION isn't set in environment")); exit (1); } /* Connect to the Upstart session */ connection = g_dbus_connection_new_for_address_sync (user_session_addr, G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, NULL, /* GDBusAuthObserver*/ NULL, /* GCancellable */ &error); if (! connection) { g_error ("D-BUS Upstart session init error: %s", (error && error->message) ? error->message : "Unknown error"); g_clear_error (&error); exit (1); } /* Allocate jobs hash table */ jobs = NIH_MUST (nih_hash_string_new (NULL, 0)); /* Get an Upstart proxy object */ upstart_proxy = g_dbus_proxy_new_sync (connection, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, NULL, /* GDBusInterfaceInfo */ NULL, /* name */ "/com/ubuntu/Upstart", "com.ubuntu.Upstart0_6", NULL, /* GCancellable */ &error); if (! upstart_proxy) { g_error ("D-BUS Upstart proxy error: %s", (error && error->message) ? error->message : "Unknown error"); g_clear_error (&error); exit (1); } /* Connect signal to be notified when jobs come and go */ g_signal_connect (upstart_proxy, "g-signal", (GCallback) handle_upstart_job, NULL); if (! handle_existing_jobs (upstart_proxy)) exit (1); if (daemonise) { /* Deal with the pidfile location when becoming a daemon. * We need to be able to run one bridge per upstart daemon. * Store the PID file in XDG_RUNTIME_DIR or HOME and include the pid of * the Upstart instance (last part of the DBus path) in the filename. */ /* Extract PID from UPSTART_SESSION */ user_session_path = nih_str_split (NULL, user_session_addr, "/", TRUE); for (int i = 0; user_session_path && user_session_path[i]; i++) path_element = user_session_path[i]; if (! path_element) { nih_fatal (_("Invalid value for UPSTART_SESSION")); exit (1); } pidfile_path = getenv ("XDG_RUNTIME_DIR"); if (!pidfile_path) pidfile_path = getenv ("HOME"); if (pidfile_path) { NIH_MUST (nih_strcat_sprintf (&pidfile, NULL, "%s/upstart-dconf-bridge.%s.pid", pidfile_path, path_element)); nih_main_set_pidfile (pidfile); } if (nih_main_daemonise () < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Unable to become daemon"), err->message); nih_free (err); exit (1); } } /* Handle TERM and INT signals gracefully */ nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); /* Listen for any dconf change */ g_signal_connect (client, "changed", (GCallback) dconf_changed, upstart_proxy); dconf_client_watch_sync (client, "/"); /* Start the glib mainloop */ g_main_loop_run (mainloop); g_object_unref (client); g_object_unref (upstart_proxy); g_object_unref (connection); g_main_loop_unref (mainloop); exit (0); } /** * handle_upstart_job: * * Called when an Upstart D-Bus signal is emitted. **/ static void handle_upstart_job (GDBusProxy *proxy, gchar *sender_name, gchar *signal_name, GVariant *parameters, gpointer user_data) { GVariantIter iter; GVariant *child; const gchar *job_class_path; Job *job; int add; nih_assert (signal_name); nih_assert (parameters); nih_assert (jobs); if (! strcmp (signal_name, "JobAdded")) { add = 1; } else if (! strcmp (signal_name, "JobRemoved")) { add = 0; } else { return; } nih_assert (g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE)); g_variant_iter_init (&iter, parameters); nih_assert (g_variant_iter_n_children (&iter) == 1); child = g_variant_iter_next_value (&iter); job_class_path = g_variant_get_string (child, NULL); nih_assert (g_variant_is_object_path (job_class_path)); /* Free any existing record for the job if we are adding * (should never happen, but worth being safe). */ job = (Job *)nih_hash_lookup (jobs, job_class_path); if (job) nih_free (job); /* Job isn't interested in DCONF_EVENT */ if (add && ! job_needs_event (job_class_path)) goto out; if (add) nih_debug ("Job got added %s for event %s", job_class_path, DCONF_EVENT); else nih_debug ("Job went away %s", job_class_path); /* We're removing, so job done */ if (! add) goto out; /* Create new record for the job */ job = NIH_MUST (nih_new (NULL, Job)); job->path = NIH_MUST (nih_strdup (job, job_class_path)); nih_list_init (&job->entry); nih_alloc_set_destructor (job, nih_list_destroy); nih_hash_add (jobs, &job->entry); out: g_variant_unref (child); } /** * dconf_changed: * * Emit an Upstart event corresponding to a dconf key change. **/ static void dconf_changed (DConfClient *client, const gchar *prefix, const gchar * const *changes, const gchar *tag, GDBusProxy *upstart) { GVariant *value; gchar *value_str = NULL; gchar *path = NULL; gchar *env_key = NULL; gchar *env_value = NULL; GVariant *event; GVariantBuilder builder; int i = 0; /* dconf currently only currently supports the changed signal, * but parameterise to allow for a future API change. */ const gchar *event_type = "TYPE=changed"; if (! jobs_need_event () && ! always) return; /* Iterate through the various changes */ while (changes[i] != NULL) { path = g_strconcat (prefix, changes[i], NULL); value = dconf_client_read (client, path); value_str = g_variant_print (value, FALSE); env_key = g_strconcat ("KEY=", path, NULL); env_value = g_strconcat ("VALUE=", value_str, NULL); /* Build event environment as GVariant */ g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE); g_variant_builder_add (&builder, "s", DCONF_EVENT); g_variant_builder_open (&builder, G_VARIANT_TYPE_ARRAY); g_variant_builder_add (&builder, "s", event_type); g_variant_builder_add (&builder, "s", env_key); g_variant_builder_add (&builder, "s", env_value); g_variant_builder_close (&builder); g_variant_builder_add (&builder, "b", FALSE); event = g_variant_builder_end (&builder); /* Send the event */ g_dbus_proxy_call (upstart, "EmitEvent", event, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, /* GAsyncReadyCallback we don't care about the answer */ NULL); g_variant_builder_clear (&builder); g_variant_unref (value); g_free (path); g_free (value_str); g_free (env_key); g_free (env_value); i += 1; } } /** * jobs_need_event: * * Returns: TRUE if any jobs need DCONF_EVENT, else FALSE. **/ static int jobs_need_event (void) { NIH_HASH_FOREACH (jobs, iter) { return TRUE; } return FALSE; } /** * job_needs_event: * @object_path: Full D-Bus object path for job. * * Returns: TRUE if job specified by @object_path specifies DCONF_EVENT * in its 'start on' or 'stop on' stanza, else FALSE. **/ static int job_needs_event (const char *class_path) { GDBusProxy *job_proxy; GError *error = NULL; GVariantIter iter; const gchar *event_name; int ret = FALSE; /* Arrays of arrays of strings (aas) */ GVariant *start_on = NULL; GVariant *stop_on = NULL; /* Array containing event name and optional environment * variable elements. */ GVariant *event_element; /* Either an event name or "/AND" or "/OR" */ GVariant *event; nih_assert (class_path); job_proxy = g_dbus_proxy_new_sync (connection, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, NULL, /* GDBusInterfaceInfo */ NULL, /* name */ class_path, "com.ubuntu.Upstart0_6.Job", NULL, /* GCancellable */ &error); start_on = g_dbus_proxy_get_cached_property (job_proxy, "start_on"); nih_assert (g_variant_is_of_type (start_on, G_VARIANT_TYPE_ARRAY)); g_variant_iter_init (&iter, start_on); while ((event_element = g_variant_iter_next_value (&iter))) { nih_assert (g_variant_is_of_type (event_element, G_VARIANT_TYPE_ARRAY)); /* First element is always the event name */ event = g_variant_get_child_value (event_element, 0); nih_assert (g_variant_is_of_type (event, G_VARIANT_TYPE_STRING)); event_name = g_variant_get_string (event, NULL); if (! strcmp (event_name, DCONF_EVENT)) ret = TRUE; g_variant_unref (event_element); g_variant_unref (event); if (ret) goto out; } /* Now handle stop on */ stop_on = g_dbus_proxy_get_cached_property (job_proxy, "stop_on"); nih_assert (g_variant_is_of_type (stop_on, G_VARIANT_TYPE_ARRAY)); g_variant_iter_init (&iter, stop_on); while ((event_element = g_variant_iter_next_value (&iter))) { nih_assert (g_variant_is_of_type (event_element, G_VARIANT_TYPE_ARRAY)); /* First element is always the event name */ event = g_variant_get_child_value (event_element, 0); nih_assert (g_variant_is_of_type (event, G_VARIANT_TYPE_STRING)); event_name = g_variant_get_string (event, NULL); if (! strcmp (event_name, DCONF_EVENT)) ret = TRUE; g_variant_unref (event_element); g_variant_unref (event); if (ret) goto out; } out: if (start_on) g_variant_unref (start_on); if (stop_on) g_variant_unref (stop_on); g_object_unref (job_proxy); return ret; } /** * handle_existing_jobs: * * @upstart_proxy: Upstart proxy. * * Add all existing jobs which specify DCONF_EVENT to the list * of tracked jobs. * * Returns: TRUE or FALSE on error. **/ static int handle_existing_jobs (GDBusProxy *upstart_proxy) { GVariant *result; GVariant *child; GVariant *proxy_job; const gchar *job_class_path; GError *error = NULL; GVariantIter iter; Job *job; nih_assert (upstart_proxy); result = g_dbus_proxy_call_sync (upstart_proxy, "GetAllJobs", NULL, G_DBUS_CALL_FLAGS_NO_AUTO_START, -1, NULL, &error); if (! result) { g_error ("D-BUS Upstart proxy error: %s", (error && error->message) ? error->message : "Unknown error"); g_clear_error (&error); return FALSE; } nih_assert (g_variant_is_of_type (result, G_VARIANT_TYPE_TUPLE)); nih_assert (g_variant_n_children (result) == 1); child = g_variant_get_child_value (result, 0); nih_assert (g_variant_is_of_type (child, G_VARIANT_TYPE_OBJECT_PATH_ARRAY)); g_variant_iter_init (&iter, child); while ((proxy_job = g_variant_iter_next_value (&iter))) { job_class_path = g_variant_get_string (proxy_job, NULL); /* Free any existing record for the job if we are adding * (should never happen, but worth being safe). */ job = (Job *)nih_hash_lookup (jobs, job_class_path); if (job) nih_free (job); if (job_needs_event (job_class_path)) { /* Create new record for the job */ job = NIH_MUST (nih_new (NULL, Job)); job->path = NIH_MUST (nih_strdup (job, job_class_path)); nih_list_init (&job->entry); nih_alloc_set_destructor (job, nih_list_destroy); nih_hash_add (jobs, &job->entry); nih_debug ("Job added %s for event %s", job_class_path, DCONF_EVENT); } g_variant_unref (proxy_job); } g_variant_unref (child); g_variant_unref (result); return TRUE; } upstart-1.13.2/extra/upstart-event-bridge.c0000664000175000017500000002117012373101356015567 00000000000000/* upstart * * Copyright © 2012-2013 Canonical Ltd. * Author: Stéphane Graber * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" /* Prototypes for static functions */ static void upstart_disconnected (DBusConnection *connection); static void upstart_forward_event (void *data, NihDBusMessage *message, const char *path); static void upstart_forward_restarted (void *data, NihDBusMessage *message, const char *path); static void emit_event_error (void *data, NihDBusMessage *message); /** * daemonise: * * Set to TRUE if we should become a daemon, rather than just running * in the foreground. **/ static int daemonise = FALSE; /** * system_upstart: * * Proxy to system Upstart daemon. **/ static NihDBusProxy *system_upstart = NULL; /** * user_upstart: * * Proxy to user Upstart daemon instance. **/ static NihDBusProxy *user_upstart = NULL; /** * options: * * Command-line options accepted by this program. **/ static NihOption options[] = { { 0, "daemon", N_("Detach and run in the background"), NULL, NULL, &daemonise, NULL }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char ** args; DBusConnection * system_connection; DBusConnection * user_connection; int ret; char * pidfile_path = NULL; char * pidfile = NULL; char * user_session_addr = NULL; nih_local char ** user_session_path = NULL; char * path_element = NULL; nih_main_init (argv[0]); nih_option_set_synopsis (_("Bridge system upstart events into the user session upstart")); nih_option_set_help ( _("By default, upstart-event-bridge does not detach from the " "console and remains in the foreground. Use the --daemon " "option to have it detach.")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); user_session_addr = getenv ("UPSTART_SESSION"); if (! user_session_addr) { nih_fatal (_("UPSTART_SESSION isn't set in environment")); exit (1); } /* Initialise the connection to system Upstart */ system_connection = NIH_SHOULD (nih_dbus_bus (DBUS_BUS_SYSTEM, upstart_disconnected)); if (! system_connection) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not connect to system Upstart"), err->message); nih_free (err); exit (1); } system_upstart = NIH_SHOULD (nih_dbus_proxy_new (NULL, system_connection, DBUS_SERVICE_UPSTART, DBUS_PATH_UPSTART, NULL, NULL)); if (! system_upstart) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create Upstart proxy"), err->message); nih_free (err); exit (1); } if (! nih_dbus_proxy_connect (system_upstart, &upstart_com_ubuntu_Upstart0_6, "EventEmitted", (NihDBusSignalHandler)upstart_forward_event, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create EventEmitted signal connection"), err->message); nih_free (err); exit (1); } if (! nih_dbus_proxy_connect (system_upstart, &upstart_com_ubuntu_Upstart0_6, "Restarted", (NihDBusSignalHandler)upstart_forward_restarted, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create Restarted signal connection"), err->message); nih_free (err); exit (1); } /* Initialise the connection to user session Upstart */ user_connection = NIH_SHOULD (nih_dbus_connect (user_session_addr, upstart_disconnected)); if (! user_connection) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not connect to the user session Upstart"), err->message); nih_free (err); exit (1); } user_upstart = NIH_SHOULD (nih_dbus_proxy_new (NULL, user_connection, NULL, DBUS_PATH_UPSTART, NULL, NULL)); if (! user_upstart) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create Upstart proxy"), err->message); nih_free (err); exit (1); } /* Become daemon */ if (daemonise) { /* Deal with the pidfile location when becoming a daemon. * We need to be able to run one bridge per upstart daemon. * Store the PID file in XDG_RUNTIME_DIR or HOME and include the pid of * the Upstart instance (last part of the DBus path) in the filename. */ /* Extract PID from UPSTART_SESSION */ user_session_path = nih_str_split (NULL, user_session_addr, "/", TRUE); for (int i = 0; user_session_path && user_session_path[i]; i++) path_element = user_session_path[i]; if (! path_element) { nih_fatal (_("Invalid value for UPSTART_SESSION")); exit (1); } pidfile_path = getenv ("XDG_RUNTIME_DIR"); if (!pidfile_path) pidfile_path = getenv ("HOME"); if (pidfile_path) { NIH_MUST (nih_strcat_sprintf (&pidfile, NULL, "%s/upstart-event-bridge.%s.pid", pidfile_path, path_element)); nih_main_set_pidfile (pidfile); } if (nih_main_daemonise () < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Unable to become daemon"), err->message); nih_free (err); exit (1); } } /* Handle TERM and INT signals gracefully */ nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); if (! daemonise) { nih_signal_set_handler (SIGINT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGINT, nih_main_term_signal, NULL)); } ret = nih_main_loop (); /* Destroy any PID file we may have created */ if (daemonise) { nih_main_unlink_pidfile(); } return ret; } static void upstart_disconnected (DBusConnection *connection) { nih_fatal (_("Disconnected from Upstart")); nih_main_loop_exit (1); } static void upstart_forward_event (void * data, NihDBusMessage *message, const char * path) { char * event_name = NULL; nih_local char * new_event_name = NULL; char ** event_env = NULL; int event_env_count = 0; DBusError error; DBusPendingCall * pending_call; dbus_error_init (&error); /* Extract information from the original event */ if (!dbus_message_get_args (message->message, &error, DBUS_TYPE_STRING, &event_name, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &event_env, &event_env_count, DBUS_TYPE_INVALID)) { nih_error("DBUS error: %s", error.message); dbus_error_free(&error); return; } nih_assert (event_name != NULL); /* Build the new event name */ NIH_MUST (nih_strcat_sprintf (&new_event_name, NULL, ":sys:%s", event_name)); /* Re-transmit the event */ pending_call = upstart_emit_event (user_upstart, new_event_name, event_env, FALSE, NULL, emit_event_error, NULL, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); } dbus_pending_call_unref (pending_call); dbus_free_string_array (event_env); } static void upstart_forward_restarted (void * data, NihDBusMessage *message, const char * path) { DBusPendingCall * pending_call; /* Re-transmit the event */ pending_call = upstart_emit_event (user_upstart, ":sys:restarted", NULL, FALSE, NULL, emit_event_error, NULL, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); } dbus_pending_call_unref (pending_call); } static void emit_event_error (void * data, NihDBusMessage *message) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); } upstart-1.13.2/extra/upstart-socket-bridge.c0000664000175000017500000004160312373101356015741 00000000000000/* upstart * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" #include "com.ubuntu.Upstart.Job.h" /* Structure we use for tracking jobs */ typedef struct job { NihList entry; char *path; NihList sockets; } Job; /* Structure we use for tracking listening sockets */ typedef struct socket { NihList entry; union { struct sockaddr addr; struct sockaddr_in sin_addr; struct sockaddr_in6 sin6_addr; struct sockaddr_un sun_addr; }; socklen_t addrlen; int sock; } Socket; /* Prototypes for static functions */ static void epoll_watcher (void *data, NihIoWatch *watch, NihIoEvents events); static void upstart_job_added (void *data, NihDBusMessage *message, const char *job); static void upstart_job_removed (void *data, NihDBusMessage *message, const char *job); static void job_add_socket (Job *job, char **socket_info); static void socket_destroy (Socket *socket); static void upstart_disconnected (DBusConnection *connection); static void emit_event_reply (Socket *sock, NihDBusMessage *message); static void emit_event_error (Socket *sock, NihDBusMessage *message); /** * daemonise: * * Set to TRUE if we should become a daemon, rather than just running * in the foreground. **/ static int daemonise = FALSE; /** * epoll_fd: * * Shared epoll file descriptor for listening on. **/ static int epoll_fd = -1; /** * jobs: * * Jobs that we're monitoring. **/ static NihHash *jobs = NULL; /** * upstart: * * Proxy to Upstart daemon. **/ static NihDBusProxy *upstart = NULL; /** * options: * * Command-line options accepted by this program. **/ static NihOption options[] = { { 0, "daemon", N_("Detach and run in the background"), NULL, NULL, &daemonise, NULL }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char ** args; DBusConnection *connection; char ** job_class_paths; int ret; nih_main_init (argv[0]); nih_option_set_synopsis (_("Bridge socket events into upstart")); nih_option_set_help ( _("By default, upstart-socket-bridge does not detach from the " "console and remains in the foreground. Use the --daemon " "option to have it detach.")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); /* Create an epoll file descriptor for listening on; use this so * we can do edge triggering rather than level. */ epoll_fd = epoll_create1 (0); if (epoll_fd < 0) { nih_fatal ("%s: %s", _("Could not create epoll descriptor"), strerror (errno)); exit (1); } NIH_MUST (nih_io_add_watch (NULL, epoll_fd, NIH_IO_READ, epoll_watcher, NULL)); /* Allocate jobs hash table */ jobs = NIH_MUST (nih_hash_string_new (NULL, 0)); /* Initialise the connection to Upstart */ connection = NIH_SHOULD (nih_dbus_connect (DBUS_ADDRESS_UPSTART, upstart_disconnected)); if (! connection) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not connect to Upstart"), err->message); nih_free (err); exit (1); } upstart = NIH_SHOULD (nih_dbus_proxy_new (NULL, connection, NULL, DBUS_PATH_UPSTART, NULL, NULL)); if (! upstart) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create Upstart proxy"), err->message); nih_free (err); exit (1); } /* Connect signals to be notified when jobs come and go */ if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobAdded", (NihDBusSignalHandler)upstart_job_added, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create JobAdded signal connection"), err->message); nih_free (err); exit (1); } if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobRemoved", (NihDBusSignalHandler)upstart_job_removed, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create JobRemoved signal connection"), err->message); nih_free (err); exit (1); } /* Request a list of all current jobs */ if (upstart_get_all_jobs_sync (NULL, upstart, &job_class_paths) < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not obtain job list"), err->message); nih_free (err); exit (1); } for (char **job_class_path = job_class_paths; job_class_path && *job_class_path; job_class_path++) upstart_job_added (NULL, NULL, *job_class_path); nih_free (job_class_paths); /* Become daemon */ if (daemonise) { if (nih_main_daemonise () < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Unable to become daemon"), err->message); nih_free (err); exit (1); } /* Send all logging output to syslog */ openlog (program_name, LOG_PID, LOG_DAEMON); nih_log_set_logger (nih_logger_syslog); } /* Handle TERM and INT signals gracefully */ nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); if (! daemonise) { nih_signal_set_handler (SIGINT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGINT, nih_main_term_signal, NULL)); } ret = nih_main_loop (); return ret; } static void epoll_watcher (void * data, NihIoWatch *watch, NihIoEvents events) { struct epoll_event event[1024]; int num_events; num_events = epoll_wait (epoll_fd, event, 1024, 0); if (num_events < 0) { nih_error ("%s: %s", _("Error from epoll"), strerror (errno)); return; } else if (num_events == 0) return; for (int i = 0; i < num_events; i++) { Socket *sock = (Socket *)event[i].data.ptr; nih_local char **env = NULL; size_t env_len = 0; char *var; DBusPendingCall *pending_call; char buffer[INET6_ADDRSTRLEN]; if (event[i].events & EPOLLIN) nih_debug ("%p EPOLLIN", sock); if (event[i].events & EPOLLERR) nih_debug ("%p EPOLLERR", sock); if (event[i].events & EPOLLHUP) nih_debug ("%p EPOLLHUP", sock); env = NIH_MUST (nih_str_array_new (NULL)); switch (sock->addr.sa_family) { case AF_INET: NIH_MUST (nih_str_array_add (&env, NULL, &env_len, "PROTO=inet")); var = NIH_MUST (nih_sprintf (NULL, "PORT=%d", ntohs (sock->sin_addr.sin_port))); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); nih_discard (var); var = NIH_MUST (nih_sprintf (NULL, "ADDR=%s", inet_ntoa (sock->sin_addr.sin_addr))); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); nih_discard (var); break; case AF_INET6: NIH_MUST (nih_str_array_add (&env, NULL, &env_len, "PROTO=inet6")); var = NIH_MUST (nih_sprintf (NULL, "PORT=%d", ntohs (sock->sin6_addr.sin6_port))); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); nih_discard (var); var = NIH_MUST (nih_sprintf (NULL, "ADDR=%s", inet_ntop(AF_INET6, &sock->sin6_addr.sin6_addr, buffer, INET6_ADDRSTRLEN))); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); nih_discard (var); break; case AF_UNIX: NIH_MUST (nih_str_array_add (&env, NULL, &env_len, "PROTO=unix")); var = NIH_MUST (nih_sprintf (NULL, "SOCKET_PATH=%s", sock->sun_addr.sun_path)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); nih_discard (var); break; default: nih_assert_not_reached (); } pending_call = NIH_SHOULD (upstart_emit_event_with_file ( upstart, "socket", env, TRUE, sock->sock, (UpstartEmitEventWithFileReply)emit_event_reply, (NihDBusErrorHandler)emit_event_error, sock, NIH_DBUS_TIMEOUT_NEVER)); if (! pending_call) { NihError *err; err = nih_error_get (); nih_warn ("%s: %s", _("Could not send socket event"), err->message); nih_free (err); } dbus_pending_call_unref (pending_call); // might be EPOLLIN // might be EPOLLERR // might be EPOLLHUP } } static void upstart_job_added (void * data, NihDBusMessage *message, const char * job_class_path) { nih_local NihDBusProxy *job_class = NULL; nih_local char ***start_on = NULL; nih_local char ***stop_on = NULL; Job *job; nih_assert (job_class_path != NULL); /* Obtain a proxy to the job */ job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_class_path, NULL, NULL); if (! job_class) { NihError *err; err = nih_error_get (); nih_error ("Could not create proxy for job %s: %s", job_class_path, err->message); nih_free (err); return; } job_class->auto_start = FALSE; /* Obtain the start_on and stop_on properties of the job */ if (job_class_get_start_on_sync (NULL, job_class, &start_on) < 0) { NihError *err; err = nih_error_get (); nih_error ("Could not obtain job start condition %s: %s", job_class_path, err->message); nih_free (err); return; } if (job_class_get_stop_on_sync (NULL, job_class, &stop_on) < 0) { NihError *err; err = nih_error_get (); nih_error ("Could not obtain job stop condition %s: %s", job_class_path, err->message); nih_free (err); return; } /* Free any existing record for the job (should never happen, * but worth being safe). */ job = (Job *)nih_hash_lookup (jobs, job_class_path); if (job) nih_free (job); /* Create new record for the job */ job = NIH_MUST (nih_new (NULL, Job)); job->path = NIH_MUST (nih_strdup (job, job_class_path)); nih_list_init (&job->entry); nih_list_init (&job->sockets); /* Find out whether this job listens for any socket events */ for (char ***event = start_on; event && *event && **event; event++) if (! strcmp (**event, "socket")) job_add_socket (job, *event); for (char ***event = stop_on; event && *event && **event; event++) if (! strcmp (**event, "socket")) job_add_socket (job, *event); /* If we didn't end up with any sockets, free the job and move on */ if (NIH_LIST_EMPTY (&job->sockets)) { nih_free (job); return; } nih_debug ("Job got added %s", job_class_path); nih_alloc_set_destructor (job, nih_list_destroy); nih_hash_add (jobs, &job->entry); } static void upstart_job_removed (void * data, NihDBusMessage *message, const char * job_path) { Job *job; nih_assert (job_path != NULL); job = (Job *)nih_hash_lookup (jobs, job_path); if (job) { nih_debug ("Job went away %s", job_path); nih_free (job); } } static void job_add_socket (Job * job, char **socket_info) { Socket *sock; nih_local char *error = NULL; int components = 0; struct epoll_event event; nih_assert (job != NULL); nih_assert (socket_info != NULL); nih_assert (! strcmp(socket_info[0], "socket")); sock = NIH_MUST (nih_new (job, Socket)); memset (sock, 0, sizeof (Socket)); sock->sock = -1; nih_list_init (&sock->entry); nih_debug ("Found socket"); for (char **env = socket_info + 1; env && *env; env++) { char *val; size_t name_len; val = strchr (*env, '='); if (! val) { nih_warn ("Ignored socket event without variable name in %s", job->path); goto error; } name_len = val - *env; val++; if (! strncmp (*env, "PROTO", name_len)) { if (! strcmp (val, "inet")) { sock->addrlen = sizeof sock->sin_addr; sock->sin_addr.sin_family = AF_INET; sock->sin_addr.sin_addr.s_addr = INADDR_ANY; components = 1; } else if (! strcmp (val, "inet6")) { sock->addrlen = sizeof sock->sin6_addr; sock->sin6_addr.sin6_family = AF_INET6; sock->sin6_addr.sin6_addr = in6addr_any; components = 1; } else if (! strcmp (val, "unix")) { sock->addrlen = sizeof sock->sun_addr; sock->sun_addr.sun_family = AF_UNIX; components = 1; } else { nih_warn ("Ignored socket event with unknown PROTO=%s in %s", val, job->path); goto error; } } else if (! strncmp (*env, "PORT", name_len) && (sock->sin_addr.sin_family == AF_INET)) { sock->sin_addr.sin_port = htons (atoi (val)); components--; } else if (! strncmp (*env, "PORT", name_len) && (sock->sin6_addr.sin6_family == AF_INET6)) { sock->sin6_addr.sin6_port = htons (atoi (val)); components--; } else if (! strncmp (*env, "ADDR", name_len) && (sock->sin_addr.sin_family == AF_INET)) { if (inet_aton (val, &(sock->sin_addr.sin_addr)) == 0) { nih_warn ("Ignored socket event with invalid ADDR=%s in %s", val, job->path); goto error; } } else if (! strncmp (*env, "ADDR", name_len) && (sock->sin6_addr.sin6_family == AF_INET6)) { if (inet_pton (AF_INET6, val, &(sock->sin6_addr.sin6_addr)) != 1) { nih_warn ("Ignored socket event with invalid ADDR=%s in %s", val, job->path); goto error; } } else if (! strncmp (*env, "PATH", name_len) && (sock->sun_addr.sun_family == AF_UNIX)) { strncpy (sock->sun_addr.sun_path, val, sizeof sock->sun_addr.sun_path); if (sock->sun_addr.sun_path[0] == '@') sock->sun_addr.sun_path[0] = '\0'; components--; } else { nih_warn ("Ignored socket event with unknown variable %.*s in %s", (int)name_len, *env, job->path); goto error; } } /* Missing any required components? */ if (components) { nih_warn ("Ignored incomplete socket event in %s", job->path); goto error; } /* Let's try and set this baby up */ sock->sock = socket (sock->addr.sa_family, SOCK_STREAM, 0); if (sock->sock < 0) { nih_warn ("Failed to create socket in %s: %s", job->path, strerror (errno)); goto error; } int opt = 1; if (setsockopt (sock->sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof opt) < 0) { nih_warn ("Failed to set socket reuse in %s: %s", job->path, strerror (errno)); goto error; } /* If socket is ipv6, need to set IPV6_V6ONLY option */ if (sock->sin6_addr.sin6_family == AF_INET6 && setsockopt (sock->sock, SOL_IPV6, IPV6_V6ONLY, &opt, sizeof opt) < 0) { nih_warn ("Failed to set IPV6 only option in %s: %s", job->path, strerror (errno)); goto error; } if (bind (sock->sock, &sock->addr, sock->addrlen) < 0) { nih_warn ("Failed to bind socket in %s: %s", job->path, strerror (errno)); goto error; } if (listen (sock->sock, SOMAXCONN) < 0) { nih_warn ("Failed to listen on socket in %s: %s", job->path, strerror (errno)); goto error; } /* We have a listening socket, now we want to be notified when someone * connects; but we just want one notification, we don't want to get * a DDoS of wake-ups while waiting for the service to start. * * The solution is to use epoll in edge-triggered mode, this will * fire only on initial connection until a new one comes in. */ event.events = EPOLLIN | EPOLLET; event.data.ptr = sock; if (epoll_ctl (epoll_fd, EPOLL_CTL_ADD, sock->sock, &event) < 0) { nih_warn ("Failed to watch socket in %s: %s", job->path, strerror (errno)); goto error; } /* Okay then, add to the job */ nih_alloc_set_destructor (sock, socket_destroy); nih_list_add (&job->sockets, &sock->entry); return; error: if (sock->sock != -1) close (sock->sock); nih_free (sock); } static void socket_destroy (Socket *sock) { epoll_ctl (epoll_fd, EPOLL_CTL_DEL, sock->sock, NULL); close (sock->sock); nih_list_destroy (&sock->entry); } static void upstart_disconnected (DBusConnection *connection) { nih_fatal (_("Disconnected from Upstart")); nih_main_loop_exit (1); } static void emit_event_reply (Socket * sock, NihDBusMessage *message) { nih_debug ("Event completed"); } static void emit_event_error (Socket * sock, NihDBusMessage *message) { NihError *err; err = nih_error_get (); nih_warn ("%s: %s", _("Error emitting socket event"), err->message); nih_free (err); } upstart-1.13.2/extra/conf/0000775000175000017500000000000012402042412012342 500000000000000upstart-1.13.2/extra/conf/upstart-socket-bridge.conf0000664000175000017500000000051112373101356017362 00000000000000# upstart-socket-bridge - Bridge socket events into upstart # # This helper daemon receives socket(7) events and # emits equivalent Upstart events. description "Bridge socket events into upstart" emits socket start on net-device-up IFACE=lo stop on runlevel [!2345] expect daemon respawn exec upstart-socket-bridge --daemon upstart-1.13.2/extra/conf/upstart-udev-bridge.conf0000664000175000017500000000105112373101356017035 00000000000000# upstart-udev-bridge - Bridge udev events into upstart # # This helper daemon receives udev events from the netlink socket and # emits equivalent Upstart events. description "Bridge udev events into upstart" # From upstart-udev-bridge itself emits *-device-added emits *-device-removed emits *-device-changed # From http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/libudev-udev-device.html emits *-device-online emits *-device-offline start on starting udev stop on stopped udev expect daemon respawn exec upstart-udev-bridge --daemon upstart-1.13.2/extra/conf/upstart-event-bridge.conf0000664000175000017500000000060112373101356017213 00000000000000# upstart-event-bridge - Bridge system upstarts events into session upstart # # This helper daemon receives system upstart events from the DBus system bus # and emits equivalent events (with a :sys:) prefix to the session bus description "Bridge Upstart system events into session Upstart" emits :sys:* start on started dbus stop on stopped dbus respawn exec upstart-event-bridge upstart-1.13.2/extra/conf/upstart-file-bridge.conf0000664000175000017500000000063412373101356017017 00000000000000# upstart-file-bridge - Bridge file events into upstart # # This helper daemon receives inotify(7) events and # emits equivalent Upstart events. description "Bridge file events into upstart" emits file # the bridge does not currently handle dealing with mounts that overlay # already-watched directories. start on filesystem stop on runlevel [!2345] expect daemon respawn exec upstart-file-bridge --daemon upstart-1.13.2/extra/conf/upstart-dbus-bridge.conf0000664000175000017500000000051512373101356017033 00000000000000# upstart-dbus-bridge - Bridge D-Bus signal events into upstart # # This helper daemon receives D-Bus signal events and # emits equivalent Upstart events. description "Bridge D-Bus signal events into upstart" emits dbus start on startup stop on runlevel [!2345] expect daemon respawn exec upstart-dbus-bridge --daemon --system upstart-1.13.2/extra/conf-session/0000775000175000017500000000000012402042412014023 500000000000000upstart-1.13.2/extra/conf-session/upstart-dbus-session-bridge.conf0000664000175000017500000000056512373101356022202 00000000000000# upstart-dbus-bridge - Bridge D-Bus signal events into upstart # # This helper daemon receives D-Bus signal events and # emits equivalent Upstart events. description "Bridge D-Bus session bus signal events into upstart" emits dbus start on started dbus stop on stopping dbus expect daemon respawn exec upstart-dbus-bridge --daemon --session --user --bus-name session upstart-1.13.2/extra/conf-session/upstart-event-bridge.conf0000664000175000017500000000060112373101356020674 00000000000000# upstart-event-bridge - Bridge system upstarts events into session upstart # # This helper daemon receives system upstart events from the DBus system bus # and emits equivalent events (with a :sys:) prefix to the session bus description "Bridge Upstart system events into session Upstart" emits :sys:* start on started dbus stop on stopped dbus respawn exec upstart-event-bridge upstart-1.13.2/extra/conf-session/upstart-dbus-system-bridge.conf0000664000175000017500000000056212373101356022040 00000000000000# upstart-dbus-bridge - Bridge D-Bus signal events into upstart # # This helper daemon receives D-Bus signal events and # emits equivalent Upstart events. description "Bridge D-Bus system bus signal events into upstart" emits dbus start on started dbus stop on stopping dbus expect daemon respawn exec upstart-dbus-bridge --daemon --system --user --bus-name system upstart-1.13.2/extra/conf-session/upstart-file-bridge.conf0000664000175000017500000000047012373101356020476 00000000000000# upstart-file-bridge - Bridge file events into upstart # # This helper daemon receives inotify(7) events and # emits equivalent Upstart events. description "Bridge file events into upstart" emits file start on started dbus stop on session-end expect daemon respawn exec upstart-file-bridge --daemon --user upstart-1.13.2/extra/conf-session/re-exec.conf0000664000175000017500000000036612373101356016161 00000000000000description "Restart session init when system init restarts" author "Stéphane Graber " start on :sys:restarted exec dbus-send --type=method_call --address=$UPSTART_SESSION /com/ubuntu/Upstart com.ubuntu.Upstart0_6.Restart upstart-1.13.2/extra/conf-session/upstart-dconf-bridge.conf0000664000175000017500000000022412373101356020645 00000000000000description "Bridge dconf events into session upstart" emits dconf start on started dbus stop on stopped dbus respawn exec upstart-dconf-bridge upstart-1.13.2/extra/upstart-file-bridge.c0000664000175000017500000013650512373101356015376 00000000000000/* upstart * * Copyright © 2013 Canonical Ltd. * Author: James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** * This is the Upstart File Bridge which allows jobs to react to files * being created, modified and deleted. * * = Design = * * This bridge creates inotify watches on the _first existing parent * directory_ for the file (normal or directory) being watched for. As * directories are created, the watch is moved to become more specific * (closer to the actually requested file path) and as directories are * deleted, the watch is correspondingly changed to a less specific, but * existing, directory. * * This is necessary since: * * - It conserves system resources. * * There is little point creating 'n' watches on existing files when a * single watch on the parent directory will suffice. * * - It is not possible to create an inotify watch for a non-existent * entity (*). * * - In a sense, it simplifies the design. * * Otherwise the bridge would have to put a watch on each existing * file for modify and delete requests, but watch the parent for * create requests. And for a combination of requests who share * a parent directory, it's easier to just watch the parent alone. * * = Limitations = * * Since inotify is used, this bridge has a number of significant * limitations: * * 1) It cannot be anything but inherently racy. * * inotify(7) does not support recursive watches, so in some -- and not * necessarily pathological -- cases, events may be missed. This is * unfortunately exacerbated by the design of the bridge which creates * watches on the parent directory. This takes time, but in the window * when the watch is being created, files may have been modified * undetectably. * * For example, if the user requests a watch on '/var/log/app/foo.log', * the following might happen: * * (1) Watch is created for existing directory '/var/log/'. * (2) A process creates '/var/log/app/'. * (3) The bridge detects this and moves the watch from * '/var/log/' to '/var/log/app/'. * (4) Whilst (3) is happening, some process removes '/var/log/app/'. * (5) The bridge now has an impotent watch on the now-deleted * '/var/log/app/'. * (6) The app starts and (re-)creates '/var/log/app/'. * (7) The app now creates '/var/log/app/foo.log'. * (8) No event is emitted due to the impotent watch in (5). * * The situation is sadly actually worse than this: if a job watches for * a deep directory, if any one of the directory elements that is * created gets missed due to a race between the directory creation and * this bridge creating or moving a watch, the event will not be * emitted. * * = Advice = * * - Attempt to only watch for files to be created/modified/deleted * in directories that are guaranteed to already exist at * system startup. This avoids the racy behaviour between * directory creation and inotify watch manipulation. * * - If the directory is not guaranteed to exist at system startup, * create an Upstart job that creates the directory before the bridge * starts ('start on starting upstart-file-bridge'). * * = Alternative Approaches = * * fanotify is an alternative but again, it is limited: * * == Pros == * * + Supports recursive watches. * * == Cons == * * - Does not support a file delete event. * * - Potentially high system performance impact since _every_ file * operation on the partition (except delete) is inspected. * *---------- * * (*) - this is half true: inotify alarmingly does allow a watch to be * created on a non-existent entity, but is impotent - if that entity is * ever created, no event is received. **/ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" #include "com.ubuntu.Upstart.Job.h" /** * FILE_EVENT: * * Name of event this program handles **/ #define FILE_EVENT "file" /** * ALL_FILE_EVENTS: * * All the inotify file events we care about. **/ #define ALL_FILE_EVENTS (IN_CREATE|IN_MODIFY|IN_CLOSE_WRITE|IN_DELETE) /** * GLOB_CHARS: * * Wildcard characters recognised by glob(3) and fnmatch(3). **/ #define GLOB_CHARS "*?[]" /** * original_path: * * @file: WatchedFile: * * Obtain the appropriate WatchedFile path: the original if the * path underwent expansion or is a directory, else the initial * unexpanded path. * * Required for emitting events since jobs need the unexpanded path to * allow their start/stop condition to match even if the path has * subsequently been expanded by this bridge. **/ #define original_path(file) \ (file->original ? file->original : file->path) /** * skip_slashes: * * @path: pointer to path string. * * Increment @path to skip over multiple leading slashes. **/ #define skip_slashes(path) \ while (*(path) == '/' && (path)+1 && *((path)+1) == '/') \ (path)++ /** * Job: * * @entry: list header, * @path: D-Bus path of Upstart job, * @files: list of pointers to WatchedFile files Job will watch. * * Structure we use for tracking Upstart jobs. **/ typedef struct job { NihList entry; char *path; NihList files; } Job; /** * WatchedDir: * * @entry: list header, * @path: full path of directory being watched, * @files: hash of WatchedFile objects representing all files * watched in directory @path and sub-directories, * @watch: watch object. * * Every watched file is handled by watching the first parent * directory that currently exists. This allows use to: * * - minimise watch descriptors * - easily handle the case where a job wants to watch for a file being * created when that file doesn't yet exist (*). * * The drawback to this strategy is the complexity of handling watched * files and directories when files are created and deleted. * * Note that the WatchedFiles in @files are not necessarily _immediate_ * children of @path, but they are children. * * (*) Irritatingly, inotify _does_ allow for a watch on a * non-existing file to be created, but the watch is * impotent in that when the file _is_ created, no inotify * event results. * **/ typedef struct watched_dir { NihList entry; char *path; NihHash *files; NihWatch *watch; } WatchedDir; /** * WatchedFile: * * @entry: list header, * @path: full path to file being watched (or a glob), * @original: original (relative) path as specified by job * (or NULL if path expansion was not necessary), * @glob: glob file pattern (or NULL if globbing disabled), * @dir: TRUE if @path is a directory, * @events: mask of inotify events file is interested in, * @parent: parent who is watching over us. * * Details of the file being watched. * * For directories, @original contains the full path specified by the * job and @path will contain @original, less any trailing slashes. **/ typedef struct watched_file { NihList entry; char *path; char *original; char *glob; int dir; uint32_t events; WatchedDir *parent; } WatchedFile; /** * FileEvent: * * @entry: list header, * @path: full path to file being watched, * @event: event to emit, * @match: optional file match if @path is a directory or glob. * * Details of the event to be emitted. **/ typedef struct file_event { NihList entry; char *path; uint32_t event; char *match; } FileEvent; /* Prototypes for static functions */ static WatchedDir *watched_dir_new (const char *path, const struct stat *statbuf) __attribute__ ((warn_unused_result)); static WatchedFile *watched_file_new (const char *path, const char *original, uint32_t events, const char *glob) __attribute__ ((warn_unused_result)); static Job *job_new (const char *class_path) __attribute__ ((warn_unused_result)); static int file_filter (WatchedDir *dir, const char *path, int is_dir); static void create_handler (WatchedDir *dir, NihWatch *watch, const char *path, struct stat *statbuf); static void modify_handler (WatchedDir *dir, NihWatch *watch, const char *path, struct stat *statbuf); static void delete_handler (WatchedDir *dir, NihWatch *watch, const char *path); static void upstart_job_added (void *data, NihDBusMessage *message, const char *job_path); static void upstart_job_removed (void *data, NihDBusMessage *message, const char *job_path); static void job_add_file (Job *job, char **file_info); static void emit_event_error (void *data, NihDBusMessage *message); static int emit_event (const char *path, uint32_t event_type, const char *match); static FileEvent *file_event_new (void *parent, const char *path, uint32_t event, const char *match); static void upstart_disconnected (DBusConnection *connection); static void handle_event (NihHash *handled, const char *path, uint32_t event, const char *match); static int job_destroy (Job *job); static char * find_first_parent (const char *path) __attribute__ ((warn_unused_result)); void watched_dir_init (void); static void ensure_watched (Job *job, WatchedFile *file); static int string_match (const char *a, const char *b) __attribute__ ((warn_unused_result)); char * expand_path (const void *parent, const char *path) __attribute__ ((warn_unused_result)); static int path_valid (const char *path) __attribute__ ((warn_unused_result)); /** * daemonise: * * Set to TRUE if we should become a daemon, rather than just running * in the foreground. **/ static int daemonise = FALSE; /** * jobs: * * Hash of Upstart jobs that we're monitoring. **/ static NihHash *jobs = NULL; /** * watched_dirs: * * Hash of WatchedDir objects representing the minimum set of existing * parent directories that allow all WatchedFiles to be watched for. **/ static NihHash *watched_dirs = NULL; /** * upstart: * * Proxy to Upstart daemon. **/ static NihDBusProxy *upstart = NULL; /** * user: * * If TRUE, run in User Session mode connecting to the Session Init * rather than PID 1. In this mode, certain relative paths are also * expanded. **/ static int user = FALSE; /** * home_dir: * * Full path to home directory. **/ char home_dir[PATH_MAX]; /** * options: * * Command-line options accepted by this program. **/ static NihOption options[] = { { 0, "daemon", N_("Detach and run in the background"), NULL, NULL, &daemonise, NULL }, { 0, "user", N_("Connect to user session"), NULL, NULL, &user, NULL }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char **args; char **job_class_paths; DBusConnection *connection; char *pidfile_path = NULL; char *pidfile = NULL; char *user_session_addr = NULL; nih_local char **user_session_path = NULL; char *path_element = NULL; int ret; nih_main_init (argv[0]); nih_option_set_synopsis (_("Bridge inotify events into upstart")); nih_option_set_help ( _("By default, upstart-inotify-bridge does not detach from the " "console and remains in the foreground. Use the --daemon " "option to have it detach.")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (EXIT_FAILURE); if (user) { struct passwd *pw; user_session_addr = getenv ("UPSTART_SESSION"); if (! user_session_addr) { nih_fatal (_("UPSTART_SESSION isn't set in environment")); exit (EXIT_FAILURE); } pw = getpwuid (getuid ()); if (! pw) { nih_error ("Failed to get password entry"); exit (EXIT_FAILURE); } nih_assert (pw->pw_dir); memset (home_dir, '\0', sizeof (home_dir)); strncpy (home_dir, pw->pw_dir, sizeof (home_dir)-1); } /* Allocate jobs hash table */ jobs = NIH_MUST (nih_hash_string_new (NULL, 0)); /* Initialise the connection to Upstart */ connection = NIH_SHOULD (nih_dbus_connect (user ? user_session_addr : DBUS_ADDRESS_UPSTART, upstart_disconnected)); if (! connection) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not connect to Upstart"), err->message); nih_free (err); exit (EXIT_FAILURE); } upstart = NIH_SHOULD (nih_dbus_proxy_new (NULL, connection, NULL, DBUS_PATH_UPSTART, NULL, NULL)); if (! upstart) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create Upstart proxy"), err->message); nih_free (err); exit (EXIT_FAILURE); } /* Connect signals to be notified when jobs come and go */ if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobAdded", (NihDBusSignalHandler)upstart_job_added, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create JobAdded signal connection"), err->message); nih_free (err); exit (EXIT_FAILURE); } if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobRemoved", (NihDBusSignalHandler)upstart_job_removed, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create JobRemoved signal connection"), err->message); nih_free (err); exit (EXIT_FAILURE); } /* Request a list of all current jobs */ if (upstart_get_all_jobs_sync (NULL, upstart, &job_class_paths) < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not obtain job list"), err->message); nih_free (err); exit (EXIT_FAILURE); } /* Look for jobs that specify the FILE_EVENT event and handle * them. */ for (char **job_class_path = job_class_paths; job_class_path && *job_class_path; job_class_path++) { upstart_job_added (NULL, NULL, *job_class_path); } nih_free (job_class_paths); /* Become daemon */ if (daemonise) { /* Deal with the pidfile location when becoming a daemon. * We need to be able to run one bridge per upstart daemon. * Store the PID file in XDG_RUNTIME_DIR or HOME and include the pid of * the Upstart instance (last part of the DBus path) in the filename. */ if (user) { /* Extract PID from UPSTART_SESSION */ user_session_path = nih_str_split (NULL, user_session_addr, "/", TRUE); for (int i = 0; user_session_path && user_session_path[i]; i++) path_element = user_session_path[i]; if (! path_element) { nih_fatal (_("Invalid value for UPSTART_SESSION")); exit (1); } pidfile_path = getenv ("XDG_RUNTIME_DIR"); if (! pidfile_path) pidfile_path = getenv ("HOME"); if (pidfile_path) { NIH_MUST (nih_strcat_sprintf (&pidfile, NULL, "%s/upstart-file-bridge.%s.pid", pidfile_path, path_element)); nih_main_set_pidfile (pidfile); } } if (nih_main_daemonise () < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Unable to become daemon"), err->message); nih_free (err); exit (1); } } if (user) { /* Ensure we are sitting in $HOME so relative FILE * values work as expected. */ if (chdir (home_dir) < 0) { nih_error ("Failed to change working directory"); exit (EXIT_FAILURE); } } /* Handle TERM and INT signals gracefully */ nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); if (! daemonise) { nih_signal_set_handler (SIGINT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGINT, nih_main_term_signal, NULL)); } ret = nih_main_loop (); /* Destroy any PID file we may have created */ if (daemonise) nih_main_unlink_pidfile(); return ret; } /** * upstart_job_added: * * @data: (unused), * @message: Nih D-Bus message (unused), * @job_path: Upstart job class (D-Bus) path associated with job. * * Called automatically when a new Upstart job appears on D-Bus ("JobAdded" signal). **/ static void upstart_job_added (void *data, NihDBusMessage *message, const char *job_path) { Job *job; nih_local NihDBusProxy *job_class = NULL; nih_local char ***start_on = NULL; nih_local char ***stop_on = NULL; nih_assert (job_path); /* Obtain a proxy to the job */ job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_path, NULL, NULL); if (! job_class) { NihError *err; err = nih_error_get (); nih_error ("Could not create proxy for job %s: %s", job_path, err->message); nih_free (err); return; } job_class->auto_start = FALSE; /* Obtain the start_on and stop_on properties of the job */ if (job_class_get_start_on_sync (NULL, job_class, &start_on) < 0) { NihError *err; err = nih_error_get (); nih_error ("Could not obtain job start condition %s: %s", job_path, err->message); nih_free (err); return; } if (job_class_get_stop_on_sync (NULL, job_class, &stop_on) < 0) { NihError *err; err = nih_error_get (); nih_error ("Could not obtain job stop condition %s: %s", job_path, err->message); nih_free (err); return; } /* Free any existing record for the job (should never happen, * but worth being safe). */ job = (Job *)nih_hash_lookup (jobs, job_path); if (job) nih_free (job); /* Create new record for the job */ job = job_new (job_path); if (! job) { nih_error ("%s %s", _("Failed to create job"), job_path); return; } /* Find out whether this job listens for any FILE_EVENT events */ for (char ***event = start_on; event && *event && **event; event++) { if (! strcmp (**event, FILE_EVENT)) job_add_file (job, *event); } for (char ***event = stop_on; event && *event && **event; event++) if (! strcmp (**event, FILE_EVENT)) job_add_file (job, *event); /* If we didn't end up with any files, free the job and move on */ if (NIH_LIST_EMPTY (&job->files)) { nih_free (job); return; } nih_debug ("Job got added %s", job_path); } /** * upstart_job_removed: * * @data: (unused), * @message: Nih D-Bus message (unused), * @job_path: Upstart job class (D-Bus) path associated with job. * * Called automatically when an Upstart job disappears from D-Bus * ("JobRemoved" signal). * **/ static void upstart_job_removed (void *data, NihDBusMessage *message, const char *job_path) { Job *job; nih_assert (job_path); job = (Job *)nih_hash_lookup (jobs, job_path); if (! job) return; nih_debug ("Job went away %s", job_path); nih_free (job); } /** * job_add_file: * * @job: Job, * @file_info: environment variables Upstart job has specified * relating to FILE_EVENT. * * Create a WatchedFile object based on @file_info and ensure that * WatchedFile file (or glob) is watched. **/ static void job_add_file (Job *job, char **file_info) { uint32_t events = 0x0; WatchedFile *file = NULL; nih_local char *error = NULL; nih_local char *glob_expr = NULL; nih_local char *expanded = NULL; nih_local char *path = NULL; nih_assert (job); nih_assert (job->path); nih_assert (file_info); nih_assert (! strcmp (file_info[0], FILE_EVENT)); for (char **env = file_info + 1; env && *env; env++) { char *val; size_t name_len; val = strchr (*env, '='); if (! val) { nih_warn ("%s: Ignored %s event without variable name", job->path, FILE_EVENT); return; } name_len = val - *env; val++; if (! strncmp (*env, "FILE", name_len)) { nih_local char *dirpart = NULL; nih_local char *basepart = NULL; char *dir; char *base; size_t len2; path = NIH_MUST (nih_strdup (NULL, val)); if (user && path[0] != '/') { expanded = expand_path (NULL, path); if (! expanded) { nih_error ("Failed to expand path"); return; } } if (! path_valid (path)) return; dirpart = NIH_MUST (nih_strdup (NULL, path)); dir = dirname (dirpart); /* See dirname(3) */ nih_assert (*dir != '.'); len2 = strlen (dir); if (strcspn (dir, GLOB_CHARS) < len2) { nih_warn ("%s: %s", job->path, _("Directory globbing not supported")); return; } basepart = NIH_MUST (nih_strdup (NULL, path)); base = basename (basepart); /* See dirname(3) */ nih_assert (strcmp (base, basepart)); len2 = strlen (base); if (strcspn (base, GLOB_CHARS) < len2) { nih_free (path); path = NIH_MUST (nih_strdup (NULL, dir)); glob_expr = NIH_MUST (nih_strdup (NULL, base)); } } else if (! strncmp (*env, "EVENT", name_len)) { if (! strcmp (val, "create")) { events = IN_CREATE; } else if (! strcmp (val, "modify")) { events = (IN_MODIFY|IN_CLOSE_WRITE); } else if (! strcmp (val, "delete")) { events |= IN_DELETE; } } } if (! path) return; if (! events) events = ALL_FILE_EVENTS; file = watched_file_new (expanded ? expanded : path, expanded ? path : NULL, events, glob_expr); if (! file) { nih_warn ("%s: %s", _("Failed to add new file"), path); return; } /* If the job cares about the file or directory existing and it * _already_ exists, emit the event. * * Although technically fraudulent (the file might not have _just * been created_ - it may have existed forever), it is necessary * since otherwise jobs will hang around waiting for the file to * be 'freshly-created'. However, although nih_watch_new() has * been told to run the create handler for pre-existing files * that doesn't help as we don't watch the files, we watch * their first existing parent directory. **/ if ((file->events & IN_CREATE)) { struct stat statbuf; if (glob_expr) { glob_t globbuf; char pattern[PATH_MAX]; sprintf (pattern, "%s/%s", expanded ? expanded : path, glob_expr); if (! glob (pattern, 0, NULL, &globbuf)) { size_t i; char **results; results = globbuf.gl_pathv; /* emit one event per matching file */ for (i = 0; i < globbuf.gl_pathc; i++) { emit_event (pattern, IN_CREATE, results[i]); } } globfree (&globbuf); } else { if (! stat (file->path, &statbuf)) emit_event (file->path, IN_CREATE, NULL); } } ensure_watched (job, file); } /** * file_filter: * * @dir: WatchedDir, * @path: full path to file to consider, * @is_dir: TRUE if @path is a directory, else FALSE. * * Watch handler function to sift the wheat from the chaff. * * Returns: TRUE if @path should be ignored, FALSE otherwise. **/ int file_filter (WatchedDir *dir, const char *path, int is_dir) { nih_assert (dir); nih_assert (path); skip_slashes (path); NIH_HASH_FOREACH_SAFE (dir->files, iter) { WatchedFile *file = (WatchedFile *)iter; if (strstr (file->path, path) == file->path) { /* Either an exact match or path is a child of the watched file. * Paths in the latter category will be inspected more closely by * the handlers. */ return FALSE; } else if ((file->dir || file->glob) && strstr (path, file->path) == path) { return FALSE; } } return TRUE; } /** * create_handler: * * @dir: WatchedDir, * @watch: NihWatch for directory tree, * @path: full path to file, * @statbuf: stat of @path. * * Watch handler function called when a WatchedFile is created in @dir. **/ void create_handler (WatchedDir *dir, NihWatch *watch, const char *path, struct stat *statbuf) { WatchedDir *new_dir; char *p; int add_dir = FALSE; int empty; /* Hash of events already emitted (required to avoid sending * same event multiple times). */ nih_local NihHash *handled = NULL; /* List of existing WatchedFiles that need to be added against * @path (since @path either exactly matches their path, or * @path is more specific ancestor of their path). */ NihList entries; nih_assert (dir); nih_assert (watch); nih_assert (path); nih_assert (statbuf); skip_slashes (path); /* path should be a file below the WatchedDir */ nih_assert (strstr (path, dir->path) == path); nih_list_init (&entries); handled = NIH_MUST (nih_hash_string_new (NULL, 0)); NIH_HASH_FOREACH_SAFE (dir->files, iter) { WatchedFile *file = (WatchedFile *)iter; if (file->dir) { if (! strcmp (file->path, dir->path)) { /* Watch is on the directory itself and a file within that * watched directory was created, hence emit the _directory_ * was modified. */ if (file->events & IN_MODIFY) handle_event (handled, original_path (file), IN_MODIFY, path); } else if (! strcmp (file->path, path)) { /* Directory has been created */ handle_event (handled, original_path (file), IN_CREATE, NULL); add_dir = TRUE; nih_list_add (&entries, &file->entry); } } else if (file->glob) { nih_local char *full_path = NULL; /* reconstruct the full path */ full_path = NIH_MUST (nih_sprintf (NULL, "%s/%s", file->path, file->glob)); if (! fnmatch (full_path, path, FNM_PATHNAME) && (file->events & IN_CREATE)) handle_event (handled, full_path, IN_CREATE, path); } else { if (! strcmp (file->path, path) && (file->events & IN_CREATE)) { /* exact match, so emit event */ handle_event (handled, file->path, IN_CREATE, NULL); } else if ((p=strstr (file->path, path)) && p == file->path && S_ISDIR (statbuf->st_mode)) { /* The created file is actually a directory * more specific that the current watch * directory associated with @file. * * As such, we can make the watch on @file more * specific by dropping the old watch, creating * a new WatchedDir for @path and adding @file * to the new WatchedDir's files hash. * * This has to be handled carefully due to NIH * list/hash handling constraints. First, the * new directory is marked as needing to be * added to the directory hash and secondly we * add the WatchedFile to a list representing * all WatchedFiles that need to be added for * the new path. */ add_dir = TRUE; nih_list_add (&entries, &file->entry); } } } if (! add_dir) return; /* we should have atleast 1 file to add to the new watch */ nih_assert (! NIH_LIST_EMPTY (&entries)); new_dir = watched_dir_new (path, statbuf); if (! new_dir) { nih_warn ("%s: %s", _("Failed to watch directory"), path); return; } /* Add all list entries to the newly-created WatchedDir */ NIH_LIST_FOREACH_SAFE (&entries, iter) { WatchedFile *file = (WatchedFile *)iter; nih_hash_add (new_dir->files, &file->entry); } empty = TRUE; NIH_HASH_FOREACH (dir->files, iter) { empty = FALSE; break; } if (empty) { /* Remove the old directory watch */ nih_free (dir); } } /** * modify_handler: * * @dir: WatchedDir, * @watch: NihWatch for directory tree, * @path: full path to file, * @statbuf: stat of @path. * * Watch handler function called when a WatchedFile is modified in @dir. **/ void modify_handler (WatchedDir *dir, NihWatch *watch, const char *path, struct stat *statbuf) { nih_local NihHash *handled = NULL; nih_assert (dir); nih_assert (watch); nih_assert (path); nih_assert (statbuf); /* path should be a file below the WatchedDir */ nih_assert (strstr (path, dir->path) == path); skip_slashes (path); handled = NIH_MUST (nih_hash_string_new (NULL, 0)); NIH_HASH_FOREACH_SAFE (dir->files, iter) { WatchedFile *file = (WatchedFile *)iter; if (! (file->events & IN_MODIFY)) continue; if (file->dir) { if (! strcmp (file->path, dir->path)) { /* Watch is on the directory itself and a file within that * watched directory was modified, hence emit the _directory_ * was modified. */ handle_event (handled, original_path (file), IN_MODIFY, path); } } else if (file->glob) { nih_local char *full_path = NULL; /* reconstruct the full path */ full_path = NIH_MUST (nih_sprintf (NULL, "%s/%s", file->path, file->glob)); if (! fnmatch (full_path, path, FNM_PATHNAME) && (file->events & IN_MODIFY)) handle_event (handled, full_path, IN_MODIFY, path); } else { if (! strcmp (file->path, path)) { /* exact match, so emit event */ handle_event (handled, original_path (file), IN_MODIFY, NULL); } else if (file->dir && strstr (path, file->path) == path) { /* file in watched directory modified, so emit event */ handle_event (handled, path, IN_MODIFY, NULL); } } } } /** * delete_handler: * * @dir: WatchedDir, * @watch: NihWatch for directory tree, * @path: full path to file that was deleted. * * Watch handler function called when a WatchedFile is deleted in @dir. */ void delete_handler (WatchedDir *dir, NihWatch *watch, const char *path) { WatchedDir *new_dir; char *parent; char *p; struct stat statbuf; int rm_dir = FALSE; nih_local NihHash *handled = NULL; /* List of existing WatchedFiles that need to be added against * @path (since @path either exactly matches their path, or * @path is more specific ancestor of their path). */ NihList entries; nih_assert (dir); nih_assert (watch); nih_assert (path); /* path should be a file below the WatchedDir */ nih_assert (strstr (path, dir->path) == path); skip_slashes (path); nih_list_init (&entries); handled = NIH_MUST (nih_hash_string_new (NULL, 0)); NIH_HASH_FOREACH_SAFE (dir->files, iter) { WatchedFile *file = (WatchedFile *)iter; if (file->dir) { if (! strcmp (file->path, path)) { /* Directory itself was deleted */ handle_event (handled, original_path (file), IN_DELETE, NULL); } else if (! strcmp (file->path, dir->path)) { /* Watch is on the directory itself and a file within that * watched directory was deleted, hence emit the directory was * modified. */ if (file->events & IN_MODIFY) handle_event (handled, original_path (file), IN_MODIFY, path); } } else if (file->glob) { nih_local char *full_path = NULL; /* reconstruct the full path */ full_path = NIH_MUST (nih_sprintf (NULL, "%s/%s", file->path, file->glob)); if (! fnmatch (full_path, path, FNM_PATHNAME) && (file->events & IN_DELETE)) handle_event (handled, full_path, IN_DELETE, path); } else { if (! strcmp (file->path, path) && (file->events & IN_DELETE)) { handle_event (handled, original_path (file), IN_DELETE, NULL); } else if ((p=strstr (file->path, path)) && p == file->path) { /* Create a new directory watch for all * WatchedFiles whose immediate parent directory * matches @path (in other words, * make the watch looking after a WatchedFile * less specific). This has to be handled * carefully due to NIH list/hash handling * constraints. First, the new directory is * marked as needing to be added to the * directory hash and secondly we add the * WatchedFile to a list representing all * WatchedFiles that need to be added for the * new path. */ rm_dir = TRUE; nih_list_add (&entries, &file->entry); } else if (file->dir && strstr (path, file->path) == path && (file->events & IN_DELETE)) { /* file in watched directory deleted, so emit event */ handle_event (handled, path, IN_DELETE, NULL); } } } if (! rm_dir) return; /* Remove the old directory watch */ nih_free (dir); nih_assert (! NIH_LIST_EMPTY (&entries)); parent = find_first_parent (dir->path); if (! parent) { nih_warn ("%s: %s", _("Failed to find parent directory"), dir->path); return; } /* Check to see if there is already an existing watch for the * parent. */ new_dir = (WatchedDir *)nih_hash_lookup (watched_dirs, parent); if (! new_dir) { if (stat (parent, &statbuf) < 0) { nih_warn ("%s: %s", _("Failed to stat directory"), parent); return; } new_dir = watched_dir_new (parent, &statbuf); if (! new_dir) { nih_warn ("%s: %s", _("Failed to watch directory"), parent); return; } } /* Add all list entries to the newly-created WatchedDir. */ NIH_LIST_FOREACH_SAFE (&entries, iter) { WatchedFile *file = (WatchedFile *)iter; nih_hash_add (new_dir->files, &file->entry); } } /** * upstart_disconnected: * * @connection: connection to Upstart. * * Handler called when bridge disconnected from Upstart. **/ static void upstart_disconnected (DBusConnection *connection) { nih_fatal (_("Disconnected from Upstart")); nih_main_loop_exit (1); } /** * ensure_watched: * * @job: job, * @file: file we want to watch. * * Ensure that the WatchedFile file specified is watched. * * For regular files, this is achieved by adding a watch to * the first *existing* _parent_ directory encountered and adding * that WatchedDir to the watched_dirs hash. * * For directories, if they do not yet exist, the strategy is as for * regular files. If the directories do exist, the watch is placed on * the directory itself. **/ static void ensure_watched (Job *job, WatchedFile *file) { WatchedDir *dir = NULL; nih_local char *path = NULL; NihListEntry *entry; struct stat statbuf; nih_assert (job); nih_assert (file); watched_dir_init (); if (file->dir || file->glob) { if (! stat (file->path, &statbuf)) { /* Directory already exists, so we can watch it, * not its parent as is done for file watches. */ path = file->path; goto lookup; } } path = find_first_parent (file->path); if (! path) { nih_warn ("%s: %s", _("Failed to find parent directory"), file->path); return; } lookup: dir = (WatchedDir *)nih_hash_lookup (watched_dirs, path); if (! dir) { dir = watched_dir_new (path, &statbuf); if (! dir) return; } /* Associate the WatchedFile with the job such that when the job * is freed, the corresponding files are removed from their * containing WatchedDirs. */ nih_ref (file, job); file->parent = dir; nih_hash_add (dir->files, &file->entry); /* Create a link from the job to the WatchedFile. */ entry = NIH_MUST (nih_list_entry_new (job)); entry->data = file; nih_list_add (&job->files, &entry->entry); } /** * dir_watched_init: * * Initialise the watched_dirs hash table. **/ void watched_dir_init (void) { if (! watched_dirs) watched_dirs = NIH_MUST (nih_hash_string_new (NULL, 0)); } /** * emit_event: * * @path: original path as specified by a registered job, * @event_type: inotify event type that occured, * @match: file match that resulted from @path if it contains glob * wildcards (or NULL). * * Emit an Upstart event. **/ static int emit_event (const char *path, uint32_t event_type, const char *match) { DBusPendingCall *pending_call; nih_local char **env = NULL; nih_local char *var = NULL; size_t env_len = 0; nih_assert (path); nih_assert (event_type == IN_CREATE || event_type == IN_MODIFY || event_type == IN_DELETE); env = NIH_MUST (nih_str_array_new (NULL)); var = NIH_MUST (nih_sprintf (NULL, "FILE=%s", path)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); var = NIH_MUST (nih_sprintf (NULL, "EVENT=%s", event_type == IN_CREATE ? "create" : event_type == IN_MODIFY ? "modify" : "delete")); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); if (match) { var = NIH_MUST (nih_sprintf (NULL, "MATCH=%s", match)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } pending_call = NIH_SHOULD (upstart_emit_event (upstart, FILE_EVENT, env, FALSE, NULL, emit_event_error, NULL, NIH_DBUS_TIMEOUT_NEVER)); if (! pending_call) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); return FALSE; } return TRUE; } /** * emit_event_error: * * @data: (unused), * @message: Nih D-Bus message (unused), * * Handle failure to emit an event by consuming raised error and * displaying its details. **/ static void emit_event_error (void *data, NihDBusMessage *message) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); } /** * watched_dir_new: * * @path: Absolute path to watch. * @statbuf: stat of @path. * * Create a new directory watch object for @path. * * Returns: WatchedDir or NULL on error. **/ static WatchedDir * watched_dir_new (const char *path, const struct stat *statbuf) { nih_local char *watched_path = NULL; WatchedDir *dir; size_t len; nih_assert (path); nih_assert (statbuf); /* we shouldn't already be watching this directory */ nih_assert (! nih_hash_lookup (watched_dirs, path)); watched_dir_init (); watched_path = nih_strdup (NULL, path); if (! watched_path) return NULL; len = strlen (watched_path); /* Sanity-check */ if (len <= 1) return NULL; if (len > 1 && watched_path[len-1] == '/') { /* Better to remove a trailing slash before handing to * inotify since although all works as expected, the * path handed to inotify also gets given to the * create/modify/delete handlers which can then lead to * multiple consecutive slashes which could result in * jobs failing to start as they would not expect MATCH * to contain such values. * * Note that we do not (cannot) do this if @path is * the root directory. */ watched_path[len-1] = '\0'; } dir = nih_new (watched_dirs, WatchedDir); if (! dir) return NULL; nih_list_init (&dir->entry); nih_alloc_set_destructor (dir, nih_list_destroy); dir->path = nih_strdup (dir, path); if (! dir->path) goto error; dir->files = nih_hash_string_new (dir, 0); if (! dir->files) goto error; nih_hash_add (watched_dirs, &dir->entry); /* Create a watch on the specified directory. * * Don't set a recursive watch as there is no need * (individual jobs only care about a single directory, * and anyway the parent directory may be arbitrarily * deep so it could be prohibitively expensive). */ dir->watch = nih_watch_new (dir, watched_path, FALSE, TRUE, (NihFileFilter)file_filter, (NihCreateHandler)create_handler, (NihModifyHandler)modify_handler, (NihDeleteHandler)delete_handler, dir); if (! dir->watch) { NihError *err; err = nih_error_get (); nih_fatal ("%s %s: %s", _("Could not create watch for path"), path, err->message); nih_free (err); goto error; } return dir; error: nih_free (dir); return NULL; } /** * watched_file_new: * * @path: full path to file, * @original: original (relative) path specified by job, * @events: events job wishes to watch for @path, * @glob: glob file pattern, or NULL, * * Create a WatchedFile object representing @path. * * If path expansion was required, @original must specify the original * path as specified by the job else it may be NULL. * * If @glob is set, @path will be the directory portion of the original * path with @glob being the file (or basename) portion. * * Returns: WatchedFile object, or NULL on insufficient memory. **/ static WatchedFile * watched_file_new (const char *path, const char *original, uint32_t events, const char *glob) { size_t len; WatchedFile *file; nih_assert (path); nih_assert (events); file = nih_new (NULL, WatchedFile); if (! file) return NULL; nih_list_init (&file->entry); nih_alloc_set_destructor (file, nih_list_destroy); len = strlen (path); /* Sanity-check */ if (len <= 1) return NULL; /* Determine if the file is a directory */ file->dir = (path[len-1] == '/'); /* Optionally one or the other, but not both */ if (file->dir || file->glob) nih_assert (file->dir || file->glob); /* Don't store the trailing slash for directories since that * confuses the logic and is redundant (due to file->dir). */ file->path = nih_strndup (file, path, file->dir ? len-1 : len); if (! file->path) goto error; file->original = NULL; if (file->dir) { /* Retain the original directory path to simplify event * matching. */ file->original = nih_strndup (file, path, len); if (! file->original) goto error; } else if (original) { file->original = nih_strdup (file, original); if (! file->original) goto error; } file->glob = NULL; if (glob) { file->glob = nih_strdup (file, glob); if (! file->glob) goto error; } file->events = events; return file; error: nih_free (file); return NULL; } /** * job_new: * * @path: Upstart job class (D-Bus) path job is registered on. * * Create a new Job object representing an Upstart job. * * Returns: job, or NULL on insufficient memory. **/ static Job * job_new (const char *path) { Job *job; nih_assert (path); job = nih_new (NULL, Job); if (! job) return NULL; nih_list_init (&job->entry); nih_list_init (&job->files); nih_alloc_set_destructor (job, job_destroy); job->path = nih_strdup (job, path); if (! job->path) goto error; nih_hash_add (jobs, &job->entry); return job; error: nih_free (job); return NULL; } /** * job_destroy: * * @job: job. * * Destructor that handles the replacement and deletion of a Job, * ensuring that it is removed from the containing linked list and that * the item attached to it is destroyed if not currently in use. * * Normally used or called from an nih_alloc() destructor so that the * list item is automatically removed from its containing list when * freed. * * Returns: zero. **/ static int job_destroy (Job *job) { nih_assert (job); nih_list_destroy (&job->entry); NIH_LIST_FOREACH_SAFE (&job->files, iter) { NihListEntry *entry = (NihListEntry *)iter; WatchedFile *file; nih_assert (entry->data); file = (WatchedFile *)entry->data; /* Remove file from associated WatchedDir */ nih_free (file); } return 0; } /** * find_first_parent: * @path: initial absolute path to start search from. * * Starting at @path, search for the first existing path by * progressively removing individual path elements until an existing * path is found. * * Returns: Newly-allocated string representing path closest to @path * that currently exists, or NULL on insufficient memory. **/ static char * find_first_parent (const char *path) { char current[PATH_MAX]; char tmp[PATH_MAX]; char *parent; WatchedDir *dir = NULL; struct stat statbuf; nih_assert (path); /* Ensure path is absolute */ nih_assert (path[0] == '/'); strncpy (current, path, sizeof (current)); /* ensure termination */ current[PATH_MAX-1] = '\0'; do { /* save parent for next time through the loop */ memset (tmp, '\0', sizeof (tmp)); strncpy (tmp, current, sizeof (tmp)-1); parent = dirname (tmp); /* Ensure dirname returned something sane */ nih_assert (strcmp (parent, ".")); dir = (WatchedDir *)nih_hash_lookup (watched_dirs, current); if (dir || ! stat (current, &statbuf)) { /* either path is already a watched directory * (and hence must exist), or it actually does exist. */ return nih_strdup (NULL, current); } /* Failed to find path, so make parent the path to look * for. */ memmove (current, parent, 1+strlen (parent)); } while (TRUE); /* If your root directory doesn't exist, you have problems :) */ nih_assert_not_reached (); } /** * file_event_new: * * @parent: parent, * @path: path that event should contain, * @event: inotify event, * @match: file match if @path contains glob wildcards. * * Returns: newly-allocated FileEvent or NULL on insufficient memory. **/ static FileEvent * file_event_new (void *parent, const char *path, uint32_t event, const char *match) { FileEvent *file_event; nih_assert (path); nih_assert (event); file_event = nih_new (parent, FileEvent); if (! file_event) return NULL; nih_list_init (&file_event->entry); nih_alloc_set_destructor (file_event, nih_list_destroy); file_event->path = NIH_MUST (nih_strdup (file_event, path)); file_event->event = event; file_event->match = match ? NIH_MUST (nih_strdup (file_event, match)) : NULL; return file_event; } /** * handle_event: * * @handled: hash of FileEvents already handled, * @file_event: FileEvent to consider. * * Determine if @file_event has already been handled; if not emit the * event and record its details in @handled. **/ static void handle_event (NihHash *handled, const char *path, uint32_t event, const char *match) { FileEvent *file_event; nih_assert (handled); nih_assert (path); nih_assert (event); file_event = (FileEvent *)nih_hash_search (handled, path, NULL); while (file_event) { if ((file_event->event & event) && string_match (file_event->match, match)) { return; } file_event = (FileEvent *)nih_hash_search (handled, path, &file_event->entry); } nih_assert (! file_event); /* Event has not yet been handled, so emit it and record fact * it's now been handled. */ file_event = NIH_MUST (file_event_new (handled, path, event, match)); nih_hash_add (handled, &file_event->entry); emit_event (path, event, match); } /** * string_match: * * @a: first string, * @b: second string. * * Compare @a and @b either or both of which may be NULL. * * Returns TRUE if strings are identical or both NULL, else FALSE. **/ static int string_match (const char *a, const char *b) { if (!a && !b) return TRUE; if (!a || !b) return FALSE; if (strcmp (a, b)) return FALSE; return TRUE; } /** * expand_path: * * @parent: parent, * @path: path. * * Expand @path by replacing a leading '~/', './' or no path prefix by * the users home directory. * * Limitations: Does not expand '~user'. * * Returns: Newly-allocated fully-expanded path, or NULL on error. **/ char * expand_path (const void *parent, const char *path) { char *new; const char *p; nih_assert (path); /* Only user instances support this limited form of relative * path. */ nih_assert (user); /* Avoid looking up users password entry again */ nih_assert (home_dir[0]); /* absolute path so nothing to do */ nih_assert (path[0] != '/'); p = path; if (strstr (path, "~/") == path || strstr (path, "./") == path) p += 2; new = nih_sprintf (parent, "%s/%s", home_dir, p); return new; } /** * path_valid: * * @path: path. * * Perform basic tests to determine if @path is valid for * the purposes of this bridge. * * Returns: TRUE if @path is acceptable, else FALSE. **/ static int path_valid (const char *path) { size_t len; nih_assert (path); len = strlen (path); if (len > PATH_MAX-1) { nih_debug ("%s: %.*s...", _("Path too long"), PATH_MAX-1, path); return FALSE; } if (user) { /* Support absolute or relative paths where the latter * begins with a directory name implicitly below $HOME. */ if (*path == '.') { nih_warn ("%s: %s", _("Path must be absolute"), path); return FALSE; } } else { if (*path != '/') { nih_warn ("%s: %s", _("Path must be absolute"), path); return FALSE; } } if (strstr (path, "../")) { nih_warn ("%s: %s", _("Path must not contain parent reference"), path); return FALSE; } return TRUE; } upstart-1.13.2/extra/man/0000775000175000017500000000000012402042412012170 500000000000000upstart-1.13.2/extra/man/upstart-file-bridge.80000664000175000017500000001323712373101356016072 00000000000000.TH upstart\-file\-bridge 8 2013-03-11 upstart .\" .SH NAME upstart\-file\-bridge \- Bridge between Upstart and inotify .\" .SH SYNOPSIS .B upstart\-file\-bridge .RI [ OPTIONS ]... .\" .SH DESCRIPTION .B upstart\-file\-bridge receives information about kernel file events that .BR inotify (7) has received and creates .BR init (8) events for them. Supported events exposed to Upstart allow jobs to detect creation, modification and deletion. See .BR file\-event (7) for further details. The bridge works by querying the .BR init (8) daemon at bridge startup time to determine a list of all jobs whose .B start on or .B stop on conditions reference the .B file event. Further, the bridge arranges to be notified automatically when new jobs are created such that any subsequent jobs which reference the .B file event are also handled (as are job deletions). See \fBinotify\fP(7) and for further details. .\" .SH OPTIONS .\" .TP .B \-\-daemon Detach and run in the background. .\" .TP .B \-\-debug Enable debugging output. .\" .TP .B \-\-help Show brief usage summary. .\" .TP .B \-\-user User-session mode: connect to Upstart via the user session rather than over the D\-Bus system bus. .\" .TP .B \-\-verbose Enable verbose output. .\" .SH JOB ENVIRONMENT VARIABLES .TP .B FILE Path to file to watch. When run without .BR \-\-user "," this must be an absolute path. If .BR \-\-user is specified, certain relative path types are supported: .RS .IP \[bu] 2 If the path begins with \(aq~/\(aq, the value will be expanded as would be performed by a shell for matching purposes (although when the event is emitted, the original value will be used). .\" .IP \[bu] If the path begins with \(aq./\(aq, \(aq.\(aq will be assumed to be the users home directory. .\" .IP \[bu] In all other scenarios, if the path does not begin with \(aq/\(aq, it will be assumed to represent a file below the users home directory. .P If the path ends with a slash, it is considered to be a directory which changes the match behaviour (see below). .P If the path is not a directory, the file (but not the directory) portion of the path may contain wildcard matches. See .BR fnmatch (3) and .BR glob (7) for further details. .RE .\" .TP .B EVENT Event relating to .B FILE that job is interested in. If this variable is specified the value must be set to .BR create ", " .BR modify " or " .B delete depending on what type of file event the job is interested in. If .B FILE is not specified, the bridge will watch for all types and set this variable to the appropriate value when emitting the event. .\" .SH WATCH TYPE BEHAVIOUR The bridge emits events depending not only on the value of .BR EVENT ", " but also on the entity specified by .BR FILE ":" .\" .SS File An event will be emitted when the named file is created, modified or deleted depending on the value of \fBEVENT\fR. If .B EVENT is not specified, react to creation, modification and deletion. If the file already exists when the job is registered, and .B EVENT either specifies .I create or the variable is not specified, the event will be emitted. .\" .SS Directory An event will be emitted when the named directory is created, modified (files within it are created, modified or deleted) or deleted depending on the value of \fBEVENT\fR. If .B EVENT is not specified, react to creation, modification and deletion. If the directory already exists when the job is registered, and .B EVENT either specifies .I create or the variable is not specified, the event will be emitted. .\" .SS Glob One event will be emitted per match when the glob wildcard matches any files in the directory part is created, modified or deleted, depending on the value of \fBEVENT\fR. If .B EVENT is not specified, react to creation, modification and deletion. If any matches already exist when the job is registered, and .B EVENT either specifies .I create or the variable is not specified, events will be emitted. .\" .SH NOTES .IP \(bu 4 A single instance of the bridge may be run at the system level, but multiple further instances may be run per user session instance by using the .BR \-\-user "." .IP \(bu All job conditions specifying the .B file event are multi-shot: if the same file event occurs multiple times, the bridge will emit an Upstart event each time. .\" .SH LIMITATIONS .IP \(bu 4 Since the bridge currently uses .BR inotify (7) "" "," it is subject to the same limitations; namely that recursive watches cannot be created reliably in all circumstances. As such, pathological scenarios such as deep directory trees being created and then quickly removed .B cannot be handled reliably. The following provides advice to minimise unexpected behaviour: .RS .IP \(bu 4 Attempt to only watch for files to be created, modified or deleted in directories that are guaranteed to already exist at the time the job is registered by the bridge. .\" .IP \(bu If the system cannot guarantee that the directory will exist at job registration time, arrange for the directory to be created by an Upstart job before the bridge itself starts. .\" .IP \(bu In user session mode, if a job specifies a file to watch for and that file is created but inaccessible to the user running the bridge, no event will be emitted. .RE .IP \(bu Tilde expansion is only supported for the current user; that is \(aq~otheruser\(aq will not work. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@canonical.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/ubuntu/+source/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2013 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO .BR init (5) .BR init (8) .BR inotify (7) .BR file-event (7) upstart-1.13.2/extra/man/socket-event.70000664000175000017500000000363712373101356014632 00000000000000.TH socket\-event 7 2011-03-08 upstart .\" .SH NAME socket \- event signalling that a socket connection has been made .\" .SH SYNOPSIS .B socket .BI PROTO\fR= PROTO .BI PORT\fR= PORT .BI ADDR\fR= ADDR .B socket .BI PROTO\fR= PROTO .BI SOCKET_PATH\fR= PATH .\" .SH DESCRIPTION The .B socket event is generated by the .BR upstart\-socket\-bridge (8) daemon when a socket connection is made whose details match the socket event condition and environment specified in a jobs .B start on or .B stop on stanza. When an incoming connection is detected, the file descriptor representing the socket is passed to the job in question to allow it to .BR accept (2) the connection. Additionally, the environment variable .B UPSTART_EVENTS will contain the name of the event ("socket") and the environment variable .B UPSTART_FDS will contain the number of the file descriptor corresponding to the listening socket. .\" .SH EXAMPLES .\" .SS Internet (IPv4) socket Start web server when first client connects from localhost: .RS .nf start on socket PROTO=inet PORT=80 ADDR=127.0.0.1 .fi .RE .\" .SS Internet (IPv6) socket Start job when a client connects from localhost: .RS .nf start on socket PROTO=inet6 PORT=80 ADDR=::1 .fi .RE .\" .SS Local socket .P .RS .nf start on socket PROTO=unix SOCKET_PATH=/var/run/.s.pgsql.1234 .fi .RE .\" .SS Abstract socket .P .RS .nf start on socket PROTO=unix SOCKET_PATH=@/at/upstart/example .fi .RE .\" .SH AUTHOR Written by Scott James Remnant .RB < scott@netsplit.com > Manual page written by James Hunt .RB < james.hunt@ubuntu.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2011 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR init (5) .BR init (8) .BR socket (2) .BR socket (7) .BR upstart\-socket\-bridge (8) upstart-1.13.2/extra/man/upstart-dbus-bridge.80000664000175000017500000000360612373101356016107 00000000000000.TH upstart\-dbus\-bridge 8 2013-04-25 upstart .\" .SH NAME upstart\-dbus\-bridge \- Bridge between Upstart and D-Bus .\" .SH SYNOPSIS .B upstart\-dbus\-bridge .RI [ OPTIONS ]... .\" .SH DESCRIPTION .B upstart\-dbus\-bridge receives information about D-Bus signals and creates .BR init (8) events for them. With no options, monitors signals on the D-Bus system bus and emits an Upstart event called .I dbus via a D-Bus system bus connection to Upstart. When run with \fB\-\-user\fP, monitors signals on the users D-Bus session bus and emits Upstart events via the private D-Bus connection to the users Session Init. See \fBdbus\-daemon\fP(1) and for further details. .\" .SH OPTIONS .\" .TP .B \-\-always Always emit events on receipt of D-Bus signal regardless of whether jobs care about them. .TP .B \-\-daemon Detach and run in the background. .\" .TP .B \-\-debug Enable debugging output. .\" .TP .B \-\-help Show brief usage summary. .\" .TP .B \-\-session Monitor signals on the D-Bus session bus. .\" .TP .B \-\-system Monitor signals on the D-Bus system bus. .\" .TP .B \-\-user User-session mode: connect to Upstart via the user session rather than over the D\-Bus system bus. .\" .TP .B \-\-bus-name Set a name for the bus to be passed as an additional argument to the event under the property BUS. Used to distinguish multiple D\-Bus bridges. .\" .TP .B \-\-verbose Enable verbose output. .\" .SH RESTRICTIONS D-Bus signals emitted by Upstart itself are ignored. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@canonical.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/ubuntu/+source/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2013 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO .BR dbus\-daemon (1) .BR dbus\-event (7) .BR init (5) .BR init (8) upstart-1.13.2/extra/man/dconf-event.70000664000175000017500000000206412373101356014424 00000000000000.TH dconf\-event 7 2013-07-09 upstart .\" .SH NAME dconf \- event signalling that a dconf key has been changed .\" .SH SYNOPSIS .B dconf .BI TYPE\fR= changed .BI KEY\fR= KEY .BI VALUE\fR= VALUE .\" .SH DESCRIPTION The .B dconf event is generated by the .BR upstart\-dconf\-bridge (8) daemon when a dconf key changes whose details match the .I dconf event condition and environment specified in a job's .B start on or .B stop on stanza. .\" .SH EXAMPLES .\" .IP "start on dconf TYPE=changed KEY=/desktop/gnome/remote-access/notify-on-connect VALUE=true" Start job when the user allows remote access to their desktop. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@canonical.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2013 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR dconf (7) .BR gsettings (1) .BR init (5) .BR init (8) .BR upstart\-dconf\-bridge (8) upstart-1.13.2/extra/man/upstart-udev-bridge.80000664000175000017500000000426012373101356016112 00000000000000.TH upstart\-udev\-bridge 8 2011-03-08 upstart .\" .SH NAME upstart\-udev\-bridge \- Bridge between Upstart and udev .\" .SH SYNOPSIS .B upstart\-udev\-bridge .RI [ OPTIONS ]... .\" .SH DESCRIPTION .B upstart\-udev\-bridge receives information about kernel uevents that .BR udev (8) has completed and creates .BR init (8) events for them. It emits events which match the pattern "\fIS\fP\-device\-\fIA\fP" where \(aqS\(aq is the udev \fIsubsystem\fP and \(aqA\(aq is one of \fIadded\fR, \fIchanged\fR or \fIremoved\fR, which correspond to the past tense of the udev \(aqaction\(aq. See \fBudev\fP(7) and for further details. Assuming \fI/sys\fP is mounted, possible values for \fIsubsystem\fP for your system are viewable via \fI/sys/class/\fP. .\" .SH OPTIONS .\" .TP .B \-\-daemon Detach and run in the background. .\" .TP .B \-\-debug Enable debugging output. .\" .TP .B \-\-help Show brief usage summary. .\" .TP .B \-\-no\-strip Do not modify udev message contents. By default, all udev data will have non-printable bytes removed. This option reverts the behaviour to not modifying the data in any way. This option is not recommended since specifying it .I could result in .BR udev (7) events not being emitted as Upstart events should any of your hardware expose non-printable characters to the kernel. You can establish whether this is happening by running .I without specifying this option but with the .B \-\-debug option. .\" .TP .B \-\-verbose Enable verbose output. .\" .SH EXAMPLES Some examples of Upstart events generated by this bridge: .IP net\-device\-added Event emitted when a network device is added. .IP net\-device\-removed Event emitted when a network device is removed. .IP graphics\-device\-added Event emitted when a graphics device is available to the system. .\" .SH AUTHOR Written by Scott James Remnant .RB < scott@netsplit.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/ubuntu/+source/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2009,2010,2011 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO .BR init (5) .BR init (8) .BR udev (7) upstart-1.13.2/extra/man/upstart-local-bridge.80000664000175000017500000000535712373101356016251 00000000000000.TH upstart\-local\-bridge 8 2013-07-23 upstart .\" .SH NAME upstart\-local\-bridge \- Bridge between Upstart and a local client socket connection. .\" .SH SYNOPSIS .B upstart\-local\-bridge .RI [ OPTIONS ]... .\" .SH DESCRIPTION .B upstart\-local\-bridge listens on a local domain socket for name=value pairs and creates .BR init (8) events for them. The local unix domain socket can be either named or abstract. .\" .SH OPTIONS .\" .TP .B \-\-any\-user By default the bridge will only accept connections from clients running under the same user ID as the bridge itself. This option allows connections from any user. .\" .TP .B \-\-daemon Detach and run in the background. .\" .TP .B \-\-debug Enable debugging output. .\" .TP .B \-\-event \fIevent\fP Specify name of event to emit on receipt of a name=value pair. .\" .TP .B \-\-help Show brief usage summary. .\" .TP .B \-\-path \fIpath\fP Specify path for local/abstract socket to listen on. If the first byte of .I path is an \(aq\fI@\fP\(aq, the socket will be created as an abstract socket. .\" .TP .B \-\-verbose Enable verbose output. .\" .SH EVENT DETAILS The following environment variables are added automatically to the event to be emitted, with the name=value pair being added as the last variable. .P .IP \(bu 4 SOCKET_TYPE=unix .IP \(bu 4 SOCKET_VARIANT=[\fInamed\fP|\fIabstract\fP] Sub-type of socket. .IP \(bu 4 CLIENT_UID=\fIUID\fP User ID of connected client. .IP \(bu 4 CLIENT_GID=\fIGID\fP Group ID of connected client. .IP \(bu 4 CLIENT_PID=\fIPID\fP Process ID of connected client. .IP \(bu 4 SOCKET_PATH=\fIPATH\fP .P .\" .SH EXAMPLES .IP "upstart\-local\-bridge \-\-event=foo \-\-path=/var/foo/bar" 0.4i Listen on local socket .I /var/foo/bar and when a name=value pair is read, emit an event of the form: .RS .nf foo SOCKET_TYPE=unix SOCKET_VARIANT=named SOCKET_PATH=/var/foo/bar name=value .fi .RE .IP "upstart\-local\-bridge \-\-event=bar \-\-path=@/var/foo/bar" 0.4i Listen on abstract socket .I @/var/foo/bar and when a name=value pair is read, emit an event of the form: .RS .nf bar SOCKET_TYPE=unix SOCKET_VARIANT=abstract SOCKET_PATH=@/var/foo/bar name=value .fi .RE .\" .SH NOTES .IP \(bu 4 If a named local socket is specified, all path elements except for the last must already exist before the bridge starts. .\" .SH LIMITATIONS .IP \(bu 4 Only a single client connection is serviced at any one time. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@canonical.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/ubuntu/+source/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2013 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO .BR init (5) .BR init (8) upstart-1.13.2/extra/man/dbus-event.70000664000175000017500000000334412373101356014272 00000000000000.TH dbus\-event 7 2013-04-25 upstart .\" .SH NAME dbus \- event signalling that a dbus signal has been emitted .\" .SH SYNOPSIS .B dbus .BI [ "" BUS\fR= BUS_NAME ] .BI SIGNAL\fR= SIGNAL .BI INTERFACE\fR= INTERFACE .BI OBJPATH\fR= PATH .BI SENDER\fR= SENDER .BI DESTINATION\fR= DESTINATION .BI ARG0\fR= VALUE .BI ARGN\fR= VALUE .\" .SH DESCRIPTION The .B dbus event is generated by the .BR upstart\-dbus\-bridge (8) daemon when a D-Bus signal is emitted whose details match the .I dbus event condition and environment specified in a job's .B start on or .B stop on stanza is modified. Arguments that are simple types (string, int, etc.) are translated into strings and placed as parameters on the event with the pattern ARG and the number representing the placement in the event prototype. Parameters that are not a simple type are skipped, with the number being incremented the same. The .B BUS parameter is optional and only set if the .BR upstart\-dbus\-bridge (8) daemon is started with the .B --bus-name parameter. The value of .B BUS will be the same as the value passed as the parameter. .\" .SH EXAMPLES .\" .IP "start on dbus SIGNAL=NameAcquired INTERFACE=org.freedesktop.DBus OBJPATH=/org/freedesktop/DBus SENDER=org.freedesktop.DBus ARG0=com.mycorp.foo" Start job when a particular .I NameAcquired D-Bus signal is received. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@canonical.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2013 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR init (5) .BR init (8) .BR upstart\-dbus\-bridge (8) upstart-1.13.2/extra/man/upstart-socket-bridge.80000664000175000017500000000205412373101356016436 00000000000000.TH upstart-socket-bridge 8 2011-03-08 upstart .\" .SH NAME upstart-socket-bridge \- Bridge between Upstart and sockets .\" .SH SYNOPSIS .B upstart-socket-bridge .RI [ OPTIONS ]... .\" .SH DESCRIPTION The .B upstart-socket-bridge queries the Upstart .BR init (8) daemon for all job configurations which .B start on or .B stop on the socket event. It then waits for an incoming connection on each specified .BR socket (7) and when detected emits the socket event (\fBsocket\-event\fP (7)), setting a number of environment variables for the job to query. .\" .SH AUTHOR Written by Scott James Remnant .RB < scott@netsplit.com > Manual page written by James Hunt .RB < james.hunt@ubuntu.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2011 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR init (5) .BR init (8) .BR socket (2) .BR socket (7) .BR socket\-event (7) upstart-1.13.2/extra/man/upstart-dconf-bridge.80000664000175000017500000000247712373101356016250 00000000000000.TH upstart\-dconf\-bridge 8 2013-07-09 upstart .\" .SH NAME upstart\-dconf\-bridge \- Bridge between Upstart and dconf/gsettings .\" .SH SYNOPSIS .B upstart\-dconf\-bridge .RI [ OPTIONS ]... .\" .SH DESCRIPTION .B upstart\-dconf\-bridge receives information about dconf/gsettings changes and creates .BR init (8) events for them. With no options (and if there are jobs which have registered an interest in the event), monitors dconf changes and emits an Upstart event called .I dconf with details of the dconf change. See \fBdconf\fP(7) and for further details. .\" .SH OPTIONS .\" .TP .B \-\-always Always emit events on receipt of dconf changes regardless of whether jobs care about them. .TP .B \-\-daemon Detach and run in the background. .\" .TP .B \-\-debug Enable debugging output. .\" .TP .B \-\-help Show brief usage summary. .\" .TP .B \-\-verbose Enable verbose output. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@canonical.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/ubuntu/+source/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2013 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO .BR dconf (7) .BR dconf\-event (7) .BR gsettings (1) .BR init (5) .BR init (8) upstart-1.13.2/extra/man/file-event.70000664000175000017500000000456012373101356014255 00000000000000.TH file\-event 7 2013-03-11 upstart .\" .SH NAME file \- event signalling that a file has changed .\" .SH SYNOPSIS .B file .BI FILE\fR= PATH .BI EVENT\fR= TYPE .IB \fR[ MATCH\fR= PATH \fR] .\" .SH DESCRIPTION The .B file event is generated by the .BR upstart\-file\-bridge (8) daemon when a file whose details match the file event condition and environment specified in a job's .B start on or .B stop on stanza is modified. The .BR FILE " and " EVENT environment variables will be set to the same values as specified by the job. Note that if the job did not specify .B EVENT this will still be set to one of .BR create ", " .BR modify " or " .B delete depending on what type of file event caused the event to be emitted. If the job specified a glob pattern in the file part of the .B FILE environment variable, the event will contain the .B MATCH environment variable which will be set to the full path of the file that matched the pattern in .BR FILE "." .\" .SH NOTES .IP \(bu 4 When specifying a path that contains spaces, ensure that the path is quoted. .\" .IP \(bu .B FILE values specified by jobs are not canonicalised; this cannot be done reliably as they may not exist so cannot be fully resolved. .\" .IP \(bu If you wish to match on .BR MATCH ", " ensure that .B FILE does not contain multiple consecutive runs of slashes since otherwise your job will find it difficult to perform such a match. .\" .SH EXAMPLES .\" .IP "start on file FILE=/run/app.pid EVENT=create" 0.4i Event emitted when file is created. .IP "start on file FILE=/run/app.pid" Event emitted when file is created, modified or deleted. .IP "start on file FILE=/var/log/" Event emitted when files within a directory are created, modified or deleted. .IP "start on file FILE=/var/crash/*.crash EVENT=create" Event emitted when files that match a glob pattern are created in the indicated directory. .IP "start on file FILE=""/this/path/contains whitespace.txt""" Specify a file that contains a space character. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@canonical.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2013 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR init (5) .BR init (8) .BR upstart\-file\-bridge (8) upstart-1.13.2/extra/man/upstart-event-bridge.80000664000175000017500000000331412373101356016267 00000000000000.TH upstart\-event\-bridge 8 2013-04-02 upstart .\" .SH NAME upstart\-event\-bridge \- Bridge between system Upstart and session Upstart .\" .SH SYNOPSIS .B upstart\-event\-bridge .RI [ OPTIONS ]... .\" .SH DESCRIPTION .B upstart\-event\-bridge receives information about Upstart system .BR events (8) have completed and creates Upstart session events for them. It emits events which match the pattern ":sys:*". Forwarding any event that's triggered on the system upstart as well as a virtual "restarted" event when upstart itself is restarted (during upgrades). See \fBupstart-events\fP(7) and for further details. This bridge should be run as a user, after the session bus has been setup and only once per session init. .\" .SH OPTIONS .\" .TP .B \-\-daemon Detach and run in the background. .\" .TP .B \-\-debug Enable debugging output. .\" .TP .B \-\-help Show brief usage summary. .\" .TP .B \-\-verbose Enable verbose output. .\" .SH NOTES Since events emitted by this bridge at the session level are copies of the original system events, the blocking semantics of the original system events are not retained. .\" .SH EXAMPLES Some examples of Upstart events generated by this bridge: .IP :sys:restarted Event emitted when the system Upstart is restarted. .IP :sys:* Any event emitted on the system Upstart. .\" .SH AUTHOR Written by Stéphane Graber .RB < stgraber@ubuntu.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/ubuntu/+source/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2012 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO .BR init (5) .BR init (8) .BR events (7) upstart-1.13.2/extra/upstart-local-bridge.c0000664000175000017500000004602612373101356015547 00000000000000/* upstart * * Copyright © 2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" #include "com.ubuntu.Upstart.Job.h" /** * Job: * * @entry: list header, * @path: D-Bus path for a job. * * Representation of an Upstart Job. * **/ typedef struct job { NihList entry; char *path; } Job; /** * Socket: * * @addr/sun_addr: socket address, * @addrlen: length of sun_addr, * @sock: file descriptor of socket, * @watch: IO Watch used to detect client activity. * * Representation of a socket(2). **/ typedef struct socket { union { struct sockaddr addr; /* Generic type */ struct sockaddr_un sun_addr; /* local/domain/unix/abstract socket */ }; socklen_t addrlen; int sock; NihIoWatch *watch; } Socket; /** * ClientConnection: * * @sock: socket client connected via, * @fd: file descriptor client connected on, * @ucred: client credentials. * * Representation of a connected client. **/ typedef struct client_connection { Socket *sock; int fd; struct ucred ucred; } ClientConnection; static void upstart_job_added (void *data, NihDBusMessage *message, const char *job); static void upstart_job_removed (void *data, NihDBusMessage *message, const char *job); static void upstart_connect (void); static void upstart_disconnected (DBusConnection *connection); static Socket *create_socket (void *parent); static void socket_watcher (Socket *sock, NihIoWatch *watch, NihIoEvents events); static void socket_reader (ClientConnection *client, NihIo *io, const char *buf, size_t len); static void close_handler (ClientConnection *client, NihIo *io); static void emit_event_error (void *data, NihDBusMessage *message); static void emit_event (ClientConnection *client, const char *pair, size_t len); static void signal_handler (void *data, NihSignal *signal); static void cleanup (void); /** * daemonise: * * Set to TRUE if we should become a daemon, rather than just running * in the foreground. **/ static int daemonise = FALSE; /** * jobs: * * Jobs that we're monitoring. **/ static NihHash *jobs = NULL; /** * upstart: * * Proxy to Upstart daemon. **/ static NihDBusProxy *upstart = NULL; /** * event_name: * * Name of event this bridge emits. **/ static char *event_name = NULL; /** * Unix (local) domain socket path. * * Abstract sockets will have '@' as first character. **/ static char *socket_path = NULL; /** * socket_type: * * Type of socket supported by this bridge. **/ static char *socket_type = "unix"; /** * socket_name: * * Human-readable socket name in form: * * unix:[@]/some/path **/ static char *socket_name = NULL; /** * sock: * * Socket this bridge listens on. **/ static Socket *sock = NULL; /** * any_user: * * If FALSE, only accept connections from the same uid as * user the bridge runs as. * If TRUE, accept connections from any user. **/ static int any_user = FALSE; /** * options: * * Command-line options accepted by this program. **/ static NihOption options[] = { { 0, "daemon", N_("Detach and run in the background"), NULL, NULL, &daemonise, NULL }, { 0, "event", N_("specify name of event to emit on receipt of name=value pair"), NULL, "EVENT", &event_name, NULL }, { 0, "any-user", N_("allow any user to connect"), NULL, NULL, &any_user, NULL }, { 0, "path", N_("specify path for local/abstract socket to use"), NULL, "PATH", &socket_path, NULL }, NIH_OPTION_LAST }; /** * signal_handler: * @data: unused, * @signal: signal caught. * * Called when we receive the TERM/INT signal. **/ static void signal_handler (void *data, NihSignal *signal) { nih_assert (signal != NULL); cleanup (); nih_main_loop_exit (0); } /** * cleanup: * * Perform final operations before exit. **/ static void cleanup (void) { nih_assert (sock); close (sock->sock); if (sock->sun_addr.sun_path[0] != '@') unlink (sock->sun_addr.sun_path); } int main (int argc, char *argv[]) { char **args; int ret; nih_main_init (argv[0]); nih_option_set_synopsis (_("Local socket Upstart Bridge")); nih_option_set_help ( _("By default, this bridge does not detach from the " "console and remains in the foreground. Use the --daemon " "option to have it detach.")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); if (! event_name) { nih_fatal ("%s", _("Must specify event name")); exit (1); } /* Allocate jobs hash table */ jobs = NIH_MUST (nih_hash_string_new (NULL, 0)); sock = create_socket (NULL); if (! sock) { nih_fatal ("%s %s", _("Failed to create socket"), socket_name); exit (1); } nih_debug ("Connected to socket '%s' on fd %d", socket_name, sock->sock); upstart_connect (); /* Become daemon */ if (daemonise) { if (nih_main_daemonise () < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Unable to become daemon"), err->message); nih_free (err); exit (1); } /* Send all logging output to syslog */ openlog (program_name, LOG_PID, LOG_DAEMON); nih_log_set_logger (nih_logger_syslog); } nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, signal_handler, NULL)); nih_signal_set_handler (SIGINT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGINT, signal_handler, NULL)); /* Handle TERM and INT signals gracefully */ nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); if (! daemonise) { nih_signal_set_handler (SIGINT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGINT, nih_main_term_signal, NULL)); } ret = nih_main_loop (); return ret; } static void upstart_job_added (void *data, NihDBusMessage *message, const char *job_class_path) { nih_local NihDBusProxy *job_class = NULL; nih_local char ***start_on = NULL; nih_local char ***stop_on = NULL; Job *job; nih_assert (job_class_path != NULL); /* Obtain a proxy to the job */ job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_class_path, NULL, NULL); if (! job_class) { NihError *err; err = nih_error_get (); nih_error ("Could not create proxy for job %s: %s", job_class_path, err->message); nih_free (err); return; } job_class->auto_start = FALSE; /* Obtain the start_on and stop_on properties of the job */ if (job_class_get_start_on_sync (NULL, job_class, &start_on) < 0) { NihError *err; err = nih_error_get (); nih_error ("Could not obtain job start condition %s: %s", job_class_path, err->message); nih_free (err); return; } if (job_class_get_stop_on_sync (NULL, job_class, &stop_on) < 0) { NihError *err; err = nih_error_get (); nih_error ("Could not obtain job stop condition %s: %s", job_class_path, err->message); nih_free (err); return; } /* Free any existing record for the job (should never happen, * but worth being safe). */ job = (Job *)nih_hash_lookup (jobs, job_class_path); if (job) nih_free (job); /* Create new record for the job */ job = NIH_MUST (nih_new (NULL, Job)); job->path = NIH_MUST (nih_strdup (job, job_class_path)); nih_list_init (&job->entry); nih_debug ("Job got added %s", job_class_path); nih_alloc_set_destructor (job, nih_list_destroy); /* Add all jobs */ nih_hash_add (jobs, &job->entry); } static void upstart_job_removed (void *data, NihDBusMessage *message, const char *job_path) { Job *job; nih_assert (job_path != NULL); job = (Job *)nih_hash_lookup (jobs, job_path); if (job) { nih_debug ("Job went away %s", job_path); nih_free (job); } } static void upstart_connect (void) { DBusConnection *connection; char **job_class_paths; /* Initialise the connection to Upstart */ connection = NIH_SHOULD (nih_dbus_connect (DBUS_ADDRESS_UPSTART, upstart_disconnected)); if (! connection) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not connect to Upstart"), err->message); nih_free (err); exit (1); } upstart = NIH_SHOULD (nih_dbus_proxy_new (NULL, connection, NULL, DBUS_PATH_UPSTART, NULL, NULL)); if (! upstart) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create Upstart proxy"), err->message); nih_free (err); exit (1); } nih_debug ("Connected to Upstart"); /* Connect signals to be notified when jobs come and go */ if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobAdded", (NihDBusSignalHandler)upstart_job_added, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create JobAdded signal connection"), err->message); nih_free (err); exit (1); } if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobRemoved", (NihDBusSignalHandler)upstart_job_removed, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create JobRemoved signal connection"), err->message); nih_free (err); exit (1); } /* Request a list of all current jobs */ if (upstart_get_all_jobs_sync (NULL, upstart, &job_class_paths) < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not obtain job list"), err->message); nih_free (err); exit (1); } for (char **job_class_path = job_class_paths; job_class_path && *job_class_path; job_class_path++) upstart_job_added (NULL, NULL, *job_class_path); nih_free (job_class_paths); } static void upstart_disconnected (DBusConnection *connection) { nih_fatal (_("Disconnected from Upstart")); nih_main_loop_exit (1); } /** * socket_watcher: * * @sock: Socket, * @watch: IO watch, * @event: events that occurred. * * Called when activity is received for socket fd. **/ static void socket_watcher (Socket *sock, NihIoWatch *watch, NihIoEvents events) { struct sockaddr client_addr; socklen_t client_len; nih_local char *buffer = NULL; ClientConnection *client; socklen_t len; nih_assert (sock); nih_assert (watch); client = NIH_MUST (nih_new (NULL, ClientConnection)); memset (client, 0, sizeof (ClientConnection)); client->sock = sock; client_len = sizeof (struct sockaddr); client->fd = accept (sock->sock, (struct sockaddr *)&client_addr, &client_len); if (client->fd < 0) { nih_fatal ("%s %s %s", _("Failed to accept socket"), socket_name, strerror (errno)); return; } len = sizeof (client->ucred); /* Establish who is connected to the other end */ if (getsockopt (client->fd, SOL_SOCKET, SO_PEERCRED, &client->ucred, &len) < 0) goto error; if (! any_user && client->ucred.uid != geteuid ()) { nih_warn ("Ignoring request from uid %u (gid %u, pid %u)", (unsigned int)client->ucred.uid, (unsigned int)client->ucred.gid, (unsigned int)client->ucred.pid); close (client->fd); return; } nih_debug ("Client connected via local socket to %s: " "pid %d (uid %d, gid %d)", socket_name, client->ucred.pid, client->ucred.uid, client->ucred.gid); /* Wait for remote end to send data */ NIH_MUST (nih_io_reopen (sock, client->fd, NIH_IO_STREAM, (NihIoReader)socket_reader, (NihIoCloseHandler)close_handler, NULL, client)); return; error: nih_warn ("%s %s: %s", _("Cannot establish peer credentials for socket"), socket_name, strerror (errno)); } /** * socket_reader: * * @client: client connection, * @io: NihIo, * @buf: data read from client, * @len: length of @buf. * * NihIoReader function called when data has been read from the * connected client. **/ static void socket_reader (ClientConnection *client, NihIo *io, const char *buf, size_t len) { nih_local char *pairs = NULL; char *pair; size_t used_len = 0; size_t i; /* Ignore messages that are too short. * (minimum message is of form "a="). */ size_t min_len = 2; nih_assert (sock); nih_assert (client); nih_assert (io); nih_assert (buf); if (len < min_len) goto error; pairs = nih_strdup (NULL, buf); if (! pairs) return; for (pair = strsep (&pairs, "\n"); pair; pair = strsep (&pairs, "\n")) { used_len = strlen (pair); if (used_len < min_len) continue; /* Ensure the data is a 'name=value' pair */ if (! strchr (pair, '=') || pair[0] == '=') continue; /* Remove extraneous line ending */ if (pair[used_len-1] == '\r') { pair[used_len-1] = '\0'; used_len--; } /* Ignore invalid input */ for (i = 0; i < used_len; i++) { if (! isprint (pair[i]) && ! isspace (pair[i])) continue; } /* Yet another check to ensure overly short messages are ignored * (required since we may have adjusted used_len */ if (used_len < min_len) continue; emit_event (client, pair, used_len); } /* Consume the entire length */ nih_io_buffer_shrink (io->recv_buf, len); return; error: nih_debug ("ignoring invalid input of length %lu", (unsigned long int)len); /* Consume the entire length */ nih_io_buffer_shrink (io->recv_buf, len); } static void close_handler (ClientConnection *client, NihIo *io) { nih_assert (client); nih_assert (io); nih_debug ("Remote end closed connection"); close (client->fd); nih_free (client); nih_free (io); } /** * create_socket: * @parent: Parent pointer. * * Create a Socket object, listen on it and arrange for NIH to monitor * it. * * Returns: Newly-allocated Socket on success, or NULL on error. **/ static Socket * create_socket (void *parent) { Socket *sock = NULL; int opt = 1; size_t len; if (! socket_path) { nih_fatal ("%s", _("Must specify socket path")); exit (1); } NIH_MUST (nih_strcat_sprintf (&socket_name, NULL, "%s:%s", socket_type, socket_path)); sock = NIH_MUST (nih_new (NULL, Socket)); memset (sock, 0, sizeof (Socket)); sock->sock = -1; sock->sun_addr.sun_family = AF_UNIX; if (! *socket_path || (socket_path[0] != '/' && socket_path[0] != '@')) { nih_fatal ("%s %s", _("Invalid path"), socket_path); goto error; } len = strlen (socket_path); if (len > sizeof (sock->sun_addr.sun_path)) { nih_fatal ("%s %s", _("Path too long"), socket_path); goto error; } strncpy (sock->sun_addr.sun_path, socket_path, sizeof (sock->sun_addr.sun_path)); sock->addrlen = sizeof (sock->sun_addr.sun_family) + len; /* Handle abstract names */ if (sock->sun_addr.sun_path[0] == '@') sock->sun_addr.sun_path[0] = '\0'; sock->sock = socket (sock->addr.sa_family, SOCK_STREAM, 0); if (sock->sock < 0) { nih_fatal ("%s %s %s", _("Failed to create socket"), socket_name, strerror (errno)); goto error; } if (setsockopt (sock->sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)) < 0) { nih_fatal ("%s %s %s", _("Failed to set socket reuse"), socket_name, strerror (errno)); goto error; } if (setsockopt (sock->sock, SOL_SOCKET, SO_PASSCRED, &opt, sizeof (opt)) < 0) { nih_fatal ("%s %s %s", _("Failed to set socket credential-passing"), socket_name, strerror (errno)); goto error; } if (bind (sock->sock, &sock->addr, sock->addrlen) < 0) { nih_fatal ("%s %s %s", _("Failed to bind socket"), socket_name, strerror (errno)); goto error; } if (listen (sock->sock, SOMAXCONN) < 0) { nih_fatal ("%s %s %s", _("Failed to listen on socket"), socket_name, strerror (errno)); goto error; } sock->watch = NIH_MUST (nih_io_add_watch (sock, sock->sock, NIH_IO_READ, (NihIoWatcher)socket_watcher, sock)); return sock; error: nih_free (sock); return NULL; } static void emit_event_error (void *data, NihDBusMessage *message) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); } static void emit_event (ClientConnection *client, const char *pair, size_t len) { DBusPendingCall *pending_call; nih_local char **env = NULL; nih_local char *var = NULL; nih_assert (client); nih_assert (pair); nih_assert (len); /* Construct the event environment. * * Note that although the client could conceivably specify one * of the variables below _itself_, if the intent is malicious * it will be thwarted since although the following example * event is valid... * * foo BAR=BAZ BAR=MALICIOUS * * ... environment variable matching only happens for the first * occurence of a variable. In summary, a malicious client * cannot spoof the standard variables we set. */ env = NIH_MUST (nih_str_array_new (NULL)); /* Specify type to allow for other types to be added in the future */ var = NIH_MUST (nih_sprintf (NULL, "SOCKET_TYPE=%s", socket_type)); NIH_MUST (nih_str_array_addp (&env, NULL, NULL, var)); var = NIH_MUST (nih_sprintf (NULL, "SOCKET_VARIANT=%s", sock->sun_addr.sun_path[0] ? "named" : "abstract")); NIH_MUST (nih_str_array_addp (&env, NULL, NULL, var)); var = NIH_MUST (nih_sprintf (NULL, "CLIENT_UID=%u", (unsigned int)client->ucred.uid)); NIH_MUST (nih_str_array_addp (&env, NULL, NULL, var)); var = NIH_MUST (nih_sprintf (NULL, "CLIENT_GID=%u", (unsigned int)client->ucred.gid)); NIH_MUST (nih_str_array_addp (&env, NULL, NULL, var)); var = NIH_MUST (nih_sprintf (NULL, "CLIENT_PID=%u", (unsigned int)client->ucred.pid)); NIH_MUST (nih_str_array_addp (&env, NULL, NULL, var)); var = NIH_MUST (nih_sprintf (NULL, "SOCKET_PATH=%s", socket_path)); NIH_MUST (nih_str_array_addp (&env, NULL, NULL, var)); /* Add the name=value pair */ NIH_MUST (nih_str_array_addn (&env, NULL, NULL, pair, len)); pending_call = upstart_emit_event (upstart, event_name, env, FALSE, NULL, emit_event_error, NULL, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); } dbus_pending_call_unref (pending_call); } upstart-1.13.2/extra/upstart-dbus-bridge.c0000664000175000017500000004602612373101356015412 00000000000000/* upstart * * Copyright © 2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" #include "com.ubuntu.Upstart.Job.h" /** * DBUS_EVENT: * * Name of event this program handles. **/ #define DBUS_EVENT "dbus" /* Prototypes for static functions */ static int bus_name_setter (NihOption *option, const char *arg); static int dbus_bus_setter (NihOption *option, const char *arg); static void dbus_disconnected (DBusConnection *connection); static void upstart_disconnected (DBusConnection *connection); static DBusHandlerResult signal_filter (DBusConnection *connection, DBusMessage *message, void *user_data); static void emit_event_error (void *data, NihDBusMessage *message); static void upstart_job_added (void *data, NihDBusMessage *message, const char *job); static void upstart_job_removed (void *data, NihDBusMessage *message, const char *job); /** * daemonise: * * Set to TRUE if we should become a daemon, rather than just running * in the foreground. **/ static int daemonise = FALSE; /** * upstart: * * Proxy to Upstart daemon. **/ static NihDBusProxy *upstart = NULL; /** * user_mode: * * If TRUE, connect to Session Init rather than PID 1. **/ static int user_mode = FALSE; /** * dbus_bus: * * type of D-Bus bus to connect to. **/ DBusBusType dbus_bus = (DBusBusType)-1; /** * bus_name: * * type of event to emit. **/ static const char * bus_name = NULL; /** * Structure we use for tracking jobs * * @entry: list header, * @path: D-Bus path of job being tracked. **/ typedef struct job { NihList entry; char *path; } Job; /** * jobs: * * Jobs that we're monitoring. **/ static NihHash *jobs = NULL; /** * always: * * If TRUE, always emit Upstart events, regardless of whether * existing jobs care about DBUS_EVENT. */ static int always = FALSE; /** * options: * * Command-line options accepted by this program. **/ static NihOption options[] = { { 0, "always", N_("Always emit an event on receipt of D-Bus signal"), NULL, NULL, &always, NULL }, { 0, "daemon", N_("Detach and run in the background"), NULL, NULL, &daemonise, NULL }, { 0, "bus-name", N_("Bus name to specify in event environment"), NULL, "name", NULL, bus_name_setter }, { 0, "user", N_("Connect to user session"), NULL, NULL, &user_mode, NULL }, { 0, "session", N_("Use D-Bus session bus"), NULL, NULL, NULL, dbus_bus_setter }, { 0, "system", N_("Use D-Bus system bus"), NULL, NULL, NULL, dbus_bus_setter }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char **args; DBusConnection *dbus_connection; DBusConnection *connection; int ret; char *pidfile_path = NULL; char *pidfile = NULL; char *user_session_addr = NULL; nih_local char **user_session_path = NULL; char *path_element = NULL; DBusError error; char **job_class_paths; nih_main_init (argv[0]); nih_option_set_synopsis (_("Bridge D-Bus signals into upstart")); nih_option_set_help ( _("By default, upstart-event-bridge does not detach from the " "console and remains in the foreground. Use the --daemon " "option to have it detach.")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (EXIT_FAILURE); dbus_error_init (&error); /* Default to an appropriate bus */ if (dbus_bus == (DBusBusType)-1) dbus_bus = user_mode ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM; /* Connect to the chosen D-Bus bus */ dbus_connection = NIH_SHOULD (nih_dbus_bus (dbus_bus, dbus_disconnected)); if (! dbus_connection) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not connect to D-Bus"), err->message); nih_free (err); exit (EXIT_FAILURE); } dbus_bus_add_match (dbus_connection, "type='signal'", &error); if (dbus_error_is_set (&error)) { nih_fatal ("%s: %s %s", _("Could not add D-Bus signal match"), error.name, error.message); dbus_error_free (&error); exit (EXIT_FAILURE); } dbus_connection_add_filter (dbus_connection, signal_filter, NULL, NULL); dbus_error_free (&error); if (user_mode) { user_session_addr = getenv ("UPSTART_SESSION"); if (! user_session_addr) { nih_fatal (_("UPSTART_SESSION is not set in environment")); exit (EXIT_FAILURE); } } connection = NIH_SHOULD (nih_dbus_connect (user_mode ? user_session_addr : DBUS_ADDRESS_UPSTART, upstart_disconnected)); if (! connection) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not connect to Upstart"), err->message); nih_free (err); exit (EXIT_FAILURE); } /* Allocate jobs hash table */ jobs = NIH_MUST (nih_hash_string_new (NULL, 0)); upstart = NIH_SHOULD (nih_dbus_proxy_new (NULL, connection, NULL, DBUS_PATH_UPSTART, NULL, NULL)); if (! upstart) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create Upstart proxy"), err->message); nih_free (err); exit (EXIT_FAILURE); } /* Connect signals to be notified when jobs come and go */ if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobAdded", (NihDBusSignalHandler)upstart_job_added, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create JobAdded signal connection"), err->message); nih_free (err); exit (EXIT_FAILURE); } if (! nih_dbus_proxy_connect (upstart, &upstart_com_ubuntu_Upstart0_6, "JobRemoved", (NihDBusSignalHandler)upstart_job_removed, NULL)) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create JobRemoved signal connection"), err->message); nih_free (err); exit (EXIT_FAILURE); } /* Request a list of all current jobs */ if (upstart_get_all_jobs_sync (NULL, upstart, &job_class_paths) < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not obtain job list"), err->message); nih_free (err); exit (EXIT_FAILURE); } for (char **job_class_path = job_class_paths; job_class_path && *job_class_path; job_class_path++) upstart_job_added (NULL, NULL, *job_class_path); nih_free (job_class_paths); /* Become daemon */ if (daemonise) { /* Deal with the pidfile location when becoming a daemon. * We need to be able to run one bridge per upstart daemon. * Store the PID file in XDG_RUNTIME_DIR or HOME and include the pid of * the Upstart instance (last part of the DBus path) in the filename. */ if (user_mode) { /* Extract PID from UPSTART_SESSION */ user_session_path = nih_str_split (NULL, user_session_addr, "/", TRUE); for (int i = 0; user_session_path && user_session_path[i]; i++) path_element = user_session_path[i]; if (! path_element) { nih_fatal (_("Invalid value for UPSTART_SESSION")); exit (EXIT_FAILURE); } pidfile_path = getenv ("XDG_RUNTIME_DIR"); if (! pidfile_path) pidfile_path = getenv ("HOME"); if (pidfile_path) { NIH_MUST (nih_strcat_sprintf (&pidfile, NULL, "%s/upstart-dbus-bridge.%s.pid", pidfile_path, path_element)); nih_main_set_pidfile (pidfile); } } if (nih_main_daemonise () < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Unable to become daemon"), err->message); nih_free (err); exit (EXIT_FAILURE); } } /* Handle TERM and INT signals gracefully */ nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); if (! daemonise) { nih_signal_set_handler (SIGINT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGINT, nih_main_term_signal, NULL)); } ret = nih_main_loop (); /* Destroy any PID file we may have created */ if (daemonise) { nih_main_unlink_pidfile (); } return ret; } /** * dbus_disconnected: * * @connection: connection to a D-Bus bus. * * Handler called when bridge disconnected from D-Bus. **/ static void dbus_disconnected (DBusConnection *connection) { nih_fatal (_("Disconnected from D-Bus")); nih_main_loop_exit (EXIT_FAILURE); } /** * upstart_disconnected: * * @connection: connection to Upstart. * * Handler called when bridge disconnected from Upstart. **/ static void upstart_disconnected (DBusConnection *connection) { nih_fatal (_("Disconnected from Upstart")); nih_main_loop_exit (EXIT_FAILURE); } /** * NihOption setter function to handle bus name * * Returns: 0 on success **/ static int bus_name_setter (NihOption *option, const char *arg) { nih_assert (option); if (arg == NULL || arg[0] == '\0' || arg[0] == ' ') { return -1; } bus_name = arg; return 0; } /** * NihOption setter function to handle selection of D-Bus bus type. * * Returns: 0 on success, -1 on invalid console type. **/ static int dbus_bus_setter (NihOption *option, const char *arg) { nih_assert (option); nih_assert (option->long_option); if (! strcmp (option->long_option, "session")) { dbus_bus = DBUS_BUS_SESSION; } else { dbus_bus = DBUS_BUS_SYSTEM; } return 0; } /** * signal_filter: * @connection: D-Bus connection, * @message: D-Bus message, * @user_data: unused. * * Handle D-Bus signal message by emitting an Upstart event * containing pertinent details from the original message. * * Returns: DBUS_HANDLER_RESULT_HANDLED always. **/ static DBusHandlerResult signal_filter (DBusConnection *connection, DBusMessage *message, void *user_data) { int emit = FALSE; DBusPendingCall *pending_call; DBusError error; DBusMessageIter message_iter; nih_local char **env = NULL; const char *sender; const char *destination; const char *interface; const char *signal; const char *path; size_t env_len = 0; nih_assert (connection); nih_assert (message); if (! always) { NIH_HASH_FOREACH (jobs, iter) { emit = TRUE; break; } /* No jobs care about DBUS_EVENT, so ignore it */ if (! emit) goto out; } dbus_error_init (&error); sender = dbus_message_get_sender (message); signal = dbus_message_get_member (message); interface = dbus_message_get_interface (message); path = dbus_message_get_path (message); destination = dbus_message_get_destination (message); /* Don't react to D-Bus signals generated by Upstart * to avoid a possible feedback loop: for example, imagine a job * that emits an event when it detects (via this bridge) that * Upstart has emitted an event by considering Upstarts * "EventEmitted" D-Bus signal interface... */ if ((sender && ! strcmp (sender, DBUS_SERVICE_UPSTART)) || (interface && ! strcmp (interface, DBUS_INTERFACE_UPSTART))) { nih_debug ("ignoring signal originating from upstart itself"); goto out; } env = NIH_MUST (nih_str_array_new (NULL)); if (signal) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "SIGNAL=%s", signal)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } else { /* We need something to work with */ nih_debug ("Ignoring message with no signal name"); goto out; } if (bus_name) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "BUS=%s", bus_name)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } if (interface) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "INTERFACE=%s", interface)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } if (path) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "OBJPATH=%s", path)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } if (sender) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "SENDER=%s", sender)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } if (destination) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "DESTINATION=%s", destination)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } if (dbus_message_iter_init (message, &message_iter)) { int current_type = DBUS_TYPE_INVALID; int arg_num = 0; while ((current_type = dbus_message_iter_get_arg_type (&message_iter)) != DBUS_TYPE_INVALID) { nih_local char *var = NULL; switch (current_type) { case DBUS_TYPE_BOOLEAN: { dbus_bool_t arg = 0; dbus_message_iter_get_basic (&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%s", arg_num, arg ? "TRUE" : "FALSE")); break; } case DBUS_TYPE_INT16: { dbus_int16_t arg = 0; dbus_message_iter_get_basic(&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%" PRIi16, arg_num, arg)); break; } case DBUS_TYPE_UINT16: { dbus_uint16_t arg = 0; dbus_message_iter_get_basic (&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%" PRIu16, arg_num, arg)); break; } case DBUS_TYPE_INT32: { dbus_int32_t arg = 0; dbus_message_iter_get_basic (&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%" PRIi32, arg_num, arg)); break; } case DBUS_TYPE_UINT32: { dbus_uint32_t arg = 0; dbus_message_iter_get_basic (&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%" PRIu32, arg_num, arg)); break; } case DBUS_TYPE_INT64: { dbus_int64_t arg = 0; dbus_message_iter_get_basic (&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%" PRIi64, arg_num, arg)); break; } case DBUS_TYPE_UINT64: { dbus_uint64_t arg = 0; dbus_message_iter_get_basic (&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%" PRIu64, arg_num, arg)); break; } case DBUS_TYPE_DOUBLE: { double arg = 0; dbus_message_iter_get_basic (&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%f", arg_num, arg)); break; } case DBUS_TYPE_STRING: { const char * arg = NULL; dbus_message_iter_get_basic (&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%s", arg_num, arg)); break; } case DBUS_TYPE_OBJECT_PATH: { const char * arg = NULL; dbus_message_iter_get_basic (&message_iter, &arg); var = NIH_MUST (nih_sprintf (NULL, "ARG%d=%s", arg_num, arg)); break; } /* NOTE: Only supporting strings for now, we can consider other types in the future by extending this switch */ } if (var != NULL) { NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } dbus_message_iter_next (&message_iter); arg_num++; } } nih_debug ("Received D-Bus signal: %s " "(sender=%s, destination=%s, interface=%s, path=%s)", signal ? signal : "", sender ? sender : "", destination ? destination : "", interface ? interface : "", path ? path : ""); pending_call = upstart_emit_event (upstart, DBUS_EVENT, env, FALSE, NULL, emit_event_error, NULL, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); } dbus_pending_call_unref (pending_call); out: return DBUS_HANDLER_RESULT_HANDLED; } static void emit_event_error (void *data, NihDBusMessage *message) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); } static void upstart_job_added (void *data, NihDBusMessage *message, const char *job_class_path) { /* set to TRUE if jobs start/stop conditions specify * DBUS_EVENT. Used to restrict emission of events * unnecessarily. Note that event environment matching * though is handled by Upstart. */ int add = FALSE; Job *job; nih_local NihDBusProxy *job_class = NULL; nih_local char ***start_on = NULL; nih_local char ***stop_on = NULL; nih_assert (job_class_path != NULL); /* Obtain a proxy to the job */ job_class = nih_dbus_proxy_new (NULL, upstart->connection, upstart->name, job_class_path, NULL, NULL); if (! job_class) { NihError *err; err = nih_error_get (); nih_error ("Could not create proxy for job %s: %s", job_class_path, err->message); nih_free (err); return; } job_class->auto_start = FALSE; /* Obtain the start_on and stop_on properties of the job */ if (job_class_get_start_on_sync (NULL, job_class, &start_on) < 0) { NihError *err; err = nih_error_get (); nih_error ("Could not obtain job start condition %s: %s", job_class_path, err->message); nih_free (err); return; } if (job_class_get_stop_on_sync (NULL, job_class, &stop_on) < 0) { NihError *err; err = nih_error_get (); nih_error ("Could not obtain job stop condition %s: %s", job_class_path, err->message); nih_free (err); return; } /* Find out whether this job listens for any DBUS events */ for (char ***event = start_on; event && *event && **event; event++) if (! strcmp (**event, DBUS_EVENT)) { add = TRUE; break; } for (char ***event = stop_on; ! add && event && *event && **event; event++) if (! strcmp (**event, DBUS_EVENT)) { add = TRUE; break; } if (! add) return; nih_debug ("Job got added %s for event %s", job_class_path, DBUS_EVENT); /* Free any existing record for the job (should never happen, * but worth being safe). */ job = (Job *)nih_hash_lookup (jobs, job_class_path); if (job) nih_free (job); /* Create new record for the job */ job = NIH_MUST (nih_new (NULL, Job)); job->path = NIH_MUST (nih_strdup (job, job_class_path)); nih_list_init (&job->entry); nih_alloc_set_destructor (job, nih_list_destroy); nih_hash_add (jobs, &job->entry); } static void upstart_job_removed (void *data, NihDBusMessage *message, const char *job_path) { Job *job; nih_assert (job_path != NULL); job = (Job *)nih_hash_lookup (jobs, job_path); if (job) { nih_debug ("Job went away %s", job_path); nih_free (job); } } upstart-1.13.2/extra/upstart-udev-bridge.c0000664000175000017500000002626012373101356015416 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "com.ubuntu.Upstart.h" /* Prototypes for static functions */ static void udev_monitor_watcher (struct udev_monitor *udev_monitor, NihIoWatch *watch, NihIoEvents events); static void upstart_disconnected (DBusConnection *connection); static void emit_event_error (void *data, NihDBusMessage *message); static char *make_safe_string (const void *parent, const char *original); /** * daemonise: * * Set to TRUE if we should become a daemon, rather than just running * in the foreground. **/ static int daemonise = FALSE; /** * upstart: * * Proxy to Upstart daemon. **/ static NihDBusProxy *upstart = NULL; /** * no_strip_udev_data: * * If TRUE, do not modify any udev message data (old behaviour). * If FALSE, use make_safe_string () to cleanse udev strings. **/ static int no_strip_udev_data = FALSE; /** * options: * * Command-line options accepted by this program. **/ static NihOption options[] = { { 0, "daemon", N_("Detach and run in the background"), NULL, NULL, &daemonise, NULL }, { 0, "no-strip", N_("Do not strip non-printable bytes from udev message data"), NULL, NULL, &no_strip_udev_data, NULL }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char ** args; DBusConnection * connection; struct udev * udev; struct udev_monitor *udev_monitor; int ret; nih_main_init (argv[0]); nih_option_set_synopsis (_("Bridge udev events into upstart")); nih_option_set_help ( _("By default, upstart-udev-bridge does not detach from the " "console and remains in the foreground. Use the --daemon " "option to have it detach.")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); /* Initialise the connection to Upstart */ connection = NIH_SHOULD (nih_dbus_connect (DBUS_ADDRESS_UPSTART, upstart_disconnected)); if (! connection) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not connect to Upstart"), err->message); nih_free (err); exit (1); } upstart = NIH_SHOULD (nih_dbus_proxy_new (NULL, connection, NULL, DBUS_PATH_UPSTART, NULL, NULL)); if (! upstart) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Could not create Upstart proxy"), err->message); nih_free (err); exit (1); } /* Initialise the connection to udev */ nih_assert (udev = udev_new ()); nih_assert (udev_monitor = udev_monitor_new_from_netlink (udev, "udev")); nih_assert (udev_monitor_enable_receiving (udev_monitor) == 0); udev_monitor_set_receive_buffer_size(udev_monitor, 128*1024*1024); NIH_MUST (nih_io_add_watch (NULL, udev_monitor_get_fd (udev_monitor), NIH_IO_READ, (NihIoWatcher)udev_monitor_watcher, udev_monitor)); /* Become daemon */ if (daemonise) { if (nih_main_daemonise () < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Unable to become daemon"), err->message); nih_free (err); exit (1); } /* Send all logging output to syslog */ openlog (program_name, LOG_PID, LOG_DAEMON); nih_log_set_logger (nih_logger_syslog); } /* Handle TERM and INT signals gracefully */ nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); if (! daemonise) { nih_signal_set_handler (SIGINT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGINT, nih_main_term_signal, NULL)); } ret = nih_main_loop (); return ret; } static void udev_monitor_watcher (struct udev_monitor *udev_monitor, NihIoWatch * watch, NihIoEvents events) { struct udev_device * udev_device; nih_local char * subsystem = NULL; nih_local char * action = NULL; nih_local char * kernel = NULL; nih_local char * devpath = NULL; nih_local char * devname = NULL; nih_local char * name = NULL; nih_local char ** env = NULL; const char * value = NULL; size_t env_len = 0; DBusPendingCall * pending_call; char *(*copy_string)(const void *, const char *) = NULL; udev_device = udev_monitor_receive_device (udev_monitor); if (! udev_device) return; copy_string = no_strip_udev_data ? nih_strdup : make_safe_string; value = udev_device_get_subsystem (udev_device); subsystem = value ? copy_string (NULL, value) : NULL; value = udev_device_get_action (udev_device); action = value ? copy_string (NULL, value) : NULL; value = udev_device_get_sysname (udev_device); kernel = value ? copy_string (NULL, value) : NULL; value = udev_device_get_devpath (udev_device); devpath = value ? copy_string (NULL, value) : NULL; value = udev_device_get_devnode (udev_device); devname = value ? copy_string (NULL, value) : NULL; /* Protect against the "impossible" */ if (! action) goto out; if (! strcmp (action, "add")) { name = NIH_MUST (nih_sprintf (NULL, "%s-device-added", subsystem)); } else if (! strcmp (action, "change")) { name = NIH_MUST (nih_sprintf (NULL, "%s-device-changed", subsystem)); } else if (! strcmp (action, "remove")) { name = NIH_MUST (nih_sprintf (NULL, "%s-device-removed", subsystem)); } else { name = NIH_MUST (nih_sprintf (NULL, "%s-device-%s", subsystem, action)); } env = NIH_MUST (nih_str_array_new (NULL)); if (kernel) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "KERNEL=%s", kernel)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } if (devpath) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "DEVPATH=%s", devpath)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } if (devname) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "DEVNAME=%s", devname)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } if (subsystem) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "SUBSYSTEM=%s", subsystem)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } if (action) { nih_local char *var = NULL; var = NIH_MUST (nih_sprintf (NULL, "ACTION=%s", action)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } for (struct udev_list_entry *list_entry = udev_device_get_properties_list_entry (udev_device); list_entry != NULL; list_entry = udev_list_entry_get_next (list_entry)) { nih_local char *udev_name = NULL; nih_local char *udev_value = NULL; nih_local char *var = NULL; udev_name = copy_string (NULL, udev_list_entry_get_name (list_entry)); if (! strcmp (udev_name, "DEVPATH")) continue; if (! strcmp (udev_name, "DEVNAME")) continue; if (! strcmp (udev_name, "SUBSYSTEM")) continue; if (! strcmp (udev_name, "ACTION")) continue; udev_value = copy_string (NULL, udev_list_entry_get_value (list_entry)); var = NIH_MUST (nih_sprintf (NULL, "%s=%s", udev_name, udev_value)); NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var)); } nih_debug ("%s %s", name, devname ? devname : ""); pending_call = upstart_emit_event (upstart, name, env, FALSE, NULL, emit_event_error, NULL, NIH_DBUS_TIMEOUT_NEVER); if (! pending_call) { NihError *err; int saved = errno; err = nih_error_get (); nih_warn ("%s", err->message); if (saved != ENOMEM && subsystem) nih_warn ("Likely that udev '%s' event contains binary garbage", subsystem); nih_free (err); } dbus_pending_call_unref (pending_call); out: udev_device_unref (udev_device); } static void upstart_disconnected (DBusConnection *connection) { nih_fatal (_("Disconnected from Upstart")); nih_main_loop_exit (1); } static void emit_event_error (void * data, NihDBusMessage *message) { NihError *err; err = nih_error_get (); nih_warn ("%s", err->message); nih_free (err); } /** * make_safe_string: * @parent: parent, * @original: original string. * * Strip non-printable and non-blank bytes from specified string. * * Notes: * * Sadly, this is necessary as some hardware (such as battery devices) * exposes non-printable bytes in their descriptive registers to the * kernel. Since neither the kernel nor udev specify any encoding for * udev messages, these (probably bogus) bytes get passed up to userland * to deal with. This is sub-optimal since it implies that _every_ * application that processes udev messages must perform its own * sanitizing on the messages. Let's just hope they all deal with the * problem in the same way... * * Note that *iff* the kernel/udev did specify an encoding model, this * problem could go away since one of the lower layers could then * detect the out-of-bound data and deal with it at source. All instances * of this issue seen so far seem to indicate the binary control data * being presented by the hardware is in fact bogus ("corruption") and * looks like some block of memory has not been initialized correctly. * * The approach taken here is to simulate the approach already adopted * by 'upower' (up_device_supply_make_safe_string()), with the exception * that we also allow blank characters (such as tabs). * * Returns a copy of @original stripped of all non-printable and * non-blank characters, or NULL if insufficient memory. **/ char * make_safe_string (const void *parent, const char *original) { size_t len; size_t i, j; char *cleaned; nih_assert (original); len = strlen (original); cleaned = nih_alloc (parent, len + 1); if (! cleaned) return NULL; for (i=0, j=0; i < len; ) { /* Skip over bogus bytes */ if (! (isprint (original[i]) || isblank (original[i]))) { i++; continue; } /* Copy what remains */ cleaned[j] = original[i]; i++; j++; } /* Terminate */ cleaned[j] = '\0'; if (i != j) nih_debug ("removed unexpected bytes from udev message data"); /* Note that strictly we should realloc the string if * bogus bytes were found (since it will now be shorter). * However, since all the strings are short (and short-lived) we * do not do this to avoid the associated overhead. */ return cleaned; } upstart-1.13.2/configure.ac0000664000175000017500000001311612402042232012502 00000000000000# Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) AC_INIT([upstart], [1.13.2], [upstart-devel@lists.ubuntu.com]) NIH_COPYRIGHT([[Copyright © 2006-2014 Canonical Ltd., 2011 Scott James Remnant]]) AC_CONFIG_SRCDIR([init/main.c]) AC_CONFIG_MACRO_DIR([m4]) AC_GNU_SOURCE AM_INIT_AUTOMAKE([1.10 gnu nostdinc check-news color-tests silent-rules]) AM_SILENT_RULES([yes]) AM_MAINTAINER_MODE([enable]) LT_PREREQ(2.2.4) LT_INIT AM_GNU_GETTEXT_VERSION([0.17]) AM_GNU_GETTEXT([external]) # Checks for programs. AC_PROG_CC AC_PROG_CC_C99 AM_PROG_CC_C_O PKG_PROG_PKG_CONFIG([0.22]) AC_PATH_PROG([NIH_DBUS_TOOL], [nih-dbus-tool]) # Checks for libraries. NIH_WITH_LOCAL_LIBNIH PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2]) PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0]) PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.36], [have_gio=yes], [have_gio=no]) PKG_CHECK_MODULES([UDEV], [libudev >= 146], [have_udev=yes], [have_udev=no]) PKG_CHECK_MODULES([DCONF], [dconf >= 0.14], [have_dconf=yes], [have_dconf=no]) AC_CHECK_HEADER([sys/epoll.h], [have_epoll=yes], [have_epoll=no]) AC_ARG_ENABLE([udev-bridge], AS_HELP_STRING([--disable-udev-bridge], [Disable building of upstart-udev-bridge even if required dependencies available]), [udev_bridge=no], [udev_bridge=yes]) AM_CONDITIONAL([ENABLE_UDEV_BRIDGE], [test "$have_udev" = yes && test "$udev_bridge" = yes]) AC_ARG_ENABLE([socket-bridge], AS_HELP_STRING([--disable-socket-bridge], [Disable building of upstart-socket-bridge even if required dependencies available]), [socket_bridge=no], [socket_bridge=yes]) AM_CONDITIONAL([ENABLE_SOCKET_BRIDGE], [test "$have_epoll" = yes && test "$socket_bridge" = yes]) AC_ARG_ENABLE([local-bridge], AS_HELP_STRING([--disable-local-bridge], [Disable building of upstart-local-bridge even if required dependencies available]), [local_bridge=no], [local_bridge=yes]) AM_CONDITIONAL([ENABLE_LOCAL_BRIDGE], [test "$local_bridge" = yes]) AC_ARG_ENABLE([dconf-bridge], AS_HELP_STRING([--disable-dconf-bridge], [Disable building of upstart-dconf-bridge even if required dependencies available]), [dconf_bridge=no], [dconf_bridge=yes]) AM_CONDITIONAL([ENABLE_DCONF_BRIDGE], [test "$have_dconf" = yes && test "$have_gio" = yes && test "$dconf_bridge" = yes]) #AC_CHECK_DECL([TEST_PLAN],[ #have_tap=yes #AC_REQUIRE_AUX_FILE([tap-driver.sh]) #AC_DEFINE([NIH_TAP_OUTPUT], [1], [Do not abort on test failure]) #],[have_tap=no],[[#include ]]) have_tap=no AM_CONDITIONAL([ENABLE_TAP_OUTPUT], [test "$have_tap" = "yes"]) AC_ARG_ENABLE([cgroups], AS_HELP_STRING([--disable-cgroups], [Disable support for Linux cgroups]), [enable_cgroups=no], [enable_cgroups=yes]) PKG_CHECK_MODULES([CGMANAGER], [libcgmanager], [have_cgmanager=yes], [have_cgmanager=no]) AM_CONDITIONAL([ENABLE_CGROUPS], [test "$enable_cgroups" = yes && test "$have_cgmanager" = yes]) if test "$enable_cgroups" = yes && test "$have_cgmanager" = yes; then AC_DEFINE([ENABLE_CGROUPS], [1], [Build with Cgroup CGManager support]) fi # Reasons for requiring this library version: # # 1) RFC 4627, the JSON "memo" (it is *NOT* a standard!) helpfully fails # to specify the maximum size of an integer type. And yet, JSON is # supposedly a subset of ECMA-262, which specifies a Number type to # be 64-bits. # # The loose JSON "memo" might expalain why older versions of JSON-C encode # a JSON Number in sizoef(int) bytes which is only 32-bits on 32-bit # systems. This is not acceptable for Upstart which needs to be able # to encode 'size_t' and 'unsigned long' types which can be larger # than 'int'. # # 2) New json_tokener_parse_verbose() function required to detect invalid # JSON (!) # PKG_CHECK_MODULES([JSON], [json-c], [], [PKG_CHECK_MODULES([JSON], [json >= 0.10])]) AC_ARG_ENABLE([abi-check], AS_HELP_STRING([--disable-abi-check], [Disable libupstart ABI check performed if abi-compliance-checker available]), [abi_check=no], [abi_check=yes]) if test x$abi_check = xyes; then AC_CHECK_PROGS([ABI_COMPLIANCE_CHECKER],[abi-compliance-checker]) AC_SUBST([ABI_COMPLIANCE_CHECKER]) fi AM_CONDITIONAL([HAVE_ABI_CHECKER], [test ! -z "$ABI_COMPLIANCE_CHECKER" && test -e "$srcdir"/lib/abi/"$host_cpu"-"$host_os"/*.abi]) # Checks for header files. AC_CHECK_HEADERS([valgrind/valgrind.h, sys/prctl.h]) # Checks for typedefs, structures, and compiler characteristics. NIH_C_THREAD AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(uid_t) AC_CHECK_SIZEOF(pid_t) AC_CHECK_SIZEOF(time_t) AC_CHECK_SIZEOF(mode_t) AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(ssize_t) # Unlikely to hit this limit for a while, but it pays to be safe. for type in int uid_t pid_t time_t mode_t size_t ssize_t do eval value="\$ac_cv_sizeof_${type}" test "$value" -gt 8 && AC_MSG_ERROR([type $type is $value bytes, larger than JSON-C can represent]) done # Checks for library functions. # Other checks AC_MSG_CHECKING([whether to include sbindir in PATH]) eval upstart_sbindir=\"$sbindir\" case $upstart_sbindir in /sbin|NONE/sbin|//sbin|/usr/sbin|/usr/local/sbin) AC_MSG_RESULT([no]) ;; *) AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([EXTRA_PATH], ["$upstart_sbindir"], [Directory to append to path.]) ;; esac NIH_COMPILER_WARNINGS NIH_COMPILER_OPTIMISATIONS NIH_COMPILER_COVERAGE NIH_LINKER_OPTIMISATIONS AC_CONFIG_FILES([ Makefile dbus/Makefile init/Makefile util/Makefile conf/Makefile extra/Makefile doc/Makefile contrib/Makefile po/Makefile.in scripts/Makefile scripts/data/Makefile test/Makefile lib/Makefile lib/libupstart.pc.in ]) AC_CONFIG_HEADERS([config.h]) AC_OUTPUT upstart-1.13.2/ltmain.sh0000644000175000017500000105204412373101364012047 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 upstart-1.13.2/configure0000775000175000017500000212064212402042375012140 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for upstart 1.13.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # # Copyright © 2006-2014 Canonical Ltd., 2011 Scott James Remnant ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: upstart-devel@lists.ubuntu.com about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='upstart' PACKAGE_TARNAME='upstart' PACKAGE_VERSION='1.13.2' PACKAGE_STRING='upstart 1.13.2' PACKAGE_BUGREPORT='upstart-devel@lists.ubuntu.com' PACKAGE_URL='' ac_unique_file="init/main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gt_needs= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS HAVE_ABI_CHECKER_FALSE HAVE_ABI_CHECKER_TRUE ABI_COMPLIANCE_CHECKER JSON_LIBS JSON_CFLAGS ENABLE_CGROUPS_FALSE ENABLE_CGROUPS_TRUE CGMANAGER_LIBS CGMANAGER_CFLAGS ENABLE_TAP_OUTPUT_FALSE ENABLE_TAP_OUTPUT_TRUE ENABLE_DCONF_BRIDGE_FALSE ENABLE_DCONF_BRIDGE_TRUE ENABLE_LOCAL_BRIDGE_FALSE ENABLE_LOCAL_BRIDGE_TRUE ENABLE_SOCKET_BRIDGE_FALSE ENABLE_SOCKET_BRIDGE_TRUE ENABLE_UDEV_BRIDGE_FALSE ENABLE_UDEV_BRIDGE_TRUE DCONF_LIBS DCONF_CFLAGS UDEV_LIBS UDEV_CFLAGS GIO_LIBS GIO_CFLAGS DBUS_LIBS DBUS_CFLAGS NIH_DBUS_LIBS NIH_DBUS_CFLAGS NIH_LIBS NIH_CFLAGS NIH_DBUS_TOOL PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG POSUB LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV INTL_MACOSX_LIBS XGETTEXT_EXTRA_OPTIONS MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC PACKAGE_COPYRIGHT target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_silent_rules enable_maintainer_mode enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_nls enable_rpath with_libiconv_prefix with_libintl_prefix with_local_libnih enable_udev_bridge enable_socket_bridge enable_local_bridge enable_dconf_bridge enable_cgroups enable_abi_check enable_threading enable_compiler_warnings enable_compiler_optimisations enable_compiler_coverage enable_linker_optimisations ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR NIH_CFLAGS NIH_LIBS NIH_DBUS_CFLAGS NIH_DBUS_LIBS DBUS_CFLAGS DBUS_LIBS GIO_CFLAGS GIO_LIBS UDEV_CFLAGS UDEV_LIBS DCONF_CFLAGS DCONF_LIBS CGMANAGER_CFLAGS CGMANAGER_LIBS JSON_CFLAGS JSON_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures upstart 1.13.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/upstart] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of upstart 1.13.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --disable-maintainer-mode disable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --disable-udev-bridge Disable building of upstart-udev-bridge even if required dependencies available --disable-socket-bridge Disable building of upstart-socket-bridge even if required dependencies available --disable-local-bridge Disable building of upstart-local-bridge even if required dependencies available --disable-dconf-bridge Disable building of upstart-dconf-bridge even if required dependencies available --disable-cgroups Disable support for Linux cgroups --disable-abi-check Disable libupstart ABI check performed if abi-compliance-checker available --enable-threading Enable support for multi-threading --enable-compiler-warnings Enable additional compiler warnings --disable-compiler-optimisations Disable compiler optimisations --enable-compiler-coverage Enable generation of coverage data --disable-linker-optimisations Disable linker optimisations Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --with-local-libnih[=DIR] Use libnih from source tree DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path NIH_CFLAGS C compiler flags for NIH, overriding pkg-config NIH_LIBS linker flags for NIH, overriding pkg-config NIH_DBUS_CFLAGS C compiler flags for NIH_DBUS, overriding pkg-config NIH_DBUS_LIBS linker flags for NIH_DBUS, overriding pkg-config DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config DBUS_LIBS linker flags for DBUS, overriding pkg-config GIO_CFLAGS C compiler flags for GIO, overriding pkg-config GIO_LIBS linker flags for GIO, overriding pkg-config UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config UDEV_LIBS linker flags for UDEV, overriding pkg-config DCONF_CFLAGS C compiler flags for DCONF, overriding pkg-config DCONF_LIBS linker flags for DCONF, overriding pkg-config CGMANAGER_CFLAGS C compiler flags for CGMANAGER, overriding pkg-config CGMANAGER_LIBS linker flags for CGMANAGER, overriding pkg-config JSON_CFLAGS C compiler flags for JSON, overriding pkg-config JSON_LIBS linker flags for JSON, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF upstart configure 1.13.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Copyright © 2006-2014 Canonical Ltd., 2011 Scott James Remnant _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## --------------------------------------------- ## ## Report this to upstart-devel@lists.ubuntu.com ## ## --------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by upstart $as_me 1.13.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu $as_echo "#define PACKAGE_COPYRIGHT \"Copyright (C) 2006-2014 Canonical Ltd., 2011 Scott James Remnant\"" >>confdefs.h PACKAGE_COPYRIGHT="Copyright © 2006-2014 Canonical Ltd., 2011 Scott James Remnant" # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='upstart' VERSION='1.13.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.17 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 $as_echo_n "checking for ld used by GCC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` LIBICONV_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if eval \${$gt_func_gnugettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes else am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` LIBINTL_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.22 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Extract the first word of "nih-dbus-tool", so it can be a program name with args. set dummy nih-dbus-tool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_NIH_DBUS_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else case $NIH_DBUS_TOOL in [\\/]* | ?:[\\/]*) ac_cv_path_NIH_DBUS_TOOL="$NIH_DBUS_TOOL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_NIH_DBUS_TOOL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi NIH_DBUS_TOOL=$ac_cv_path_NIH_DBUS_TOOL if test -n "$NIH_DBUS_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NIH_DBUS_TOOL" >&5 $as_echo "$NIH_DBUS_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Checks for libraries. # Check whether --with-local-libnih was given. if test "${with_local_libnih+set}" = set; then : withval=$with_local_libnih; if test "x$with_local_libnih" != "xno"; then : if ! test -f "$withval/nih/alloc.c"; then : as_fn_error $? "$withval doesn't look like a libnih source tree" "$LINENO" 5 fi nih_dir="`cd $withval && pwd`" NIH_CFLAGS="-I\"$nih_dir\"" NIH_LIBS="\"$nih_dir/nih/libnih.la\"" NIH_DBUS_CFLAGS="-I\"$nih_dir\"" NIH_DBUS_LIBS="\"$nih_dir/nih-dbus/libnih-dbus.la\"" NIH_DBUS_TOOL="\"$nih_dir/nih-dbus-tool/nih-dbus-tool\"" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NIH" >&5 $as_echo_n "checking for NIH... " >&6; } if test -n "$NIH_CFLAGS"; then pkg_cv_NIH_CFLAGS="$NIH_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnih >= 1.0.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnih >= 1.0.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NIH_CFLAGS=`$PKG_CONFIG --cflags "libnih >= 1.0.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NIH_LIBS"; then pkg_cv_NIH_LIBS="$NIH_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnih >= 1.0.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnih >= 1.0.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NIH_LIBS=`$PKG_CONFIG --libs "libnih >= 1.0.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NIH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnih >= 1.0.2" 2>&1` else NIH_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnih >= 1.0.2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NIH_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libnih >= 1.0.2) were not met: $NIH_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NIH_CFLAGS and NIH_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NIH_CFLAGS and NIH_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else NIH_CFLAGS=$pkg_cv_NIH_CFLAGS NIH_LIBS=$pkg_cv_NIH_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NIH_DBUS" >&5 $as_echo_n "checking for NIH_DBUS... " >&6; } if test -n "$NIH_DBUS_CFLAGS"; then pkg_cv_NIH_DBUS_CFLAGS="$NIH_DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnih-dbus >= 1.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnih-dbus >= 1.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NIH_DBUS_CFLAGS=`$PKG_CONFIG --cflags "libnih-dbus >= 1.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NIH_DBUS_LIBS"; then pkg_cv_NIH_DBUS_LIBS="$NIH_DBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnih-dbus >= 1.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnih-dbus >= 1.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NIH_DBUS_LIBS=`$PKG_CONFIG --libs "libnih-dbus >= 1.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NIH_DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnih-dbus >= 1.0.0" 2>&1` else NIH_DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnih-dbus >= 1.0.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NIH_DBUS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libnih-dbus >= 1.0.0) were not met: $NIH_DBUS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NIH_DBUS_CFLAGS and NIH_DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NIH_DBUS_CFLAGS and NIH_DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else NIH_DBUS_CFLAGS=$pkg_cv_NIH_DBUS_CFLAGS NIH_DBUS_LIBS=$pkg_cv_NIH_DBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 $as_echo_n "checking for DBUS... " >&6; } if test -n "$DBUS_CFLAGS"; then pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.2.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.2.16" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_LIBS"; then pkg_cv_DBUS_LIBS="$DBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.2.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.2.16" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-1 >= 1.2.16" 2>&1` else DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 1.2.16" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-1 >= 1.2.16) were not met: $DBUS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_CFLAGS and DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_CFLAGS and DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS DBUS_LIBS=$pkg_cv_DBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIO" >&5 $as_echo_n "checking for GIO... " >&6; } if test -n "$GIO_CFLAGS"; then pkg_cv_GIO_CFLAGS="$GIO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.36\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.36") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= 2.36" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GIO_LIBS"; then pkg_cv_GIO_LIBS="$GIO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.36\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.36") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0 >= 2.36" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-2.0 >= 2.36" 2>&1` else GIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-2.0 >= 2.36" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GIO_PKG_ERRORS" >&5 have_gio=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_gio=no else GIO_CFLAGS=$pkg_cv_GIO_CFLAGS GIO_LIBS=$pkg_cv_GIO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_gio=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5 $as_echo_n "checking for UDEV... " >&6; } if test -n "$UDEV_CFLAGS"; then pkg_cv_UDEV_CFLAGS="$UDEV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 146\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev >= 146") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 146" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$UDEV_LIBS"; then pkg_cv_UDEV_LIBS="$UDEV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 146\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev >= 146") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "libudev >= 146" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev >= 146" 2>&1` else UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev >= 146" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UDEV_PKG_ERRORS" >&5 have_udev=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_udev=no else UDEV_CFLAGS=$pkg_cv_UDEV_CFLAGS UDEV_LIBS=$pkg_cv_UDEV_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_udev=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DCONF" >&5 $as_echo_n "checking for DCONF... " >&6; } if test -n "$DCONF_CFLAGS"; then pkg_cv_DCONF_CFLAGS="$DCONF_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dconf >= 0.14\""; } >&5 ($PKG_CONFIG --exists --print-errors "dconf >= 0.14") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DCONF_CFLAGS=`$PKG_CONFIG --cflags "dconf >= 0.14" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DCONF_LIBS"; then pkg_cv_DCONF_LIBS="$DCONF_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dconf >= 0.14\""; } >&5 ($PKG_CONFIG --exists --print-errors "dconf >= 0.14") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DCONF_LIBS=`$PKG_CONFIG --libs "dconf >= 0.14" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DCONF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dconf >= 0.14" 2>&1` else DCONF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dconf >= 0.14" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DCONF_PKG_ERRORS" >&5 have_dconf=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_dconf=no else DCONF_CFLAGS=$pkg_cv_DCONF_CFLAGS DCONF_LIBS=$pkg_cv_DCONF_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_dconf=yes fi ac_fn_c_check_header_mongrel "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" if test "x$ac_cv_header_sys_epoll_h" = xyes; then : have_epoll=yes else have_epoll=no fi # Check whether --enable-udev-bridge was given. if test "${enable_udev_bridge+set}" = set; then : enableval=$enable_udev_bridge; udev_bridge=no else udev_bridge=yes fi if test "$have_udev" = yes && test "$udev_bridge" = yes; then ENABLE_UDEV_BRIDGE_TRUE= ENABLE_UDEV_BRIDGE_FALSE='#' else ENABLE_UDEV_BRIDGE_TRUE='#' ENABLE_UDEV_BRIDGE_FALSE= fi # Check whether --enable-socket-bridge was given. if test "${enable_socket_bridge+set}" = set; then : enableval=$enable_socket_bridge; socket_bridge=no else socket_bridge=yes fi if test "$have_epoll" = yes && test "$socket_bridge" = yes; then ENABLE_SOCKET_BRIDGE_TRUE= ENABLE_SOCKET_BRIDGE_FALSE='#' else ENABLE_SOCKET_BRIDGE_TRUE='#' ENABLE_SOCKET_BRIDGE_FALSE= fi # Check whether --enable-local-bridge was given. if test "${enable_local_bridge+set}" = set; then : enableval=$enable_local_bridge; local_bridge=no else local_bridge=yes fi if test "$local_bridge" = yes; then ENABLE_LOCAL_BRIDGE_TRUE= ENABLE_LOCAL_BRIDGE_FALSE='#' else ENABLE_LOCAL_BRIDGE_TRUE='#' ENABLE_LOCAL_BRIDGE_FALSE= fi # Check whether --enable-dconf-bridge was given. if test "${enable_dconf_bridge+set}" = set; then : enableval=$enable_dconf_bridge; dconf_bridge=no else dconf_bridge=yes fi if test "$have_dconf" = yes && test "$have_gio" = yes && test "$dconf_bridge" = yes; then ENABLE_DCONF_BRIDGE_TRUE= ENABLE_DCONF_BRIDGE_FALSE='#' else ENABLE_DCONF_BRIDGE_TRUE='#' ENABLE_DCONF_BRIDGE_FALSE= fi #AC_CHECK_DECL([TEST_PLAN],[ #have_tap=yes #AC_REQUIRE_AUX_FILE([tap-driver.sh]) #AC_DEFINE([NIH_TAP_OUTPUT], [1], [Do not abort on test failure]) #],[have_tap=no],[[#include ]]) have_tap=no if test "$have_tap" = "yes"; then ENABLE_TAP_OUTPUT_TRUE= ENABLE_TAP_OUTPUT_FALSE='#' else ENABLE_TAP_OUTPUT_TRUE='#' ENABLE_TAP_OUTPUT_FALSE= fi # Check whether --enable-cgroups was given. if test "${enable_cgroups+set}" = set; then : enableval=$enable_cgroups; enable_cgroups=no else enable_cgroups=yes fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CGMANAGER" >&5 $as_echo_n "checking for CGMANAGER... " >&6; } if test -n "$CGMANAGER_CFLAGS"; then pkg_cv_CGMANAGER_CFLAGS="$CGMANAGER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcgmanager\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcgmanager") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CGMANAGER_CFLAGS=`$PKG_CONFIG --cflags "libcgmanager" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CGMANAGER_LIBS"; then pkg_cv_CGMANAGER_LIBS="$CGMANAGER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcgmanager\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcgmanager") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CGMANAGER_LIBS=`$PKG_CONFIG --libs "libcgmanager" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CGMANAGER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcgmanager" 2>&1` else CGMANAGER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcgmanager" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CGMANAGER_PKG_ERRORS" >&5 have_cgmanager=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_cgmanager=no else CGMANAGER_CFLAGS=$pkg_cv_CGMANAGER_CFLAGS CGMANAGER_LIBS=$pkg_cv_CGMANAGER_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_cgmanager=yes fi if test "$enable_cgroups" = yes && test "$have_cgmanager" = yes; then ENABLE_CGROUPS_TRUE= ENABLE_CGROUPS_FALSE='#' else ENABLE_CGROUPS_TRUE='#' ENABLE_CGROUPS_FALSE= fi if test "$enable_cgroups" = yes && test "$have_cgmanager" = yes; then $as_echo "#define ENABLE_CGROUPS 1" >>confdefs.h fi # Reasons for requiring this library version: # # 1) RFC 4627, the JSON "memo" (it is *NOT* a standard!) helpfully fails # to specify the maximum size of an integer type. And yet, JSON is # supposedly a subset of ECMA-262, which specifies a Number type to # be 64-bits. # # The loose JSON "memo" might expalain why older versions of JSON-C encode # a JSON Number in sizoef(int) bytes which is only 32-bits on 32-bit # systems. This is not acceptable for Upstart which needs to be able # to encode 'size_t' and 'unsigned long' types which can be larger # than 'int'. # # 2) New json_tokener_parse_verbose() function required to detect invalid # JSON (!) # pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON" >&5 $as_echo_n "checking for JSON... " >&6; } if test -n "$JSON_CFLAGS"; then pkg_cv_JSON_CFLAGS="$JSON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5 ($PKG_CONFIG --exists --print-errors "json-c") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JSON_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$JSON_LIBS"; then pkg_cv_JSON_LIBS="$JSON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5 ($PKG_CONFIG --exists --print-errors "json-c") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JSON_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then JSON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1` else JSON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$JSON_PKG_ERRORS" >&5 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON" >&5 $as_echo_n "checking for JSON... " >&6; } if test -n "$JSON_CFLAGS"; then pkg_cv_JSON_CFLAGS="$JSON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json >= 0.10\""; } >&5 ($PKG_CONFIG --exists --print-errors "json >= 0.10") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JSON_CFLAGS=`$PKG_CONFIG --cflags "json >= 0.10" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$JSON_LIBS"; then pkg_cv_JSON_LIBS="$JSON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json >= 0.10\""; } >&5 ($PKG_CONFIG --exists --print-errors "json >= 0.10") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JSON_LIBS=`$PKG_CONFIG --libs "json >= 0.10" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then JSON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json >= 0.10" 2>&1` else JSON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json >= 0.10" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$JSON_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (json >= 0.10) were not met: $JSON_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables JSON_CFLAGS and JSON_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables JSON_CFLAGS and JSON_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else JSON_CFLAGS=$pkg_cv_JSON_CFLAGS JSON_LIBS=$pkg_cv_JSON_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON" >&5 $as_echo_n "checking for JSON... " >&6; } if test -n "$JSON_CFLAGS"; then pkg_cv_JSON_CFLAGS="$JSON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json >= 0.10\""; } >&5 ($PKG_CONFIG --exists --print-errors "json >= 0.10") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JSON_CFLAGS=`$PKG_CONFIG --cflags "json >= 0.10" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$JSON_LIBS"; then pkg_cv_JSON_LIBS="$JSON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json >= 0.10\""; } >&5 ($PKG_CONFIG --exists --print-errors "json >= 0.10") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JSON_LIBS=`$PKG_CONFIG --libs "json >= 0.10" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then JSON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json >= 0.10" 2>&1` else JSON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json >= 0.10" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$JSON_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (json >= 0.10) were not met: $JSON_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables JSON_CFLAGS and JSON_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables JSON_CFLAGS and JSON_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else JSON_CFLAGS=$pkg_cv_JSON_CFLAGS JSON_LIBS=$pkg_cv_JSON_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else JSON_CFLAGS=$pkg_cv_JSON_CFLAGS JSON_LIBS=$pkg_cv_JSON_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check whether --enable-abi-check was given. if test "${enable_abi_check+set}" = set; then : enableval=$enable_abi_check; abi_check=no else abi_check=yes fi if test x$abi_check = xyes; then for ac_prog in abi-compliance-checker do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ABI_COMPLIANCE_CHECKER+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ABI_COMPLIANCE_CHECKER"; then ac_cv_prog_ABI_COMPLIANCE_CHECKER="$ABI_COMPLIANCE_CHECKER" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ABI_COMPLIANCE_CHECKER="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ABI_COMPLIANCE_CHECKER=$ac_cv_prog_ABI_COMPLIANCE_CHECKER if test -n "$ABI_COMPLIANCE_CHECKER"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ABI_COMPLIANCE_CHECKER" >&5 $as_echo "$ABI_COMPLIANCE_CHECKER" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ABI_COMPLIANCE_CHECKER" && break done fi if test ! -z "$ABI_COMPLIANCE_CHECKER" && test -e "$srcdir"/lib/abi/"$host_cpu"-"$host_os"/*.abi; then HAVE_ABI_CHECKER_TRUE= HAVE_ABI_CHECKER_FALSE='#' else HAVE_ABI_CHECKER_TRUE='#' HAVE_ABI_CHECKER_FALSE= fi # Checks for header files. for ac_header in valgrind/valgrind.h, sys/prctl.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. # Check whether --enable-threading was given. if test "${enable_threading+set}" = set; then : enableval=$enable_threading; else enable_threading=no fi if test "x$enable_threading" != "xno" ; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports __thread" >&5 $as_echo_n "checking whether compiler supports __thread... " >&6; } if ${nih_cv_c_thread+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int __thread a; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : nih_cv_c_thread=yes else nih_cv_c_thread=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nih_cv_c_thread" >&5 $as_echo "$nih_cv_c_thread" >&6; } if test "x$nih_cv_c_thread" = "xno"; then : $as_echo "#define __thread /**/" >>confdefs.h fi else $as_echo "#define __thread /**/" >>confdefs.h fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uid_t" >&5 $as_echo_n "checking size of uid_t... " >&6; } if ${ac_cv_sizeof_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uid_t))" "ac_cv_sizeof_uid_t" "$ac_includes_default"; then : else if test "$ac_cv_type_uid_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (uid_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_uid_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uid_t" >&5 $as_echo "$ac_cv_sizeof_uid_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UID_T $ac_cv_sizeof_uid_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5 $as_echo_n "checking size of pid_t... " >&6; } if ${ac_cv_sizeof_pid_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))" "ac_cv_sizeof_pid_t" "$ac_includes_default"; then : else if test "$ac_cv_type_pid_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (pid_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_pid_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pid_t" >&5 $as_echo "$ac_cv_sizeof_pid_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_PID_T $ac_cv_sizeof_pid_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 $as_echo_n "checking size of time_t... " >&6; } if ${ac_cv_sizeof_time_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then : else if test "$ac_cv_type_time_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_time_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 $as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of mode_t" >&5 $as_echo_n "checking size of mode_t... " >&6; } if ${ac_cv_sizeof_mode_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (mode_t))" "ac_cv_sizeof_mode_t" "$ac_includes_default"; then : else if test "$ac_cv_type_mode_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (mode_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_mode_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_mode_t" >&5 $as_echo "$ac_cv_sizeof_mode_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_MODE_T $ac_cv_sizeof_mode_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } if ${ac_cv_sizeof_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : else if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 $as_echo "$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ssize_t" >&5 $as_echo_n "checking size of ssize_t... " >&6; } if ${ac_cv_sizeof_ssize_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ssize_t))" "ac_cv_sizeof_ssize_t" "$ac_includes_default"; then : else if test "$ac_cv_type_ssize_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (ssize_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_ssize_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ssize_t" >&5 $as_echo "$ac_cv_sizeof_ssize_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t _ACEOF # Unlikely to hit this limit for a while, but it pays to be safe. for type in int uid_t pid_t time_t mode_t size_t ssize_t do eval value="\$ac_cv_sizeof_${type}" test "$value" -gt 8 && as_fn_error $? "type $type is $value bytes, larger than JSON-C can represent" "$LINENO" 5 done # Checks for library functions. # Other checks { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include sbindir in PATH" >&5 $as_echo_n "checking whether to include sbindir in PATH... " >&6; } eval upstart_sbindir=\"$sbindir\" case $upstart_sbindir in /sbin|NONE/sbin|//sbin|/usr/sbin|/usr/local/sbin) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define EXTRA_PATH "$upstart_sbindir" _ACEOF ;; esac # Check whether --enable-compiler-warnings was given. if test "${enable_compiler_warnings+set}" = set; then : enableval=$enable_compiler_warnings; if test "x$enable_compiler_warnings" = "xyes"; then : if test "x$GCC" = "xyes"; then : CFLAGS="-Wall -Wextra -Wno-empty-body -Wno-missing-field-initializers -Wno-unused-parameter -Wformat-security -Werror -D_FORTIFY_SOURCE=2 $CFLAGS" fi if test "x$GXX" = "xyes"; then : CXXFLAGS="-Wall -Wextra -Wno-empty-body -Wno-missing-field-initializers -Wno-unused-parameter -Wformat-security -Werror -D_FORTIFY_SOURCE=2 $CXXFLAGS" fi fi fi # Check whether --enable-compiler-optimisations was given. if test "${enable_compiler_optimisations+set}" = set; then : enableval=$enable_compiler_optimisations; if test "x$enable_compiler_optimisations" = "xno"; then : CFLAGS=`echo "$CFLAGS" | sed -e "s/ -O[1-9s]*\b/ -O0/g"` CXXFLAGS=`echo "$CXXFLAGS" | sed -e "s/ -O[1-9s]*\b/ -O0/g"` fi fi # Check whether --enable-compiler-coverage was given. if test "${enable_compiler_coverage+set}" = set; then : enableval=$enable_compiler_coverage; if test "x$enable_compiler_coverage" = "xyes"; then : if test "x$GCC" = "xyes"; then : CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" fi if test "x$GXX" = "xyes"; then : CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage" fi fi fi # Check whether --enable-linker-optimisations was given. if test "${enable_linker_optimisations+set}" = set; then : enableval=$enable_linker_optimisations; if test "x$enable_linker_optimisations" = "xno"; then : LDFLAGS=`echo "$LDFLAGS" | sed -e "s/ -Wl,-O0-9*\b//g"` else LDFLAGS="$LDFLAGS -Wl,-O1" fi fi ac_config_files="$ac_config_files Makefile dbus/Makefile init/Makefile util/Makefile conf/Makefile extra/Makefile doc/Makefile contrib/Makefile po/Makefile.in scripts/Makefile scripts/data/Makefile test/Makefile lib/Makefile lib/libupstart.pc.in" ac_config_headers="$ac_config_headers config.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_UDEV_BRIDGE_TRUE}" && test -z "${ENABLE_UDEV_BRIDGE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_UDEV_BRIDGE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_SOCKET_BRIDGE_TRUE}" && test -z "${ENABLE_SOCKET_BRIDGE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SOCKET_BRIDGE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_LOCAL_BRIDGE_TRUE}" && test -z "${ENABLE_LOCAL_BRIDGE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_LOCAL_BRIDGE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DCONF_BRIDGE_TRUE}" && test -z "${ENABLE_DCONF_BRIDGE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DCONF_BRIDGE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_TAP_OUTPUT_TRUE}" && test -z "${ENABLE_TAP_OUTPUT_FALSE}"; then as_fn_error $? "conditional \"ENABLE_TAP_OUTPUT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_CGROUPS_TRUE}" && test -z "${ENABLE_CGROUPS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_CGROUPS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_ABI_CHECKER_TRUE}" && test -z "${HAVE_ABI_CHECKER_FALSE}"; then as_fn_error $? "conditional \"HAVE_ABI_CHECKER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by upstart $as_me 1.13.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ upstart config.status 1.13.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "dbus/Makefile") CONFIG_FILES="$CONFIG_FILES dbus/Makefile" ;; "init/Makefile") CONFIG_FILES="$CONFIG_FILES init/Makefile" ;; "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;; "conf/Makefile") CONFIG_FILES="$CONFIG_FILES conf/Makefile" ;; "extra/Makefile") CONFIG_FILES="$CONFIG_FILES extra/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/data/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/data/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/libupstart.pc.in") CONFIG_FILES="$CONFIG_FILES lib/libupstart.pc.in" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi upstart-1.13.2/depcomp0000755000175000017500000005601612373101367011611 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: upstart-1.13.2/INSTALL0000644000175000017500000003661012373101367011263 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command `./configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. upstart-1.13.2/po/0000775000175000017500000000000012402042421010710 500000000000000upstart-1.13.2/po/insert-header.sin0000644000175000017500000000124012373101360014075 00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } upstart-1.13.2/po/ChangeLog0000664000175000017500000001003312373101356012411 000000000000002011-05-12 Marc - A. Dahlhaus * POTFILES.in: Add errors.h 2011-03-16 Scott James Remnant * Makevars.template (COPYRIGHT_HOLDER): Update copyright. 2010-02-03 Scott James Remnant * upstart.pot: Actually include the pot file * POTFILES.in: Remove files that come from libnih. 2009-06-17 Scott James Remnant * POTFILES.in: Update from libnih, don't include generated output 2009-02-20 Scott James Remnant * POTFILES.in: Update path to nih-dbus-tool 2009-01-29 Scott James Remnant * POTFILES.in: Update D-Bus paths 2008-06-11 Scott James Remnant * POTFILES.in: Put the auto-generated files back in now we're figured out how to do it. 2008-06-08 Scott James Remnant * POTFILES.in: Remove the auto-generated ones again, grr @ distcheck * POTFILES.in: Update. 2008-05-01 Scott James Remnant * POTFILES.in: Update with all the recent file changes. 2008-03-19 Scott James Remnant * POTFILES.in: Remove init/enum.c and add init/control.c 2008-03-07 Scott James Remnant * ca.po, fr.po, sv.po: Remove, abandoning Rosetta for translations for the time being since the workflow doesn't help me get updated translations into releases. Please provide translations by hand based on an upstart.pot file generated in trunk. * LINGUAS: Remove. 2008-03-01 Scott James Remnant * POTFILES.in: Add init/environ.c 2007-11-30 Scott James Remnant * POTFILES.in: Update for recent changes (ie. the dropping of libupstart) 2007-06-13 Scott James Remnant * POTFILES.in: Add init/parse_conf.c 2007-06-10 Scott James Remnant * POTFILES.in: Add init/conf.c 2007-06-04 Michael Biebl * POTFILES.in: Remove init/cfgfile.c; add init/parse_job.c 2007-03-09 Scott James Remnant * POTFILES.in: Add nih/tree.c; remove util/events.c and util/jobs.c 2007-02-05 Scott James Remnant * POTFILES.in: Add nih/config.c, nih/watch.c; rename upstart/job.c to upstart/enum.c; add init/notify.c; add util/events.c and util/jobs.c 2007-01-06 Scott James Remnant * ca.po, fr.po, sv.po: Update line numbers. * POTFILES.in: Add nih/command.c, remove upstart/control.c and replace with upstart/message.c and upstart/wire.c 2006-12-14 Scott James Remnant * LINGUAS: Include the en@quot and en@boldquot translation files as suggested by the manual, these seem to be generated correctly. * ca.po, fr.po, sv.po: Download translations from Rosetta. * LINGUAS: Update to include new languages. 2006-10-17 Scott James Remnant * POTFILES.in: Update initctl sources. 2006-09-27 Scott James Remnant * POTFILES.in: Update with everything moving around 2006-08-31 Scott James Remnant * POTFILES.in: Add new sources from util and compat/sysv directories. 2006-08-24 Scott James Remnant * POTFILES.in: Add nih/file.c and nih/option.c, add init/cfgfile.c 2006-08-19 Scott James Remnant * POTFILES.in: add util/initctl.c 2006-08-18 Scott James Remnant * POTFILES.in: nih/errors.h and upstart/errors.h have strings marked for translation. * POTFILES.in: Add the list of current source files. 2006-07-13 Scott James Remnant * Makevars (COPYRIGHT_HOLDER): Change to Canonical Ltd. (MSGID_BUGS_ADDRESS): Change to Launchpad. 2006-05-14 Scott James Remnant * LINGUAS: Created file to hold language list once we have some translations. * POTFILES.in: Created file to hold list of source files which contain translations. * Makevars: Created file from Makevars.template and filled in fields. * ChangeLog: Initial gettext infrastructure from gettext 0.14.5. upstart-1.13.2/po/LINGUAS0000664000175000017500000000042012373101356011663 00000000000000# This file contains the list of available translations. # # Each should be prefixed with the English name for the language and # the current maintainer's name in their preferred form and contact # e-mail address. # Automatically generated by gettext en@quot en@boldquot upstart-1.13.2/po/en@quot.header0000644000175000017500000000226312373101360013423 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # upstart-1.13.2/po/en@quot.po0000664000175000017500000015326612402042420012617 00000000000000# English translations for upstart package. # Copyright (C) 2014 Canonical Ltd. # This file is distributed under the same license as the upstart package. # Automatically generated, 2014. # # All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # msgid "" msgstr "" "Project-Id-Version: upstart 1.13.2\n" "Report-Msgid-Bugs-To: new@bugs.launchpad.net\n" "POT-Creation-Date: 2014-09-04 11:55+0100\n" "PO-Revision-Date: 2014-09-04 11:55+0100\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: init/conf.c:505 init/session.c:254 msgid "Unable to load configuration" msgstr "Unable to load configuration" #: init/conf.c:538 #, c-format msgid "Loading configuration from %s" msgstr "Loading configuration from %s" #: init/conf.c:575 #, c-format msgid "Handling deletion of %s" msgstr "Handling deletion of %s" #: init/conf.c:652 msgid "Unable to watch configuration file" msgstr "Unable to watch configuration file" #: init/conf.c:747 msgid "Unable to watch configuration directory" msgstr "Unable to watch configuration directory" #: init/conf.c:871 msgid "Error while loading configuration file" msgstr "Error while loading configuration file" #: init/conf.c:985 msgid "Configuration directory deleted" msgstr "Configuration directory deleted" #: init/control.c:223 msgid "Connection from private client" msgstr "Connection from private client" #: init/control.c:386 msgid "Disconnected from notified D-Bus bus" msgstr "Disconnected from notified D-Bus bus" #: init/control.c:388 #, c-format msgid "Disconnected from D-Bus %s bus" msgstr "Disconnected from D-Bus %s bus" #: init/control.c:462 msgid "You do not have permission to reload configuration" msgstr "You do not have permission to reload configuration" #: init/control.c:466 init/main.c:1022 msgid "Reloading configuration" msgstr "Reloading configuration" #: init/control.c:510 init/control.c:671 msgid "Name may not be empty string" msgstr "Name may not be empty string" #: init/control.c:541 #, c-format msgid "Unknown job: %s" msgstr "Unknown job: %s" #: init/control.c:664 msgid "You do not have permission to emit an event" msgstr "You do not have permission to emit an event" #: init/control.c:679 init/job_class.c:843 init/job_class.c:1066 #: init/job_class.c:1206 init/job_class.c:1342 msgid "Env must be KEY=VALUE pairs" msgstr "Env must be KEY=VALUE pairs" #: init/control.c:831 msgid "You do not have permission to set log priority" msgstr "You do not have permission to set log priority" #: init/control.c:855 msgid "The log priority given was not recognised" msgstr "The log priority given was not recognised" #: init/control.c:907 msgid "You do not have permission to notify disk is writeable" msgstr "You do not have permission to notify disk is writeable" #: init/control.c:953 msgid "Not permissible to notify D-Bus address for PID 1" msgstr "Not permissible to notify D-Bus address for PID 1" #: init/control.c:960 msgid "You do not have permission to notify D-Bus address" msgstr "You do not have permission to notify D-Bus address" #: init/control.c:971 init/control.c:1020 init/control.c:1028 #: init/control.c:1223 msgid "Out of Memory" msgstr "Out of Memory" #: init/control.c:1006 msgid "You do not have permission to notify cgroup manager address" msgstr "You do not have permission to notify cgroup manager address" #: init/control.c:1197 msgid "You do not have permission to request state" msgstr "You do not have permission to request state" #: init/control.c:1210 msgid "Ignoring state query from chroot session" msgstr "Ignoring state query from chroot session" #: init/control.c:1251 msgid "You do not have permission to request restart" msgstr "You do not have permission to request restart" #: init/control.c:1265 msgid "Ignoring restart request from chroot session" msgstr "Ignoring restart request from chroot session" #: init/control.c:1269 msgid "Restarting" msgstr "Restarting" #: init/control.c:1358 init/control.c:1510 init/control.c:1820 msgid "You do not have permission to modify job environment" msgstr "You do not have permission to modify job environment" #: init/control.c:1365 init/control.c:1517 init/control.c:1827 msgid "Not permissible to modify PID 1 job environment" msgstr "Not permissible to modify PID 1 job environment" #: init/control.c:1379 init/control.c:1531 init/control.c:1668 #: init/control.c:1764 init/control.c:1841 msgid "Job may not be empty string" msgstr "Job may not be empty string" #: init/control.c:1390 msgid "Ignoring set env request from chroot session" msgstr "Ignoring set env request from chroot session" #: init/control.c:1402 init/control.c:1464 init/control.c:1552 #: init/control.c:1602 init/control.c:1654 msgid "Variable may not be empty string" msgstr "Variable may not be empty string" #: init/control.c:1542 msgid "Ignoring unset env request from chroot session" msgstr "Ignoring unset env request from chroot session" #: init/control.c:1572 init/control.c:1712 msgid "No such variable" msgstr "No such variable" #: init/control.c:1648 init/control.c:1750 msgid "You do not have permission to query job environment" msgstr "You do not have permission to query job environment" #: init/control.c:1679 msgid "Ignoring get env request from chroot session" msgstr "Ignoring get env request from chroot session" #: init/control.c:1852 msgid "Ignoring reset env request from chroot session" msgstr "Ignoring reset env request from chroot session" #: init/control.c:1985 msgid "unable to create session file" msgstr "unable to create session file" #: init/control.c:1992 msgid "unable to write session file" msgstr "unable to write session file" #: init/control.c:2041 msgid "You do not have permission to end session" msgstr "You do not have permission to end session" #: init/control.c:2049 msgid "Ignoring session end request from chroot session" msgstr "Ignoring session end request from chroot session" #: init/errors.h:63 msgid "Illegal parameter" msgstr "Illegal parameter" #: init/errors.h:64 msgid "Unknown parameter" msgstr "Unknown parameter" #: init/errors.h:65 init/errors.h:79 msgid "Expected operator" msgstr "Expected operator" #: init/errors.h:66 msgid "Mismatched braces" msgstr "Mismatched braces" #: init/errors.h:67 msgid "Invalid setuid user name does not exist" msgstr "Invalid setuid user name does not exist" #: init/errors.h:68 msgid "Invalid setgid group name does not exist" msgstr "Invalid setgid group name does not exist" #: init/errors.h:69 msgid "Failed to set security context" msgstr "Failed to set security context" #: init/errors.h:70 msgid "Illegal interval, expected number of seconds" msgstr "Illegal interval, expected number of seconds" #: init/errors.h:71 msgid "Illegal exit status, expected integer" msgstr "Illegal exit status, expected integer" #: init/errors.h:72 msgid "Illegal signal status, expected integer" msgstr "Illegal signal status, expected integer" #: init/errors.h:73 msgid "Illegal file creation mask, expected octal integer" msgstr "Illegal file creation mask, expected octal integer" #: init/errors.h:74 msgid "Illegal nice value, expected -20 to 19" msgstr "Illegal nice value, expected -20 to 19" #: init/errors.h:75 msgid "Illegal oom adjustment, expected -16 to 15 or 'never'" msgstr "Illegal oom adjustment, expected -16 to 15 or ‘never’" #: init/errors.h:76 msgid "Illegal oom score adjustment, expected -999 to 1000 or 'never'" msgstr "Illegal oom score adjustment, expected -999 to 1000 or ‘never’" #: init/errors.h:77 msgid "Illegal limit, expected 'unlimited' or integer" msgstr "Illegal limit, expected ‘unlimited’ or integer" #: init/errors.h:78 msgid "Expected event" msgstr "Expected event" #: init/errors.h:80 msgid "Expected variable name before value" msgstr "Expected variable name before value" #: init/errors.h:81 msgid "Mismatched parentheses" msgstr "Mismatched parentheses" #: init/errors.h:82 msgid "Name already taken" msgstr "Name already taken" #: init/event.c:290 #, c-format msgid "Handling %s event" msgstr "Handling %s event" #: init/event.c:488 msgid "Event failed" msgstr "Event failed" #: init/job.c:334 #, c-format msgid "%s goal changed from %s to %s" msgstr "%s goal changed from %s to %s" #: init/job.c:409 #, c-format msgid "%s state changed from %s to %s" msgstr "%s state changed from %s to %s" #: init/job.c:934 init/job.c:972 msgid "Job failed to start" msgstr "Job failed to start" #: init/job.c:947 init/job.c:983 msgid "Job failed while stopping" msgstr "Job failed while stopping" #: init/job.c:959 init/job.c:994 msgid "Job failed to restart" msgstr "Job failed to restart" #: init/job.c:1188 msgid "stop" msgstr "stop" #: init/job.c:1190 msgid "start" msgstr "start" #: init/job.c:1192 msgid "respawn" msgstr "respawn" #: init/job.c:1237 msgid "waiting" msgstr "waiting" #: init/job.c:1239 msgid "starting" msgstr "starting" #: init/job.c:1241 msgid "security-spawning" msgstr "security-spawning" #: init/job.c:1243 init/process.c:90 msgid "security" msgstr "security" #: init/job.c:1245 msgid "pre-starting" msgstr "pre-starting" #: init/job.c:1247 init/process.c:82 msgid "pre-start" msgstr "pre-start" #: init/job.c:1249 msgid "spawning" msgstr "spawning" #: init/job.c:1251 msgid "spawned" msgstr "spawned" #: init/job.c:1253 msgid "post-starting" msgstr "post-starting" #: init/job.c:1255 init/process.c:84 msgid "post-start" msgstr "post-start" #: init/job.c:1257 msgid "running" msgstr "running" #: init/job.c:1259 msgid "pre-stopping" msgstr "pre-stopping" #: init/job.c:1261 init/process.c:86 msgid "pre-stop" msgstr "pre-stop" #: init/job.c:1263 msgid "stopping" msgstr "stopping" #: init/job.c:1265 msgid "killed" msgstr "killed" #: init/job.c:1267 msgid "post-stopping" msgstr "post-stopping" #: init/job.c:1269 init/process.c:88 msgid "post-stop" msgstr "post-stop" #: init/job.c:1366 init/job.c:1454 init/job.c:1530 init/job.c:1599 #: init/job_class.c:1045 init/job_class.c:1198 init/job_class.c:1334 #, c-format msgid "You do not have permission to modify job: %s" msgstr "You do not have permission to modify job: %s" #: init/job.c:1374 init/job_class.c:1122 #, c-format msgid "Job is already running: %s" msgstr "Job is already running: %s" #: init/job.c:1387 init/job_class.c:1057 #, c-format msgid "Job cannot be started as cgroup manager not available: %s" msgstr "Job cannot be started as cgroup manager not available: %s" #: init/job.c:1462 init/job.c:1538 init/job_class.c:1252 init/job_class.c:1387 #, c-format msgid "Job has already been stopped: %s" msgstr "Job has already been stopped: %s" #: init/job.c:1607 #, c-format msgid "Job is not running: %s" msgstr "Job is not running: %s" #: init/job.c:2113 init/job_class.c:2268 init/job_class.c:2303 msgid "BUG" msgstr "BUG" #: init/job.c:2114 msgid "instance 'stop on' parse error" msgstr "instance ‘stop on’ parse error" #: init/job_class.c:873 init/job_class.c:1096 util/initctl.c:1708 msgid "Usage" msgstr "Usage" #: init/job_class.c:891 init/job_class.c:936 init/job_class.c:1244 #: init/job_class.c:1379 #, c-format msgid "Unknown instance: %s" msgstr "Unknown instance: %s" #: init/job_class.c:2269 msgid "'start on' parse error" msgstr "‘start on’ parse error" #: init/job_class.c:2304 msgid "'stop on' parse error" msgstr "‘stop on’ parse error" #: init/job_class.c:2650 msgid "unable to clear CLOEXEC bit on log fd" msgstr "unable to clear CLOEXEC bit on log fd" #: init/job_class.c:2744 #, c-format msgid "Failed to obtain %s instance: %s" msgstr "Failed to obtain %s instance: %s" #: init/job_process.c:318 init/job_process.c:2472 msgid "Temporary process spawn error" msgstr "Temporary process spawn error" #: init/job_process.c:323 #, c-format msgid "%s %s process (%d)" msgstr "%s %s process (%d)" #: init/job_process.c:448 msgid "cgroup support not available" msgstr "cgroup support not available" #: init/job_process.c:452 msgid "cgroup manager not available" msgstr "cgroup manager not available" #: init/job_process.c:493 msgid "Failed to create pty - disabling logging for job" msgstr "Failed to create pty - disabling logging for job" #: init/job_process.c:540 #, c-format msgid "Pausing %s (%d) [pre-exec] for debug" msgstr "Pausing %s (%d) [pre-exec] for debug" #: init/job_process.c:664 #, c-format msgid "Failed to open system console: %s" msgstr "Failed to open system console: %s" #: init/job_process.c:1070 #, c-format msgid "unable to move script fd: %s" msgstr "unable to move script fd: %s" #: init/job_process.c:1075 #, c-format msgid "unable to open console: %s" msgstr "unable to open console: %s" #: init/job_process.c:1130 #, c-format msgid "unable to set \"%s\" resource limit: %s" msgstr "unable to set “%s” resource limit: %s" #: init/job_process.c:1135 #, c-format msgid "unable to set priority: %s" msgstr "unable to set priority: %s" #: init/job_process.c:1140 #, c-format msgid "unable to set oom adjustment: %s" msgstr "unable to set oom adjustment: %s" #: init/job_process.c:1145 #, c-format msgid "unable to change root directory: %s" msgstr "unable to change root directory: %s" #: init/job_process.c:1150 #, c-format msgid "unable to change working directory: %s" msgstr "unable to change working directory: %s" #: init/job_process.c:1155 #, c-format msgid "unable to set trace: %s" msgstr "unable to set trace: %s" #: init/job_process.c:1160 #, c-format msgid "unable to execute: %s" msgstr "unable to execute: %s" #: init/job_process.c:1165 #, c-format msgid "unable to getpwnam: %s" msgstr "unable to getpwnam: %s" #: init/job_process.c:1170 #, c-format msgid "unable to getgrnam: %s" msgstr "unable to getgrnam: %s" #: init/job_process.c:1175 #, c-format msgid "unable to getpwuid: %s" msgstr "unable to getpwuid: %s" #: init/job_process.c:1180 #, c-format msgid "unable to getgrgid: %s" msgstr "unable to getgrgid: %s" #: init/job_process.c:1185 msgid "unable to find setuid user" msgstr "unable to find setuid user" #: init/job_process.c:1189 msgid "unable to find setgid group" msgstr "unable to find setgid group" #: init/job_process.c:1193 #, c-format msgid "unable to setuid: %s" msgstr "unable to setuid: %s" #: init/job_process.c:1198 #, c-format msgid "unable to setgid: %s" msgstr "unable to setgid: %s" #: init/job_process.c:1203 #, c-format msgid "unable to chown: %s" msgstr "unable to chown: %s" #: init/job_process.c:1208 #, c-format msgid "unable to unlockpt: %s" msgstr "unable to unlockpt: %s" #: init/job_process.c:1213 #, c-format msgid "unable to granpt: %s" msgstr "unable to granpt: %s" #: init/job_process.c:1218 #, c-format msgid "unable to get ptsname: %s" msgstr "unable to get ptsname: %s" #: init/job_process.c:1223 #, c-format msgid "unable to open pty slave: %s" msgstr "unable to open pty slave: %s" #: init/job_process.c:1228 #, c-format msgid "unable to modify signal handler: %s" msgstr "unable to modify signal handler: %s" #: init/job_process.c:1233 #, c-format msgid "unable to allocate memory: %s" msgstr "unable to allocate memory: %s" #: init/job_process.c:1238 #, c-format msgid "unable to initgroups: %s" msgstr "unable to initgroups: %s" #: init/job_process.c:1243 #, c-format msgid "unable to switch security profile: %s" msgstr "unable to switch security profile: %s" #: init/job_process.c:1248 #, c-format msgid "unable to connect to CGManager: %s" msgstr "unable to connect to CGManager: %s" #: init/job_process.c:1253 #, c-format msgid "unable to setup cgroup: %s" msgstr "unable to setup cgroup: %s" #: init/job_process.c:1258 #, c-format msgid "unable to enter cgroup: %s" msgstr "unable to enter cgroup: %s" #: init/job_process.c:1263 #, c-format msgid "unable to mark cgroups for removal: %s" msgstr "unable to mark cgroups for removal: %s" #: init/job_process.c:1294 init/job_process.c:1437 #, c-format msgid "Sending %s signal to %s %s process (%d)" msgstr "Sending %s signal to %s %s process (%d)" #: init/job_process.c:1303 init/job_process.c:1446 #, c-format msgid "Failed to send %s signal to %s %s process (%d): %s" msgstr "Failed to send %s signal to %s %s process (%d): %s" #: init/job_process.c:1507 #, c-format msgid "%s %s process (%d) terminated with status %d" msgstr "%s %s process (%d) terminated with status %d" #: init/job_process.c:1512 #, c-format msgid "%s %s process (%d) exited normally" msgstr "%s %s process (%d) exited normally" #: init/job_process.c:1527 #, c-format msgid "%s %s process (%d) killed by %s signal" msgstr "%s %s process (%d) killed by %s signal" #: init/job_process.c:1531 #, c-format msgid "%s %s process (%d) killed by signal %d" msgstr "%s %s process (%d) killed by signal %d" #: init/job_process.c:1545 #, c-format msgid "%s %s process (%d) stopped by %s signal" msgstr "%s %s process (%d) stopped by %s signal" #: init/job_process.c:1549 #, c-format msgid "%s %s process (%d) stopped by signal %d" msgstr "%s %s process (%d) stopped by signal %d" #: init/job_process.c:1563 #, c-format msgid "%s %s process (%d) continued by %s signal" msgstr "%s %s process (%d) continued by %s signal" #: init/job_process.c:1567 #, c-format msgid "%s %s process (%d) continued by signal %d" msgstr "%s %s process (%d) continued by signal %d" #: init/job_process.c:1734 #, c-format msgid "%s respawning too fast, stopped" msgstr "%s respawning too fast, stopped" #: init/job_process.c:1740 #, c-format msgid "%s %s process ended, respawning" msgstr "%s %s process ended, respawning" #: init/job_process.c:1850 msgid "Failed to add log to unflushed queue" msgstr "Failed to add log to unflushed queue" #: init/job_process.c:2027 #, c-format msgid "Failed to set ptrace options for %s %s process (%d): %s" msgstr "Failed to set ptrace options for %s %s process (%d): %s" #: init/job_process.c:2040 init/job_process.c:2236 #, c-format msgid "Failed to continue traced %s %s process (%d): %s" msgstr "Failed to continue traced %s %s process (%d): %s" #: init/job_process.c:2080 init/job_process.c:2172 init/job_process.c:2227 #, c-format msgid "Failed to detach traced %s %s process (%d): %s" msgstr "Failed to detach traced %s %s process (%d): %s" #: init/job_process.c:2120 #, c-format msgid "Failed to deliver signal to traced %s %s process (%d): %s" msgstr "Failed to deliver signal to traced %s %s process (%d): %s" #: init/job_process.c:2156 #, c-format msgid "Failed to obtain child process id for %s %s process (%d): %s" msgstr "Failed to obtain child process id for %s %s process (%d): %s" #: init/job_process.c:2163 #, c-format msgid "%s %s process (%d) became new process (%d)" msgstr "%s %s process (%d) became new process (%d)" #: init/job_process.c:2222 #, c-format msgid "%s %s process (%d) executable changed" msgstr "%s %s process (%d) executable changed" #: init/job_process.c:2482 #, c-format msgid "Failed to spawn %s %s process: %s" msgstr "Failed to spawn %s %s process: %s" #: init/log.c:354 msgid "Failed to write to log file" msgstr "Failed to write to log file" #: init/main.c:171 msgid "specify additional directory to load configuration files from" msgstr "specify additional directory to load configuration files from" #: init/main.c:174 msgid "enable chroot sessions" msgstr "enable chroot sessions" #: init/main.c:177 msgid "specify alternative directory to load configuration files from" msgstr "specify alternative directory to load configuration files from" #: init/main.c:180 msgid "default value for console stanza" msgstr "default value for console stanza" #: init/main.c:183 msgid "specify alternative directory to store job output logs in" msgstr "specify alternative directory to store job output logs in" #: init/main.c:187 msgid "do not support cgroups" msgstr "do not support cgroups" #: init/main.c:191 msgid "do not connect to a D-Bus bus" msgstr "do not connect to a D-Bus bus" #: init/main.c:194 msgid "jobs will not inherit environment of init" msgstr "jobs will not inherit environment of init" #: init/main.c:197 msgid "disable job logging" msgstr "disable job logging" #: init/main.c:200 msgid "do not emit any startup event (for testing)" msgstr "do not emit any startup event (for testing)" #: init/main.c:203 msgid "specify additional initial directory to load configuration files from" msgstr "specify additional initial directory to load configuration files from" #: init/main.c:207 msgid "flag a re-exec has occurred" msgstr "flag a re-exec has occurred" #: init/main.c:211 msgid "specify file descriptor to read serialisation data from" msgstr "specify file descriptor to read serialisation data from" #: init/main.c:214 msgid "use D-Bus session bus rather than system bus (for testing)" msgstr "use D-Bus session bus rather than system bus (for testing)" #: init/main.c:217 msgid "specify an alternative initial event (for testing)" msgstr "specify an alternative initial event (for testing)" #: init/main.c:220 msgid "start in user mode (as used for user sessions)" msgstr "start in user mode (as used for user sessions)" #: init/main.c:223 msgid "attempt to write state file on every re-exec" msgstr "attempt to write state file on every re-exec" #: init/main.c:248 msgid "Process management daemon." msgstr "Process management daemon." #: init/main.c:250 msgid "" "This daemon is normally executed by the kernel and given process id 1 to " "denote its special status. When executed by a user process, it will " "actually run /sbin/telinit." msgstr "" "This daemon is normally executed by the kernel and given process id 1 to " "denote its special status. When executed by a user process, it will " "actually run /sbin/telinit." #: init/main.c:280 util/reboot.c:172 util/shutdown.c:373 util/telinit.c:251 msgid "Need to be root" msgstr "Need to be root" #: init/main.c:289 msgid "Not being executed as init" msgstr "Not being executed as init" #: init/main.c:340 msgid "Unable to mount /dev filesystem" msgstr "Unable to mount /dev filesystem" #: init/main.c:349 msgid "Cannot create directory" msgstr "Cannot create directory" #: init/main.c:357 msgid "Unable to mount /dev/pts filesystem" msgstr "Unable to mount /dev/pts filesystem" #: init/main.c:383 msgid "Unable to initialize console, will try /dev/null" msgstr "Unable to initialize console, will try /dev/null" #: init/main.c:389 msgid "Unable to initialize console as /dev/null" msgstr "Unable to initialize console as /dev/null" #: init/main.c:405 init/main.c:904 msgid "Unable to set root directory" msgstr "Unable to set root directory" #: init/main.c:418 msgid "Unable to mount /proc filesystem" msgstr "Unable to mount /proc filesystem" #: init/main.c:428 msgid "Unable to mount /sys filesystem" msgstr "Unable to mount /sys filesystem" #: init/main.c:551 init/main.c:557 msgid "Unable to set default oom score" msgstr "Unable to set default oom score" #: init/main.c:566 msgid "Stateful re-exec supported but stateless re-exec requested" msgstr "Stateful re-exec supported but stateless re-exec requested" #: init/main.c:580 msgid "Failed to read serialisation data" msgstr "Failed to read serialisation data" #: init/main.c:581 init/state.c:2060 msgid "reverting to stateless re-exec" msgstr "reverting to stateless re-exec" #: init/main.c:593 msgid "Both stateful and stateless re-execs failed" msgstr "Both stateful and stateless re-execs failed" #: init/main.c:663 msgid "Unable to listen for private connections" msgstr "Unable to listen for private connections" #: init/main.c:677 #, c-format msgid "Not connecting to %s bus" msgstr "Not connecting to %s bus" #: init/main.c:702 msgid "Unable to setup standard file descriptors" msgstr "Unable to setup standard file descriptors" #: init/main.c:758 msgid "Unable to register as subreaper" msgstr "Unable to register as subreaper" #: init/main.c:921 #, c-format msgid "Caught %s, core dumped" msgstr "Caught %s, core dumped" #: init/main.c:925 #, c-format msgid "Caught %s, unable to dump core" msgstr "Caught %s, unable to dump core" #: init/main.c:956 #, c-format msgid "Re-executing %s" msgstr "Re-executing %s" #: init/main.c:1049 #, c-format msgid "Reconnecting to D-Bus %s bus" msgstr "Reconnecting to D-Bus %s bus" #: init/main.c:1056 #, c-format msgid "Unable to connect to the D-Bus %s bus: %s" msgstr "Unable to connect to the D-Bus %s bus: %s" #: init/main.c:1135 msgid "invalid console type specified" msgstr "invalid console type specified" #: init/process.c:80 msgid "main" msgstr "main" #: init/quiesce.c:127 msgid "logout" msgstr "logout" #: init/quiesce.c:127 msgid "shutdown" msgstr "shutdown" #: init/quiesce.c:129 #, c-format msgid "Quiescing due to %s request" msgstr "Quiescing due to %s request" #: init/quiesce.c:313 #, c-format msgid "Quiesce %s sequence took %s%d second%s" msgstr "Quiesce %s sequence took %s%d second%s" #: init/state.c:369 init/state.c:377 init/state.c:390 init/state.c:405 #: init/state.c:417 init/state.c:426 init/state.c:435 msgid "Failed to serialise" msgstr "Failed to serialise" #: init/state.c:391 msgid "control bus address" msgstr "control bus address" #: init/state.c:406 init/state.c:531 init/state.c:535 msgid "cgroup manager address" msgstr "cgroup manager address" #: init/state.c:492 msgid "Detected invalid serialisation data" msgstr "Detected invalid serialisation data" #: init/state.c:501 init/state.c:506 init/state.c:514 init/state.c:530 #: init/state.c:544 init/state.c:554 init/state.c:562 msgid "Failed to deserialise" msgstr "Failed to deserialise" #: init/state.c:521 msgid "No control details present in state data" msgstr "No control details present in state data" #: init/state.c:548 msgid "No ConfSources present in state data" msgstr "No ConfSources present in state data" #: init/state.c:558 msgid "No global job environment data present in state data" msgstr "No global job environment data present in state data" #: init/state.c:567 msgid "Failed to resolve deserialisation dependencies" msgstr "Failed to resolve deserialisation dependencies" #: init/state.c:1756 msgid "failed to demarshal D-Bus message" msgstr "failed to demarshal D-Bus message" #: init/state.c:2020 #, c-format msgid "Failed to re-execute %s: %s" msgstr "Failed to re-execute %s: %s" #: init/state.c:2059 msgid "Failed to generate serialisation data" msgstr "Failed to generate serialisation data" #: init/state.c:2067 msgid "Performing stateful re-exec" msgstr "Performing stateful re-exec" #: init/state.c:2107 #, c-format msgid "Passing state from PID %d to parent" msgstr "Passing state from PID %d to parent" #: init/state.c:2116 #, c-format msgid "Failed to release D-Bus name: %s" msgstr "Failed to release D-Bus name: %s" #: init/state.c:2125 msgid "Failed to write serialisation data" msgstr "Failed to write serialisation data" #: init/system.c:235 msgid "Unable to create device" msgstr "Unable to create device" #: util/initctl.c:366 msgid "Unable to connect to system bus" msgstr "Unable to connect to system bus" #: util/initctl.c:367 msgid "Unable to connect to session bus" msgstr "Unable to connect to session bus" #: util/initctl.c:376 #, c-format msgid "%s: --dest given without --system\n" msgstr "%s: --dest given without --system\n" #: util/initctl.c:384 msgid "Unable to connect to Upstart" msgstr "Unable to connect to Upstart" #: util/initctl.c:594 util/initctl.c:729 util/initctl.c:857 util/initctl.c:992 #: util/initctl.c:1110 util/initctl.c:1678 util/initctl.c:2913 #, c-format msgid "%s: missing job name\n" msgstr "%s: missing job name\n" #: util/initctl.c:1056 msgid "Not running" msgstr "Not running" #: util/initctl.c:1414 util/initctl.c:1512 #, c-format msgid "%s: missing variable name\n" msgstr "%s: missing variable name\n" #: util/initctl.c:1463 #, c-format msgid "%s: missing variable value\n" msgstr "%s: missing variable value\n" #: util/initctl.c:1743 #, c-format msgid "%s: missing event name\n" msgstr "%s: missing event name\n" #: util/initctl.c:1940 msgid "Invalid job class" msgstr "Invalid job class" #: util/initctl.c:2029 #, c-format msgid "%s: missing D-Bus address\n" msgstr "%s: missing D-Bus address\n" #: util/initctl.c:2074 #, c-format msgid "%s: missing address\n" msgstr "%s: missing address\n" #: util/initctl.c:2122 msgid "Unable to query session directory" msgstr "Unable to query session directory" #: util/initctl.c:2175 msgid "Ignoring stale session file" msgstr "Ignoring stale session file" #: util/initctl.c:2776 msgid "unknown event" msgstr "unknown event" #: util/initctl.c:2780 msgid "unknown job" msgstr "unknown job" #: util/initctl.c:2939 msgid "use existing D-Bus session bus to connect to init daemon (for testing)" msgstr "use existing D-Bus session bus to connect to init daemon (for testing)" #: util/initctl.c:2941 msgid "use D-Bus system bus to connect to init daemon" msgstr "use D-Bus system bus to connect to init daemon" #: util/initctl.c:2943 msgid "destination well-known name on D-Bus bus" msgstr "destination well-known name on D-Bus bus" #: util/initctl.c:2945 msgid "run in user mode (as used for user sessions)" msgstr "run in user mode (as used for user sessions)" #: util/initctl.c:2958 msgid "do not wait for job to start before exiting" msgstr "do not wait for job to start before exiting" #: util/initctl.c:2970 msgid "do not wait for job to stop before exiting" msgstr "do not wait for job to stop before exiting" #: util/initctl.c:2982 msgid "do not wait for job to restart before exiting" msgstr "do not wait for job to restart before exiting" #: util/initctl.c:3021 msgid "do not wait for event to finish before exiting" msgstr "do not wait for event to finish before exiting" #: util/initctl.c:3062 msgid "" "enumerate list of events and jobs causing job created from job config to " "start/stop" msgstr "" "enumerate list of events and jobs causing job created from job config to " "start/stop" #: util/initctl.c:3075 msgid "ignore specified list of events (comma-separated)" msgstr "ignore specified list of events (comma-separated)" #: util/initctl.c:3077 msgid "Generate warning for any unreachable events/jobs" msgstr "Generate warning for any unreachable events/jobs" #: util/initctl.c:3088 util/initctl.c:3101 util/initctl.c:3112 #: util/initctl.c:3123 util/initctl.c:3134 msgid "apply to global job environment table" msgstr "apply to global job environment table" #: util/initctl.c:3090 msgid "do not replace the value of the variable if already set" msgstr "do not replace the value of the variable if already set" #: util/initctl.c:3153 msgid "Job" msgstr "Job" #: util/initctl.c:3160 msgid "Event" msgstr "Event" #: util/initctl.c:3167 msgid "Environment" msgstr "Environment" #: util/initctl.c:3175 util/initctl.c:3187 util/initctl.c:3198 #: util/initctl.c:3209 util/initctl.c:3216 msgid "JOB [KEY=VALUE]..." msgstr "JOB [KEY=VALUE]..." #: util/initctl.c:3176 msgid "Start job." msgstr "Start job." #: util/initctl.c:3177 msgid "" "JOB is the name of the job that is to be started, this may be followed by " "zero or more environment variables to be defined in the new job.\n" "\n" "The environment may also serve to distinguish between job instances, and " "thus decide whether a new instance will be started or an error returned if " "an existing instance is already running." msgstr "" "JOB is the name of the job that is to be started, this may be followed by " "zero or more environment variables to be defined in the new job.\n" "\n" "The environment may also serve to distinguish between job instances, and " "thus decide whether a new instance will be started or an error returned if " "an existing instance is already running." #: util/initctl.c:3188 msgid "Stop job." msgstr "Stop job." #: util/initctl.c:3189 msgid "" "JOB is the name of the job that is to be stopped, this may be followed by " "zero or more environment variables to be passed to the job's pre-stop and " "post-stop processes.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be stopped." msgstr "" "JOB is the name of the job that is to be stopped, this may be followed by " "zero or more environment variables to be passed to the job's pre-stop and " "post-stop processes.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be stopped." #: util/initctl.c:3199 msgid "Restart job." msgstr "Restart job." #: util/initctl.c:3200 msgid "" "JOB is the name of the job that is to be restarted, this may be followed by " "zero or more environment variables to be defined in the job after " "restarting.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be restarted." msgstr "" "JOB is the name of the job that is to be restarted, this may be followed by " "zero or more environment variables to be defined in the job after " "restarting.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be restarted." #: util/initctl.c:3210 msgid "Send HUP signal to job." msgstr "Send HUP signal to job." #: util/initctl.c:3211 msgid "" "JOB is the name of the job that is to be sent the signal, this may be " "followed by zero or more environment variables to distinguish between job " "instances.\n" msgstr "" "JOB is the name of the job that is to be sent the signal, this may be " "followed by zero or more environment variables to distinguish between job " "instances.\n" #: util/initctl.c:3217 msgid "Query status of job." msgstr "Query status of job." #: util/initctl.c:3218 msgid "" "JOB is the name of the job that is to be queried, this may be followed by " "zero or more environment variables to distguish between job instances.\n" msgstr "" "JOB is the name of the job that is to be queried, this may be followed by " "zero or more environment variables to distguish between job instances.\n" #: util/initctl.c:3224 msgid "List known jobs." msgstr "List known jobs." #: util/initctl.c:3225 msgid "The known jobs and their current status will be output." msgstr "The known jobs and their current status will be output." #: util/initctl.c:3228 msgid "EVENT [KEY=VALUE]..." msgstr "EVENT [KEY=VALUE]..." #: util/initctl.c:3229 msgid "Emit an event." msgstr "Emit an event." #: util/initctl.c:3230 msgid "" "EVENT is the name of an event the init daemon should emit, this may be " "followed by zero or more environment variables to be included in the event.\n" msgstr "" "EVENT is the name of an event the init daemon should emit, this may be " "followed by zero or more environment variables to be included in the event.\n" #: util/initctl.c:3236 msgid "Reload the configuration of the init daemon." msgstr "Reload the configuration of the init daemon." #: util/initctl.c:3240 msgid "Request the version of the init daemon." msgstr "Request the version of the init daemon." #: util/initctl.c:3243 msgid "[PRIORITY]" msgstr "[PRIORITY]" #: util/initctl.c:3244 msgid "Change the minimum priority of log messages from the init daemon." msgstr "Change the minimum priority of log messages from the init daemon." #: util/initctl.c:3246 msgid "" "PRIORITY may be one of:\n" " `debug' (messages useful for debugging upstart are logged, equivalent to --" "debug on kernel command-line);\n" " `info' (messages about job goal and state changes, as well as event " "emissions are logged, equivalent to --verbose on the kernel command-line);\n" " `message' (informational and debugging messages are suppressed, the " "default); `warn' (ordinary messages are suppressed whilst still logging " "warnings and errors);\n" " `error' (only errors are logged, equivalent to --quiet on the kernel " "command-line) or\n" " `fatal' (only fatal errors are logged).\n" "\n" "Without arguments, this outputs the current log priority." msgstr "" "PRIORITY may be one of:\n" " ‘debug’ (messages useful for debugging upstart are logged, equivalent to --" "debug on kernel command-line);\n" " ‘info’ (messages about job goal and state changes, as well as event " "emissions are logged, equivalent to --verbose on the kernel command-line);\n" " ‘message’ (informational and debugging messages are suppressed, the " "default); ‘warn’ (ordinary messages are suppressed whilst still logging " "warnings and errors);\n" " ‘error’ (only errors are logged, equivalent to --quiet on the kernel " "command-line) or\n" " ‘fatal’ (only fatal errors are logged).\n" "\n" "Without arguments, this outputs the current log priority." #: util/initctl.c:3263 util/initctl.c:3269 msgid "[CONF]" msgstr "[CONF]" #: util/initctl.c:3264 msgid "Show emits, start on and stop on details for job configurations." msgstr "Show emits, start on and stop on details for job configurations." #: util/initctl.c:3265 msgid "" "If CONF specified, show configuration details for single job configuration, " "else show details for all jobs configurations.\n" msgstr "" "If CONF specified, show configuration details for single job configuration, " "else show details for all jobs configurations.\n" #: util/initctl.c:3270 msgid "Check for unreachable jobs/event conditions." msgstr "Check for unreachable jobs/event conditions." #: util/initctl.c:3271 msgid "" "List all jobs and events which cannot be satisfied by currently available " "job configuration files." msgstr "" "List all jobs and events which cannot be satisfied by currently available " "job configuration files." #: util/initctl.c:3275 util/initctl.c:3285 util/initctl.c:3295 msgid "VARIABLE" msgstr "VARIABLE" #: util/initctl.c:3276 msgid "Retrieve value of a job environment variable." msgstr "Retrieve value of a job environment variable." #: util/initctl.c:3277 msgid "Display the value of a variable from the job environment table." msgstr "Display the value of a variable from the job environment table." #: util/initctl.c:3281 msgid "Show all job environment variables." msgstr "Show all job environment variables." #: util/initctl.c:3282 msgid "" "Displays sorted list of variables and their values from the job environment " "table." msgstr "" "Displays sorted list of variables and their values from the job environment " "table." #: util/initctl.c:3286 msgid "Revert all job environment variable changes." msgstr "Revert all job environment variable changes." #: util/initctl.c:3287 msgid "" "Discards all changes make to the job environment table, setting it back to " "its default value." msgstr "" "Discards all changes make to the job environment table, setting it back to " "its default value." #: util/initctl.c:3290 msgid "VARIABLE[=VALUE]" msgstr "VARIABLE[=VALUE]" #: util/initctl.c:3291 msgid "Set one or more job environment variables." msgstr "Set one or more job environment variables." #: util/initctl.c:3292 msgid "Adds or updates variables in the job environment table." msgstr "Adds or updates variables in the job environment table." #: util/initctl.c:3296 msgid "Remove one or more job environment variables." msgstr "Remove one or more job environment variables." #: util/initctl.c:3297 msgid "Discards variables from the job environment table." msgstr "Discards variables from the job environment table." #: util/initctl.c:3300 msgid "JOB" msgstr "JOB" #: util/initctl.c:3301 msgid "Show job usage message if available." msgstr "Show job usage message if available." #: util/initctl.c:3302 msgid "JOB is the name of the job which usage is to be shown.\n" msgstr "JOB is the name of the job which usage is to be shown.\n" #: util/initctl.c:3306 msgid "Inform Upstart of D-Bus address cgroup manager is available on." msgstr "Inform Upstart of D-Bus address cgroup manager is available on." #: util/initctl.c:3307 msgid "Run to allow Upstart to provide cgroup stanza support." msgstr "Run to allow Upstart to provide cgroup stanza support." #: util/initctl.c:3311 msgid "Inform Upstart of D-Bus address to connect to." msgstr "Inform Upstart of D-Bus address to connect to." #: util/initctl.c:3312 msgid "Run to allow Upstart to provide services over D-Bus." msgstr "Run to allow Upstart to provide services over D-Bus." #: util/initctl.c:3316 msgid "Inform Upstart that disk is now writeable." msgstr "Inform Upstart that disk is now writeable." #: util/initctl.c:3317 msgid "" "Run to ensure output from jobs ending before disk is writeable are flushed " "to disk." msgstr "" "Run to ensure output from jobs ending before disk is writeable are flushed " "to disk." #: util/initctl.c:3322 msgid "List all sessions." msgstr "List all sessions." #: util/initctl.c:3323 msgid "Displays list of running Session Init sessions" msgstr "Displays list of running Session Init sessions" #: util/reboot.c:116 msgid "don't sync before reboot or halt" msgstr "don't sync before reboot or halt" #: util/reboot.c:118 msgid "force reboot or halt, don't call shutdown(8)" msgstr "force reboot or halt, don't call shutdown(8)" #: util/reboot.c:120 msgid "switch off the power when called as halt" msgstr "switch off the power when called as halt" #: util/reboot.c:122 msgid "don't actually reboot or halt, just write wtmp record" msgstr "don't actually reboot or halt, just write wtmp record" #: util/reboot.c:148 msgid "Halt the system." msgstr "Halt the system." #: util/reboot.c:151 msgid "Power off the system." msgstr "Power off the system." #: util/reboot.c:154 msgid "Reboot the system." msgstr "Reboot the system." #: util/reboot.c:158 msgid "" "This command is intended to instruct the kernel to reboot or halt the " "system; when run without the -f option, or when in a system runlevel other " "than 0 or 6, it will actually execute /sbin/shutdown.\n" msgstr "" "This command is intended to instruct the kernel to reboot or halt the " "system; when run without the -f option, or when in a system runlevel other " "than 0 or 6, it will actually execute /sbin/shutdown.\n" #: util/reboot.c:169 util/shutdown.c:370 util/telinit.c:248 msgid "Couldn't set uid." msgstr "Couldn't set uid." #: util/reboot.c:222 msgid "Calling shutdown" msgstr "Calling shutdown" #: util/reboot.c:225 #, c-format msgid "Unable to execute shutdown: %s" msgstr "Unable to execute shutdown: %s" #: util/reboot.c:246 msgid "Rebooting" msgstr "Rebooting" #: util/reboot.c:250 msgid "Halting" msgstr "Halting" #: util/reboot.c:254 msgid "Powering off" msgstr "Powering off" #: util/reboot.c:258 #, c-format msgid "Rebooting with %s" msgstr "Rebooting with %s" #: util/runlevel.c:59 msgid "[UTMP]" msgstr "[UTMP]" #: util/runlevel.c:60 msgid "Output previous and current runlevel." msgstr "Output previous and current runlevel." #: util/runlevel.c:62 msgid "" "The system /var/run/utmp file is used unless the alternate file UTMP is " "given.\n" msgstr "" "The system /var/run/utmp file is used unless the alternate file UTMP is " "given.\n" #: util/shutdown.c:201 msgid "reboot after shutdown" msgstr "reboot after shutdown" #: util/shutdown.c:203 msgid "halt or power off after shutdown" msgstr "halt or power off after shutdown" #: util/shutdown.c:205 msgid "halt after shutdown (implies -h)" msgstr "halt after shutdown (implies -h)" #: util/shutdown.c:207 msgid "power off after shutdown (implies -h)" msgstr "power off after shutdown (implies -h)" #: util/shutdown.c:209 msgid "cancel a running shutdown" msgstr "cancel a running shutdown" #: util/shutdown.c:211 msgid "only send warnings, don't shutdown" msgstr "only send warnings, don't shutdown" #: util/shutdown.c:243 msgid "TIME [MESSAGE]" msgstr "TIME [MESSAGE]" #: util/shutdown.c:244 msgid "Bring the system down." msgstr "Bring the system down." #: util/shutdown.c:246 msgid "" "TIME may have different formats, the most common is simply the word 'now' " "which will bring the system down immediately. Other valid formats are +m, " "where m is the number of minutes to wait until shutting down and hh:mm which " "specifies the time on the 24hr clock.\n" "\n" "Logged in users are warned by a message sent to their terminal, you may " "include an optional MESSAGE included with this. Messages can be sent " "without actually bringing the system down by using the -k option.\n" "\n" "If TIME is given, the command will remain in the foreground until the " "shutdown occurs. It can be cancelled by Control-C, or by another user using " "the -c option.\n" "\n" "The system is brought down into maintenance (single-user) mode by default, " "you can change this with either the -r or -h option which specify a reboot " "or system halt respectively. The -h option can be further modified with -H " "or -P to specify whether to halt the system, or to power it off afterwards. " "The default is left up to the shutdown scripts." msgstr "" "TIME may have different formats, the most common is simply the word ‘now’ " "which will bring the system down immediately. Other valid formats are +m, " "where m is the number of minutes to wait until shutting down and hh:mm which " "specifies the time on the 24hr clock.\n" "\n" "Logged in users are warned by a message sent to their terminal, you may " "include an optional MESSAGE included with this. Messages can be sent " "without actually bringing the system down by using the -k option.\n" "\n" "If TIME is given, the command will remain in the foreground until the " "shutdown occurs. It can be cancelled by Control-C, or by another user using " "the -c option.\n" "\n" "The system is brought down into maintenance (single-user) mode by default, " "you can change this with either the -r or -h option which specify a reboot " "or system halt respectively. The -h option can be further modified with -H " "or -P to specify whether to halt the system, or to power it off afterwards. " "The default is left up to the shutdown scripts." #: util/shutdown.c:284 #, c-format msgid "%s: time expected\n" msgstr "%s: time expected\n" #: util/shutdown.c:308 #, c-format msgid "%s: illegal hour value\n" msgstr "%s: illegal hour value\n" #: util/shutdown.c:317 #, c-format msgid "%s: illegal minute value\n" msgstr "%s: illegal minute value\n" #: util/shutdown.c:337 #, c-format msgid "%s: illegal time value\n" msgstr "%s: illegal time value\n" #: util/shutdown.c:384 msgid "Shutdown is not running" msgstr "Shutdown is not running" #: util/shutdown.c:393 msgid "Another shutdown is already running" msgstr "Another shutdown is already running" #: util/shutdown.c:397 msgid "Cannot find pid of running shutdown" msgstr "Cannot find pid of running shutdown" #: util/shutdown.c:411 msgid "Unable to change directory" msgstr "Unable to change directory" #: util/shutdown.c:425 msgid "Unable to write pid file" msgstr "Unable to write pid file" #: util/shutdown.c:524 msgid "Shutdown cancelled" msgstr "Shutdown cancelled" #: util/shutdown.c:609 msgid "The system is going down for power off NOW!" msgstr "The system is going down for power off NOW!" #: util/shutdown.c:622 msgid "The system is going down for halt NOW!" msgstr "The system is going down for halt NOW!" #: util/shutdown.c:635 msgid "The system is going down for maintenance NOW!" msgstr "The system is going down for maintenance NOW!" #: util/shutdown.c:648 msgid "The system is going down for reboot NOW!" msgstr "The system is going down for reboot NOW!" #: util/shutdown.c:695 #, c-format msgid "Unable to fork child-process to warn users: %s" msgstr "Unable to fork child-process to warn users: %s" #: util/shutdown.c:740 #, c-format msgid "Broadcast message from %s@%s" msgstr "Broadcast message from %s@%s" #: util/shutdown.c:742 #, c-format msgid "(%s) at %d:%02d ..." msgstr "(%s) at %d:%02d ..." #: util/telinit.c:195 msgid "set environment variable in the runlevel event" msgstr "set environment variable in the runlevel event" #: util/telinit.c:216 msgid "Change runlevel." msgstr "Change runlevel." #: util/telinit.c:218 msgid "" "RUNLEVEL should be one of 0123456sS, where s and S are considered " "identical.\n" "\n" "RUNLEVEL may also be Q or q to instruct the init daemon to reload its " "configuration, this is rarely necessary since the daemon watches its " "configuration for changes.\n" "\n" "RUNLEVEL may be U or u to instruct the init daemon to re-execute itself, " "this is not recommended since Upstart does not currently preserve its " "state.\n" msgstr "" "RUNLEVEL should be one of 0123456sS, where s and S are considered " "identical.\n" "\n" "RUNLEVEL may also be Q or q to instruct the init daemon to reload its " "configuration, this is rarely necessary since the daemon watches its " "configuration for changes.\n" "\n" "RUNLEVEL may be U or u to instruct the init daemon to re-execute itself, " "this is not recommended since Upstart does not currently preserve its " "state.\n" #: util/telinit.c:235 #, c-format msgid "%s: missing runlevel\n" msgstr "%s: missing runlevel\n" #: util/telinit.c:240 #, c-format msgid "%s: illegal runlevel: %s\n" msgstr "%s: illegal runlevel: %s\n" #: extra/upstart-udev-bridge.c:85 extra/upstart-socket-bridge.c:131 msgid "Detach and run in the background" msgstr "Detach and run in the background" #: extra/upstart-udev-bridge.c:87 msgid "Do not strip non-printable bytes from udev message data" msgstr "Do not strip non-printable bytes from udev message data" #: extra/upstart-udev-bridge.c:106 msgid "Bridge udev events into upstart" msgstr "Bridge udev events into upstart" #: extra/upstart-udev-bridge.c:108 msgid "" "By default, upstart-udev-bridge does not detach from the console and remains " "in the foreground. Use the --daemon option to have it detach." msgstr "" "By default, upstart-udev-bridge does not detach from the console and remains " "in the foreground. Use the --daemon option to have it detach." #: extra/upstart-udev-bridge.c:122 extra/upstart-socket-bridge.c:181 msgid "Could not connect to Upstart" msgstr "Could not connect to Upstart" #: extra/upstart-udev-bridge.c:136 extra/upstart-socket-bridge.c:195 msgid "Could not create Upstart proxy" msgstr "Could not create Upstart proxy" #: extra/upstart-udev-bridge.c:160 extra/upstart-socket-bridge.c:251 msgid "Unable to become daemon" msgstr "Unable to become daemon" #: extra/upstart-udev-bridge.c:336 extra/upstart-socket-bridge.c:665 msgid "Disconnected from Upstart" msgstr "Disconnected from Upstart" #: extra/upstart-socket-bridge.c:149 msgid "Bridge socket events into upstart" msgstr "Bridge socket events into upstart" #: extra/upstart-socket-bridge.c:151 msgid "" "By default, upstart-socket-bridge does not detach from the console and " "remains in the foreground. Use the --daemon option to have it detach." msgstr "" "By default, upstart-socket-bridge does not detach from the console and " "remains in the foreground. Use the --daemon option to have it detach." #: extra/upstart-socket-bridge.c:164 msgid "Could not create epoll descriptor" msgstr "Could not create epoll descriptor" #: extra/upstart-socket-bridge.c:208 msgid "Could not create JobAdded signal connection" msgstr "Could not create JobAdded signal connection" #: extra/upstart-socket-bridge.c:220 msgid "Could not create JobRemoved signal connection" msgstr "Could not create JobRemoved signal connection" #: extra/upstart-socket-bridge.c:232 msgid "Could not obtain job list" msgstr "Could not obtain job list" #: extra/upstart-socket-bridge.c:288 msgid "Error from epoll" msgstr "Error from epoll" #: extra/upstart-socket-bridge.c:369 msgid "Could not send socket event" msgstr "Could not send socket event" #: extra/upstart-socket-bridge.c:684 msgid "Error emitting socket event" msgstr "Error emitting socket event" #: scripts/upstart-monitor.py:65 msgid "WARNING" msgstr "WARNING" #: scripts/upstart-monitor.py:65 msgid "GUI modules not available - falling back to CLI" msgstr "GUI modules not available - falling back to CLI" #: scripts/upstart-monitor.py:287 msgid "Version" msgstr "Version" #: scripts/upstart-monitor.py:334 msgid "Error saving file" msgstr "Error saving file" #: scripts/upstart-monitor.py:351 msgid "No events to save" msgstr "No events to save" #: scripts/upstart-monitor.py:359 msgid "Save File" msgstr "Save File" #: scripts/upstart-monitor.py:487 msgid "Clear events" msgstr "Clear events" #: scripts/upstart-monitor.py:489 msgid "Save events to default file" msgstr "Save events to default file" #: scripts/upstart-monitor.py:491 msgid "Save events to specified file" msgstr "Save events to specified file" #: scripts/upstart-monitor.py:493 msgid "Exit application" msgstr "Exit application" #: scripts/upstart-monitor.py:497 msgid "Application details" msgstr "Application details" #: scripts/upstart-monitor.py:502 msgid "Copy" msgstr "Copy" #: scripts/upstart-monitor.py:559 msgid "Index" msgstr "Index" #: scripts/upstart-monitor.py:563 msgid "Time" msgstr "Time" #: scripts/upstart-monitor.py:567 msgid "Event and environment" msgstr "Event and environment" #: scripts/upstart-monitor.py:592 scripts/upstart-monitor.py:674 msgid "Connected to" msgstr "Connected to" #: scripts/upstart-monitor.py:623 msgid "Upstart Event Monitor" msgstr "Upstart Event Monitor" #: scripts/upstart-monitor.py:627 msgid "run in command-line mode" msgstr "run in command-line mode" #: scripts/upstart-monitor.py:630 msgid "field separator to use for command-line output" msgstr "field separator to use for command-line output" #: scripts/upstart-monitor.py:634 msgid "connect to Upstart via specified D-Bus route" msgstr "connect to Upstart via specified D-Bus route" #: scripts/upstart-monitor.py:672 msgid "console mode" msgstr "console mode" #: scripts/upstart-monitor.py:676 msgid "Columns: time, event and environment" msgstr "Columns: time, event and environment" upstart-1.13.2/po/en@boldquot.gmo0000664000175000017500000012164412402042420013617 00000000000000| P!Q!*d!)!)!%!" "&,"&S"'z"'",""#5#U#"t######$+$C$Y$o$$$$$$7$#2%V%j%+n%!%%%%&&*';'#S'w'''A',( -($:(_( ((((+(-(')!F)h))) )#)])2S***$*?*.$+RS+7+++,, ,,,,&,$-*- @-M-^-m-#-$-0-0-9*.d..z.%. .<.!-/O/!k/ /./2/07$0\0!{0"00/00 1=1N1V1h1{1,1.)2,X202,22(2.(3%W32}3,3.3& 4534>i44'44?4.(5*W55(5'555567HF8(97::9:.;D;X; r;;;;b;D<W<h<<<<<<$<(===4O====/=1= +> 7>%E>wk>#@$A,AHA ^AkAA&AAAjCzC CCC,CC- D'9D aD nD-yD,D6D4 ES@E EEEE'E*F#CF@gF$FFF F:G >GHGWG3K7QK)KOK&L-*L+XL(LLuMN$N[9[2\7E\}\.\\\\(\\#]&4][]%o]"]]]]^#^>^X^o^^^^^&^# _-_J_e_%_ ____`&`%A`g`~` ` `:`.`Fafapnab*b)c)Gc%qc"c&c&c'd'0d,Xddddd"e%e=eWeqeeeeeeef4f"Gf!jff7f#ffg+g!@gbggggDhhh#hi4iSiAdi,i i$ij %j2jQjVj+sj-jj!jk(kDk Vk#wk]k2k,lKl$el?l.lRl7Lmmm-nZ p}&ԃ| ,؅-'K s -,64SR ̇'**#U@y$߈ : PZiQ7o)Oэ&!-H+v(ˎ=BZu )Ӑ.4)c0(#$ Hi!˒)'2"Z}͓ $,+4)`4,2;6[32ƕ-+'.S %,<,Y  (ȗ+#7O.-͘+*'5R S!.6e, Ϛ1*"M)l" ̛ כ % # -: CPfn,Ӝۜ.%.6=?E}>Ý92<7o.ܞ(#:&^%"1MhǠޠ& #3Wt1 ޡ2G\%w Ѣ ߢ:.&FU_j5KG|:0*JUEqmNCYc($ o}LbCn;HP5V  0?lEWM P<q,-[y!3fun9aKBp=D]c&Vse4.trxr"g!+@6)-h_^OR>WoX;v ^=eI{+k|vi~b)w&NYaT#DHZ(  f4.', %"1>MS`ygzLSZ8tJ@%kpTwOh8 lx7R:#   \d/7iA\A6$F]3IFsmd2z~/*<9jGUQ`'{[uB21QX}?%s %s process (%d)%s %s process (%d) became new process (%d)%s %s process (%d) continued by %s signal%s %s process (%d) continued by signal %d%s %s process (%d) executable changed%s %s process (%d) exited normally%s %s process (%d) killed by %s signal%s %s process (%d) killed by signal %d%s %s process (%d) stopped by %s signal%s %s process (%d) stopped by signal %d%s %s process (%d) terminated with status %d%s %s process ended, respawning%s goal changed from %s to %s%s respawning too fast, stopped%s state changed from %s to %s%s: --dest given without --system %s: illegal hour value %s: illegal minute value %s: illegal runlevel: %s %s: illegal time value %s: missing D-Bus address %s: missing address %s: missing event name %s: missing job name %s: missing runlevel %s: missing variable name %s: missing variable value %s: time expected 'start on' parse error'stop on' parse error(%s) at %d:%02d ...Adds or updates variables in the job environment table.Another shutdown is already runningApplication detailsBUGBoth stateful and stateless re-execs failedBridge socket events into upstartBridge udev events into upstartBring the system down.Broadcast message from %s@%sBy default, upstart-socket-bridge does not detach from the console and remains in the foreground. Use the --daemon option to have it detach.By default, upstart-udev-bridge does not detach from the console and remains in the foreground. Use the --daemon option to have it detach.Calling shutdownCannot create directoryCannot find pid of running shutdownCaught %s, core dumpedCaught %s, unable to dump coreChange runlevel.Change the minimum priority of log messages from the init daemon.Check for unreachable jobs/event conditions.Clear eventsColumns: time, event and environmentConfiguration directory deletedConnected toConnection from private clientCopyCould not connect to UpstartCould not create JobAdded signal connectionCould not create JobRemoved signal connectionCould not create Upstart proxyCould not create epoll descriptorCould not obtain job listCould not send socket eventCouldn't set uid.Detach and run in the backgroundDetected invalid serialisation dataDiscards all changes make to the job environment table, setting it back to its default value.Discards variables from the job environment table.Disconnected from D-Bus %s busDisconnected from UpstartDisconnected from notified D-Bus busDisplay the value of a variable from the job environment table.Displays list of running Session Init sessionsDisplays sorted list of variables and their values from the job environment table.Do not strip non-printable bytes from udev message dataEVENT [KEY=VALUE]...EVENT is the name of an event the init daemon should emit, this may be followed by zero or more environment variables to be included in the event. Emit an event.Env must be KEY=VALUE pairsEnvironmentError emitting socket eventError from epollError saving fileError while loading configuration fileEventEvent and environmentEvent failedExit applicationExpected eventExpected operatorExpected variable name before valueFailed to add log to unflushed queueFailed to continue traced %s %s process (%d): %sFailed to create pty - disabling logging for jobFailed to deliver signal to traced %s %s process (%d): %sFailed to deserialiseFailed to detach traced %s %s process (%d): %sFailed to generate serialisation dataFailed to obtain %s instance: %sFailed to obtain child process id for %s %s process (%d): %sFailed to open system console: %sFailed to re-execute %s: %sFailed to read serialisation dataFailed to release D-Bus name: %sFailed to resolve deserialisation dependenciesFailed to send %s signal to %s %s process (%d): %sFailed to serialiseFailed to set ptrace options for %s %s process (%d): %sFailed to set security contextFailed to spawn %s %s process: %sFailed to write serialisation dataFailed to write to log fileGUI modules not available - falling back to CLIGenerate warning for any unreachable events/jobsHalt the system.HaltingHandling %s eventHandling deletion of %sIf CONF specified, show configuration details for single job configuration, else show details for all jobs configurations. Ignoring get env request from chroot sessionIgnoring reset env request from chroot sessionIgnoring restart request from chroot sessionIgnoring session end request from chroot sessionIgnoring set env request from chroot sessionIgnoring stale session fileIgnoring state query from chroot sessionIgnoring unset env request from chroot sessionIllegal exit status, expected integerIllegal file creation mask, expected octal integerIllegal interval, expected number of secondsIllegal limit, expected 'unlimited' or integerIllegal nice value, expected -20 to 19Illegal oom adjustment, expected -16 to 15 or 'never'Illegal oom score adjustment, expected -999 to 1000 or 'never'Illegal parameterIllegal signal status, expected integerIndexInform Upstart of D-Bus address cgroup manager is available on.Inform Upstart of D-Bus address to connect to.Inform Upstart that disk is now writeable.Invalid job classInvalid setgid group name does not existInvalid setuid user name does not existJOBJOB [KEY=VALUE]...JOB is the name of the job that is to be queried, this may be followed by zero or more environment variables to distguish between job instances. JOB is the name of the job that is to be restarted, this may be followed by zero or more environment variables to be defined in the job after restarting. The environment also serves to distinguish between job instances, and thus decide which of multiple instances will be restarted.JOB is the name of the job that is to be sent the signal, this may be followed by zero or more environment variables to distinguish between job instances. JOB is the name of the job that is to be started, this may be followed by zero or more environment variables to be defined in the new job. The environment may also serve to distinguish between job instances, and thus decide whether a new instance will be started or an error returned if an existing instance is already running.JOB is the name of the job that is to be stopped, this may be followed by zero or more environment variables to be passed to the job's pre-stop and post-stop processes. The environment also serves to distinguish between job instances, and thus decide which of multiple instances will be stopped.JOB is the name of the job which usage is to be shown. JobJob cannot be started as cgroup manager not available: %sJob failed to restartJob failed to startJob failed while stoppingJob has already been stopped: %sJob is already running: %sJob is not running: %sJob may not be empty stringList all jobs and events which cannot be satisfied by currently available job configuration files.List all sessions.List known jobs.Loading configuration from %sMismatched bracesMismatched parenthesesName already takenName may not be empty stringNeed to be rootNo ConfSources present in state dataNo control details present in state dataNo events to saveNo global job environment data present in state dataNo such variableNot being executed as initNot connecting to %s busNot permissible to modify PID 1 job environmentNot permissible to notify D-Bus address for PID 1Not runningOut of MemoryOutput previous and current runlevel.PRIORITY may be one of: `debug' (messages useful for debugging upstart are logged, equivalent to --debug on kernel command-line); `info' (messages about job goal and state changes, as well as event emissions are logged, equivalent to --verbose on the kernel command-line); `message' (informational and debugging messages are suppressed, the default); `warn' (ordinary messages are suppressed whilst still logging warnings and errors); `error' (only errors are logged, equivalent to --quiet on the kernel command-line) or `fatal' (only fatal errors are logged). Without arguments, this outputs the current log priority.Passing state from PID %d to parentPausing %s (%d) [pre-exec] for debugPerforming stateful re-execPower off the system.Powering offProcess management daemon.Query status of job.Quiesce %s sequence took %s%d second%sQuiescing due to %s requestRUNLEVEL should be one of 0123456sS, where s and S are considered identical. RUNLEVEL may also be Q or q to instruct the init daemon to reload its configuration, this is rarely necessary since the daemon watches its configuration for changes. RUNLEVEL may be U or u to instruct the init daemon to re-execute itself, this is not recommended since Upstart does not currently preserve its state. Re-executing %sReboot the system.RebootingRebooting with %sReconnecting to D-Bus %s busReload the configuration of the init daemon.Reloading configurationRemove one or more job environment variables.Request the version of the init daemon.Restart job.RestartingRetrieve value of a job environment variable.Revert all job environment variable changes.Run to allow Upstart to provide cgroup stanza support.Run to allow Upstart to provide services over D-Bus.Run to ensure output from jobs ending before disk is writeable are flushed to disk.Save FileSave events to default fileSave events to specified fileSend HUP signal to job.Sending %s signal to %s %s process (%d)Set one or more job environment variables.Show all job environment variables.Show emits, start on and stop on details for job configurations.Show job usage message if available.Shutdown cancelledShutdown is not runningStart job.Stateful re-exec supported but stateless re-exec requestedStop job.TIME [MESSAGE]TIME may have different formats, the most common is simply the word 'now' which will bring the system down immediately. Other valid formats are +m, where m is the number of minutes to wait until shutting down and hh:mm which specifies the time on the 24hr clock. Logged in users are warned by a message sent to their terminal, you may include an optional MESSAGE included with this. Messages can be sent without actually bringing the system down by using the -k option. If TIME is given, the command will remain in the foreground until the shutdown occurs. It can be cancelled by Control-C, or by another user using the -c option. The system is brought down into maintenance (single-user) mode by default, you can change this with either the -r or -h option which specify a reboot or system halt respectively. The -h option can be further modified with -H or -P to specify whether to halt the system, or to power it off afterwards. The default is left up to the shutdown scripts.Temporary process spawn errorThe known jobs and their current status will be output.The log priority given was not recognisedThe system /var/run/utmp file is used unless the alternate file UTMP is given. The system is going down for halt NOW!The system is going down for maintenance NOW!The system is going down for power off NOW!The system is going down for reboot NOW!This command is intended to instruct the kernel to reboot or halt the system; when run without the -f option, or when in a system runlevel other than 0 or 6, it will actually execute /sbin/shutdown. This daemon is normally executed by the kernel and given process id 1 to denote its special status. When executed by a user process, it will actually run /sbin/telinit.TimeUnable to become daemonUnable to change directoryUnable to connect to UpstartUnable to connect to session busUnable to connect to system busUnable to connect to the D-Bus %s bus: %sUnable to create deviceUnable to execute shutdown: %sUnable to fork child-process to warn users: %sUnable to initialize console as /dev/nullUnable to initialize console, will try /dev/nullUnable to listen for private connectionsUnable to load configurationUnable to mount /dev filesystemUnable to mount /dev/pts filesystemUnable to mount /proc filesystemUnable to mount /sys filesystemUnable to query session directoryUnable to register as subreaperUnable to set default oom scoreUnable to set root directoryUnable to setup standard file descriptorsUnable to watch configuration directoryUnable to watch configuration fileUnable to write pid fileUnknown instance: %sUnknown job: %sUnknown parameterUpstart Event MonitorUsageVARIABLEVARIABLE[=VALUE]Variable may not be empty stringVersionWARNINGYou do not have permission to emit an eventYou do not have permission to end sessionYou do not have permission to modify job environmentYou do not have permission to modify job: %sYou do not have permission to notify D-Bus addressYou do not have permission to notify cgroup manager addressYou do not have permission to notify disk is writeableYou do not have permission to query job environmentYou do not have permission to reload configurationYou do not have permission to request restartYou do not have permission to request stateYou do not have permission to set log priority[CONF][PRIORITY][UTMP]apply to global job environment tableattempt to write state file on every re-execcancel a running shutdowncgroup manager addresscgroup manager not availablecgroup support not availableconnect to Upstart via specified D-Bus routeconsole modecontrol bus addressdefault value for console stanzadestination well-known name on D-Bus busdisable job loggingdo not connect to a D-Bus busdo not emit any startup event (for testing)do not replace the value of the variable if already setdo not support cgroupsdo not wait for event to finish before exitingdo not wait for job to restart before exitingdo not wait for job to start before exitingdo not wait for job to stop before exitingdon't actually reboot or halt, just write wtmp recorddon't sync before reboot or haltenable chroot sessionsenumerate list of events and jobs causing job created from job config to start/stopfailed to demarshal D-Bus messagefield separator to use for command-line outputflag a re-exec has occurredforce reboot or halt, don't call shutdown(8)halt after shutdown (implies -h)halt or power off after shutdownignore specified list of events (comma-separated)instance 'stop on' parse errorinvalid console type specifiedjobs will not inherit environment of initkilledlogoutmainonly send warnings, don't shutdownpost-startpost-startingpost-stoppost-stoppingpower off after shutdown (implies -h)pre-startpre-startingpre-stoppre-stoppingreboot after shutdownrespawnreverting to stateless re-execrun in command-line moderun in user mode (as used for user sessions)runningsecuritysecurity-spawningset environment variable in the runlevel eventshutdownspawnedspawningspecify additional directory to load configuration files fromspecify additional initial directory to load configuration files fromspecify alternative directory to load configuration files fromspecify alternative directory to store job output logs inspecify an alternative initial event (for testing)specify file descriptor to read serialisation data fromstartstart in user mode (as used for user sessions)startingstopstoppingswitch off the power when called as haltunable to allocate memory: %sunable to change root directory: %sunable to change working directory: %sunable to chown: %sunable to clear CLOEXEC bit on log fdunable to connect to CGManager: %sunable to create session fileunable to enter cgroup: %sunable to execute: %sunable to find setgid groupunable to find setuid userunable to get ptsname: %sunable to getgrgid: %sunable to getgrnam: %sunable to getpwnam: %sunable to getpwuid: %sunable to granpt: %sunable to initgroups: %sunable to mark cgroups for removal: %sunable to modify signal handler: %sunable to move script fd: %sunable to open console: %sunable to open pty slave: %sunable to set "%s" resource limit: %sunable to set oom adjustment: %sunable to set priority: %sunable to set trace: %sunable to setgid: %sunable to setuid: %sunable to setup cgroup: %sunable to switch security profile: %sunable to unlockpt: %sunable to write session fileunknown eventunknown jobuse D-Bus session bus rather than system bus (for testing)use D-Bus system bus to connect to init daemonuse existing D-Bus session bus to connect to init daemon (for testing)waitingProject-Id-Version: upstart 1.13.2 Report-Msgid-Bugs-To: new@bugs.launchpad.net POT-Creation-Date: 2014-09-04 11:55+0100 PO-Revision-Date: 2014-09-04 11:55+0100 Last-Translator: Automatically generated Language-Team: none Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); %s %s process (%d)%s %s process (%d) became new process (%d)%s %s process (%d) continued by %s signal%s %s process (%d) continued by signal %d%s %s process (%d) executable changed%s %s process (%d) exited normally%s %s process (%d) killed by %s signal%s %s process (%d) killed by signal %d%s %s process (%d) stopped by %s signal%s %s process (%d) stopped by signal %d%s %s process (%d) terminated with status %d%s %s process ended, respawning%s goal changed from %s to %s%s respawning too fast, stopped%s state changed from %s to %s%s: --dest given without --system %s: illegal hour value %s: illegal minute value %s: illegal runlevel: %s %s: illegal time value %s: missing D-Bus address %s: missing address %s: missing event name %s: missing job name %s: missing runlevel %s: missing variable name %s: missing variable value %s: time expected ‘start on’ parse error‘stop on’ parse error(%s) at %d:%02d ...Adds or updates variables in the job environment table.Another shutdown is already runningApplication detailsBUGBoth stateful and stateless re-execs failedBridge socket events into upstartBridge udev events into upstartBring the system down.Broadcast message from %s@%sBy default, upstart-socket-bridge does not detach from the console and remains in the foreground. Use the --daemon option to have it detach.By default, upstart-udev-bridge does not detach from the console and remains in the foreground. Use the --daemon option to have it detach.Calling shutdownCannot create directoryCannot find pid of running shutdownCaught %s, core dumpedCaught %s, unable to dump coreChange runlevel.Change the minimum priority of log messages from the init daemon.Check for unreachable jobs/event conditions.Clear eventsColumns: time, event and environmentConfiguration directory deletedConnected toConnection from private clientCopyCould not connect to UpstartCould not create JobAdded signal connectionCould not create JobRemoved signal connectionCould not create Upstart proxyCould not create epoll descriptorCould not obtain job listCould not send socket eventCouldn't set uid.Detach and run in the backgroundDetected invalid serialisation dataDiscards all changes make to the job environment table, setting it back to its default value.Discards variables from the job environment table.Disconnected from D-Bus %s busDisconnected from UpstartDisconnected from notified D-Bus busDisplay the value of a variable from the job environment table.Displays list of running Session Init sessionsDisplays sorted list of variables and their values from the job environment table.Do not strip non-printable bytes from udev message dataEVENT [KEY=VALUE]...EVENT is the name of an event the init daemon should emit, this may be followed by zero or more environment variables to be included in the event. Emit an event.Env must be KEY=VALUE pairsEnvironmentError emitting socket eventError from epollError saving fileError while loading configuration fileEventEvent and environmentEvent failedExit applicationExpected eventExpected operatorExpected variable name before valueFailed to add log to unflushed queueFailed to continue traced %s %s process (%d): %sFailed to create pty - disabling logging for jobFailed to deliver signal to traced %s %s process (%d): %sFailed to deserialiseFailed to detach traced %s %s process (%d): %sFailed to generate serialisation dataFailed to obtain %s instance: %sFailed to obtain child process id for %s %s process (%d): %sFailed to open system console: %sFailed to re-execute %s: %sFailed to read serialisation dataFailed to release D-Bus name: %sFailed to resolve deserialisation dependenciesFailed to send %s signal to %s %s process (%d): %sFailed to serialiseFailed to set ptrace options for %s %s process (%d): %sFailed to set security contextFailed to spawn %s %s process: %sFailed to write serialisation dataFailed to write to log fileGUI modules not available - falling back to CLIGenerate warning for any unreachable events/jobsHalt the system.HaltingHandling %s eventHandling deletion of %sIf CONF specified, show configuration details for single job configuration, else show details for all jobs configurations. Ignoring get env request from chroot sessionIgnoring reset env request from chroot sessionIgnoring restart request from chroot sessionIgnoring session end request from chroot sessionIgnoring set env request from chroot sessionIgnoring stale session fileIgnoring state query from chroot sessionIgnoring unset env request from chroot sessionIllegal exit status, expected integerIllegal file creation mask, expected octal integerIllegal interval, expected number of secondsIllegal limit, expected ‘unlimited’ or integerIllegal nice value, expected -20 to 19Illegal oom adjustment, expected -16 to 15 or ‘never’Illegal oom score adjustment, expected -999 to 1000 or ‘never’Illegal parameterIllegal signal status, expected integerIndexInform Upstart of D-Bus address cgroup manager is available on.Inform Upstart of D-Bus address to connect to.Inform Upstart that disk is now writeable.Invalid job classInvalid setgid group name does not existInvalid setuid user name does not existJOBJOB [KEY=VALUE]...JOB is the name of the job that is to be queried, this may be followed by zero or more environment variables to distguish between job instances. JOB is the name of the job that is to be restarted, this may be followed by zero or more environment variables to be defined in the job after restarting. The environment also serves to distinguish between job instances, and thus decide which of multiple instances will be restarted.JOB is the name of the job that is to be sent the signal, this may be followed by zero or more environment variables to distinguish between job instances. JOB is the name of the job that is to be started, this may be followed by zero or more environment variables to be defined in the new job. The environment may also serve to distinguish between job instances, and thus decide whether a new instance will be started or an error returned if an existing instance is already running.JOB is the name of the job that is to be stopped, this may be followed by zero or more environment variables to be passed to the job's pre-stop and post-stop processes. The environment also serves to distinguish between job instances, and thus decide which of multiple instances will be stopped.JOB is the name of the job which usage is to be shown. JobJob cannot be started as cgroup manager not available: %sJob failed to restartJob failed to startJob failed while stoppingJob has already been stopped: %sJob is already running: %sJob is not running: %sJob may not be empty stringList all jobs and events which cannot be satisfied by currently available job configuration files.List all sessions.List known jobs.Loading configuration from %sMismatched bracesMismatched parenthesesName already takenName may not be empty stringNeed to be rootNo ConfSources present in state dataNo control details present in state dataNo events to saveNo global job environment data present in state dataNo such variableNot being executed as initNot connecting to %s busNot permissible to modify PID 1 job environmentNot permissible to notify D-Bus address for PID 1Not runningOut of MemoryOutput previous and current runlevel.PRIORITY may be one of: ‘debug’ (messages useful for debugging upstart are logged, equivalent to --debug on kernel command-line); ‘info’ (messages about job goal and state changes, as well as event emissions are logged, equivalent to --verbose on the kernel command-line); ‘message’ (informational and debugging messages are suppressed, the default); ‘warn’ (ordinary messages are suppressed whilst still logging warnings and errors); ‘error’ (only errors are logged, equivalent to --quiet on the kernel command-line) or ‘fatal’ (only fatal errors are logged). Without arguments, this outputs the current log priority.Passing state from PID %d to parentPausing %s (%d) [pre-exec] for debugPerforming stateful re-execPower off the system.Powering offProcess management daemon.Query status of job.Quiesce %s sequence took %s%d second%sQuiescing due to %s requestRUNLEVEL should be one of 0123456sS, where s and S are considered identical. RUNLEVEL may also be Q or q to instruct the init daemon to reload its configuration, this is rarely necessary since the daemon watches its configuration for changes. RUNLEVEL may be U or u to instruct the init daemon to re-execute itself, this is not recommended since Upstart does not currently preserve its state. Re-executing %sReboot the system.RebootingRebooting with %sReconnecting to D-Bus %s busReload the configuration of the init daemon.Reloading configurationRemove one or more job environment variables.Request the version of the init daemon.Restart job.RestartingRetrieve value of a job environment variable.Revert all job environment variable changes.Run to allow Upstart to provide cgroup stanza support.Run to allow Upstart to provide services over D-Bus.Run to ensure output from jobs ending before disk is writeable are flushed to disk.Save FileSave events to default fileSave events to specified fileSend HUP signal to job.Sending %s signal to %s %s process (%d)Set one or more job environment variables.Show all job environment variables.Show emits, start on and stop on details for job configurations.Show job usage message if available.Shutdown cancelledShutdown is not runningStart job.Stateful re-exec supported but stateless re-exec requestedStop job.TIME [MESSAGE]TIME may have different formats, the most common is simply the word ‘now’ which will bring the system down immediately. Other valid formats are +m, where m is the number of minutes to wait until shutting down and hh:mm which specifies the time on the 24hr clock. Logged in users are warned by a message sent to their terminal, you may include an optional MESSAGE included with this. Messages can be sent without actually bringing the system down by using the -k option. If TIME is given, the command will remain in the foreground until the shutdown occurs. It can be cancelled by Control-C, or by another user using the -c option. The system is brought down into maintenance (single-user) mode by default, you can change this with either the -r or -h option which specify a reboot or system halt respectively. The -h option can be further modified with -H or -P to specify whether to halt the system, or to power it off afterwards. The default is left up to the shutdown scripts.Temporary process spawn errorThe known jobs and their current status will be output.The log priority given was not recognisedThe system /var/run/utmp file is used unless the alternate file UTMP is given. The system is going down for halt NOW!The system is going down for maintenance NOW!The system is going down for power off NOW!The system is going down for reboot NOW!This command is intended to instruct the kernel to reboot or halt the system; when run without the -f option, or when in a system runlevel other than 0 or 6, it will actually execute /sbin/shutdown. This daemon is normally executed by the kernel and given process id 1 to denote its special status. When executed by a user process, it will actually run /sbin/telinit.TimeUnable to become daemonUnable to change directoryUnable to connect to UpstartUnable to connect to session busUnable to connect to system busUnable to connect to the D-Bus %s bus: %sUnable to create deviceUnable to execute shutdown: %sUnable to fork child-process to warn users: %sUnable to initialize console as /dev/nullUnable to initialize console, will try /dev/nullUnable to listen for private connectionsUnable to load configurationUnable to mount /dev filesystemUnable to mount /dev/pts filesystemUnable to mount /proc filesystemUnable to mount /sys filesystemUnable to query session directoryUnable to register as subreaperUnable to set default oom scoreUnable to set root directoryUnable to setup standard file descriptorsUnable to watch configuration directoryUnable to watch configuration fileUnable to write pid fileUnknown instance: %sUnknown job: %sUnknown parameterUpstart Event MonitorUsageVARIABLEVARIABLE[=VALUE]Variable may not be empty stringVersionWARNINGYou do not have permission to emit an eventYou do not have permission to end sessionYou do not have permission to modify job environmentYou do not have permission to modify job: %sYou do not have permission to notify D-Bus addressYou do not have permission to notify cgroup manager addressYou do not have permission to notify disk is writeableYou do not have permission to query job environmentYou do not have permission to reload configurationYou do not have permission to request restartYou do not have permission to request stateYou do not have permission to set log priority[CONF][PRIORITY][UTMP]apply to global job environment tableattempt to write state file on every re-execcancel a running shutdowncgroup manager addresscgroup manager not availablecgroup support not availableconnect to Upstart via specified D-Bus routeconsole modecontrol bus addressdefault value for console stanzadestination well-known name on D-Bus busdisable job loggingdo not connect to a D-Bus busdo not emit any startup event (for testing)do not replace the value of the variable if already setdo not support cgroupsdo not wait for event to finish before exitingdo not wait for job to restart before exitingdo not wait for job to start before exitingdo not wait for job to stop before exitingdon't actually reboot or halt, just write wtmp recorddon't sync before reboot or haltenable chroot sessionsenumerate list of events and jobs causing job created from job config to start/stopfailed to demarshal D-Bus messagefield separator to use for command-line outputflag a re-exec has occurredforce reboot or halt, don't call shutdown(8)halt after shutdown (implies -h)halt or power off after shutdownignore specified list of events (comma-separated)instance ‘stop on’ parse errorinvalid console type specifiedjobs will not inherit environment of initkilledlogoutmainonly send warnings, don't shutdownpost-startpost-startingpost-stoppost-stoppingpower off after shutdown (implies -h)pre-startpre-startingpre-stoppre-stoppingreboot after shutdownrespawnreverting to stateless re-execrun in command-line moderun in user mode (as used for user sessions)runningsecuritysecurity-spawningset environment variable in the runlevel eventshutdownspawnedspawningspecify additional directory to load configuration files fromspecify additional initial directory to load configuration files fromspecify alternative directory to load configuration files fromspecify alternative directory to store job output logs inspecify an alternative initial event (for testing)specify file descriptor to read serialisation data fromstartstart in user mode (as used for user sessions)startingstopstoppingswitch off the power when called as haltunable to allocate memory: %sunable to change root directory: %sunable to change working directory: %sunable to chown: %sunable to clear CLOEXEC bit on log fdunable to connect to CGManager: %sunable to create session fileunable to enter cgroup: %sunable to execute: %sunable to find setgid groupunable to find setuid userunable to get ptsname: %sunable to getgrgid: %sunable to getgrnam: %sunable to getpwnam: %sunable to getpwuid: %sunable to granpt: %sunable to initgroups: %sunable to mark cgroups for removal: %sunable to modify signal handler: %sunable to move script fd: %sunable to open console: %sunable to open pty slave: %sunable to set “%s” resource limit: %sunable to set oom adjustment: %sunable to set priority: %sunable to set trace: %sunable to setgid: %sunable to setuid: %sunable to setup cgroup: %sunable to switch security profile: %sunable to unlockpt: %sunable to write session fileunknown eventunknown jobuse D-Bus session bus rather than system bus (for testing)use D-Bus system bus to connect to init daemonuse existing D-Bus session bus to connect to init daemon (for testing)waitingupstart-1.13.2/po/POTFILES.in0000664000175000017500000000077212373101356012425 00000000000000# List of source files which contain translatable strings. init/blocked.c init/conf.c init/control.c init/environ.c init/errors.h init/event.c init/event_operator.c init/job.c init/job_class.c init/job_process.c init/log.c init/main.c init/parse_conf.c init/parse_job.c init/process.c init/quiesce.c init/session.c init/state.c init/system.c util/initctl.c util/reboot.c util/runlevel.c util/shutdown.c util/telinit.c extra/upstart-udev-bridge.c extra/upstart-socket-bridge.c scripts/upstart-monitor.py upstart-1.13.2/po/en@boldquot.po0000664000175000017500000015365412402042420013461 00000000000000# English translations for upstart package. # Copyright (C) 2014 Canonical Ltd. # This file is distributed under the same license as the upstart package. # Automatically generated, 2014. # # All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # msgid "" msgstr "" "Project-Id-Version: upstart 1.13.2\n" "Report-Msgid-Bugs-To: new@bugs.launchpad.net\n" "POT-Creation-Date: 2014-09-04 11:55+0100\n" "PO-Revision-Date: 2014-09-04 11:55+0100\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: init/conf.c:505 init/session.c:254 msgid "Unable to load configuration" msgstr "Unable to load configuration" #: init/conf.c:538 #, c-format msgid "Loading configuration from %s" msgstr "Loading configuration from %s" #: init/conf.c:575 #, c-format msgid "Handling deletion of %s" msgstr "Handling deletion of %s" #: init/conf.c:652 msgid "Unable to watch configuration file" msgstr "Unable to watch configuration file" #: init/conf.c:747 msgid "Unable to watch configuration directory" msgstr "Unable to watch configuration directory" #: init/conf.c:871 msgid "Error while loading configuration file" msgstr "Error while loading configuration file" #: init/conf.c:985 msgid "Configuration directory deleted" msgstr "Configuration directory deleted" #: init/control.c:223 msgid "Connection from private client" msgstr "Connection from private client" #: init/control.c:386 msgid "Disconnected from notified D-Bus bus" msgstr "Disconnected from notified D-Bus bus" #: init/control.c:388 #, c-format msgid "Disconnected from D-Bus %s bus" msgstr "Disconnected from D-Bus %s bus" #: init/control.c:462 msgid "You do not have permission to reload configuration" msgstr "You do not have permission to reload configuration" #: init/control.c:466 init/main.c:1022 msgid "Reloading configuration" msgstr "Reloading configuration" #: init/control.c:510 init/control.c:671 msgid "Name may not be empty string" msgstr "Name may not be empty string" #: init/control.c:541 #, c-format msgid "Unknown job: %s" msgstr "Unknown job: %s" #: init/control.c:664 msgid "You do not have permission to emit an event" msgstr "You do not have permission to emit an event" #: init/control.c:679 init/job_class.c:843 init/job_class.c:1066 #: init/job_class.c:1206 init/job_class.c:1342 msgid "Env must be KEY=VALUE pairs" msgstr "Env must be KEY=VALUE pairs" #: init/control.c:831 msgid "You do not have permission to set log priority" msgstr "You do not have permission to set log priority" #: init/control.c:855 msgid "The log priority given was not recognised" msgstr "The log priority given was not recognised" #: init/control.c:907 msgid "You do not have permission to notify disk is writeable" msgstr "You do not have permission to notify disk is writeable" #: init/control.c:953 msgid "Not permissible to notify D-Bus address for PID 1" msgstr "Not permissible to notify D-Bus address for PID 1" #: init/control.c:960 msgid "You do not have permission to notify D-Bus address" msgstr "You do not have permission to notify D-Bus address" #: init/control.c:971 init/control.c:1020 init/control.c:1028 #: init/control.c:1223 msgid "Out of Memory" msgstr "Out of Memory" #: init/control.c:1006 msgid "You do not have permission to notify cgroup manager address" msgstr "You do not have permission to notify cgroup manager address" #: init/control.c:1197 msgid "You do not have permission to request state" msgstr "You do not have permission to request state" #: init/control.c:1210 msgid "Ignoring state query from chroot session" msgstr "Ignoring state query from chroot session" #: init/control.c:1251 msgid "You do not have permission to request restart" msgstr "You do not have permission to request restart" #: init/control.c:1265 msgid "Ignoring restart request from chroot session" msgstr "Ignoring restart request from chroot session" #: init/control.c:1269 msgid "Restarting" msgstr "Restarting" #: init/control.c:1358 init/control.c:1510 init/control.c:1820 msgid "You do not have permission to modify job environment" msgstr "You do not have permission to modify job environment" #: init/control.c:1365 init/control.c:1517 init/control.c:1827 msgid "Not permissible to modify PID 1 job environment" msgstr "Not permissible to modify PID 1 job environment" #: init/control.c:1379 init/control.c:1531 init/control.c:1668 #: init/control.c:1764 init/control.c:1841 msgid "Job may not be empty string" msgstr "Job may not be empty string" #: init/control.c:1390 msgid "Ignoring set env request from chroot session" msgstr "Ignoring set env request from chroot session" #: init/control.c:1402 init/control.c:1464 init/control.c:1552 #: init/control.c:1602 init/control.c:1654 msgid "Variable may not be empty string" msgstr "Variable may not be empty string" #: init/control.c:1542 msgid "Ignoring unset env request from chroot session" msgstr "Ignoring unset env request from chroot session" #: init/control.c:1572 init/control.c:1712 msgid "No such variable" msgstr "No such variable" #: init/control.c:1648 init/control.c:1750 msgid "You do not have permission to query job environment" msgstr "You do not have permission to query job environment" #: init/control.c:1679 msgid "Ignoring get env request from chroot session" msgstr "Ignoring get env request from chroot session" #: init/control.c:1852 msgid "Ignoring reset env request from chroot session" msgstr "Ignoring reset env request from chroot session" #: init/control.c:1985 msgid "unable to create session file" msgstr "unable to create session file" #: init/control.c:1992 msgid "unable to write session file" msgstr "unable to write session file" #: init/control.c:2041 msgid "You do not have permission to end session" msgstr "You do not have permission to end session" #: init/control.c:2049 msgid "Ignoring session end request from chroot session" msgstr "Ignoring session end request from chroot session" #: init/errors.h:63 msgid "Illegal parameter" msgstr "Illegal parameter" #: init/errors.h:64 msgid "Unknown parameter" msgstr "Unknown parameter" #: init/errors.h:65 init/errors.h:79 msgid "Expected operator" msgstr "Expected operator" #: init/errors.h:66 msgid "Mismatched braces" msgstr "Mismatched braces" #: init/errors.h:67 msgid "Invalid setuid user name does not exist" msgstr "Invalid setuid user name does not exist" #: init/errors.h:68 msgid "Invalid setgid group name does not exist" msgstr "Invalid setgid group name does not exist" #: init/errors.h:69 msgid "Failed to set security context" msgstr "Failed to set security context" #: init/errors.h:70 msgid "Illegal interval, expected number of seconds" msgstr "Illegal interval, expected number of seconds" #: init/errors.h:71 msgid "Illegal exit status, expected integer" msgstr "Illegal exit status, expected integer" #: init/errors.h:72 msgid "Illegal signal status, expected integer" msgstr "Illegal signal status, expected integer" #: init/errors.h:73 msgid "Illegal file creation mask, expected octal integer" msgstr "Illegal file creation mask, expected octal integer" #: init/errors.h:74 msgid "Illegal nice value, expected -20 to 19" msgstr "Illegal nice value, expected -20 to 19" #: init/errors.h:75 msgid "Illegal oom adjustment, expected -16 to 15 or 'never'" msgstr "Illegal oom adjustment, expected -16 to 15 or ‘never’" #: init/errors.h:76 msgid "Illegal oom score adjustment, expected -999 to 1000 or 'never'" msgstr "Illegal oom score adjustment, expected -999 to 1000 or ‘never’" #: init/errors.h:77 msgid "Illegal limit, expected 'unlimited' or integer" msgstr "Illegal limit, expected ‘unlimited’ or integer" #: init/errors.h:78 msgid "Expected event" msgstr "Expected event" #: init/errors.h:80 msgid "Expected variable name before value" msgstr "Expected variable name before value" #: init/errors.h:81 msgid "Mismatched parentheses" msgstr "Mismatched parentheses" #: init/errors.h:82 msgid "Name already taken" msgstr "Name already taken" #: init/event.c:290 #, c-format msgid "Handling %s event" msgstr "Handling %s event" #: init/event.c:488 msgid "Event failed" msgstr "Event failed" #: init/job.c:334 #, c-format msgid "%s goal changed from %s to %s" msgstr "%s goal changed from %s to %s" #: init/job.c:409 #, c-format msgid "%s state changed from %s to %s" msgstr "%s state changed from %s to %s" #: init/job.c:934 init/job.c:972 msgid "Job failed to start" msgstr "Job failed to start" #: init/job.c:947 init/job.c:983 msgid "Job failed while stopping" msgstr "Job failed while stopping" #: init/job.c:959 init/job.c:994 msgid "Job failed to restart" msgstr "Job failed to restart" #: init/job.c:1188 msgid "stop" msgstr "stop" #: init/job.c:1190 msgid "start" msgstr "start" #: init/job.c:1192 msgid "respawn" msgstr "respawn" #: init/job.c:1237 msgid "waiting" msgstr "waiting" #: init/job.c:1239 msgid "starting" msgstr "starting" #: init/job.c:1241 msgid "security-spawning" msgstr "security-spawning" #: init/job.c:1243 init/process.c:90 msgid "security" msgstr "security" #: init/job.c:1245 msgid "pre-starting" msgstr "pre-starting" #: init/job.c:1247 init/process.c:82 msgid "pre-start" msgstr "pre-start" #: init/job.c:1249 msgid "spawning" msgstr "spawning" #: init/job.c:1251 msgid "spawned" msgstr "spawned" #: init/job.c:1253 msgid "post-starting" msgstr "post-starting" #: init/job.c:1255 init/process.c:84 msgid "post-start" msgstr "post-start" #: init/job.c:1257 msgid "running" msgstr "running" #: init/job.c:1259 msgid "pre-stopping" msgstr "pre-stopping" #: init/job.c:1261 init/process.c:86 msgid "pre-stop" msgstr "pre-stop" #: init/job.c:1263 msgid "stopping" msgstr "stopping" #: init/job.c:1265 msgid "killed" msgstr "killed" #: init/job.c:1267 msgid "post-stopping" msgstr "post-stopping" #: init/job.c:1269 init/process.c:88 msgid "post-stop" msgstr "post-stop" #: init/job.c:1366 init/job.c:1454 init/job.c:1530 init/job.c:1599 #: init/job_class.c:1045 init/job_class.c:1198 init/job_class.c:1334 #, c-format msgid "You do not have permission to modify job: %s" msgstr "You do not have permission to modify job: %s" #: init/job.c:1374 init/job_class.c:1122 #, c-format msgid "Job is already running: %s" msgstr "Job is already running: %s" #: init/job.c:1387 init/job_class.c:1057 #, c-format msgid "Job cannot be started as cgroup manager not available: %s" msgstr "Job cannot be started as cgroup manager not available: %s" #: init/job.c:1462 init/job.c:1538 init/job_class.c:1252 init/job_class.c:1387 #, c-format msgid "Job has already been stopped: %s" msgstr "Job has already been stopped: %s" #: init/job.c:1607 #, c-format msgid "Job is not running: %s" msgstr "Job is not running: %s" #: init/job.c:2113 init/job_class.c:2268 init/job_class.c:2303 msgid "BUG" msgstr "BUG" #: init/job.c:2114 msgid "instance 'stop on' parse error" msgstr "instance ‘stop on’ parse error" #: init/job_class.c:873 init/job_class.c:1096 util/initctl.c:1708 msgid "Usage" msgstr "Usage" #: init/job_class.c:891 init/job_class.c:936 init/job_class.c:1244 #: init/job_class.c:1379 #, c-format msgid "Unknown instance: %s" msgstr "Unknown instance: %s" #: init/job_class.c:2269 msgid "'start on' parse error" msgstr "‘start on’ parse error" #: init/job_class.c:2304 msgid "'stop on' parse error" msgstr "‘stop on’ parse error" #: init/job_class.c:2650 msgid "unable to clear CLOEXEC bit on log fd" msgstr "unable to clear CLOEXEC bit on log fd" #: init/job_class.c:2744 #, c-format msgid "Failed to obtain %s instance: %s" msgstr "Failed to obtain %s instance: %s" #: init/job_process.c:318 init/job_process.c:2472 msgid "Temporary process spawn error" msgstr "Temporary process spawn error" #: init/job_process.c:323 #, c-format msgid "%s %s process (%d)" msgstr "%s %s process (%d)" #: init/job_process.c:448 msgid "cgroup support not available" msgstr "cgroup support not available" #: init/job_process.c:452 msgid "cgroup manager not available" msgstr "cgroup manager not available" #: init/job_process.c:493 msgid "Failed to create pty - disabling logging for job" msgstr "Failed to create pty - disabling logging for job" #: init/job_process.c:540 #, c-format msgid "Pausing %s (%d) [pre-exec] for debug" msgstr "Pausing %s (%d) [pre-exec] for debug" #: init/job_process.c:664 #, c-format msgid "Failed to open system console: %s" msgstr "Failed to open system console: %s" #: init/job_process.c:1070 #, c-format msgid "unable to move script fd: %s" msgstr "unable to move script fd: %s" #: init/job_process.c:1075 #, c-format msgid "unable to open console: %s" msgstr "unable to open console: %s" #: init/job_process.c:1130 #, c-format msgid "unable to set \"%s\" resource limit: %s" msgstr "unable to set “%s” resource limit: %s" #: init/job_process.c:1135 #, c-format msgid "unable to set priority: %s" msgstr "unable to set priority: %s" #: init/job_process.c:1140 #, c-format msgid "unable to set oom adjustment: %s" msgstr "unable to set oom adjustment: %s" #: init/job_process.c:1145 #, c-format msgid "unable to change root directory: %s" msgstr "unable to change root directory: %s" #: init/job_process.c:1150 #, c-format msgid "unable to change working directory: %s" msgstr "unable to change working directory: %s" #: init/job_process.c:1155 #, c-format msgid "unable to set trace: %s" msgstr "unable to set trace: %s" #: init/job_process.c:1160 #, c-format msgid "unable to execute: %s" msgstr "unable to execute: %s" #: init/job_process.c:1165 #, c-format msgid "unable to getpwnam: %s" msgstr "unable to getpwnam: %s" #: init/job_process.c:1170 #, c-format msgid "unable to getgrnam: %s" msgstr "unable to getgrnam: %s" #: init/job_process.c:1175 #, c-format msgid "unable to getpwuid: %s" msgstr "unable to getpwuid: %s" #: init/job_process.c:1180 #, c-format msgid "unable to getgrgid: %s" msgstr "unable to getgrgid: %s" #: init/job_process.c:1185 msgid "unable to find setuid user" msgstr "unable to find setuid user" #: init/job_process.c:1189 msgid "unable to find setgid group" msgstr "unable to find setgid group" #: init/job_process.c:1193 #, c-format msgid "unable to setuid: %s" msgstr "unable to setuid: %s" #: init/job_process.c:1198 #, c-format msgid "unable to setgid: %s" msgstr "unable to setgid: %s" #: init/job_process.c:1203 #, c-format msgid "unable to chown: %s" msgstr "unable to chown: %s" #: init/job_process.c:1208 #, c-format msgid "unable to unlockpt: %s" msgstr "unable to unlockpt: %s" #: init/job_process.c:1213 #, c-format msgid "unable to granpt: %s" msgstr "unable to granpt: %s" #: init/job_process.c:1218 #, c-format msgid "unable to get ptsname: %s" msgstr "unable to get ptsname: %s" #: init/job_process.c:1223 #, c-format msgid "unable to open pty slave: %s" msgstr "unable to open pty slave: %s" #: init/job_process.c:1228 #, c-format msgid "unable to modify signal handler: %s" msgstr "unable to modify signal handler: %s" #: init/job_process.c:1233 #, c-format msgid "unable to allocate memory: %s" msgstr "unable to allocate memory: %s" #: init/job_process.c:1238 #, c-format msgid "unable to initgroups: %s" msgstr "unable to initgroups: %s" #: init/job_process.c:1243 #, c-format msgid "unable to switch security profile: %s" msgstr "unable to switch security profile: %s" #: init/job_process.c:1248 #, c-format msgid "unable to connect to CGManager: %s" msgstr "unable to connect to CGManager: %s" #: init/job_process.c:1253 #, c-format msgid "unable to setup cgroup: %s" msgstr "unable to setup cgroup: %s" #: init/job_process.c:1258 #, c-format msgid "unable to enter cgroup: %s" msgstr "unable to enter cgroup: %s" #: init/job_process.c:1263 #, c-format msgid "unable to mark cgroups for removal: %s" msgstr "unable to mark cgroups for removal: %s" #: init/job_process.c:1294 init/job_process.c:1437 #, c-format msgid "Sending %s signal to %s %s process (%d)" msgstr "Sending %s signal to %s %s process (%d)" #: init/job_process.c:1303 init/job_process.c:1446 #, c-format msgid "Failed to send %s signal to %s %s process (%d): %s" msgstr "Failed to send %s signal to %s %s process (%d): %s" #: init/job_process.c:1507 #, c-format msgid "%s %s process (%d) terminated with status %d" msgstr "%s %s process (%d) terminated with status %d" #: init/job_process.c:1512 #, c-format msgid "%s %s process (%d) exited normally" msgstr "%s %s process (%d) exited normally" #: init/job_process.c:1527 #, c-format msgid "%s %s process (%d) killed by %s signal" msgstr "%s %s process (%d) killed by %s signal" #: init/job_process.c:1531 #, c-format msgid "%s %s process (%d) killed by signal %d" msgstr "%s %s process (%d) killed by signal %d" #: init/job_process.c:1545 #, c-format msgid "%s %s process (%d) stopped by %s signal" msgstr "%s %s process (%d) stopped by %s signal" #: init/job_process.c:1549 #, c-format msgid "%s %s process (%d) stopped by signal %d" msgstr "%s %s process (%d) stopped by signal %d" #: init/job_process.c:1563 #, c-format msgid "%s %s process (%d) continued by %s signal" msgstr "%s %s process (%d) continued by %s signal" #: init/job_process.c:1567 #, c-format msgid "%s %s process (%d) continued by signal %d" msgstr "%s %s process (%d) continued by signal %d" #: init/job_process.c:1734 #, c-format msgid "%s respawning too fast, stopped" msgstr "%s respawning too fast, stopped" #: init/job_process.c:1740 #, c-format msgid "%s %s process ended, respawning" msgstr "%s %s process ended, respawning" #: init/job_process.c:1850 msgid "Failed to add log to unflushed queue" msgstr "Failed to add log to unflushed queue" #: init/job_process.c:2027 #, c-format msgid "Failed to set ptrace options for %s %s process (%d): %s" msgstr "Failed to set ptrace options for %s %s process (%d): %s" #: init/job_process.c:2040 init/job_process.c:2236 #, c-format msgid "Failed to continue traced %s %s process (%d): %s" msgstr "Failed to continue traced %s %s process (%d): %s" #: init/job_process.c:2080 init/job_process.c:2172 init/job_process.c:2227 #, c-format msgid "Failed to detach traced %s %s process (%d): %s" msgstr "Failed to detach traced %s %s process (%d): %s" #: init/job_process.c:2120 #, c-format msgid "Failed to deliver signal to traced %s %s process (%d): %s" msgstr "Failed to deliver signal to traced %s %s process (%d): %s" #: init/job_process.c:2156 #, c-format msgid "Failed to obtain child process id for %s %s process (%d): %s" msgstr "Failed to obtain child process id for %s %s process (%d): %s" #: init/job_process.c:2163 #, c-format msgid "%s %s process (%d) became new process (%d)" msgstr "%s %s process (%d) became new process (%d)" #: init/job_process.c:2222 #, c-format msgid "%s %s process (%d) executable changed" msgstr "%s %s process (%d) executable changed" #: init/job_process.c:2482 #, c-format msgid "Failed to spawn %s %s process: %s" msgstr "Failed to spawn %s %s process: %s" #: init/log.c:354 msgid "Failed to write to log file" msgstr "Failed to write to log file" #: init/main.c:171 msgid "specify additional directory to load configuration files from" msgstr "specify additional directory to load configuration files from" #: init/main.c:174 msgid "enable chroot sessions" msgstr "enable chroot sessions" #: init/main.c:177 msgid "specify alternative directory to load configuration files from" msgstr "specify alternative directory to load configuration files from" #: init/main.c:180 msgid "default value for console stanza" msgstr "default value for console stanza" #: init/main.c:183 msgid "specify alternative directory to store job output logs in" msgstr "specify alternative directory to store job output logs in" #: init/main.c:187 msgid "do not support cgroups" msgstr "do not support cgroups" #: init/main.c:191 msgid "do not connect to a D-Bus bus" msgstr "do not connect to a D-Bus bus" #: init/main.c:194 msgid "jobs will not inherit environment of init" msgstr "jobs will not inherit environment of init" #: init/main.c:197 msgid "disable job logging" msgstr "disable job logging" #: init/main.c:200 msgid "do not emit any startup event (for testing)" msgstr "do not emit any startup event (for testing)" #: init/main.c:203 msgid "specify additional initial directory to load configuration files from" msgstr "specify additional initial directory to load configuration files from" #: init/main.c:207 msgid "flag a re-exec has occurred" msgstr "flag a re-exec has occurred" #: init/main.c:211 msgid "specify file descriptor to read serialisation data from" msgstr "specify file descriptor to read serialisation data from" #: init/main.c:214 msgid "use D-Bus session bus rather than system bus (for testing)" msgstr "use D-Bus session bus rather than system bus (for testing)" #: init/main.c:217 msgid "specify an alternative initial event (for testing)" msgstr "specify an alternative initial event (for testing)" #: init/main.c:220 msgid "start in user mode (as used for user sessions)" msgstr "start in user mode (as used for user sessions)" #: init/main.c:223 msgid "attempt to write state file on every re-exec" msgstr "attempt to write state file on every re-exec" #: init/main.c:248 msgid "Process management daemon." msgstr "Process management daemon." #: init/main.c:250 msgid "" "This daemon is normally executed by the kernel and given process id 1 to " "denote its special status. When executed by a user process, it will " "actually run /sbin/telinit." msgstr "" "This daemon is normally executed by the kernel and given process id 1 to " "denote its special status. When executed by a user process, it will " "actually run /sbin/telinit." #: init/main.c:280 util/reboot.c:172 util/shutdown.c:373 util/telinit.c:251 msgid "Need to be root" msgstr "Need to be root" #: init/main.c:289 msgid "Not being executed as init" msgstr "Not being executed as init" #: init/main.c:340 msgid "Unable to mount /dev filesystem" msgstr "Unable to mount /dev filesystem" #: init/main.c:349 msgid "Cannot create directory" msgstr "Cannot create directory" #: init/main.c:357 msgid "Unable to mount /dev/pts filesystem" msgstr "Unable to mount /dev/pts filesystem" #: init/main.c:383 msgid "Unable to initialize console, will try /dev/null" msgstr "Unable to initialize console, will try /dev/null" #: init/main.c:389 msgid "Unable to initialize console as /dev/null" msgstr "Unable to initialize console as /dev/null" #: init/main.c:405 init/main.c:904 msgid "Unable to set root directory" msgstr "Unable to set root directory" #: init/main.c:418 msgid "Unable to mount /proc filesystem" msgstr "Unable to mount /proc filesystem" #: init/main.c:428 msgid "Unable to mount /sys filesystem" msgstr "Unable to mount /sys filesystem" #: init/main.c:551 init/main.c:557 msgid "Unable to set default oom score" msgstr "Unable to set default oom score" #: init/main.c:566 msgid "Stateful re-exec supported but stateless re-exec requested" msgstr "Stateful re-exec supported but stateless re-exec requested" #: init/main.c:580 msgid "Failed to read serialisation data" msgstr "Failed to read serialisation data" #: init/main.c:581 init/state.c:2060 msgid "reverting to stateless re-exec" msgstr "reverting to stateless re-exec" #: init/main.c:593 msgid "Both stateful and stateless re-execs failed" msgstr "Both stateful and stateless re-execs failed" #: init/main.c:663 msgid "Unable to listen for private connections" msgstr "Unable to listen for private connections" #: init/main.c:677 #, c-format msgid "Not connecting to %s bus" msgstr "Not connecting to %s bus" #: init/main.c:702 msgid "Unable to setup standard file descriptors" msgstr "Unable to setup standard file descriptors" #: init/main.c:758 msgid "Unable to register as subreaper" msgstr "Unable to register as subreaper" #: init/main.c:921 #, c-format msgid "Caught %s, core dumped" msgstr "Caught %s, core dumped" #: init/main.c:925 #, c-format msgid "Caught %s, unable to dump core" msgstr "Caught %s, unable to dump core" #: init/main.c:956 #, c-format msgid "Re-executing %s" msgstr "Re-executing %s" #: init/main.c:1049 #, c-format msgid "Reconnecting to D-Bus %s bus" msgstr "Reconnecting to D-Bus %s bus" #: init/main.c:1056 #, c-format msgid "Unable to connect to the D-Bus %s bus: %s" msgstr "Unable to connect to the D-Bus %s bus: %s" #: init/main.c:1135 msgid "invalid console type specified" msgstr "invalid console type specified" #: init/process.c:80 msgid "main" msgstr "main" #: init/quiesce.c:127 msgid "logout" msgstr "logout" #: init/quiesce.c:127 msgid "shutdown" msgstr "shutdown" #: init/quiesce.c:129 #, c-format msgid "Quiescing due to %s request" msgstr "Quiescing due to %s request" #: init/quiesce.c:313 #, c-format msgid "Quiesce %s sequence took %s%d second%s" msgstr "Quiesce %s sequence took %s%d second%s" #: init/state.c:369 init/state.c:377 init/state.c:390 init/state.c:405 #: init/state.c:417 init/state.c:426 init/state.c:435 msgid "Failed to serialise" msgstr "Failed to serialise" #: init/state.c:391 msgid "control bus address" msgstr "control bus address" #: init/state.c:406 init/state.c:531 init/state.c:535 msgid "cgroup manager address" msgstr "cgroup manager address" #: init/state.c:492 msgid "Detected invalid serialisation data" msgstr "Detected invalid serialisation data" #: init/state.c:501 init/state.c:506 init/state.c:514 init/state.c:530 #: init/state.c:544 init/state.c:554 init/state.c:562 msgid "Failed to deserialise" msgstr "Failed to deserialise" #: init/state.c:521 msgid "No control details present in state data" msgstr "No control details present in state data" #: init/state.c:548 msgid "No ConfSources present in state data" msgstr "No ConfSources present in state data" #: init/state.c:558 msgid "No global job environment data present in state data" msgstr "No global job environment data present in state data" #: init/state.c:567 msgid "Failed to resolve deserialisation dependencies" msgstr "Failed to resolve deserialisation dependencies" #: init/state.c:1756 msgid "failed to demarshal D-Bus message" msgstr "failed to demarshal D-Bus message" #: init/state.c:2020 #, c-format msgid "Failed to re-execute %s: %s" msgstr "Failed to re-execute %s: %s" #: init/state.c:2059 msgid "Failed to generate serialisation data" msgstr "Failed to generate serialisation data" #: init/state.c:2067 msgid "Performing stateful re-exec" msgstr "Performing stateful re-exec" #: init/state.c:2107 #, c-format msgid "Passing state from PID %d to parent" msgstr "Passing state from PID %d to parent" #: init/state.c:2116 #, c-format msgid "Failed to release D-Bus name: %s" msgstr "Failed to release D-Bus name: %s" #: init/state.c:2125 msgid "Failed to write serialisation data" msgstr "Failed to write serialisation data" #: init/system.c:235 msgid "Unable to create device" msgstr "Unable to create device" #: util/initctl.c:366 msgid "Unable to connect to system bus" msgstr "Unable to connect to system bus" #: util/initctl.c:367 msgid "Unable to connect to session bus" msgstr "Unable to connect to session bus" #: util/initctl.c:376 #, c-format msgid "%s: --dest given without --system\n" msgstr "%s: --dest given without --system\n" #: util/initctl.c:384 msgid "Unable to connect to Upstart" msgstr "Unable to connect to Upstart" #: util/initctl.c:594 util/initctl.c:729 util/initctl.c:857 util/initctl.c:992 #: util/initctl.c:1110 util/initctl.c:1678 util/initctl.c:2913 #, c-format msgid "%s: missing job name\n" msgstr "%s: missing job name\n" #: util/initctl.c:1056 msgid "Not running" msgstr "Not running" #: util/initctl.c:1414 util/initctl.c:1512 #, c-format msgid "%s: missing variable name\n" msgstr "%s: missing variable name\n" #: util/initctl.c:1463 #, c-format msgid "%s: missing variable value\n" msgstr "%s: missing variable value\n" #: util/initctl.c:1743 #, c-format msgid "%s: missing event name\n" msgstr "%s: missing event name\n" #: util/initctl.c:1940 msgid "Invalid job class" msgstr "Invalid job class" #: util/initctl.c:2029 #, c-format msgid "%s: missing D-Bus address\n" msgstr "%s: missing D-Bus address\n" #: util/initctl.c:2074 #, c-format msgid "%s: missing address\n" msgstr "%s: missing address\n" #: util/initctl.c:2122 msgid "Unable to query session directory" msgstr "Unable to query session directory" #: util/initctl.c:2175 msgid "Ignoring stale session file" msgstr "Ignoring stale session file" #: util/initctl.c:2776 msgid "unknown event" msgstr "unknown event" #: util/initctl.c:2780 msgid "unknown job" msgstr "unknown job" #: util/initctl.c:2939 msgid "use existing D-Bus session bus to connect to init daemon (for testing)" msgstr "use existing D-Bus session bus to connect to init daemon (for testing)" #: util/initctl.c:2941 msgid "use D-Bus system bus to connect to init daemon" msgstr "use D-Bus system bus to connect to init daemon" #: util/initctl.c:2943 msgid "destination well-known name on D-Bus bus" msgstr "destination well-known name on D-Bus bus" #: util/initctl.c:2945 msgid "run in user mode (as used for user sessions)" msgstr "run in user mode (as used for user sessions)" #: util/initctl.c:2958 msgid "do not wait for job to start before exiting" msgstr "do not wait for job to start before exiting" #: util/initctl.c:2970 msgid "do not wait for job to stop before exiting" msgstr "do not wait for job to stop before exiting" #: util/initctl.c:2982 msgid "do not wait for job to restart before exiting" msgstr "do not wait for job to restart before exiting" #: util/initctl.c:3021 msgid "do not wait for event to finish before exiting" msgstr "do not wait for event to finish before exiting" #: util/initctl.c:3062 msgid "" "enumerate list of events and jobs causing job created from job config to " "start/stop" msgstr "" "enumerate list of events and jobs causing job created from job config to " "start/stop" #: util/initctl.c:3075 msgid "ignore specified list of events (comma-separated)" msgstr "ignore specified list of events (comma-separated)" #: util/initctl.c:3077 msgid "Generate warning for any unreachable events/jobs" msgstr "Generate warning for any unreachable events/jobs" #: util/initctl.c:3088 util/initctl.c:3101 util/initctl.c:3112 #: util/initctl.c:3123 util/initctl.c:3134 msgid "apply to global job environment table" msgstr "apply to global job environment table" #: util/initctl.c:3090 msgid "do not replace the value of the variable if already set" msgstr "do not replace the value of the variable if already set" #: util/initctl.c:3153 msgid "Job" msgstr "Job" #: util/initctl.c:3160 msgid "Event" msgstr "Event" #: util/initctl.c:3167 msgid "Environment" msgstr "Environment" #: util/initctl.c:3175 util/initctl.c:3187 util/initctl.c:3198 #: util/initctl.c:3209 util/initctl.c:3216 msgid "JOB [KEY=VALUE]..." msgstr "JOB [KEY=VALUE]..." #: util/initctl.c:3176 msgid "Start job." msgstr "Start job." #: util/initctl.c:3177 msgid "" "JOB is the name of the job that is to be started, this may be followed by " "zero or more environment variables to be defined in the new job.\n" "\n" "The environment may also serve to distinguish between job instances, and " "thus decide whether a new instance will be started or an error returned if " "an existing instance is already running." msgstr "" "JOB is the name of the job that is to be started, this may be followed by " "zero or more environment variables to be defined in the new job.\n" "\n" "The environment may also serve to distinguish between job instances, and " "thus decide whether a new instance will be started or an error returned if " "an existing instance is already running." #: util/initctl.c:3188 msgid "Stop job." msgstr "Stop job." #: util/initctl.c:3189 msgid "" "JOB is the name of the job that is to be stopped, this may be followed by " "zero or more environment variables to be passed to the job's pre-stop and " "post-stop processes.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be stopped." msgstr "" "JOB is the name of the job that is to be stopped, this may be followed by " "zero or more environment variables to be passed to the job's pre-stop and " "post-stop processes.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be stopped." #: util/initctl.c:3199 msgid "Restart job." msgstr "Restart job." #: util/initctl.c:3200 msgid "" "JOB is the name of the job that is to be restarted, this may be followed by " "zero or more environment variables to be defined in the job after " "restarting.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be restarted." msgstr "" "JOB is the name of the job that is to be restarted, this may be followed by " "zero or more environment variables to be defined in the job after " "restarting.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be restarted." #: util/initctl.c:3210 msgid "Send HUP signal to job." msgstr "Send HUP signal to job." #: util/initctl.c:3211 msgid "" "JOB is the name of the job that is to be sent the signal, this may be " "followed by zero or more environment variables to distinguish between job " "instances.\n" msgstr "" "JOB is the name of the job that is to be sent the signal, this may be " "followed by zero or more environment variables to distinguish between job " "instances.\n" #: util/initctl.c:3217 msgid "Query status of job." msgstr "Query status of job." #: util/initctl.c:3218 msgid "" "JOB is the name of the job that is to be queried, this may be followed by " "zero or more environment variables to distguish between job instances.\n" msgstr "" "JOB is the name of the job that is to be queried, this may be followed by " "zero or more environment variables to distguish between job instances.\n" #: util/initctl.c:3224 msgid "List known jobs." msgstr "List known jobs." #: util/initctl.c:3225 msgid "The known jobs and their current status will be output." msgstr "The known jobs and their current status will be output." #: util/initctl.c:3228 msgid "EVENT [KEY=VALUE]..." msgstr "EVENT [KEY=VALUE]..." #: util/initctl.c:3229 msgid "Emit an event." msgstr "Emit an event." #: util/initctl.c:3230 msgid "" "EVENT is the name of an event the init daemon should emit, this may be " "followed by zero or more environment variables to be included in the event.\n" msgstr "" "EVENT is the name of an event the init daemon should emit, this may be " "followed by zero or more environment variables to be included in the event.\n" #: util/initctl.c:3236 msgid "Reload the configuration of the init daemon." msgstr "Reload the configuration of the init daemon." #: util/initctl.c:3240 msgid "Request the version of the init daemon." msgstr "Request the version of the init daemon." #: util/initctl.c:3243 msgid "[PRIORITY]" msgstr "[PRIORITY]" #: util/initctl.c:3244 msgid "Change the minimum priority of log messages from the init daemon." msgstr "Change the minimum priority of log messages from the init daemon." #: util/initctl.c:3246 msgid "" "PRIORITY may be one of:\n" " `debug' (messages useful for debugging upstart are logged, equivalent to --" "debug on kernel command-line);\n" " `info' (messages about job goal and state changes, as well as event " "emissions are logged, equivalent to --verbose on the kernel command-line);\n" " `message' (informational and debugging messages are suppressed, the " "default); `warn' (ordinary messages are suppressed whilst still logging " "warnings and errors);\n" " `error' (only errors are logged, equivalent to --quiet on the kernel " "command-line) or\n" " `fatal' (only fatal errors are logged).\n" "\n" "Without arguments, this outputs the current log priority." msgstr "" "PRIORITY may be one of:\n" " ‘debug’ (messages useful for debugging upstart are logged, " "equivalent to --debug on kernel command-line);\n" " ‘info’ (messages about job goal and state changes, as well as event " "emissions are logged, equivalent to --verbose on the kernel command-line);\n" " ‘message’ (informational and debugging messages are suppressed, the " "default); ‘warn’ (ordinary messages are suppressed whilst still " "logging warnings and errors);\n" " ‘error’ (only errors are logged, equivalent to --quiet on the kernel " "command-line) or\n" " ‘fatal’ (only fatal errors are logged).\n" "\n" "Without arguments, this outputs the current log priority." #: util/initctl.c:3263 util/initctl.c:3269 msgid "[CONF]" msgstr "[CONF]" #: util/initctl.c:3264 msgid "Show emits, start on and stop on details for job configurations." msgstr "Show emits, start on and stop on details for job configurations." #: util/initctl.c:3265 msgid "" "If CONF specified, show configuration details for single job configuration, " "else show details for all jobs configurations.\n" msgstr "" "If CONF specified, show configuration details for single job configuration, " "else show details for all jobs configurations.\n" #: util/initctl.c:3270 msgid "Check for unreachable jobs/event conditions." msgstr "Check for unreachable jobs/event conditions." #: util/initctl.c:3271 msgid "" "List all jobs and events which cannot be satisfied by currently available " "job configuration files." msgstr "" "List all jobs and events which cannot be satisfied by currently available " "job configuration files." #: util/initctl.c:3275 util/initctl.c:3285 util/initctl.c:3295 msgid "VARIABLE" msgstr "VARIABLE" #: util/initctl.c:3276 msgid "Retrieve value of a job environment variable." msgstr "Retrieve value of a job environment variable." #: util/initctl.c:3277 msgid "Display the value of a variable from the job environment table." msgstr "Display the value of a variable from the job environment table." #: util/initctl.c:3281 msgid "Show all job environment variables." msgstr "Show all job environment variables." #: util/initctl.c:3282 msgid "" "Displays sorted list of variables and their values from the job environment " "table." msgstr "" "Displays sorted list of variables and their values from the job environment " "table." #: util/initctl.c:3286 msgid "Revert all job environment variable changes." msgstr "Revert all job environment variable changes." #: util/initctl.c:3287 msgid "" "Discards all changes make to the job environment table, setting it back to " "its default value." msgstr "" "Discards all changes make to the job environment table, setting it back to " "its default value." #: util/initctl.c:3290 msgid "VARIABLE[=VALUE]" msgstr "VARIABLE[=VALUE]" #: util/initctl.c:3291 msgid "Set one or more job environment variables." msgstr "Set one or more job environment variables." #: util/initctl.c:3292 msgid "Adds or updates variables in the job environment table." msgstr "Adds or updates variables in the job environment table." #: util/initctl.c:3296 msgid "Remove one or more job environment variables." msgstr "Remove one or more job environment variables." #: util/initctl.c:3297 msgid "Discards variables from the job environment table." msgstr "Discards variables from the job environment table." #: util/initctl.c:3300 msgid "JOB" msgstr "JOB" #: util/initctl.c:3301 msgid "Show job usage message if available." msgstr "Show job usage message if available." #: util/initctl.c:3302 msgid "JOB is the name of the job which usage is to be shown.\n" msgstr "JOB is the name of the job which usage is to be shown.\n" #: util/initctl.c:3306 msgid "Inform Upstart of D-Bus address cgroup manager is available on." msgstr "Inform Upstart of D-Bus address cgroup manager is available on." #: util/initctl.c:3307 msgid "Run to allow Upstart to provide cgroup stanza support." msgstr "Run to allow Upstart to provide cgroup stanza support." #: util/initctl.c:3311 msgid "Inform Upstart of D-Bus address to connect to." msgstr "Inform Upstart of D-Bus address to connect to." #: util/initctl.c:3312 msgid "Run to allow Upstart to provide services over D-Bus." msgstr "Run to allow Upstart to provide services over D-Bus." #: util/initctl.c:3316 msgid "Inform Upstart that disk is now writeable." msgstr "Inform Upstart that disk is now writeable." #: util/initctl.c:3317 msgid "" "Run to ensure output from jobs ending before disk is writeable are flushed " "to disk." msgstr "" "Run to ensure output from jobs ending before disk is writeable are flushed " "to disk." #: util/initctl.c:3322 msgid "List all sessions." msgstr "List all sessions." #: util/initctl.c:3323 msgid "Displays list of running Session Init sessions" msgstr "Displays list of running Session Init sessions" #: util/reboot.c:116 msgid "don't sync before reboot or halt" msgstr "don't sync before reboot or halt" #: util/reboot.c:118 msgid "force reboot or halt, don't call shutdown(8)" msgstr "force reboot or halt, don't call shutdown(8)" #: util/reboot.c:120 msgid "switch off the power when called as halt" msgstr "switch off the power when called as halt" #: util/reboot.c:122 msgid "don't actually reboot or halt, just write wtmp record" msgstr "don't actually reboot or halt, just write wtmp record" #: util/reboot.c:148 msgid "Halt the system." msgstr "Halt the system." #: util/reboot.c:151 msgid "Power off the system." msgstr "Power off the system." #: util/reboot.c:154 msgid "Reboot the system." msgstr "Reboot the system." #: util/reboot.c:158 msgid "" "This command is intended to instruct the kernel to reboot or halt the " "system; when run without the -f option, or when in a system runlevel other " "than 0 or 6, it will actually execute /sbin/shutdown.\n" msgstr "" "This command is intended to instruct the kernel to reboot or halt the " "system; when run without the -f option, or when in a system runlevel other " "than 0 or 6, it will actually execute /sbin/shutdown.\n" #: util/reboot.c:169 util/shutdown.c:370 util/telinit.c:248 msgid "Couldn't set uid." msgstr "Couldn't set uid." #: util/reboot.c:222 msgid "Calling shutdown" msgstr "Calling shutdown" #: util/reboot.c:225 #, c-format msgid "Unable to execute shutdown: %s" msgstr "Unable to execute shutdown: %s" #: util/reboot.c:246 msgid "Rebooting" msgstr "Rebooting" #: util/reboot.c:250 msgid "Halting" msgstr "Halting" #: util/reboot.c:254 msgid "Powering off" msgstr "Powering off" #: util/reboot.c:258 #, c-format msgid "Rebooting with %s" msgstr "Rebooting with %s" #: util/runlevel.c:59 msgid "[UTMP]" msgstr "[UTMP]" #: util/runlevel.c:60 msgid "Output previous and current runlevel." msgstr "Output previous and current runlevel." #: util/runlevel.c:62 msgid "" "The system /var/run/utmp file is used unless the alternate file UTMP is " "given.\n" msgstr "" "The system /var/run/utmp file is used unless the alternate file UTMP is " "given.\n" #: util/shutdown.c:201 msgid "reboot after shutdown" msgstr "reboot after shutdown" #: util/shutdown.c:203 msgid "halt or power off after shutdown" msgstr "halt or power off after shutdown" #: util/shutdown.c:205 msgid "halt after shutdown (implies -h)" msgstr "halt after shutdown (implies -h)" #: util/shutdown.c:207 msgid "power off after shutdown (implies -h)" msgstr "power off after shutdown (implies -h)" #: util/shutdown.c:209 msgid "cancel a running shutdown" msgstr "cancel a running shutdown" #: util/shutdown.c:211 msgid "only send warnings, don't shutdown" msgstr "only send warnings, don't shutdown" #: util/shutdown.c:243 msgid "TIME [MESSAGE]" msgstr "TIME [MESSAGE]" #: util/shutdown.c:244 msgid "Bring the system down." msgstr "Bring the system down." #: util/shutdown.c:246 msgid "" "TIME may have different formats, the most common is simply the word 'now' " "which will bring the system down immediately. Other valid formats are +m, " "where m is the number of minutes to wait until shutting down and hh:mm which " "specifies the time on the 24hr clock.\n" "\n" "Logged in users are warned by a message sent to their terminal, you may " "include an optional MESSAGE included with this. Messages can be sent " "without actually bringing the system down by using the -k option.\n" "\n" "If TIME is given, the command will remain in the foreground until the " "shutdown occurs. It can be cancelled by Control-C, or by another user using " "the -c option.\n" "\n" "The system is brought down into maintenance (single-user) mode by default, " "you can change this with either the -r or -h option which specify a reboot " "or system halt respectively. The -h option can be further modified with -H " "or -P to specify whether to halt the system, or to power it off afterwards. " "The default is left up to the shutdown scripts." msgstr "" "TIME may have different formats, the most common is simply the word " "‘now’ which will bring the system down immediately. Other valid " "formats are +m, where m is the number of minutes to wait until shutting down " "and hh:mm which specifies the time on the 24hr clock.\n" "\n" "Logged in users are warned by a message sent to their terminal, you may " "include an optional MESSAGE included with this. Messages can be sent " "without actually bringing the system down by using the -k option.\n" "\n" "If TIME is given, the command will remain in the foreground until the " "shutdown occurs. It can be cancelled by Control-C, or by another user using " "the -c option.\n" "\n" "The system is brought down into maintenance (single-user) mode by default, " "you can change this with either the -r or -h option which specify a reboot " "or system halt respectively. The -h option can be further modified with -H " "or -P to specify whether to halt the system, or to power it off afterwards. " "The default is left up to the shutdown scripts." #: util/shutdown.c:284 #, c-format msgid "%s: time expected\n" msgstr "%s: time expected\n" #: util/shutdown.c:308 #, c-format msgid "%s: illegal hour value\n" msgstr "%s: illegal hour value\n" #: util/shutdown.c:317 #, c-format msgid "%s: illegal minute value\n" msgstr "%s: illegal minute value\n" #: util/shutdown.c:337 #, c-format msgid "%s: illegal time value\n" msgstr "%s: illegal time value\n" #: util/shutdown.c:384 msgid "Shutdown is not running" msgstr "Shutdown is not running" #: util/shutdown.c:393 msgid "Another shutdown is already running" msgstr "Another shutdown is already running" #: util/shutdown.c:397 msgid "Cannot find pid of running shutdown" msgstr "Cannot find pid of running shutdown" #: util/shutdown.c:411 msgid "Unable to change directory" msgstr "Unable to change directory" #: util/shutdown.c:425 msgid "Unable to write pid file" msgstr "Unable to write pid file" #: util/shutdown.c:524 msgid "Shutdown cancelled" msgstr "Shutdown cancelled" #: util/shutdown.c:609 msgid "The system is going down for power off NOW!" msgstr "The system is going down for power off NOW!" #: util/shutdown.c:622 msgid "The system is going down for halt NOW!" msgstr "The system is going down for halt NOW!" #: util/shutdown.c:635 msgid "The system is going down for maintenance NOW!" msgstr "The system is going down for maintenance NOW!" #: util/shutdown.c:648 msgid "The system is going down for reboot NOW!" msgstr "The system is going down for reboot NOW!" #: util/shutdown.c:695 #, c-format msgid "Unable to fork child-process to warn users: %s" msgstr "Unable to fork child-process to warn users: %s" #: util/shutdown.c:740 #, c-format msgid "Broadcast message from %s@%s" msgstr "Broadcast message from %s@%s" #: util/shutdown.c:742 #, c-format msgid "(%s) at %d:%02d ..." msgstr "(%s) at %d:%02d ..." #: util/telinit.c:195 msgid "set environment variable in the runlevel event" msgstr "set environment variable in the runlevel event" #: util/telinit.c:216 msgid "Change runlevel." msgstr "Change runlevel." #: util/telinit.c:218 msgid "" "RUNLEVEL should be one of 0123456sS, where s and S are considered " "identical.\n" "\n" "RUNLEVEL may also be Q or q to instruct the init daemon to reload its " "configuration, this is rarely necessary since the daemon watches its " "configuration for changes.\n" "\n" "RUNLEVEL may be U or u to instruct the init daemon to re-execute itself, " "this is not recommended since Upstart does not currently preserve its " "state.\n" msgstr "" "RUNLEVEL should be one of 0123456sS, where s and S are considered " "identical.\n" "\n" "RUNLEVEL may also be Q or q to instruct the init daemon to reload its " "configuration, this is rarely necessary since the daemon watches its " "configuration for changes.\n" "\n" "RUNLEVEL may be U or u to instruct the init daemon to re-execute itself, " "this is not recommended since Upstart does not currently preserve its " "state.\n" #: util/telinit.c:235 #, c-format msgid "%s: missing runlevel\n" msgstr "%s: missing runlevel\n" #: util/telinit.c:240 #, c-format msgid "%s: illegal runlevel: %s\n" msgstr "%s: illegal runlevel: %s\n" #: extra/upstart-udev-bridge.c:85 extra/upstart-socket-bridge.c:131 msgid "Detach and run in the background" msgstr "Detach and run in the background" #: extra/upstart-udev-bridge.c:87 msgid "Do not strip non-printable bytes from udev message data" msgstr "Do not strip non-printable bytes from udev message data" #: extra/upstart-udev-bridge.c:106 msgid "Bridge udev events into upstart" msgstr "Bridge udev events into upstart" #: extra/upstart-udev-bridge.c:108 msgid "" "By default, upstart-udev-bridge does not detach from the console and remains " "in the foreground. Use the --daemon option to have it detach." msgstr "" "By default, upstart-udev-bridge does not detach from the console and remains " "in the foreground. Use the --daemon option to have it detach." #: extra/upstart-udev-bridge.c:122 extra/upstart-socket-bridge.c:181 msgid "Could not connect to Upstart" msgstr "Could not connect to Upstart" #: extra/upstart-udev-bridge.c:136 extra/upstart-socket-bridge.c:195 msgid "Could not create Upstart proxy" msgstr "Could not create Upstart proxy" #: extra/upstart-udev-bridge.c:160 extra/upstart-socket-bridge.c:251 msgid "Unable to become daemon" msgstr "Unable to become daemon" #: extra/upstart-udev-bridge.c:336 extra/upstart-socket-bridge.c:665 msgid "Disconnected from Upstart" msgstr "Disconnected from Upstart" #: extra/upstart-socket-bridge.c:149 msgid "Bridge socket events into upstart" msgstr "Bridge socket events into upstart" #: extra/upstart-socket-bridge.c:151 msgid "" "By default, upstart-socket-bridge does not detach from the console and " "remains in the foreground. Use the --daemon option to have it detach." msgstr "" "By default, upstart-socket-bridge does not detach from the console and " "remains in the foreground. Use the --daemon option to have it detach." #: extra/upstart-socket-bridge.c:164 msgid "Could not create epoll descriptor" msgstr "Could not create epoll descriptor" #: extra/upstart-socket-bridge.c:208 msgid "Could not create JobAdded signal connection" msgstr "Could not create JobAdded signal connection" #: extra/upstart-socket-bridge.c:220 msgid "Could not create JobRemoved signal connection" msgstr "Could not create JobRemoved signal connection" #: extra/upstart-socket-bridge.c:232 msgid "Could not obtain job list" msgstr "Could not obtain job list" #: extra/upstart-socket-bridge.c:288 msgid "Error from epoll" msgstr "Error from epoll" #: extra/upstart-socket-bridge.c:369 msgid "Could not send socket event" msgstr "Could not send socket event" #: extra/upstart-socket-bridge.c:684 msgid "Error emitting socket event" msgstr "Error emitting socket event" #: scripts/upstart-monitor.py:65 msgid "WARNING" msgstr "WARNING" #: scripts/upstart-monitor.py:65 msgid "GUI modules not available - falling back to CLI" msgstr "GUI modules not available - falling back to CLI" #: scripts/upstart-monitor.py:287 msgid "Version" msgstr "Version" #: scripts/upstart-monitor.py:334 msgid "Error saving file" msgstr "Error saving file" #: scripts/upstart-monitor.py:351 msgid "No events to save" msgstr "No events to save" #: scripts/upstart-monitor.py:359 msgid "Save File" msgstr "Save File" #: scripts/upstart-monitor.py:487 msgid "Clear events" msgstr "Clear events" #: scripts/upstart-monitor.py:489 msgid "Save events to default file" msgstr "Save events to default file" #: scripts/upstart-monitor.py:491 msgid "Save events to specified file" msgstr "Save events to specified file" #: scripts/upstart-monitor.py:493 msgid "Exit application" msgstr "Exit application" #: scripts/upstart-monitor.py:497 msgid "Application details" msgstr "Application details" #: scripts/upstart-monitor.py:502 msgid "Copy" msgstr "Copy" #: scripts/upstart-monitor.py:559 msgid "Index" msgstr "Index" #: scripts/upstart-monitor.py:563 msgid "Time" msgstr "Time" #: scripts/upstart-monitor.py:567 msgid "Event and environment" msgstr "Event and environment" #: scripts/upstart-monitor.py:592 scripts/upstart-monitor.py:674 msgid "Connected to" msgstr "Connected to" #: scripts/upstart-monitor.py:623 msgid "Upstart Event Monitor" msgstr "Upstart Event Monitor" #: scripts/upstart-monitor.py:627 msgid "run in command-line mode" msgstr "run in command-line mode" #: scripts/upstart-monitor.py:630 msgid "field separator to use for command-line output" msgstr "field separator to use for command-line output" #: scripts/upstart-monitor.py:634 msgid "connect to Upstart via specified D-Bus route" msgstr "connect to Upstart via specified D-Bus route" #: scripts/upstart-monitor.py:672 msgid "console mode" msgstr "console mode" #: scripts/upstart-monitor.py:676 msgid "Columns: time, event and environment" msgstr "Columns: time, event and environment" upstart-1.13.2/po/Rules-quot0000644000175000017500000000337612373101360012647 00000000000000# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header upstart-1.13.2/po/Makefile.in.in0000644000175000017500000003552412373101360013316 00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.17 GETTEXT_MACRO_VERSION = 0.17 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: check-macro-version all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. check-macro-version: @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && $(SHELL) ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/po/upstart.pot0000664000175000017500000011073612402042417013073 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Canonical Ltd. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: upstart 1.13.2\n" "Report-Msgid-Bugs-To: new@bugs.launchpad.net\n" "POT-Creation-Date: 2014-09-04 11:55+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: init/conf.c:505 init/session.c:254 msgid "Unable to load configuration" msgstr "" #: init/conf.c:538 #, c-format msgid "Loading configuration from %s" msgstr "" #: init/conf.c:575 #, c-format msgid "Handling deletion of %s" msgstr "" #: init/conf.c:652 msgid "Unable to watch configuration file" msgstr "" #: init/conf.c:747 msgid "Unable to watch configuration directory" msgstr "" #: init/conf.c:871 msgid "Error while loading configuration file" msgstr "" #: init/conf.c:985 msgid "Configuration directory deleted" msgstr "" #: init/control.c:223 msgid "Connection from private client" msgstr "" #: init/control.c:386 msgid "Disconnected from notified D-Bus bus" msgstr "" #: init/control.c:388 #, c-format msgid "Disconnected from D-Bus %s bus" msgstr "" #: init/control.c:462 msgid "You do not have permission to reload configuration" msgstr "" #: init/control.c:466 init/main.c:1022 msgid "Reloading configuration" msgstr "" #: init/control.c:510 init/control.c:671 msgid "Name may not be empty string" msgstr "" #: init/control.c:541 #, c-format msgid "Unknown job: %s" msgstr "" #: init/control.c:664 msgid "You do not have permission to emit an event" msgstr "" #: init/control.c:679 init/job_class.c:843 init/job_class.c:1066 #: init/job_class.c:1206 init/job_class.c:1342 msgid "Env must be KEY=VALUE pairs" msgstr "" #: init/control.c:831 msgid "You do not have permission to set log priority" msgstr "" #: init/control.c:855 msgid "The log priority given was not recognised" msgstr "" #: init/control.c:907 msgid "You do not have permission to notify disk is writeable" msgstr "" #: init/control.c:953 msgid "Not permissible to notify D-Bus address for PID 1" msgstr "" #: init/control.c:960 msgid "You do not have permission to notify D-Bus address" msgstr "" #: init/control.c:971 init/control.c:1020 init/control.c:1028 #: init/control.c:1223 msgid "Out of Memory" msgstr "" #: init/control.c:1006 msgid "You do not have permission to notify cgroup manager address" msgstr "" #: init/control.c:1197 msgid "You do not have permission to request state" msgstr "" #: init/control.c:1210 msgid "Ignoring state query from chroot session" msgstr "" #: init/control.c:1251 msgid "You do not have permission to request restart" msgstr "" #: init/control.c:1265 msgid "Ignoring restart request from chroot session" msgstr "" #: init/control.c:1269 msgid "Restarting" msgstr "" #: init/control.c:1358 init/control.c:1510 init/control.c:1820 msgid "You do not have permission to modify job environment" msgstr "" #: init/control.c:1365 init/control.c:1517 init/control.c:1827 msgid "Not permissible to modify PID 1 job environment" msgstr "" #: init/control.c:1379 init/control.c:1531 init/control.c:1668 #: init/control.c:1764 init/control.c:1841 msgid "Job may not be empty string" msgstr "" #: init/control.c:1390 msgid "Ignoring set env request from chroot session" msgstr "" #: init/control.c:1402 init/control.c:1464 init/control.c:1552 #: init/control.c:1602 init/control.c:1654 msgid "Variable may not be empty string" msgstr "" #: init/control.c:1542 msgid "Ignoring unset env request from chroot session" msgstr "" #: init/control.c:1572 init/control.c:1712 msgid "No such variable" msgstr "" #: init/control.c:1648 init/control.c:1750 msgid "You do not have permission to query job environment" msgstr "" #: init/control.c:1679 msgid "Ignoring get env request from chroot session" msgstr "" #: init/control.c:1852 msgid "Ignoring reset env request from chroot session" msgstr "" #: init/control.c:1985 msgid "unable to create session file" msgstr "" #: init/control.c:1992 msgid "unable to write session file" msgstr "" #: init/control.c:2041 msgid "You do not have permission to end session" msgstr "" #: init/control.c:2049 msgid "Ignoring session end request from chroot session" msgstr "" #: init/errors.h:63 msgid "Illegal parameter" msgstr "" #: init/errors.h:64 msgid "Unknown parameter" msgstr "" #: init/errors.h:65 init/errors.h:79 msgid "Expected operator" msgstr "" #: init/errors.h:66 msgid "Mismatched braces" msgstr "" #: init/errors.h:67 msgid "Invalid setuid user name does not exist" msgstr "" #: init/errors.h:68 msgid "Invalid setgid group name does not exist" msgstr "" #: init/errors.h:69 msgid "Failed to set security context" msgstr "" #: init/errors.h:70 msgid "Illegal interval, expected number of seconds" msgstr "" #: init/errors.h:71 msgid "Illegal exit status, expected integer" msgstr "" #: init/errors.h:72 msgid "Illegal signal status, expected integer" msgstr "" #: init/errors.h:73 msgid "Illegal file creation mask, expected octal integer" msgstr "" #: init/errors.h:74 msgid "Illegal nice value, expected -20 to 19" msgstr "" #: init/errors.h:75 msgid "Illegal oom adjustment, expected -16 to 15 or 'never'" msgstr "" #: init/errors.h:76 msgid "Illegal oom score adjustment, expected -999 to 1000 or 'never'" msgstr "" #: init/errors.h:77 msgid "Illegal limit, expected 'unlimited' or integer" msgstr "" #: init/errors.h:78 msgid "Expected event" msgstr "" #: init/errors.h:80 msgid "Expected variable name before value" msgstr "" #: init/errors.h:81 msgid "Mismatched parentheses" msgstr "" #: init/errors.h:82 msgid "Name already taken" msgstr "" #: init/event.c:290 #, c-format msgid "Handling %s event" msgstr "" #: init/event.c:488 msgid "Event failed" msgstr "" #: init/job.c:334 #, c-format msgid "%s goal changed from %s to %s" msgstr "" #: init/job.c:409 #, c-format msgid "%s state changed from %s to %s" msgstr "" #: init/job.c:934 init/job.c:972 msgid "Job failed to start" msgstr "" #: init/job.c:947 init/job.c:983 msgid "Job failed while stopping" msgstr "" #: init/job.c:959 init/job.c:994 msgid "Job failed to restart" msgstr "" #: init/job.c:1188 msgid "stop" msgstr "" #: init/job.c:1190 msgid "start" msgstr "" #: init/job.c:1192 msgid "respawn" msgstr "" #: init/job.c:1237 msgid "waiting" msgstr "" #: init/job.c:1239 msgid "starting" msgstr "" #: init/job.c:1241 msgid "security-spawning" msgstr "" #: init/job.c:1243 init/process.c:90 msgid "security" msgstr "" #: init/job.c:1245 msgid "pre-starting" msgstr "" #: init/job.c:1247 init/process.c:82 msgid "pre-start" msgstr "" #: init/job.c:1249 msgid "spawning" msgstr "" #: init/job.c:1251 msgid "spawned" msgstr "" #: init/job.c:1253 msgid "post-starting" msgstr "" #: init/job.c:1255 init/process.c:84 msgid "post-start" msgstr "" #: init/job.c:1257 msgid "running" msgstr "" #: init/job.c:1259 msgid "pre-stopping" msgstr "" #: init/job.c:1261 init/process.c:86 msgid "pre-stop" msgstr "" #: init/job.c:1263 msgid "stopping" msgstr "" #: init/job.c:1265 msgid "killed" msgstr "" #: init/job.c:1267 msgid "post-stopping" msgstr "" #: init/job.c:1269 init/process.c:88 msgid "post-stop" msgstr "" #: init/job.c:1366 init/job.c:1454 init/job.c:1530 init/job.c:1599 #: init/job_class.c:1045 init/job_class.c:1198 init/job_class.c:1334 #, c-format msgid "You do not have permission to modify job: %s" msgstr "" #: init/job.c:1374 init/job_class.c:1122 #, c-format msgid "Job is already running: %s" msgstr "" #: init/job.c:1387 init/job_class.c:1057 #, c-format msgid "Job cannot be started as cgroup manager not available: %s" msgstr "" #: init/job.c:1462 init/job.c:1538 init/job_class.c:1252 init/job_class.c:1387 #, c-format msgid "Job has already been stopped: %s" msgstr "" #: init/job.c:1607 #, c-format msgid "Job is not running: %s" msgstr "" #: init/job.c:2113 init/job_class.c:2268 init/job_class.c:2303 msgid "BUG" msgstr "" #: init/job.c:2114 msgid "instance 'stop on' parse error" msgstr "" #: init/job_class.c:873 init/job_class.c:1096 util/initctl.c:1708 msgid "Usage" msgstr "" #: init/job_class.c:891 init/job_class.c:936 init/job_class.c:1244 #: init/job_class.c:1379 #, c-format msgid "Unknown instance: %s" msgstr "" #: init/job_class.c:2269 msgid "'start on' parse error" msgstr "" #: init/job_class.c:2304 msgid "'stop on' parse error" msgstr "" #: init/job_class.c:2650 msgid "unable to clear CLOEXEC bit on log fd" msgstr "" #: init/job_class.c:2744 #, c-format msgid "Failed to obtain %s instance: %s" msgstr "" #: init/job_process.c:318 init/job_process.c:2472 msgid "Temporary process spawn error" msgstr "" #: init/job_process.c:323 #, c-format msgid "%s %s process (%d)" msgstr "" #: init/job_process.c:448 msgid "cgroup support not available" msgstr "" #: init/job_process.c:452 msgid "cgroup manager not available" msgstr "" #: init/job_process.c:493 msgid "Failed to create pty - disabling logging for job" msgstr "" #: init/job_process.c:540 #, c-format msgid "Pausing %s (%d) [pre-exec] for debug" msgstr "" #: init/job_process.c:664 #, c-format msgid "Failed to open system console: %s" msgstr "" #: init/job_process.c:1070 #, c-format msgid "unable to move script fd: %s" msgstr "" #: init/job_process.c:1075 #, c-format msgid "unable to open console: %s" msgstr "" #: init/job_process.c:1130 #, c-format msgid "unable to set \"%s\" resource limit: %s" msgstr "" #: init/job_process.c:1135 #, c-format msgid "unable to set priority: %s" msgstr "" #: init/job_process.c:1140 #, c-format msgid "unable to set oom adjustment: %s" msgstr "" #: init/job_process.c:1145 #, c-format msgid "unable to change root directory: %s" msgstr "" #: init/job_process.c:1150 #, c-format msgid "unable to change working directory: %s" msgstr "" #: init/job_process.c:1155 #, c-format msgid "unable to set trace: %s" msgstr "" #: init/job_process.c:1160 #, c-format msgid "unable to execute: %s" msgstr "" #: init/job_process.c:1165 #, c-format msgid "unable to getpwnam: %s" msgstr "" #: init/job_process.c:1170 #, c-format msgid "unable to getgrnam: %s" msgstr "" #: init/job_process.c:1175 #, c-format msgid "unable to getpwuid: %s" msgstr "" #: init/job_process.c:1180 #, c-format msgid "unable to getgrgid: %s" msgstr "" #: init/job_process.c:1185 msgid "unable to find setuid user" msgstr "" #: init/job_process.c:1189 msgid "unable to find setgid group" msgstr "" #: init/job_process.c:1193 #, c-format msgid "unable to setuid: %s" msgstr "" #: init/job_process.c:1198 #, c-format msgid "unable to setgid: %s" msgstr "" #: init/job_process.c:1203 #, c-format msgid "unable to chown: %s" msgstr "" #: init/job_process.c:1208 #, c-format msgid "unable to unlockpt: %s" msgstr "" #: init/job_process.c:1213 #, c-format msgid "unable to granpt: %s" msgstr "" #: init/job_process.c:1218 #, c-format msgid "unable to get ptsname: %s" msgstr "" #: init/job_process.c:1223 #, c-format msgid "unable to open pty slave: %s" msgstr "" #: init/job_process.c:1228 #, c-format msgid "unable to modify signal handler: %s" msgstr "" #: init/job_process.c:1233 #, c-format msgid "unable to allocate memory: %s" msgstr "" #: init/job_process.c:1238 #, c-format msgid "unable to initgroups: %s" msgstr "" #: init/job_process.c:1243 #, c-format msgid "unable to switch security profile: %s" msgstr "" #: init/job_process.c:1248 #, c-format msgid "unable to connect to CGManager: %s" msgstr "" #: init/job_process.c:1253 #, c-format msgid "unable to setup cgroup: %s" msgstr "" #: init/job_process.c:1258 #, c-format msgid "unable to enter cgroup: %s" msgstr "" #: init/job_process.c:1263 #, c-format msgid "unable to mark cgroups for removal: %s" msgstr "" #: init/job_process.c:1294 init/job_process.c:1437 #, c-format msgid "Sending %s signal to %s %s process (%d)" msgstr "" #: init/job_process.c:1303 init/job_process.c:1446 #, c-format msgid "Failed to send %s signal to %s %s process (%d): %s" msgstr "" #: init/job_process.c:1507 #, c-format msgid "%s %s process (%d) terminated with status %d" msgstr "" #: init/job_process.c:1512 #, c-format msgid "%s %s process (%d) exited normally" msgstr "" #: init/job_process.c:1527 #, c-format msgid "%s %s process (%d) killed by %s signal" msgstr "" #: init/job_process.c:1531 #, c-format msgid "%s %s process (%d) killed by signal %d" msgstr "" #: init/job_process.c:1545 #, c-format msgid "%s %s process (%d) stopped by %s signal" msgstr "" #: init/job_process.c:1549 #, c-format msgid "%s %s process (%d) stopped by signal %d" msgstr "" #: init/job_process.c:1563 #, c-format msgid "%s %s process (%d) continued by %s signal" msgstr "" #: init/job_process.c:1567 #, c-format msgid "%s %s process (%d) continued by signal %d" msgstr "" #: init/job_process.c:1734 #, c-format msgid "%s respawning too fast, stopped" msgstr "" #: init/job_process.c:1740 #, c-format msgid "%s %s process ended, respawning" msgstr "" #: init/job_process.c:1850 msgid "Failed to add log to unflushed queue" msgstr "" #: init/job_process.c:2027 #, c-format msgid "Failed to set ptrace options for %s %s process (%d): %s" msgstr "" #: init/job_process.c:2040 init/job_process.c:2236 #, c-format msgid "Failed to continue traced %s %s process (%d): %s" msgstr "" #: init/job_process.c:2080 init/job_process.c:2172 init/job_process.c:2227 #, c-format msgid "Failed to detach traced %s %s process (%d): %s" msgstr "" #: init/job_process.c:2120 #, c-format msgid "Failed to deliver signal to traced %s %s process (%d): %s" msgstr "" #: init/job_process.c:2156 #, c-format msgid "Failed to obtain child process id for %s %s process (%d): %s" msgstr "" #: init/job_process.c:2163 #, c-format msgid "%s %s process (%d) became new process (%d)" msgstr "" #: init/job_process.c:2222 #, c-format msgid "%s %s process (%d) executable changed" msgstr "" #: init/job_process.c:2482 #, c-format msgid "Failed to spawn %s %s process: %s" msgstr "" #: init/log.c:354 msgid "Failed to write to log file" msgstr "" #: init/main.c:171 msgid "specify additional directory to load configuration files from" msgstr "" #: init/main.c:174 msgid "enable chroot sessions" msgstr "" #: init/main.c:177 msgid "specify alternative directory to load configuration files from" msgstr "" #: init/main.c:180 msgid "default value for console stanza" msgstr "" #: init/main.c:183 msgid "specify alternative directory to store job output logs in" msgstr "" #: init/main.c:187 msgid "do not support cgroups" msgstr "" #: init/main.c:191 msgid "do not connect to a D-Bus bus" msgstr "" #: init/main.c:194 msgid "jobs will not inherit environment of init" msgstr "" #: init/main.c:197 msgid "disable job logging" msgstr "" #: init/main.c:200 msgid "do not emit any startup event (for testing)" msgstr "" #: init/main.c:203 msgid "specify additional initial directory to load configuration files from" msgstr "" #: init/main.c:207 msgid "flag a re-exec has occurred" msgstr "" #: init/main.c:211 msgid "specify file descriptor to read serialisation data from" msgstr "" #: init/main.c:214 msgid "use D-Bus session bus rather than system bus (for testing)" msgstr "" #: init/main.c:217 msgid "specify an alternative initial event (for testing)" msgstr "" #: init/main.c:220 msgid "start in user mode (as used for user sessions)" msgstr "" #: init/main.c:223 msgid "attempt to write state file on every re-exec" msgstr "" #: init/main.c:248 msgid "Process management daemon." msgstr "" #: init/main.c:250 msgid "" "This daemon is normally executed by the kernel and given process id 1 to " "denote its special status. When executed by a user process, it will " "actually run /sbin/telinit." msgstr "" #: init/main.c:280 util/reboot.c:172 util/shutdown.c:373 util/telinit.c:251 msgid "Need to be root" msgstr "" #: init/main.c:289 msgid "Not being executed as init" msgstr "" #: init/main.c:340 msgid "Unable to mount /dev filesystem" msgstr "" #: init/main.c:349 msgid "Cannot create directory" msgstr "" #: init/main.c:357 msgid "Unable to mount /dev/pts filesystem" msgstr "" #: init/main.c:383 msgid "Unable to initialize console, will try /dev/null" msgstr "" #: init/main.c:389 msgid "Unable to initialize console as /dev/null" msgstr "" #: init/main.c:405 init/main.c:904 msgid "Unable to set root directory" msgstr "" #: init/main.c:418 msgid "Unable to mount /proc filesystem" msgstr "" #: init/main.c:428 msgid "Unable to mount /sys filesystem" msgstr "" #: init/main.c:551 init/main.c:557 msgid "Unable to set default oom score" msgstr "" #: init/main.c:566 msgid "Stateful re-exec supported but stateless re-exec requested" msgstr "" #: init/main.c:580 msgid "Failed to read serialisation data" msgstr "" #: init/main.c:581 init/state.c:2060 msgid "reverting to stateless re-exec" msgstr "" #: init/main.c:593 msgid "Both stateful and stateless re-execs failed" msgstr "" #: init/main.c:663 msgid "Unable to listen for private connections" msgstr "" #: init/main.c:677 #, c-format msgid "Not connecting to %s bus" msgstr "" #: init/main.c:702 msgid "Unable to setup standard file descriptors" msgstr "" #: init/main.c:758 msgid "Unable to register as subreaper" msgstr "" #: init/main.c:921 #, c-format msgid "Caught %s, core dumped" msgstr "" #: init/main.c:925 #, c-format msgid "Caught %s, unable to dump core" msgstr "" #: init/main.c:956 #, c-format msgid "Re-executing %s" msgstr "" #: init/main.c:1049 #, c-format msgid "Reconnecting to D-Bus %s bus" msgstr "" #: init/main.c:1056 #, c-format msgid "Unable to connect to the D-Bus %s bus: %s" msgstr "" #: init/main.c:1135 msgid "invalid console type specified" msgstr "" #: init/process.c:80 msgid "main" msgstr "" #: init/quiesce.c:127 msgid "logout" msgstr "" #: init/quiesce.c:127 msgid "shutdown" msgstr "" #: init/quiesce.c:129 #, c-format msgid "Quiescing due to %s request" msgstr "" #: init/quiesce.c:313 #, c-format msgid "Quiesce %s sequence took %s%d second%s" msgstr "" #: init/state.c:369 init/state.c:377 init/state.c:390 init/state.c:405 #: init/state.c:417 init/state.c:426 init/state.c:435 msgid "Failed to serialise" msgstr "" #: init/state.c:391 msgid "control bus address" msgstr "" #: init/state.c:406 init/state.c:531 init/state.c:535 msgid "cgroup manager address" msgstr "" #: init/state.c:492 msgid "Detected invalid serialisation data" msgstr "" #: init/state.c:501 init/state.c:506 init/state.c:514 init/state.c:530 #: init/state.c:544 init/state.c:554 init/state.c:562 msgid "Failed to deserialise" msgstr "" #: init/state.c:521 msgid "No control details present in state data" msgstr "" #: init/state.c:548 msgid "No ConfSources present in state data" msgstr "" #: init/state.c:558 msgid "No global job environment data present in state data" msgstr "" #: init/state.c:567 msgid "Failed to resolve deserialisation dependencies" msgstr "" #: init/state.c:1756 msgid "failed to demarshal D-Bus message" msgstr "" #: init/state.c:2020 #, c-format msgid "Failed to re-execute %s: %s" msgstr "" #: init/state.c:2059 msgid "Failed to generate serialisation data" msgstr "" #: init/state.c:2067 msgid "Performing stateful re-exec" msgstr "" #: init/state.c:2107 #, c-format msgid "Passing state from PID %d to parent" msgstr "" #: init/state.c:2116 #, c-format msgid "Failed to release D-Bus name: %s" msgstr "" #: init/state.c:2125 msgid "Failed to write serialisation data" msgstr "" #: init/system.c:235 msgid "Unable to create device" msgstr "" #: util/initctl.c:366 msgid "Unable to connect to system bus" msgstr "" #: util/initctl.c:367 msgid "Unable to connect to session bus" msgstr "" #: util/initctl.c:376 #, c-format msgid "%s: --dest given without --system\n" msgstr "" #: util/initctl.c:384 msgid "Unable to connect to Upstart" msgstr "" #: util/initctl.c:594 util/initctl.c:729 util/initctl.c:857 util/initctl.c:992 #: util/initctl.c:1110 util/initctl.c:1678 util/initctl.c:2913 #, c-format msgid "%s: missing job name\n" msgstr "" #: util/initctl.c:1056 msgid "Not running" msgstr "" #: util/initctl.c:1414 util/initctl.c:1512 #, c-format msgid "%s: missing variable name\n" msgstr "" #: util/initctl.c:1463 #, c-format msgid "%s: missing variable value\n" msgstr "" #: util/initctl.c:1743 #, c-format msgid "%s: missing event name\n" msgstr "" #: util/initctl.c:1940 msgid "Invalid job class" msgstr "" #: util/initctl.c:2029 #, c-format msgid "%s: missing D-Bus address\n" msgstr "" #: util/initctl.c:2074 #, c-format msgid "%s: missing address\n" msgstr "" #: util/initctl.c:2122 msgid "Unable to query session directory" msgstr "" #: util/initctl.c:2175 msgid "Ignoring stale session file" msgstr "" #: util/initctl.c:2776 msgid "unknown event" msgstr "" #: util/initctl.c:2780 msgid "unknown job" msgstr "" #: util/initctl.c:2939 msgid "use existing D-Bus session bus to connect to init daemon (for testing)" msgstr "" #: util/initctl.c:2941 msgid "use D-Bus system bus to connect to init daemon" msgstr "" #: util/initctl.c:2943 msgid "destination well-known name on D-Bus bus" msgstr "" #: util/initctl.c:2945 msgid "run in user mode (as used for user sessions)" msgstr "" #: util/initctl.c:2958 msgid "do not wait for job to start before exiting" msgstr "" #: util/initctl.c:2970 msgid "do not wait for job to stop before exiting" msgstr "" #: util/initctl.c:2982 msgid "do not wait for job to restart before exiting" msgstr "" #: util/initctl.c:3021 msgid "do not wait for event to finish before exiting" msgstr "" #: util/initctl.c:3062 msgid "" "enumerate list of events and jobs causing job created from job config to " "start/stop" msgstr "" #: util/initctl.c:3075 msgid "ignore specified list of events (comma-separated)" msgstr "" #: util/initctl.c:3077 msgid "Generate warning for any unreachable events/jobs" msgstr "" #: util/initctl.c:3088 util/initctl.c:3101 util/initctl.c:3112 #: util/initctl.c:3123 util/initctl.c:3134 msgid "apply to global job environment table" msgstr "" #: util/initctl.c:3090 msgid "do not replace the value of the variable if already set" msgstr "" #: util/initctl.c:3153 msgid "Job" msgstr "" #: util/initctl.c:3160 msgid "Event" msgstr "" #: util/initctl.c:3167 msgid "Environment" msgstr "" #: util/initctl.c:3175 util/initctl.c:3187 util/initctl.c:3198 #: util/initctl.c:3209 util/initctl.c:3216 msgid "JOB [KEY=VALUE]..." msgstr "" #: util/initctl.c:3176 msgid "Start job." msgstr "" #: util/initctl.c:3177 msgid "" "JOB is the name of the job that is to be started, this may be followed by " "zero or more environment variables to be defined in the new job.\n" "\n" "The environment may also serve to distinguish between job instances, and " "thus decide whether a new instance will be started or an error returned if " "an existing instance is already running." msgstr "" #: util/initctl.c:3188 msgid "Stop job." msgstr "" #: util/initctl.c:3189 msgid "" "JOB is the name of the job that is to be stopped, this may be followed by " "zero or more environment variables to be passed to the job's pre-stop and " "post-stop processes.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be stopped." msgstr "" #: util/initctl.c:3199 msgid "Restart job." msgstr "" #: util/initctl.c:3200 msgid "" "JOB is the name of the job that is to be restarted, this may be followed by " "zero or more environment variables to be defined in the job after " "restarting.\n" "\n" "The environment also serves to distinguish between job instances, and thus " "decide which of multiple instances will be restarted." msgstr "" #: util/initctl.c:3210 msgid "Send HUP signal to job." msgstr "" #: util/initctl.c:3211 msgid "" "JOB is the name of the job that is to be sent the signal, this may be " "followed by zero or more environment variables to distinguish between job " "instances.\n" msgstr "" #: util/initctl.c:3217 msgid "Query status of job." msgstr "" #: util/initctl.c:3218 msgid "" "JOB is the name of the job that is to be queried, this may be followed by " "zero or more environment variables to distguish between job instances.\n" msgstr "" #: util/initctl.c:3224 msgid "List known jobs." msgstr "" #: util/initctl.c:3225 msgid "The known jobs and their current status will be output." msgstr "" #: util/initctl.c:3228 msgid "EVENT [KEY=VALUE]..." msgstr "" #: util/initctl.c:3229 msgid "Emit an event." msgstr "" #: util/initctl.c:3230 msgid "" "EVENT is the name of an event the init daemon should emit, this may be " "followed by zero or more environment variables to be included in the event.\n" msgstr "" #: util/initctl.c:3236 msgid "Reload the configuration of the init daemon." msgstr "" #: util/initctl.c:3240 msgid "Request the version of the init daemon." msgstr "" #: util/initctl.c:3243 msgid "[PRIORITY]" msgstr "" #: util/initctl.c:3244 msgid "Change the minimum priority of log messages from the init daemon." msgstr "" #: util/initctl.c:3246 msgid "" "PRIORITY may be one of:\n" " `debug' (messages useful for debugging upstart are logged, equivalent to --" "debug on kernel command-line);\n" " `info' (messages about job goal and state changes, as well as event " "emissions are logged, equivalent to --verbose on the kernel command-line);\n" " `message' (informational and debugging messages are suppressed, the " "default); `warn' (ordinary messages are suppressed whilst still logging " "warnings and errors);\n" " `error' (only errors are logged, equivalent to --quiet on the kernel " "command-line) or\n" " `fatal' (only fatal errors are logged).\n" "\n" "Without arguments, this outputs the current log priority." msgstr "" #: util/initctl.c:3263 util/initctl.c:3269 msgid "[CONF]" msgstr "" #: util/initctl.c:3264 msgid "Show emits, start on and stop on details for job configurations." msgstr "" #: util/initctl.c:3265 msgid "" "If CONF specified, show configuration details for single job configuration, " "else show details for all jobs configurations.\n" msgstr "" #: util/initctl.c:3270 msgid "Check for unreachable jobs/event conditions." msgstr "" #: util/initctl.c:3271 msgid "" "List all jobs and events which cannot be satisfied by currently available " "job configuration files." msgstr "" #: util/initctl.c:3275 util/initctl.c:3285 util/initctl.c:3295 msgid "VARIABLE" msgstr "" #: util/initctl.c:3276 msgid "Retrieve value of a job environment variable." msgstr "" #: util/initctl.c:3277 msgid "Display the value of a variable from the job environment table." msgstr "" #: util/initctl.c:3281 msgid "Show all job environment variables." msgstr "" #: util/initctl.c:3282 msgid "" "Displays sorted list of variables and their values from the job environment " "table." msgstr "" #: util/initctl.c:3286 msgid "Revert all job environment variable changes." msgstr "" #: util/initctl.c:3287 msgid "" "Discards all changes make to the job environment table, setting it back to " "its default value." msgstr "" #: util/initctl.c:3290 msgid "VARIABLE[=VALUE]" msgstr "" #: util/initctl.c:3291 msgid "Set one or more job environment variables." msgstr "" #: util/initctl.c:3292 msgid "Adds or updates variables in the job environment table." msgstr "" #: util/initctl.c:3296 msgid "Remove one or more job environment variables." msgstr "" #: util/initctl.c:3297 msgid "Discards variables from the job environment table." msgstr "" #: util/initctl.c:3300 msgid "JOB" msgstr "" #: util/initctl.c:3301 msgid "Show job usage message if available." msgstr "" #: util/initctl.c:3302 msgid "JOB is the name of the job which usage is to be shown.\n" msgstr "" #: util/initctl.c:3306 msgid "Inform Upstart of D-Bus address cgroup manager is available on." msgstr "" #: util/initctl.c:3307 msgid "Run to allow Upstart to provide cgroup stanza support." msgstr "" #: util/initctl.c:3311 msgid "Inform Upstart of D-Bus address to connect to." msgstr "" #: util/initctl.c:3312 msgid "Run to allow Upstart to provide services over D-Bus." msgstr "" #: util/initctl.c:3316 msgid "Inform Upstart that disk is now writeable." msgstr "" #: util/initctl.c:3317 msgid "" "Run to ensure output from jobs ending before disk is writeable are flushed " "to disk." msgstr "" #: util/initctl.c:3322 msgid "List all sessions." msgstr "" #: util/initctl.c:3323 msgid "Displays list of running Session Init sessions" msgstr "" #: util/reboot.c:116 msgid "don't sync before reboot or halt" msgstr "" #: util/reboot.c:118 msgid "force reboot or halt, don't call shutdown(8)" msgstr "" #: util/reboot.c:120 msgid "switch off the power when called as halt" msgstr "" #: util/reboot.c:122 msgid "don't actually reboot or halt, just write wtmp record" msgstr "" #: util/reboot.c:148 msgid "Halt the system." msgstr "" #: util/reboot.c:151 msgid "Power off the system." msgstr "" #: util/reboot.c:154 msgid "Reboot the system." msgstr "" #: util/reboot.c:158 msgid "" "This command is intended to instruct the kernel to reboot or halt the " "system; when run without the -f option, or when in a system runlevel other " "than 0 or 6, it will actually execute /sbin/shutdown.\n" msgstr "" #: util/reboot.c:169 util/shutdown.c:370 util/telinit.c:248 msgid "Couldn't set uid." msgstr "" #: util/reboot.c:222 msgid "Calling shutdown" msgstr "" #: util/reboot.c:225 #, c-format msgid "Unable to execute shutdown: %s" msgstr "" #: util/reboot.c:246 msgid "Rebooting" msgstr "" #: util/reboot.c:250 msgid "Halting" msgstr "" #: util/reboot.c:254 msgid "Powering off" msgstr "" #: util/reboot.c:258 #, c-format msgid "Rebooting with %s" msgstr "" #: util/runlevel.c:59 msgid "[UTMP]" msgstr "" #: util/runlevel.c:60 msgid "Output previous and current runlevel." msgstr "" #: util/runlevel.c:62 msgid "" "The system /var/run/utmp file is used unless the alternate file UTMP is " "given.\n" msgstr "" #: util/shutdown.c:201 msgid "reboot after shutdown" msgstr "" #: util/shutdown.c:203 msgid "halt or power off after shutdown" msgstr "" #: util/shutdown.c:205 msgid "halt after shutdown (implies -h)" msgstr "" #: util/shutdown.c:207 msgid "power off after shutdown (implies -h)" msgstr "" #: util/shutdown.c:209 msgid "cancel a running shutdown" msgstr "" #: util/shutdown.c:211 msgid "only send warnings, don't shutdown" msgstr "" #: util/shutdown.c:243 msgid "TIME [MESSAGE]" msgstr "" #: util/shutdown.c:244 msgid "Bring the system down." msgstr "" #: util/shutdown.c:246 msgid "" "TIME may have different formats, the most common is simply the word 'now' " "which will bring the system down immediately. Other valid formats are +m, " "where m is the number of minutes to wait until shutting down and hh:mm which " "specifies the time on the 24hr clock.\n" "\n" "Logged in users are warned by a message sent to their terminal, you may " "include an optional MESSAGE included with this. Messages can be sent " "without actually bringing the system down by using the -k option.\n" "\n" "If TIME is given, the command will remain in the foreground until the " "shutdown occurs. It can be cancelled by Control-C, or by another user using " "the -c option.\n" "\n" "The system is brought down into maintenance (single-user) mode by default, " "you can change this with either the -r or -h option which specify a reboot " "or system halt respectively. The -h option can be further modified with -H " "or -P to specify whether to halt the system, or to power it off afterwards. " "The default is left up to the shutdown scripts." msgstr "" #: util/shutdown.c:284 #, c-format msgid "%s: time expected\n" msgstr "" #: util/shutdown.c:308 #, c-format msgid "%s: illegal hour value\n" msgstr "" #: util/shutdown.c:317 #, c-format msgid "%s: illegal minute value\n" msgstr "" #: util/shutdown.c:337 #, c-format msgid "%s: illegal time value\n" msgstr "" #: util/shutdown.c:384 msgid "Shutdown is not running" msgstr "" #: util/shutdown.c:393 msgid "Another shutdown is already running" msgstr "" #: util/shutdown.c:397 msgid "Cannot find pid of running shutdown" msgstr "" #: util/shutdown.c:411 msgid "Unable to change directory" msgstr "" #: util/shutdown.c:425 msgid "Unable to write pid file" msgstr "" #: util/shutdown.c:524 msgid "Shutdown cancelled" msgstr "" #: util/shutdown.c:609 msgid "The system is going down for power off NOW!" msgstr "" #: util/shutdown.c:622 msgid "The system is going down for halt NOW!" msgstr "" #: util/shutdown.c:635 msgid "The system is going down for maintenance NOW!" msgstr "" #: util/shutdown.c:648 msgid "The system is going down for reboot NOW!" msgstr "" #: util/shutdown.c:695 #, c-format msgid "Unable to fork child-process to warn users: %s" msgstr "" #: util/shutdown.c:740 #, c-format msgid "Broadcast message from %s@%s" msgstr "" #: util/shutdown.c:742 #, c-format msgid "(%s) at %d:%02d ..." msgstr "" #: util/telinit.c:195 msgid "set environment variable in the runlevel event" msgstr "" #: util/telinit.c:216 msgid "Change runlevel." msgstr "" #: util/telinit.c:218 msgid "" "RUNLEVEL should be one of 0123456sS, where s and S are considered " "identical.\n" "\n" "RUNLEVEL may also be Q or q to instruct the init daemon to reload its " "configuration, this is rarely necessary since the daemon watches its " "configuration for changes.\n" "\n" "RUNLEVEL may be U or u to instruct the init daemon to re-execute itself, " "this is not recommended since Upstart does not currently preserve its " "state.\n" msgstr "" #: util/telinit.c:235 #, c-format msgid "%s: missing runlevel\n" msgstr "" #: util/telinit.c:240 #, c-format msgid "%s: illegal runlevel: %s\n" msgstr "" #: extra/upstart-udev-bridge.c:85 extra/upstart-socket-bridge.c:131 msgid "Detach and run in the background" msgstr "" #: extra/upstart-udev-bridge.c:87 msgid "Do not strip non-printable bytes from udev message data" msgstr "" #: extra/upstart-udev-bridge.c:106 msgid "Bridge udev events into upstart" msgstr "" #: extra/upstart-udev-bridge.c:108 msgid "" "By default, upstart-udev-bridge does not detach from the console and remains " "in the foreground. Use the --daemon option to have it detach." msgstr "" #: extra/upstart-udev-bridge.c:122 extra/upstart-socket-bridge.c:181 msgid "Could not connect to Upstart" msgstr "" #: extra/upstart-udev-bridge.c:136 extra/upstart-socket-bridge.c:195 msgid "Could not create Upstart proxy" msgstr "" #: extra/upstart-udev-bridge.c:160 extra/upstart-socket-bridge.c:251 msgid "Unable to become daemon" msgstr "" #: extra/upstart-udev-bridge.c:336 extra/upstart-socket-bridge.c:665 msgid "Disconnected from Upstart" msgstr "" #: extra/upstart-socket-bridge.c:149 msgid "Bridge socket events into upstart" msgstr "" #: extra/upstart-socket-bridge.c:151 msgid "" "By default, upstart-socket-bridge does not detach from the console and " "remains in the foreground. Use the --daemon option to have it detach." msgstr "" #: extra/upstart-socket-bridge.c:164 msgid "Could not create epoll descriptor" msgstr "" #: extra/upstart-socket-bridge.c:208 msgid "Could not create JobAdded signal connection" msgstr "" #: extra/upstart-socket-bridge.c:220 msgid "Could not create JobRemoved signal connection" msgstr "" #: extra/upstart-socket-bridge.c:232 msgid "Could not obtain job list" msgstr "" #: extra/upstart-socket-bridge.c:288 msgid "Error from epoll" msgstr "" #: extra/upstart-socket-bridge.c:369 msgid "Could not send socket event" msgstr "" #: extra/upstart-socket-bridge.c:684 msgid "Error emitting socket event" msgstr "" #: scripts/upstart-monitor.py:65 msgid "WARNING" msgstr "" #: scripts/upstart-monitor.py:65 msgid "GUI modules not available - falling back to CLI" msgstr "" #: scripts/upstart-monitor.py:287 msgid "Version" msgstr "" #: scripts/upstart-monitor.py:334 msgid "Error saving file" msgstr "" #: scripts/upstart-monitor.py:351 msgid "No events to save" msgstr "" #: scripts/upstart-monitor.py:359 msgid "Save File" msgstr "" #: scripts/upstart-monitor.py:487 msgid "Clear events" msgstr "" #: scripts/upstart-monitor.py:489 msgid "Save events to default file" msgstr "" #: scripts/upstart-monitor.py:491 msgid "Save events to specified file" msgstr "" #: scripts/upstart-monitor.py:493 msgid "Exit application" msgstr "" #: scripts/upstart-monitor.py:497 msgid "Application details" msgstr "" #: scripts/upstart-monitor.py:502 msgid "Copy" msgstr "" #: scripts/upstart-monitor.py:559 msgid "Index" msgstr "" #: scripts/upstart-monitor.py:563 msgid "Time" msgstr "" #: scripts/upstart-monitor.py:567 msgid "Event and environment" msgstr "" #: scripts/upstart-monitor.py:592 scripts/upstart-monitor.py:674 msgid "Connected to" msgstr "" #: scripts/upstart-monitor.py:623 msgid "Upstart Event Monitor" msgstr "" #: scripts/upstart-monitor.py:627 msgid "run in command-line mode" msgstr "" #: scripts/upstart-monitor.py:630 msgid "field separator to use for command-line output" msgstr "" #: scripts/upstart-monitor.py:634 msgid "connect to Upstart via specified D-Bus route" msgstr "" #: scripts/upstart-monitor.py:672 msgid "console mode" msgstr "" #: scripts/upstart-monitor.py:676 msgid "Columns: time, event and environment" msgstr "" upstart-1.13.2/po/stamp-po0000664000175000017500000000001212402042420012303 00000000000000timestamp upstart-1.13.2/po/en@quot.gmo0000664000175000017500000012146412402042420012756 00000000000000| P!Q!*d!)!)!%!" "&,"&S"'z"'",""#5#U#"t######$+$C$Y$o$$$$$$7$#2%V%j%+n%!%%%%&&*';'#S'w'''A',( -($:(_( ((((+(-(')!F)h))) )#)])2S***$*?*.$+RS+7+++,, ,,,,&,$-*- @-M-^-m-#-$-0-0-9*.d..z.%. .<.!-/O/!k/ /./2/07$0\0!{0"00/00 1=1N1V1h1{1,1.)2,X202,22(2.(3%W32}3,3.3& 4534>i44'44?4.(5*W55(5'555567HF8(97::9:.;D;X; r;;;;b;D<W<h<<<<<<$<(===4O====/=1= +> 7>%E>wk>#@$A,AHA ^AkAA&AAAjCzC CCC,CC- D'9D aD nD-yD,D6D4 ES@E EEEE'E*F#CF@gF$FFF F:G >GHGWG3K7QK)KOK&L-*L+XL(LLuMN$N[9[2\7E\}\.\\\\(\\#]&4][]%o]"]]]]^#^>^X^o^^^^^&^# _-_J_e_%_ ____`&`%A`g`~` ` `:`.`Fafapnab*b)c)Gc%qc"c&c&c'd'0d,Xddddd"e%e=eWeqeeeeeeef4fGfbf|f7f#ffg+g!0gRgrggg4hhh#h i$iCiATi,i i$ii j"jAjFj+cj-jj!jjk4k Fk#gk]k2kl;l$Ul?zl.lRl7-m+*ǘ5 (IS`!.֙,! N o1"š).5<"A d o } % śқ ۛ%,>ks|.ƜΜ=לE>[92ԝ7?.Et}(#Ҟ&%1"Wzɟ1H_v&#ˠ ')D n¡ס%-D a o:{.F,_j5KG|:0*JUEqmNCYc($ o}LbCn;HP5V  0?lEWM P<q,-[y!3fun9aKBp=D]c&Vse4.trxr"g!+@6)-h_^OR>WoX;v ^=eI{+k|vi~b)w&NYaT#DHZ(  f4.', %"1>MS`ygzLSZ8tJ@%kpTwOh8 lx7R:#   \d/7iA\A6$F]3IFsmd2z~/*<9jGUQ`'{[uB21QX}?%s %s process (%d)%s %s process (%d) became new process (%d)%s %s process (%d) continued by %s signal%s %s process (%d) continued by signal %d%s %s process (%d) executable changed%s %s process (%d) exited normally%s %s process (%d) killed by %s signal%s %s process (%d) killed by signal %d%s %s process (%d) stopped by %s signal%s %s process (%d) stopped by signal %d%s %s process (%d) terminated with status %d%s %s process ended, respawning%s goal changed from %s to %s%s respawning too fast, stopped%s state changed from %s to %s%s: --dest given without --system %s: illegal hour value %s: illegal minute value %s: illegal runlevel: %s %s: illegal time value %s: missing D-Bus address %s: missing address %s: missing event name %s: missing job name %s: missing runlevel %s: missing variable name %s: missing variable value %s: time expected 'start on' parse error'stop on' parse error(%s) at %d:%02d ...Adds or updates variables in the job environment table.Another shutdown is already runningApplication detailsBUGBoth stateful and stateless re-execs failedBridge socket events into upstartBridge udev events into upstartBring the system down.Broadcast message from %s@%sBy default, upstart-socket-bridge does not detach from the console and remains in the foreground. Use the --daemon option to have it detach.By default, upstart-udev-bridge does not detach from the console and remains in the foreground. Use the --daemon option to have it detach.Calling shutdownCannot create directoryCannot find pid of running shutdownCaught %s, core dumpedCaught %s, unable to dump coreChange runlevel.Change the minimum priority of log messages from the init daemon.Check for unreachable jobs/event conditions.Clear eventsColumns: time, event and environmentConfiguration directory deletedConnected toConnection from private clientCopyCould not connect to UpstartCould not create JobAdded signal connectionCould not create JobRemoved signal connectionCould not create Upstart proxyCould not create epoll descriptorCould not obtain job listCould not send socket eventCouldn't set uid.Detach and run in the backgroundDetected invalid serialisation dataDiscards all changes make to the job environment table, setting it back to its default value.Discards variables from the job environment table.Disconnected from D-Bus %s busDisconnected from UpstartDisconnected from notified D-Bus busDisplay the value of a variable from the job environment table.Displays list of running Session Init sessionsDisplays sorted list of variables and their values from the job environment table.Do not strip non-printable bytes from udev message dataEVENT [KEY=VALUE]...EVENT is the name of an event the init daemon should emit, this may be followed by zero or more environment variables to be included in the event. Emit an event.Env must be KEY=VALUE pairsEnvironmentError emitting socket eventError from epollError saving fileError while loading configuration fileEventEvent and environmentEvent failedExit applicationExpected eventExpected operatorExpected variable name before valueFailed to add log to unflushed queueFailed to continue traced %s %s process (%d): %sFailed to create pty - disabling logging for jobFailed to deliver signal to traced %s %s process (%d): %sFailed to deserialiseFailed to detach traced %s %s process (%d): %sFailed to generate serialisation dataFailed to obtain %s instance: %sFailed to obtain child process id for %s %s process (%d): %sFailed to open system console: %sFailed to re-execute %s: %sFailed to read serialisation dataFailed to release D-Bus name: %sFailed to resolve deserialisation dependenciesFailed to send %s signal to %s %s process (%d): %sFailed to serialiseFailed to set ptrace options for %s %s process (%d): %sFailed to set security contextFailed to spawn %s %s process: %sFailed to write serialisation dataFailed to write to log fileGUI modules not available - falling back to CLIGenerate warning for any unreachable events/jobsHalt the system.HaltingHandling %s eventHandling deletion of %sIf CONF specified, show configuration details for single job configuration, else show details for all jobs configurations. Ignoring get env request from chroot sessionIgnoring reset env request from chroot sessionIgnoring restart request from chroot sessionIgnoring session end request from chroot sessionIgnoring set env request from chroot sessionIgnoring stale session fileIgnoring state query from chroot sessionIgnoring unset env request from chroot sessionIllegal exit status, expected integerIllegal file creation mask, expected octal integerIllegal interval, expected number of secondsIllegal limit, expected 'unlimited' or integerIllegal nice value, expected -20 to 19Illegal oom adjustment, expected -16 to 15 or 'never'Illegal oom score adjustment, expected -999 to 1000 or 'never'Illegal parameterIllegal signal status, expected integerIndexInform Upstart of D-Bus address cgroup manager is available on.Inform Upstart of D-Bus address to connect to.Inform Upstart that disk is now writeable.Invalid job classInvalid setgid group name does not existInvalid setuid user name does not existJOBJOB [KEY=VALUE]...JOB is the name of the job that is to be queried, this may be followed by zero or more environment variables to distguish between job instances. JOB is the name of the job that is to be restarted, this may be followed by zero or more environment variables to be defined in the job after restarting. The environment also serves to distinguish between job instances, and thus decide which of multiple instances will be restarted.JOB is the name of the job that is to be sent the signal, this may be followed by zero or more environment variables to distinguish between job instances. JOB is the name of the job that is to be started, this may be followed by zero or more environment variables to be defined in the new job. The environment may also serve to distinguish between job instances, and thus decide whether a new instance will be started or an error returned if an existing instance is already running.JOB is the name of the job that is to be stopped, this may be followed by zero or more environment variables to be passed to the job's pre-stop and post-stop processes. The environment also serves to distinguish between job instances, and thus decide which of multiple instances will be stopped.JOB is the name of the job which usage is to be shown. JobJob cannot be started as cgroup manager not available: %sJob failed to restartJob failed to startJob failed while stoppingJob has already been stopped: %sJob is already running: %sJob is not running: %sJob may not be empty stringList all jobs and events which cannot be satisfied by currently available job configuration files.List all sessions.List known jobs.Loading configuration from %sMismatched bracesMismatched parenthesesName already takenName may not be empty stringNeed to be rootNo ConfSources present in state dataNo control details present in state dataNo events to saveNo global job environment data present in state dataNo such variableNot being executed as initNot connecting to %s busNot permissible to modify PID 1 job environmentNot permissible to notify D-Bus address for PID 1Not runningOut of MemoryOutput previous and current runlevel.PRIORITY may be one of: `debug' (messages useful for debugging upstart are logged, equivalent to --debug on kernel command-line); `info' (messages about job goal and state changes, as well as event emissions are logged, equivalent to --verbose on the kernel command-line); `message' (informational and debugging messages are suppressed, the default); `warn' (ordinary messages are suppressed whilst still logging warnings and errors); `error' (only errors are logged, equivalent to --quiet on the kernel command-line) or `fatal' (only fatal errors are logged). Without arguments, this outputs the current log priority.Passing state from PID %d to parentPausing %s (%d) [pre-exec] for debugPerforming stateful re-execPower off the system.Powering offProcess management daemon.Query status of job.Quiesce %s sequence took %s%d second%sQuiescing due to %s requestRUNLEVEL should be one of 0123456sS, where s and S are considered identical. RUNLEVEL may also be Q or q to instruct the init daemon to reload its configuration, this is rarely necessary since the daemon watches its configuration for changes. RUNLEVEL may be U or u to instruct the init daemon to re-execute itself, this is not recommended since Upstart does not currently preserve its state. Re-executing %sReboot the system.RebootingRebooting with %sReconnecting to D-Bus %s busReload the configuration of the init daemon.Reloading configurationRemove one or more job environment variables.Request the version of the init daemon.Restart job.RestartingRetrieve value of a job environment variable.Revert all job environment variable changes.Run to allow Upstart to provide cgroup stanza support.Run to allow Upstart to provide services over D-Bus.Run to ensure output from jobs ending before disk is writeable are flushed to disk.Save FileSave events to default fileSave events to specified fileSend HUP signal to job.Sending %s signal to %s %s process (%d)Set one or more job environment variables.Show all job environment variables.Show emits, start on and stop on details for job configurations.Show job usage message if available.Shutdown cancelledShutdown is not runningStart job.Stateful re-exec supported but stateless re-exec requestedStop job.TIME [MESSAGE]TIME may have different formats, the most common is simply the word 'now' which will bring the system down immediately. Other valid formats are +m, where m is the number of minutes to wait until shutting down and hh:mm which specifies the time on the 24hr clock. Logged in users are warned by a message sent to their terminal, you may include an optional MESSAGE included with this. Messages can be sent without actually bringing the system down by using the -k option. If TIME is given, the command will remain in the foreground until the shutdown occurs. It can be cancelled by Control-C, or by another user using the -c option. The system is brought down into maintenance (single-user) mode by default, you can change this with either the -r or -h option which specify a reboot or system halt respectively. The -h option can be further modified with -H or -P to specify whether to halt the system, or to power it off afterwards. The default is left up to the shutdown scripts.Temporary process spawn errorThe known jobs and their current status will be output.The log priority given was not recognisedThe system /var/run/utmp file is used unless the alternate file UTMP is given. The system is going down for halt NOW!The system is going down for maintenance NOW!The system is going down for power off NOW!The system is going down for reboot NOW!This command is intended to instruct the kernel to reboot or halt the system; when run without the -f option, or when in a system runlevel other than 0 or 6, it will actually execute /sbin/shutdown. This daemon is normally executed by the kernel and given process id 1 to denote its special status. When executed by a user process, it will actually run /sbin/telinit.TimeUnable to become daemonUnable to change directoryUnable to connect to UpstartUnable to connect to session busUnable to connect to system busUnable to connect to the D-Bus %s bus: %sUnable to create deviceUnable to execute shutdown: %sUnable to fork child-process to warn users: %sUnable to initialize console as /dev/nullUnable to initialize console, will try /dev/nullUnable to listen for private connectionsUnable to load configurationUnable to mount /dev filesystemUnable to mount /dev/pts filesystemUnable to mount /proc filesystemUnable to mount /sys filesystemUnable to query session directoryUnable to register as subreaperUnable to set default oom scoreUnable to set root directoryUnable to setup standard file descriptorsUnable to watch configuration directoryUnable to watch configuration fileUnable to write pid fileUnknown instance: %sUnknown job: %sUnknown parameterUpstart Event MonitorUsageVARIABLEVARIABLE[=VALUE]Variable may not be empty stringVersionWARNINGYou do not have permission to emit an eventYou do not have permission to end sessionYou do not have permission to modify job environmentYou do not have permission to modify job: %sYou do not have permission to notify D-Bus addressYou do not have permission to notify cgroup manager addressYou do not have permission to notify disk is writeableYou do not have permission to query job environmentYou do not have permission to reload configurationYou do not have permission to request restartYou do not have permission to request stateYou do not have permission to set log priority[CONF][PRIORITY][UTMP]apply to global job environment tableattempt to write state file on every re-execcancel a running shutdowncgroup manager addresscgroup manager not availablecgroup support not availableconnect to Upstart via specified D-Bus routeconsole modecontrol bus addressdefault value for console stanzadestination well-known name on D-Bus busdisable job loggingdo not connect to a D-Bus busdo not emit any startup event (for testing)do not replace the value of the variable if already setdo not support cgroupsdo not wait for event to finish before exitingdo not wait for job to restart before exitingdo not wait for job to start before exitingdo not wait for job to stop before exitingdon't actually reboot or halt, just write wtmp recorddon't sync before reboot or haltenable chroot sessionsenumerate list of events and jobs causing job created from job config to start/stopfailed to demarshal D-Bus messagefield separator to use for command-line outputflag a re-exec has occurredforce reboot or halt, don't call shutdown(8)halt after shutdown (implies -h)halt or power off after shutdownignore specified list of events (comma-separated)instance 'stop on' parse errorinvalid console type specifiedjobs will not inherit environment of initkilledlogoutmainonly send warnings, don't shutdownpost-startpost-startingpost-stoppost-stoppingpower off after shutdown (implies -h)pre-startpre-startingpre-stoppre-stoppingreboot after shutdownrespawnreverting to stateless re-execrun in command-line moderun in user mode (as used for user sessions)runningsecuritysecurity-spawningset environment variable in the runlevel eventshutdownspawnedspawningspecify additional directory to load configuration files fromspecify additional initial directory to load configuration files fromspecify alternative directory to load configuration files fromspecify alternative directory to store job output logs inspecify an alternative initial event (for testing)specify file descriptor to read serialisation data fromstartstart in user mode (as used for user sessions)startingstopstoppingswitch off the power when called as haltunable to allocate memory: %sunable to change root directory: %sunable to change working directory: %sunable to chown: %sunable to clear CLOEXEC bit on log fdunable to connect to CGManager: %sunable to create session fileunable to enter cgroup: %sunable to execute: %sunable to find setgid groupunable to find setuid userunable to get ptsname: %sunable to getgrgid: %sunable to getgrnam: %sunable to getpwnam: %sunable to getpwuid: %sunable to granpt: %sunable to initgroups: %sunable to mark cgroups for removal: %sunable to modify signal handler: %sunable to move script fd: %sunable to open console: %sunable to open pty slave: %sunable to set "%s" resource limit: %sunable to set oom adjustment: %sunable to set priority: %sunable to set trace: %sunable to setgid: %sunable to setuid: %sunable to setup cgroup: %sunable to switch security profile: %sunable to unlockpt: %sunable to write session fileunknown eventunknown jobuse D-Bus session bus rather than system bus (for testing)use D-Bus system bus to connect to init daemonuse existing D-Bus session bus to connect to init daemon (for testing)waitingProject-Id-Version: upstart 1.13.2 Report-Msgid-Bugs-To: new@bugs.launchpad.net POT-Creation-Date: 2014-09-04 11:55+0100 PO-Revision-Date: 2014-09-04 11:55+0100 Last-Translator: Automatically generated Language-Team: none Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); %s %s process (%d)%s %s process (%d) became new process (%d)%s %s process (%d) continued by %s signal%s %s process (%d) continued by signal %d%s %s process (%d) executable changed%s %s process (%d) exited normally%s %s process (%d) killed by %s signal%s %s process (%d) killed by signal %d%s %s process (%d) stopped by %s signal%s %s process (%d) stopped by signal %d%s %s process (%d) terminated with status %d%s %s process ended, respawning%s goal changed from %s to %s%s respawning too fast, stopped%s state changed from %s to %s%s: --dest given without --system %s: illegal hour value %s: illegal minute value %s: illegal runlevel: %s %s: illegal time value %s: missing D-Bus address %s: missing address %s: missing event name %s: missing job name %s: missing runlevel %s: missing variable name %s: missing variable value %s: time expected ‘start on’ parse error‘stop on’ parse error(%s) at %d:%02d ...Adds or updates variables in the job environment table.Another shutdown is already runningApplication detailsBUGBoth stateful and stateless re-execs failedBridge socket events into upstartBridge udev events into upstartBring the system down.Broadcast message from %s@%sBy default, upstart-socket-bridge does not detach from the console and remains in the foreground. Use the --daemon option to have it detach.By default, upstart-udev-bridge does not detach from the console and remains in the foreground. Use the --daemon option to have it detach.Calling shutdownCannot create directoryCannot find pid of running shutdownCaught %s, core dumpedCaught %s, unable to dump coreChange runlevel.Change the minimum priority of log messages from the init daemon.Check for unreachable jobs/event conditions.Clear eventsColumns: time, event and environmentConfiguration directory deletedConnected toConnection from private clientCopyCould not connect to UpstartCould not create JobAdded signal connectionCould not create JobRemoved signal connectionCould not create Upstart proxyCould not create epoll descriptorCould not obtain job listCould not send socket eventCouldn't set uid.Detach and run in the backgroundDetected invalid serialisation dataDiscards all changes make to the job environment table, setting it back to its default value.Discards variables from the job environment table.Disconnected from D-Bus %s busDisconnected from UpstartDisconnected from notified D-Bus busDisplay the value of a variable from the job environment table.Displays list of running Session Init sessionsDisplays sorted list of variables and their values from the job environment table.Do not strip non-printable bytes from udev message dataEVENT [KEY=VALUE]...EVENT is the name of an event the init daemon should emit, this may be followed by zero or more environment variables to be included in the event. Emit an event.Env must be KEY=VALUE pairsEnvironmentError emitting socket eventError from epollError saving fileError while loading configuration fileEventEvent and environmentEvent failedExit applicationExpected eventExpected operatorExpected variable name before valueFailed to add log to unflushed queueFailed to continue traced %s %s process (%d): %sFailed to create pty - disabling logging for jobFailed to deliver signal to traced %s %s process (%d): %sFailed to deserialiseFailed to detach traced %s %s process (%d): %sFailed to generate serialisation dataFailed to obtain %s instance: %sFailed to obtain child process id for %s %s process (%d): %sFailed to open system console: %sFailed to re-execute %s: %sFailed to read serialisation dataFailed to release D-Bus name: %sFailed to resolve deserialisation dependenciesFailed to send %s signal to %s %s process (%d): %sFailed to serialiseFailed to set ptrace options for %s %s process (%d): %sFailed to set security contextFailed to spawn %s %s process: %sFailed to write serialisation dataFailed to write to log fileGUI modules not available - falling back to CLIGenerate warning for any unreachable events/jobsHalt the system.HaltingHandling %s eventHandling deletion of %sIf CONF specified, show configuration details for single job configuration, else show details for all jobs configurations. Ignoring get env request from chroot sessionIgnoring reset env request from chroot sessionIgnoring restart request from chroot sessionIgnoring session end request from chroot sessionIgnoring set env request from chroot sessionIgnoring stale session fileIgnoring state query from chroot sessionIgnoring unset env request from chroot sessionIllegal exit status, expected integerIllegal file creation mask, expected octal integerIllegal interval, expected number of secondsIllegal limit, expected ‘unlimited’ or integerIllegal nice value, expected -20 to 19Illegal oom adjustment, expected -16 to 15 or ‘never’Illegal oom score adjustment, expected -999 to 1000 or ‘never’Illegal parameterIllegal signal status, expected integerIndexInform Upstart of D-Bus address cgroup manager is available on.Inform Upstart of D-Bus address to connect to.Inform Upstart that disk is now writeable.Invalid job classInvalid setgid group name does not existInvalid setuid user name does not existJOBJOB [KEY=VALUE]...JOB is the name of the job that is to be queried, this may be followed by zero or more environment variables to distguish between job instances. JOB is the name of the job that is to be restarted, this may be followed by zero or more environment variables to be defined in the job after restarting. The environment also serves to distinguish between job instances, and thus decide which of multiple instances will be restarted.JOB is the name of the job that is to be sent the signal, this may be followed by zero or more environment variables to distinguish between job instances. JOB is the name of the job that is to be started, this may be followed by zero or more environment variables to be defined in the new job. The environment may also serve to distinguish between job instances, and thus decide whether a new instance will be started or an error returned if an existing instance is already running.JOB is the name of the job that is to be stopped, this may be followed by zero or more environment variables to be passed to the job's pre-stop and post-stop processes. The environment also serves to distinguish between job instances, and thus decide which of multiple instances will be stopped.JOB is the name of the job which usage is to be shown. JobJob cannot be started as cgroup manager not available: %sJob failed to restartJob failed to startJob failed while stoppingJob has already been stopped: %sJob is already running: %sJob is not running: %sJob may not be empty stringList all jobs and events which cannot be satisfied by currently available job configuration files.List all sessions.List known jobs.Loading configuration from %sMismatched bracesMismatched parenthesesName already takenName may not be empty stringNeed to be rootNo ConfSources present in state dataNo control details present in state dataNo events to saveNo global job environment data present in state dataNo such variableNot being executed as initNot connecting to %s busNot permissible to modify PID 1 job environmentNot permissible to notify D-Bus address for PID 1Not runningOut of MemoryOutput previous and current runlevel.PRIORITY may be one of: ‘debug’ (messages useful for debugging upstart are logged, equivalent to --debug on kernel command-line); ‘info’ (messages about job goal and state changes, as well as event emissions are logged, equivalent to --verbose on the kernel command-line); ‘message’ (informational and debugging messages are suppressed, the default); ‘warn’ (ordinary messages are suppressed whilst still logging warnings and errors); ‘error’ (only errors are logged, equivalent to --quiet on the kernel command-line) or ‘fatal’ (only fatal errors are logged). Without arguments, this outputs the current log priority.Passing state from PID %d to parentPausing %s (%d) [pre-exec] for debugPerforming stateful re-execPower off the system.Powering offProcess management daemon.Query status of job.Quiesce %s sequence took %s%d second%sQuiescing due to %s requestRUNLEVEL should be one of 0123456sS, where s and S are considered identical. RUNLEVEL may also be Q or q to instruct the init daemon to reload its configuration, this is rarely necessary since the daemon watches its configuration for changes. RUNLEVEL may be U or u to instruct the init daemon to re-execute itself, this is not recommended since Upstart does not currently preserve its state. Re-executing %sReboot the system.RebootingRebooting with %sReconnecting to D-Bus %s busReload the configuration of the init daemon.Reloading configurationRemove one or more job environment variables.Request the version of the init daemon.Restart job.RestartingRetrieve value of a job environment variable.Revert all job environment variable changes.Run to allow Upstart to provide cgroup stanza support.Run to allow Upstart to provide services over D-Bus.Run to ensure output from jobs ending before disk is writeable are flushed to disk.Save FileSave events to default fileSave events to specified fileSend HUP signal to job.Sending %s signal to %s %s process (%d)Set one or more job environment variables.Show all job environment variables.Show emits, start on and stop on details for job configurations.Show job usage message if available.Shutdown cancelledShutdown is not runningStart job.Stateful re-exec supported but stateless re-exec requestedStop job.TIME [MESSAGE]TIME may have different formats, the most common is simply the word ‘now’ which will bring the system down immediately. Other valid formats are +m, where m is the number of minutes to wait until shutting down and hh:mm which specifies the time on the 24hr clock. Logged in users are warned by a message sent to their terminal, you may include an optional MESSAGE included with this. Messages can be sent without actually bringing the system down by using the -k option. If TIME is given, the command will remain in the foreground until the shutdown occurs. It can be cancelled by Control-C, or by another user using the -c option. The system is brought down into maintenance (single-user) mode by default, you can change this with either the -r or -h option which specify a reboot or system halt respectively. The -h option can be further modified with -H or -P to specify whether to halt the system, or to power it off afterwards. The default is left up to the shutdown scripts.Temporary process spawn errorThe known jobs and their current status will be output.The log priority given was not recognisedThe system /var/run/utmp file is used unless the alternate file UTMP is given. The system is going down for halt NOW!The system is going down for maintenance NOW!The system is going down for power off NOW!The system is going down for reboot NOW!This command is intended to instruct the kernel to reboot or halt the system; when run without the -f option, or when in a system runlevel other than 0 or 6, it will actually execute /sbin/shutdown. This daemon is normally executed by the kernel and given process id 1 to denote its special status. When executed by a user process, it will actually run /sbin/telinit.TimeUnable to become daemonUnable to change directoryUnable to connect to UpstartUnable to connect to session busUnable to connect to system busUnable to connect to the D-Bus %s bus: %sUnable to create deviceUnable to execute shutdown: %sUnable to fork child-process to warn users: %sUnable to initialize console as /dev/nullUnable to initialize console, will try /dev/nullUnable to listen for private connectionsUnable to load configurationUnable to mount /dev filesystemUnable to mount /dev/pts filesystemUnable to mount /proc filesystemUnable to mount /sys filesystemUnable to query session directoryUnable to register as subreaperUnable to set default oom scoreUnable to set root directoryUnable to setup standard file descriptorsUnable to watch configuration directoryUnable to watch configuration fileUnable to write pid fileUnknown instance: %sUnknown job: %sUnknown parameterUpstart Event MonitorUsageVARIABLEVARIABLE[=VALUE]Variable may not be empty stringVersionWARNINGYou do not have permission to emit an eventYou do not have permission to end sessionYou do not have permission to modify job environmentYou do not have permission to modify job: %sYou do not have permission to notify D-Bus addressYou do not have permission to notify cgroup manager addressYou do not have permission to notify disk is writeableYou do not have permission to query job environmentYou do not have permission to reload configurationYou do not have permission to request restartYou do not have permission to request stateYou do not have permission to set log priority[CONF][PRIORITY][UTMP]apply to global job environment tableattempt to write state file on every re-execcancel a running shutdowncgroup manager addresscgroup manager not availablecgroup support not availableconnect to Upstart via specified D-Bus routeconsole modecontrol bus addressdefault value for console stanzadestination well-known name on D-Bus busdisable job loggingdo not connect to a D-Bus busdo not emit any startup event (for testing)do not replace the value of the variable if already setdo not support cgroupsdo not wait for event to finish before exitingdo not wait for job to restart before exitingdo not wait for job to start before exitingdo not wait for job to stop before exitingdon't actually reboot or halt, just write wtmp recorddon't sync before reboot or haltenable chroot sessionsenumerate list of events and jobs causing job created from job config to start/stopfailed to demarshal D-Bus messagefield separator to use for command-line outputflag a re-exec has occurredforce reboot or halt, don't call shutdown(8)halt after shutdown (implies -h)halt or power off after shutdownignore specified list of events (comma-separated)instance ‘stop on’ parse errorinvalid console type specifiedjobs will not inherit environment of initkilledlogoutmainonly send warnings, don't shutdownpost-startpost-startingpost-stoppost-stoppingpower off after shutdown (implies -h)pre-startpre-startingpre-stoppre-stoppingreboot after shutdownrespawnreverting to stateless re-execrun in command-line moderun in user mode (as used for user sessions)runningsecuritysecurity-spawningset environment variable in the runlevel eventshutdownspawnedspawningspecify additional directory to load configuration files fromspecify additional initial directory to load configuration files fromspecify alternative directory to load configuration files fromspecify alternative directory to store job output logs inspecify an alternative initial event (for testing)specify file descriptor to read serialisation data fromstartstart in user mode (as used for user sessions)startingstopstoppingswitch off the power when called as haltunable to allocate memory: %sunable to change root directory: %sunable to change working directory: %sunable to chown: %sunable to clear CLOEXEC bit on log fdunable to connect to CGManager: %sunable to create session fileunable to enter cgroup: %sunable to execute: %sunable to find setgid groupunable to find setuid userunable to get ptsname: %sunable to getgrgid: %sunable to getgrnam: %sunable to getpwnam: %sunable to getpwuid: %sunable to granpt: %sunable to initgroups: %sunable to mark cgroups for removal: %sunable to modify signal handler: %sunable to move script fd: %sunable to open console: %sunable to open pty slave: %sunable to set “%s” resource limit: %sunable to set oom adjustment: %sunable to set priority: %sunable to set trace: %sunable to setgid: %sunable to setuid: %sunable to setup cgroup: %sunable to switch security profile: %sunable to unlockpt: %sunable to write session fileunknown eventunknown jobuse D-Bus session bus rather than system bus (for testing)use D-Bus system bus to connect to init daemonuse existing D-Bus session bus to connect to init daemon (for testing)waitingupstart-1.13.2/po/boldquot.sed0000644000175000017500000000033112373101360013156 00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g upstart-1.13.2/po/remove-potcdate.sin0000644000175000017500000000066012373101360014446 00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } upstart-1.13.2/po/en@boldquot.header0000644000175000017500000000247112373101360014265 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # upstart-1.13.2/po/quot.sed0000644000175000017500000000023112373101360012314 00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g upstart-1.13.2/po/Makevars0000664000175000017500000000342512373101356012342 00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Canonical Ltd. # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = new@bugs.launchpad.net # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = upstart-1.13.2/missing0000755000175000017500000001533012373101367011625 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: upstart-1.13.2/doc/0000775000175000017500000000000012402042417011044 500000000000000upstart-1.13.2/doc/states.dot0000664000175000017500000000613612373101356013012 00000000000000/* Upstart state machine. * * Generate with: * dot -Tpng -ostates.png states.dot * * Diamonds represent natural rest states in which we need to take an action * to change the goal. * * Ovals represent ordinary states which clear themselves when the process * being run, or the event that was emitted, finishes. * * Rectangles represent additional actions that are taken, they are not * states, instead you should follow through them to the next real state. * * Green arrows are followed while the goal is START. * Red arrows are followed while the goal is STOP. * * Note that from the running state, there are two read arrows leaving it; * these are chosen based on whether there is a process for the job or not. */ digraph { edge [fontsize=10]; waiting [shape=diamond]; starting [label="starting\n(emit starting)"]; security_spawning [label="security-spawning"]; security [label="security"]; pre_starting [label="pre-starting"]; pre_start [label="pre-start"]; spawning [label="spawning"]; spawned [label="spawned\n(wait for pid)"]; post_starting [label="post-starting"]; post_start [label="post-start"]; emit_started [shape=rectangle,label="emit started"]; running [shape=diamond]; pre_stopping [label="pre-stopping"]; pre_stop [label="pre-stop"]; stopping [label="stopping\n(emit stopping)"]; killed [label="killed\n(wait for SIGCHLD)"]; post_stopping [label="post-stopping"]; post_stop [label="post-stop"]; emit_stopped [shape=rectangle,label="emit stopped"]; constraint=false; waiting -> starting [color=green,weight=10]; starting -> security_spawning [color=green,weight=10]; starting -> stopping [color=red]; security_spawning -> security [color=green,weight=10]; security_spawning -> stopping [color=red]; security -> pre_starting [color=green,weight=10]; security -> stopping [color=red]; pre_starting -> pre_start [color=green,weight=10]; pre_starting -> stopping [color=red]; pre_start -> spawning [color=green,weight=10]; pre_start -> stopping [color=red]; spawning -> spawned [color=green,weight=10]; spawning -> stopping [color=red]; spawned -> post_starting [color=green,weight=10]; spawned -> stopping [color=red]; post_starting -> post_start [color=green,weight=10]; post_starting -> stopping [color=red]; post_start -> emit_started -> running [color=green,weight=10]; post_start -> stopping [color=red]; running -> pre_stopping [color=red,fontcolor=red,label="pid > 0",weight=10]; running -> stopping [color=red,fontcolor=red,label="pid == 0"]; running -> stopping [color=green,fontcolor=darkgreen,label="respawn"]; pre_stopping -> pre_stop [color=green,weight=10]; pre_stopping -> pre_stop [color=red,weight=10]; pre_stop -> running [color=green]; pre_stop -> stopping [color=red,weight=10]; stopping -> killed [color=green]; stopping -> killed [color=red]; killed -> post_stopping [color=green]; killed -> post_stopping [color=red]; post_stopping -> post_stop [color=green,weight=10]; post_stopping -> post_stop [color=red]; post_stop -> starting [color=green]; post_stop -> emit_stopped [color=red,weight=10]; emit_stopped -> waiting [color=red]; } upstart-1.13.2/doc/Makefile.in0000664000175000017500000003171512402042374013042 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ upstart-logo.svg \ states.dot \ states.png all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am states.png: states.dot dot -Tpng -o$@ $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/doc/Makefile.am0000664000175000017500000000024312373101356013024 00000000000000## Process this file with automake to produce Makefile.in EXTRA_DIST = \ upstart-logo.svg \ states.dot \ states.png states.png: states.dot dot -Tpng -o$@ $< upstart-1.13.2/doc/upstart-logo.svg0000664000175000017500000001430012373101356014150 00000000000000 image/svg+xml upstart logo Thursday, August 31 2006 Alexandre Vassalotti upstart-1.13.2/doc/states.png0000664000175000017500000053063212402042417013006 00000000000000PNG  IHDRHѷjbKGD IDATxy\eTdq7\0tr7\rAM(Mc4_s,8eͨee\0sR]Md}9\?n9R7y>>f>A)B!B!B!Du!I!B!n$B!I@B ׻ !BJewB+""5kLdd$mڴ! ڷosB! ]EEEYBɓ'dܸq?`L&ׯ_SNԢE +B!xpDFFb2Eb4СC9}4& .]Fg}__*B!CԥKX|%5mڔqa4ݻ7VV[XPP@XX&5ko KSL%!B}Xx{{]bze Uhh(5T}`0]B!j( HBTctz*m۶% qwyU"""k̹st۷ !$D5sYYv-gΜUVL4 H.OWOd2rJ.^H7nkNBQH@p+Wd2;F@uwyұc d2FI&ѺukB!CJ:aŊ+Fz%>  d2LBB~~~% !!"I*ի1L8pFM``  Zjf={ĦMHOOW^F&L% !$D%uqA;v,Fcoow5Rvv6;wd2aٳ'wB!$ Q ٰa&]vQPP!C ߟu]bу Tyzb֭c4hFcwB!&d$77ȑ#quu`ҥdzeFChذac::[.F-[ҥKxquueȑL&rssuT!z$!@^^۷od2eRSS8p 'OfĈ4jH+ԥK d߾}zR!n޼ ",, '''FhdСԩSGBQ$ ?DHHO?Mf.R\v'|ٳg.EGG[EѰaCN`` O39r7g! ~U˩VtЁŋQF{nbccqttd2}t@kaeeŴi(((חWh#}DPP.]ĉ`ʕ$&&2k,@Þ={={6Ν#dR:,[cnP( BwS| (BC0L&k׮%..KMsܹ͛sIJJťk/^dĉ:t?7** L&oܘ-4Ԧ͕C^z <<*^!BT= HBT́0L|$%%ѫW/F#ǏiӦz!CsN̙[o=J)=ʂ x*l-..5kְb ;Fƍ8q"F^zam0@H>E..д CSӦ,B!+ HBTv؁d###&NH&M.J3o<{RRRС 2{4ܸqoā_>O=F!C`wўcabm*%27HNXyx(((z<<ݽǼA]!ⷑ$Db׮]L&֯_ONN `Ɍ3%--7b كO?4Fcoo_EEikNXݺ7=~+llF<hd899=Eږh]rr*K)1Q L)!Ak CUBB5SZPrsOϒ5_B!(IDRR[nd2}vlmm1b'O'@Mnn.?+V $$\hߟ Vff7p4bb*s~S@JJWT?'$D5tu֭[d",, ggg1 6 Z???֭[IIIwFy<==;HOTшӵkEPEA*.N{U}SO+jLײ? !$ Q]z7b2 qƌ;ɓ'ӧO %V XsMhd̘1x{{]b͓7ohՒKFyx@˖EϽ%H !x(H@!ڵk ܹsxyy1fF#}ջ ~L&7n$::v1~xƏO.O@ɩ}׮i_^rD^y奍H5k uB$ :}4&+WrEZhq:u*ڵӻ̙3,_5kpeZnͳ>hCz'~;GbcG]Ӻ >%룄BT2 HBǎ#((Dll,~~~F&MD֭.L.\`ʕL&"""pwwh4Hn.OTY[U8*>uzF66E]jL;-υB.A  d2LBB~~~2yd<<ww E!Diٹs'& 6MϞ= $ GG T֬YCPPnݺf޾B?ODBB{$D-֭[ bǎ hdر888릧aL&;wD)ѣ^i:{իuyD{ަ [Հ$!DH@B\zS'Y NZXz䑢Ժ5Ȥ#Q{H@B$!frh^DLwwDSn]}kH@B$!errFN.qxQWCmQ]DKB!Divvйi*io񔟯3m+ M:I;rА$B!V >;<58}ӂӒ%(TAZ֦NIkS.D5"S"SB.7nɓvlN`mw墖$( HB!*TLL4ӧ!;[צMzAzW-jb'B! Tt,=] I'Nh]N  #C Mi7}Ѣ~AHB!D=zh[q11%G-+ZRpk^' S"SBT+%G~"#:5n.=(֢$!DH@BQefjj-8egkm Rn[E5$SB!DPtmN+> AL\dI!Da6kkpmQk5^<4wբH@B$!5ZvQ-0= gh7GuuXTb'B!}zCASZwTz$L5 !JU-rɵ_HG1[lF !%n݂Ça~m), ~}Ly) HBRrxv[%W$BTSyy|Y{M޽Q'kk]'IQ&_|IdU$B<$ҴLHӁp&ԩAOWѭV$ !4y{WuÜ!BC~>?{vvR>w$!D.r_|QG9O+ZUqeB!D S4(eˢѥ>}Ÿ$ !Q'J$Ѕש2!vM]ڿӧS߾?-*$!]-d!8n X,fTBQ%%i#KimQ#+q$ !*Xь JŠk\w*B!j|î]ڶw/j#LmI@BSdOoaB!Dmu+ LZ.]R߾ po"IqO_/"fXcR<\B!,_ݻ}t48:B0l6$K➒I 7K:!6B!Du~vdh׶~V*% HBǟbKB!oq4lݪM'Ѧ #Gj IQXE `sEB!nFlBSrrQ2Dm-%Iq_d҈F0H"wIB!99ZGm۴-2R7d< ]e$D LRR)))Z斖@AA(HII;AAw''n...4lggY$BT;.hAiVm*5  O?MkP +$!RfWELL eJ^z899l .P׺ IDATXYY`kIIIT 6n*233Knݺxxxn{zzҴiS<==iѢX[[WK!QVfdZ֭RH@SJpϟDFFEnn.u ///h֬eߴiS4iR" թSJG^^%,@||<׮]#>>?ihٲ%mڴuZf͚YFBQɲnx&l Zcy5$!|Ξ= /ܺu |}}KmҲeKt('**HK(,222mZ_.]ڵ+>(]v]v2$BTL{ذAݻkaiDpw׻"I\|{rA?ɓ'ޞGy.]ХK:t@6mлj?SN//p)rrrW:uk׮ٓwB!D͕,_MKOnL;e PvÓ$D9s c߾}DGG@=xGҥ ;w]v]C%??3g/p 9tӯ_?G4@!Vfس`:혿? x HBT7nO?DBBۗӵkW C$??Gw^IMM͍?1aÆѸqcKB!jXV KaaЬ6n4hJIɓe:dРAߟN:Yae69y${eǎѳgO1b;vԻL! aj&ԩ0f ]])xJ)<իٴiW^4hMULv֭[ٺu+qqq0zh&L@Ϟ=.Q!Y`v-,mݪݐv4><=BÙ3goo}FFInݤCcǎeL&gϞUVL8'ʺ%!×_CB<2we(7o7߰j*qww' I&ѵkWѣZ`ڵ+>,SNa-BQe /-[jAn]]J$}DFF'|r;v,&M'{pfݻwj*6l؀R)S0k,|}}.O!Y_Қ;xz̙?CUZ$!ʠb̟֭?Px7nz'tڵk?>Ӈ_R)BTXF^][Twضm=Fd2qI%br ֮]RQFѣGo߮wyB!D ./,] m‚Y/IK߾}ˋÇ~yJ',lll0r!6l?8׻#KB!jٳQjr.A5ζm9r$}Q&M… 1cOGGG m۶ٳ.]ӦM___^J^^mڴܼyD󅲮ʪmiYgݝdrrr:t(;v ;;[[[pssgϞ8pg x7ٶmC ѻ!fRJ_Ҳe};2N(L:S֚pgQ~}fϞMO>q駟-[Yi43]Yڵo̜9s,x0 >ҙ<3ne69udlܸ7xkk ёŋao߮w9B!DkhmWiD#G2h Kr .ƍ?ggg|||<1118qr~RR111W_ Ç3 u4-Dziv|[la߾}l߾0Ν;Wb^m1l0^" !<(<6Νyw*!*?b <==.ʽL&nݺqqqaٲe899ѨQ#vMy'޽{ etЁ0ù|2?4mwwwRg̞={ذaeҥ 9֭ԯ_?RzjVZ_͢EXx1͚5SN:&ӢE {=!5WNж-tXeb'jiӦqI:w)V\IbbFAA111ٳٳgsUk׮у>LRBm͛K$SCO)͛3fޥr7o'Ofʔ)cVVV4k֌޽{ӪU+O?ͦMʵL!੧`N*$лx" cۿ?*^ȑ#曬XBtO˗u~6lf3>JB!DpJlt(G u XRQ=XyrJ-ZDpuueȐ!\[[[KENĉhѢs2{DŽl&l ?΅BkL_ڕxI*z 8;;Sn]Kŋ.ک_>NNNǗ8@YM00 ݞ%I!-6oT_U<222_eQ!HOO'8ְլG0`olW:UYBQ3WxR {2o!l" qG]7B!$kҤ dee4;P x5cewK]챧up\h@l{Rkqg1`>;G= 'p;n? 'Q;~ϯA!Е$ܹ3f_ݻ]]EFFyf^yJ=z㏳`JTu[o1c .ȬN<ؗsl氽%ťqت:4`(TR-̘$r#tQ(RH 4',& m^v:G6d3U䂋%X9v4A0UqR֧>vY^K]KxB!*$kժ6 O||7Uynnn4,\|x[tt4^^^t݊ƽUVƆ_iӦ-[V+ҏ?[uy:gg:p,) \Ƭ976{>89ԯ U;\vH!r 4!["L&KJ%rH'rnQLrsު-4N8ҠРs<.B2(#Mɓ'9tޥСC QFp%ٷoרk׉'xg9x UE׮]ѣ}Y,HN&;%-;e#; 8Ӗ-[vvM-E-&MN4(J'rH%D!4Ҹ-RHH+(ݻwӮ];-[f1R rKn-Y3fp9Z*^INN&44)|x*B ?dx* SwKN~.:u԰a[ L%H&7II_աeF44B;I@5O?ĀضmÆ ӻ&L@pp0Թ= I)Ŕ)Sx뭷hwC ĉ?.^H6mpvvf͚5ooooZjŴix|2]taȐ!LJJQFm2Bc0J|7:t ..D O=_|e^M6f.^H^^M4Ãp;?|'4hРԵ}_NIOOg޼yriFA޽-AO?o 4jԈ%K/3{l>/<<]o<k˖-=ӻwo˩>rw0fԃ.u=ۣqqq,^XR¦啑Q4Nka ؙ3󄄒SQ'wwpsӞ{xh{WעnnU)\t]%tnp,xUsrNiag NA4 7Kª2BT9 HFqwwg9GyٳgZ5;;==K.Q*f\Ey:wK/ݻ۷/_|ӟ<߾}L0/Çz*̙?/6՞_5(dk89ͯNRs[ nK,qđ@׸F 1׹^1 67ޥ“'`S$Q#͘1x&O5FQ:qF-G/?~:O<gΜì[HGẞt}wP֮]˔)S3g/ߡn]mn~^A6/&v6!m_l(P4"}FfsOOm[o?e5K,DK,o?qMl"8r)>#x^x7^xxぇ4BT%D +kkkd]>Ϟ= P?CW^UGV...MM6M%$$(Sekkvܩo߮f̘(@͟?_ݸqC7xr|…*55UU...߾gj޼zw_W5zhu*˖-S...sj޽jɒ%EG͘1Rnj3-ZeX~~wUJJZp+233Վ;xV\Y-YDYYY .Qemm}-D-ԕ+J*~R~o(ԀJiTݺJi+Q)??|R?IsKmS)RRVYUqEmQmUkZ+{퇵VSQ}T PWտտfYp:B(fMNx}fb%F2°ah۶-|I~nmrJ5kݜ7&&={0{l-9777*3??o,^?ҦRMmUm]]U,:A͵ǧhk\k8'\׸~\*DC yhOsӂ%ܿy6ߢ6[nSN{W֕ IDATx˾}hڴi}nm0o<ΝKRR.wt8x"'NСC8pSrȑ{v qqq?pxꩧE-R-8]m/k[llQǾu||PSG%0]QDq W,Sq, PT{g !*$Q۝?1cpuϟϴi%oqI>C2ugȐ!ܹ9s[oaooRG`{=ڴiי>}:}^^^UVR/^{ ///6nH֭(Sr2DEm&9(hٲE2@]%0OQDK, E8ӂ;˪?YUpQA@QDQr[8δŖirf4[ղtLs$7\TP\X8zrzޏ}}9iwv}?p\ (ә={6F'~~~5?;v^x+VGǎeذa}8;;SRR›oԩSkQVVXbSN_ JJ#Oao0G_[,<9ΑIfҴpn\8D8i}PAI\\wG+mQS(//g<1w\˧Tӧ+[F]}:O?4...Vaw4AzOۙ3\]/-M!!csrlei/{\B Å[(F [.b$_> 22W^y[Kŋyؽ{7'OgkD×4ؿ/eP cGhT O Jy䱟)J*)a.݂t#F/Z`"u ȯKLL'dժU=gy=zXKjDfΜ7|Ð!CxW޽ձDKY9iis2lAkWBe//R8J) :ґ Nt"0q_]D'$w3ϰe#<7L=;X^ii)_}o67nGK :h"uOAYRSansKM5H ڴ1 SֱO -tnd.HRp" )pGt=USAm3gӓ)S?MZM,pqyfϞMAA&Mbʔ)th"ןRsa %,M)) ͢ԭO[7s';UL1]pK!Cq3t֙b$ksA}]}JJJ[8q" Q:~O?/ggg^?`u<R4;Ͳsede)":up&M]INڦl%TpOyyyp19vYYY>.))qHPPPOEn(/7@lC\dfBF4gguc-kY:2WzvJ^oz㌳QSA{Nmzw|ǜ~)# `&oFCJAʫ1 HjƏe`nxAHR߾xk~S^x1le+I$q7/?6YQ*AIDDDDOv活a.8f__5,Nv<3+]yw9aMI$Hb R#o$""""5cG_!3>0t9w2d kÏIL" ^uȳ:\%$Y wB|RL <04on^luJO f*SyiNs.vx? uBC)xGo@\DDG̓]_15^c LPQTDDDDzpѣŋ ~{6Sa nSUJA|,`o&]骵 }o@b"BPVfuJx6OVDz[*H""""r}W NNЩy4d׬tH`; 'l:]RAS =O? YR"$x:щ fdw ÎxH81^eqζ/Dk@)Ѭ3T8pqŋS영Lf1iK8HEVA_ZzҗzԻ?SFqCL 'K/´iV'IL}/H j\}Ï2(­2}+""R5<<g0OԾYJA ǬT %pN>NL&""R/eOaȷpE<4AZVSA˚J(%0 5HDDxy]Rj* V'%Єh#Z*H"rY]B!B ]j8H 0Lrv>}̱voiG;2]:R$"W4= '&1ɂD"""5֯p^|t#XQA+;(ҋSK)u""rh zn NT)D뚤_PA+ "t0G"$ 0WWk4ܰ}Չ*WKqgǾQT%$UtIAu""r]rv64 ݻNT)MiJVrɝSnuZAID~mVrʹ,L$""bz`< #QU~,g9kXĜp7ki*u^#[)8q:\ӧOSPP@aa!瓟_aӧ)**Q\\|}?W^^N~/|}wݞ8:V]xyy₫exzzUa[u|"""U㦛`40"N8t+//Ց,`v~ DDDйsgܹ3m۶8 À޽͵$&Mf7DTA6eeeȖ-[عs';wGGGڶmKxx8;vcǎv4KJJ )))ܹL$<Lbb" $$$eN>Mƍ֭;wcǎӡC5jdudgΜ!55;wk.vŖ-[8utޝhe˖VGb$زRRѾWչXjzԱ_ \%##a8::`PTasBBɔжm[ !C4hM6:X >Hiс,da[ QIT\\ڵkYr%ر'''zСC0`4hbΞ=KRRk֬aʕlڴRt!C:t(ͭBZlf"f45VGZ*Hr=믿fҿo#""prҺRyرXbccYf g?1ch&A|<A߾V,g~R ٳ,Y|0`nfF:ҥKYd k׮ٙoq1f˺u]NR)ҊV<ȃ?#F0vXn&'ױSN|r,Y_4h ޽DD6<,= vC<֐LQ egΜaܹЩS'~&MR$ҩS?>s!55p>&ODD*#j_~ G[Rֲ hE+T+$;(׽3g֭6l`Ν<*GRky{{CB\\<oRTTduD-gOX$֋^`uj$vmۖ/vm߿O>޽{[O7a۷qOӶm[x '""1x0\iuJsƙ^b5RT$$$Э[70aw ]תU+ymƌ3޽;]uX IDAT7o:\a~̴:I/Youj$vٳ<Ӈ&M̬YhٲDپ};ݛiӦq9o AeWWA9muj$v!33(>c.\ڵk :H %..>>(:du,-6maTZ!cQ z?~Ցjhx cJu?~<񔕕1`${ iiV@q‰:JRAZɓ <___֯_O``Ցjf͚Ѹq ,JS\Wڵcƍx{{3h N:eu$Z>?3IQD~ɓ)..fŊxxxXVZti322뮻(Qyzzb "##yXhՑDDjV^xO1 I˒%K裏hڴqBvv6#G$77(RM|}}Xx1WQ""u;ZJN!u\ ZsaРA 2(2l0~ix )ӧy޽;C aΝ-**7G!::3gppp7|Ӷ5k#ЦM9B  77E~ѣG2e ϧaÆ888+PZZ g}3|o~lڴ{6mp!FQQQ[iii|MyyUom8::Ǐ7 0}]0}Zդo1DDj|a88XJ3VǨ`rQDsU(VkڴoQVVf$''F\\\v[log*..6>CɓaFhh% 8qDǕ_UA:zѠAcɶ}/lٲk~?uyz-0>0 c{ga)))`}F2\]]m믿6fϞm?$$S^^n4kpvvj>oᆃ9;v={ת&}WrH-u : IIBÆ ˳: ׿hԨ>(QQQ9s6oLXXˆ ȑ#YjU~}n;:U9jOj֬{/իli߾%ۯ=rvv}ѣGN[{[5k3g8p aAYY%%%,\0O8q^^^ks5׻wo `iqCWzX%33u]VG{j?ߪС1tP,M41rrr 02ze?v=c,Xx駍CƑ#G ooo0h;38}aq-SOiii?q`X(--5ڴicFIII\`hhذ}KGjjs7lo(**2 0 GGGcܹs 0C>o̙sN0BCC#G^u`aѲe C]{@7VXalذسgO֧8pѩSK{ZJ N hFÆ )STF6mӟd38xaq!c̘1ѬY3 0ō7h޼Ѹqcq1 WWW#**ضmcL8ј;wO?ۈ0֭[g4aÆ^2)?46mTa;c{?g z6/"7|}}/m,X_P^^nw}FÆ mERDD Rt`'R{-_[nw}WWBqq1$&&Z׾}{{ͧF ,<#sV^ͣ>qVB?͛soTmHM e˖<|r222xgiժ1EDDp:H9{v쀭[u+##~)z!zɰa4hZ|VTqq1Z<<<1b_|7x֢T>B| е+O>i-5#ݻw{}$$$Hbb"*'NV.n:tiTvܹs޽d۶cĦMҽ{wniӦ$5 aƟMiμnh8m׮аՉpJ@~~>;w$55={6gΜۛ@Fǎ ݪ"@aa!iiiʁl۩ShԨ]t[n?08$>im`ӧpУ~VjcW\\Ljj*{e߾}ի9~8NNNjՊVZѺuk' ilGCmtIСCdggmf &<yySJNBhi~*wE=ѣe/,,pݻwn:[ %777<==U9GGǫ>,??KSiiPVVFAAyyy瓗wvşX/H|||hѢ]@@nnnW_DDDT>mu`ZزΟnzΝըj+--KJ?"//ӧOSRRR58ص 777ׯ_],xM4!((//KJK֨ꤟdN2 [gnIIit:ACf1:uɉ-ZТ(0]8W8`fLfQa%/_TĔ+Wt сРy-o5:TRQW=`H!ՒKDDD6PA^9b*wq=zek#ő#7ӄ9//:,C~HDDDDki*)15OKL4d&O!C :>V*H 6nܒ4?Gt_\T·ߚBCaHx 9*T۔㷗-380lyoXFDDDDD Rmf!~'[7?ĜF'"""""׵ Gc#wwӉH-Q Rl,kFpp=ZUDDDDD.2K5 6lmbԤDDDDD;>,F0dyM7i<\/H{[ogCzN&"""""v~ K`Ÿ-[ZLDDDDDt})4o'%IDDDDD k[XZ2tDDDDD [o 5<TDDDDDJނ5E;Ö-'Fi*Twɓ)t}D+g8C1Ŷ/S}8ӈF5MDDDԞtnS1@qekLKCLMv X=f^[?Œmu*V{SzQG=B T""""ڋy쁛n2Pص0aԣSz g8>`2eMA*)3K8zV6[GD.5S~)g"k0HSVS`$pp"0\8ǹ cSéDDDDWA**Ga钒஻TDjF4b cpQpb,cqՂd""""էf RRDFg|9n]#ZDݝI)/;ӂD""""իz RY<DGCn&Ts7%=`8-H$"""R 97f¯"b7S[ԯ6nODDDv-t ǏÖ-0u5Swp%>.;D""""էj Ry9LwVBDjV㋯c_|G? T+Hyy0f 0oTSEj9&|vwh""""եj~ͅ!C !VZ>>BTY撙9x $%%1| qtt]vу^zѫW/:w[]O#YY摣P#&Xa̷~w}GBBEEE4oޜ^zq=ЩS':vH6mj$]LRRRعs' ̜9cǎѨQ#>|87p;w""""? ѣo__:#UVVFll,-bŊ㏴lْn{޽{hu+jӦ mڴaĈ}gƍY~iӦ 7WEDDz RQ eet)WS,D,XE8v={o$"";^9(( &Mal߾+V_мysn6Nzau\~ۘ4[hٲ"EEEE̚5PٰaO>$lڴ'|.]u9%vSO=EBBYYYL>uE5kEEEVG: GH)**_'88{p֬Y֭[y:bf֭Z0{1BBBx78{EDw9֏_;olls!1D9̡ ȡD'N%S"B(9(y#0lYv]zoG$庛{ IDATы/BYIvS\9ƌÓO>ɡC?>7:xG9x ݺu7ߤ\r|'XQDDD.Hз/ogC$?SR%^z%x :ĻKR{q!tСC dٲeVG\ öm0s&dC$rqhݺ55*Th9ǏԫW-ZеkElEDDD;gW\9"؎TR۷j*k)bu\Xb̚5+VeTҥK%"""Н һ•+G6+жm[qo#.]+]aOn:-[F 5jԈKzjzaun]v;駳9H5i$.\?@ppqlFÆ 7o磏>:p.HVիqD?^zѣGbu裏3l0mfun]~5;l#7 :u2bdu2l0cd5j5kQDDD$繹 ]k$~gV^{g Сpx{{_ﯿ( {rJ/_nYn.HǏC|<ԬiAO>y6wѢE1[n&zf͚'XCDDDr 棟_6G{N>/by1ѣGiݺ5N: ݺucҥ9s("""\2ixl"^tZj%If9r$Æ ޞpz-zEڵ aΝ{EƏO^4huw!==SbggyIs?~|澴4V^͠A'66ƍST)N:ܹsٳ'T믿&22'NfΜvvv7+W0gokֺukXfMrƍ3 0^g„ Fų ooo#==0 xnj'OFݍcCCC ___#11HMM5BCC'|Hi XpaQL"2%''ׯ7\]] 7nb O>獄0*V70 㥗^2c׮]:dk~nPhQcĉYzLo~tW ojLאKų8}4~!ǘ1cpuue̜93g1k֬a߾}X={`z GGQ''>6c קdɒ߿}9aw|L8/YfѧO/NlllCDDDr' ,dooOZZZ~;&(($<<< 000nZnͯ @%2ɉ^zu(W7Vw.\~3fp1 ~yw^II$ eH?ΟIӦMٺu+ 6䫯… DGGtǤ,6la0qD"""W7nOGaʕ[¡Ccއ}\"""b{G\\gΜW#3wfȑ\onݺꫯGq%}]Fy|dd$+Vvlڴ~>s$(&&:u9 +)))y ݽ1õJ*œO>ԩS^o$$$Oҥw>77puwwpvppOOrdOOpt}{xg2d*""" Hjڴ),\^z8q"}LJΝ;sG6m(_III̞=Bǎ9qgƌSO=ILL`儆re,>׎\;^E۩Vu9rʕ_k-X777XNNiipx… .ŋp/5ts)-}˗Ϝ$TޒY<<”/nn,] 緸oLDDD$,?~6mʼy %$$D^8u7棏>ٙUV1p@,X%Kh۶-gnYnmڴaƌ0~xΜ9äIXr%SN%00=믿NLL C ᩧF$%%1vX;ƤIݻ7cǎ_d޼y76mJϞ=F#$$7__sGҥKfi:sj~{k /^由e~]Na"""6θqssgYD~gZn :NB͚5 '_|YvkҨQ#-[ƣ>erXWDsxL/QQ\>վ{RD&`.s-NrCXucB,ֲeK~aΚ5kޝnڴim6KQzz:Ç'$$$w#0/+TUjղṱU *|LHӧѬkݺ4Pe៹ȽPA|7W^y89ի0`ɜ?ݻwgz-O6oޜ5{t,_-O]Fnn7)["Py_wI,$lPfM&L /@PPP悪ϏTY`h?X|9o&SL'GVLz%*1c={`Z8uܮ$jY*Rus__]'"" H6y CQFVGTҥٻwog<ٓg V?nNZoګZ={fL@Q-ED d/Zh… :RtR:vH6mq^[bP3Nqqfy:u N'}{o>9TYJ4Y}H$5k}UV{ 4XyaL0_~={2mڴp%3 /Tǟ=kkKp(> 7_[epq1 Svmy*YҼhQM."_plөPCeÆ |xxxX-O8w{f…;aÆi@5OOsTǥF]{ߡC;arH@2`^WYʔy2f¾""9 xWUݺuJ*|glhŋyHNNfٲe Cg竗+W_p9 _HԖ-Sb%Q'??ҥǒ%5 %"b+bG}]v /ЪU+x }-ju\%66!CwѥK&NH"E%,:JA>&9,Ou2"Wחrt4SFatiidTD$K XhѢ̝;%K0p@ʕ+s=K/S_NwO?Xb,]͛[K\]Bs͢s5fJM5sq1G2 SٲoI*H"9DV eڴi;SS߬5c>̔)SO>駟h"MѢVͯ#N7]য়rH SrW/""w$8;;3`z͔)SVd^ƧYDF `¾}={6saڴiTT6mТE 6lS%%%uֱtR-Zľ}P[n/_"9ZTͯ]b^w}ŋ2>tbE@st<0 =sB"#3w\.]Jdd$ҸqcׯOjp%S_rm۶aV^ʕ+9<+WEQNcئݻ!2\inDOOr@sʕMq\# ̵8}`gaaVAݎ9²eXlk׮%>>wwwԩCݺuR +W&00K&''ݻٹs'7o&""/C=Di޼9%K4Az ""#s##˗cTǀR@[VA\0 Xn֭#<<r)[,*T??GO?wgΜԩSpa>Ltt4HrS= 6$ >}D2W4e4elAۛUnn5j[bV'Zyk[(H+vvvH߾}|2QQQDFFk.:Ė-[?>'Nڟ888u]Yʗ/M#O/_ŋRtҮRH֡CVJ`` [$/rtzRǎW5e6mnήPYW5rXBI$sqqzT^._̑#GHHH,9gϞ̙3?$RRR@ЏAd (TR_'"9y]*iضܶoBժ]e^ݼ)LH#"9 sqq|w53\ƐGfu,ФeHK3$߽n5y̅pѩZnu~#" Pisut4DD@x#$%#M5kE)c,~*H""".mn]b2Ͱ|9L`@*t,ծ ꙋ$}{Ug1]bNu+_[oӒ- Bcz""7PAB=zNa:qps"E ”K DDD$*Rڷ77dزaZ~5 SÆ []D,$"""j {UwQ2e $BCӺ"mTDDDĶ+fn%$ᅴeiJ6 ܠ~Ӓ׮KD(@p^m/#T9E-""""w:ԩp cǚMb^~Wt g#P"kiIDDDnAժ6h0\ ˖ٙk/j-[SH${d^fi; S Tn.\3fٳV'$ݜMHK3G~ܞz \\ᇡuks:@#H""""Y?f̀R͑7ހ(ӊTDDDD6YW&O6Rz0~XFIDDD$99—_ӈYuڑ={N*bsTDDDDdooNK@:!8&LX$ٜIX*Tѣ{ZᅦdY*H""""997ߘ.[CLaaKauRmu:AIDDD˜1fQ9Μ:TDDDDl'DG~- ARD,$"""b<W\)G(""\`gᇡW/?޼wI$PA\"Y~׎q_RvD.9s``X,L"y.<ȃ@UfC"qu}Q#hN% -wdvđD"",3gԩRFZJ" R7Fm_O#tD""c= 'ӂ/\hu"{$"TRԡv=D)JYLDDrr`s`HM:ȿ$"Ճ ;A H _~ |[ùsVWTDk蔍IDD$W6oHU :]SAGx29@DD${AXG`.$tAw[HDDreͩw:?RA;jOv‰v0*ްjԫgNau";RA;*@Zǿ5(`u,M\\)[={N$r[*H"ЅuqDD$7ʗ/*UE 8~D"χH^ve9w9s&K.L}*.S 憫k^^^,X ။K.""ù%iS uT"QAcRSSd.e9{,.\ ))$Μ9<..'Np "##9~8'OxGGGJ*Eٲe3@#""yDhYƌ_:H&$ܹslݺ"##ٽ{7QQQ$%%Y(*VH)]4.],lMtttիWs\B rRNjժE(BD$W^LjՠfHAI$1 ;va"""'** 0(W> ͛7gСRbE}ϼf͚7޽{dΝDEE1m4DRFDDr޽ar6BN$$b%0?Xr%+Wdƍ$%%HZxgU5jٙURjU:w?))?[uV>#OW!!!PfM&`T !CoN#$ذa .dѢE8p иqcƎKHHV̱iذ! 6ܷ{̒[o/S|yڶmKv_>XD$g/VS's$ d4/_Ώ?ȢE8uѢE ֭Yʕ+Sre^xRSSٴiK.e…?___ڶmKh֬VGkl mСм98[T~*:ĨQul߾gvoMÆ U#'''z!ƎKdd$QQQ 4m۶ѪU+yW:\k8tf϶:8$0 /^LHHʕB IDATogϞݻFAŊi3*UĈ#`޽tޝӧS\9BCCaVeW/sӈ SAORSS9s&> ڵÃ%KoM孎hʗ/رc9|0/ݝ{jժ1{l\buDK oua*H"a̚5 *лwojԨ]iѢwɁhٲ% .dǎ<>8""y[@yl$r#FŅɓ'[%EGGӭ[,}E1bĈrcgggYD$[U/}aPAhfΜ;#qѣGiݺ5NQx{{3vX>luP!iksQAB 1 72d9rZӓ ֬YCZZWfРAKƍ)UO… [ՋڵkΝ;ܑ4k֌#G2l09<_58qgo>ڷoψ#x'iܸ1۷oc &^iii̝;={ҨQ# য়~o߾/^8ڷoAAA}.a0avJqqq.s]tۛ>['"b<>0 Ø2e?{O-Zsؔd{҅ N;+O7C"E2eqeʗ/o˗3M8gyc2Yvr[xYP!0&Nh;v,U*5}1m40 #--(Sxpm۽WzzM+T`\stp†sG}԰:{{󯣳s澶md^bq̵3EDDa㺭uTT oCƌ˗rBw;}vvvxzz~%K8s x)_|\x1[)"""YO Ŋ܆7qqqf(V 1.\ ::$ݯ{--- sˏ}ǩV>,VaÆL6޽{kҵkWMF˖-o3w*ŊO>lذ0nܸl_OɓʸXDDD Fjؼyhܸm ҥK폌?۔/_+W2gxW3_rzΎ-[fsr{ݫ4vŦMxY`/2͛VZSDDDFDn%%εkkpN+WRJ\|0ˆ׷M6/_1cp14iBTT̟?8q"}LJΝ;s@ѢEeE$&&~zHLL <[}ٴi3 Ÿ ,Z{ 0d={'s*((ѣG /иqc;Ǝ+<>`W\-A˛ɵkg2tϧ:u*5jgѢEϟ}Z׺^ٺuީW^yWWW `˖-̜93}y:taL<9#"""RAٛЮ]p88@ P>x_JНn:6mJƍY|}… =:^}ҷo_ׯΑW̜9ѣG3k,>c*W/͚5c֬YYV,O:ţ>Jbb"֭"""y X9͛m68r|,@jA^P9:1K./BHH<~-UT/?~{={~yY…2eJsǎtڕ/j*"""T$\wEh&(HO…!(1GU3Grrʱ~zx ԩû30 >CFApp0f\WDDD.$:ǎ]-C7j'%+ԨaN=jԭ K[/^UV1vX O?L@@>ڽ{7 `ݺu1{{ ""b |i̩%Kذ]#@"DDD0}tFŬY}w^{9>J*K/k)66ÇST)&Lػw/zR9Q@1󲹶m`JsdhL8zlwށpw:%<<}:>tЁS~}]ʕEذa ,`PT)G^:@*H*-͜X`B8yҼh@hA |Mx 6m0a YfuvXVXʕ+_ߟ;ұcGիuDDDTla3͘*Èо=*eu<Ύ`زe ,`Ŋ̙34*WLHH5"((%JX;G;z(7of͚5\HUO?4۷vV\D;sh.X6!*Wt6Ύ:uPNƎӧXjK.?̅iWu<>3dzcټy3PR%4i[o?iEDD$RAʫ`l[lYxI{ :;200@DDᄇ/UT!00*U@ٲe)VX|,==X:Ddd$w&22;wr)||| _~QN-"""r 5;w—_Ys1cu4BQP!ZhA-2EGG_W6mIJJ???J.?KXbRX1|||lRt∋|}}*RYeg*H0w.B^0`&\[z=:a0DDDDr*dF;\̵lYx}(`u2 :'*Ha@W0u*<ՉDDDDD>RA[?ӧ=ՉDDDDD>SAa͜ AvV',O ^xf0GTDDDDD,;бiDDDDD$ i;YFރ>}N#"""""YLv6o69z9:4""""" Tn寿{BCa$ӈH6QAѕ+Х xz7߀ՉDDDDD$hl[iDDDDD$ ]k 7*V:d3]bIv5EDDDDh)σ3Llu%^|E/΀aܹ>X"""K?ZBիWSzu<ƍyWquu:V믿ٳgիWgڵV\ ;͟?͛#uVjԨau$111*GرcIHHClܸ$ IDATzH"""8877Hs=?ɓ#7M20tBFFqDDD$qt ,hu ɣfΜ;w.VǑ<<<3g{H""";]]N!yPJJ GG-[89ĉ&,,ݻ3j(RSSX"""b_TD9{,:J8rѹСC9}4~mKDDD H67o# (ɓ4oޜs3%JN:̝;7ۏ%"""ñ իP)$yDzu `ӦM 0 ??ժUcݺuwK/D\\*U .pеkWVJFسgϟ{߾}4i҄aÆ1p@|2|̙33sCѪU+JǎdoҤIw}ciӦl?^ `'9.--ӧOSt,파 Ο?ԩSINN歷bÇpB\]]ի I&4jԈXyvqaوÇhѢ7oޜt>sRSS)RO=vgѣGoK2e8y$iii8_"""8'ǜ;wti޼9%K$66cvׯ3f'&&___5jĆ 3gsk[͛\p)S/2f<<<prr]pabccqwwVZw͗ӊ-Jzz: -Z4Ǐ/"""$VP!l6.\ȶc*n!_~n뛹϶mۈয়~kY0m4tB~;w.o8уK.1eqiii{Η.\fPBeűA &...G{kAp+Wp^ vh۶-vaÆرڵku֯_O fȑxzzNOשL*H"٠B lܸ1Gyy"##ODDׯ_gw~?|cʕ+?> ><_tFf̀0?}/}qFz9MO>$իƕqvv`ʕѿnܸp-Z 881cp)4hٺu+|7$&&"EСCzE`` Ŋ#..ݻwK.qFϥKغu+wwW\/d[P0/f[.FDO>yD`PUVѣGӷo_"##3߫/ĉx{{ӻwoBCCyW(T `ĉww'--;Bj.r,[S /@˖PDD@ѢʘP4<<DGi~r%#> ^DDD$،wY:t0 &k޼]' 4?C흥t5BLL ƍ㝓yp o&$o 9BUE-z~"psdPD$OoW="=|iH6:t(gfԨQVǑ_1b h|IFiug^5ٳwӧ2m|Y%J@ɒfi*Q܊7+ZTICRAfNNN̙3Zlɻ˳>ku(ݺuc˖-̞=[e 6r%/_NƍdnEjջatԎ'󷖺-P,JKYn/R$gޛM*H"9uTZgyڵkөS'ƏOQ%N>͠A7o 6?$ Xy9Zի{oOỵ%W^_ƍ :TEӞCHͭ{7|ŝD un` 5K!&""w$b 2n8 o1c0a]tG+AL>>C)\$YJK3{~+2nW9M/"ʗ=m/<\#O""y H.0n8^~ef͚ŬYx7hܸ1]vyy~T,]ٳgj*ʕ+y:..^/%\0Viڷϼq߭b,MThyqp[^$)\0fРA^3fеkWl6׿hӦ ͛7'\_&11%K'bhٲ%+W~yFrnF|.>۷7Ü9pSʗ7G4eODA R6 ҰaCYb/W^tԉZhAFSVGlذ%KtR>-[dѢE4iaޫ2~~Vlyl!XuJO7Gʖ]|vqҟW$b<<@ɒPTx6(Ȋ""EID2(P P.A`9&EBfvwasP!\UG1ou^ߢ$""bO ƍK`.0|f(ڪVoor*H"""3[avs۶ }opr;G*UҲ""7 8"hn|v6Gvij^$G[-/"y H^QY~j׾ilh.;f2լ j[DYDD H^V=ի攼4d\hNY"#F B""FIDDDn+P üӭaH0ҭ}WWa$"""fݾ0sϙ] [ʕW+~+<=(ԭD. S @5w0~Ljj*NNNRR-000K3ؽ"AD<ՉD INNf֭]׳}v.^[fhԨ!!!KgJ…)\0˗>iii=zX<޽{Yd ƍ#55___VJ:uZj'"ˀo!!V'q8*H"ܮ]Xd Vb֭$''Bdd$:tr \\\(WʕiӦw^v͛裏>|8T^ ҢE *Vhazl{PynҖ-I"eTDrTV^W_}Œ%K8q~ؼNԩV'q(D! l2/^W_}իWW E)Sꈖ  ::h>̒%KXx1ӦM`DEEѹsg6l*^_x4:uD,t%^u"""b 0XVXA߾}|92eзo_6l@ll,gӦM4nܘp&NȥK)"ukRRN#0TD,pQGɒ%yWW7nСC > #ڍ2e0b:Ć [.#GTRߟcǎYQD$69nu$N|ku<ː!C8r3gd3tP'" `D8$l6gʔ)ɓܹ-m\]]ҥ fɼ{.]yYMD$xx /io*H"$))g}Ν;ӸqcCLL\]]Atؑݻsed޽!- ̱:SAJ*|,ZEous5kFVXjFrbŊfhڴ)_|ՑDDO:v_mu$E֮]Ktt4}aٸ[I;|{橧bVGl6h4*.r_TD?L˖-iݺ5oqo4iO<QQQ>|8""\iXDn '0ٳgR6HJ8p1~!8""\jphLI>}G|w̘1777:vq1\777f̘իerE^3oubu{7a{9Vju\髯:_VZ5vʄ ԩqDD>ww X- ܇}[E?޽{ٲeQDD??8"vKI>|gDDDPbl=ξ}hҤ Æ c899ĦM0`AAA?~Uƺu2СCjՊCұcG"##ٽ{7W OOO֭[Gbb" IDAT;vfQ~} Ν;)V._~%111/^xZjժUcoh"y֭a#ǹpSL!##1cP@7oNɒ%;v,u%::1cƐƤI0`C ٙ… /7n`޼y˗ի_t_!-[O?%J|Ç'00M3_PBm6_o0(X m۶`ӦMYSŋs̙9HsvtS-$`0 #ۏ3m4 (@~VW^ 0XA/** sZ=h߾=SLa̘1ܸq#""_>3f0 9Bzz:,X9sбcT7͆)ݦUaͫ_xƍ2 #*"""y>N>i۶-vaÆرڵk3{{k)_<9OO} /ݻٶm&L`„ nݚ3gO?H Ù9s&=dȐ!7#G(ZhKDDDr$PbE6lؐ;v,\瓞EFFеkWl6͚5;F(QFի/_={czM^Nzz:{eͼ| 2gg9 RJKDDDr$O~l=ΛoɹsС>>>ޱO曯\0 cƍ̚5K.uVN8 =z` 40 Vhh( L2w/99d]| sܭ\W_eɒ%_˗s;esС;Hޡ$r*UC=ӳ8ϟZj=}… g֬Y$$$ӧټy3`ĉx{{ӻwoBCCyW(T#FgϞKJXXE\H"̘1ʕ+f ECȁϳ]Exb:tڵkSN?,,b9eܹ$$$K/A\\k֬_~$$$dq׮]KYx1mڴɖcd;Gc~Oʁ>_X}j׮?8=zڵkVDZ{GSN<3ZZVZ-[6[{5zATTʑH$NʹsСgߞcn-zoqҶm:t(scѾ}{.^;3/"""CI$ ,YUVѣGv yNLLL/̙C^;w.ԩSm۲sNΝKHHH0 bbbXf K,xY"""b_\ (j֬ɂ h۶-/_?cy"Gc8׮]g/O?Zj9r\ɽ4$ZlɲeXb 4ٳVG{8}4cժU|7DEEYIDDDr$,ָqc6mąZ/ŋ$C͛iԨՑDDD$PAJGKLKo^I3gh۶-O=ڵcY~N7$uL?Ŋ3@l,޽qݰ%~˶mW^ʕ+V's._ȑ# f׮]ZSiu4eH?o| |%A0yYJܵo>L:u*Æ [nϟߺ\z3gꫯӧO.!"""M#H"՞=0r$/onӧCt)$$%У|1d~:uĐ!C dԨQ;w΂7Ν;ȑ# dذat҅_~ARAÀ o_(U z>ڵ{ͩuSBf_ĉ9v}w%((=z85d7n$&&@ON߾}9v&LPBVG;$[a uC6fYڷF2GC"E1bGeʔ)ܹG}ƌѣGfфPvm~z-;y("""vD ; G4m[Qll9ݺu[n?~ 0}tFA2ehԨ͛7I&gK{s [.]ʊ+8reʔ!&&hJ,iuDc*Hw]盥h&hx]R%*Uӿ֬YòeXl3f̠p4lؐHիGxx8l*ma۷kײj*.\@HHO<͚5^z3D!yÜ9D.Az0{9.,J&MhҤ 'O&66o+V0tPnݺT^ʕ+SR%9ŋܹ;wyf֯_Ϲsnݺ5MR\9RA!>\Pa,sqG^3Z̋/HZZ;v`|w\xҥKSR%*T@HHm;Dbccݻ;wf#>>kޭ[o;srrߟŋ@Ŋiݺu(Wҥqssˊ}SADZGAry31nnnz8s gϞ,6˗/ $ܺ~ׇ㓹POH ˋEDDDnS7ÀKaxظ*U2?,hu\Ņ%JPD=iӳ+T>ĉyF ФI]HDDDD ؗ 5%%A`hg*HbIA>ou2q *Hqt>>0dYrDDDD> Ity!w߅7߄gwwSA)=ڼnQ0}"DDDD$PAi5,FE[oA.F"""""9DIo'3 /V' œ9V'q*HׯCvB ~DDDD$RA._-`^sUN$""""b-Ґ%'C6O|ʑyAʫRS}{ؾ֬:TTh6lP9&"$=gÖyWֱx""""F)1 \aR#@I'OK'@s H9Hy+Gy7lhuɥp8L}Sb9LDDD${ %Ӧi h4u=70DL$"""To_!C ŠִfB+Z`"짂= O=͛رV;hvג 8^xYLDDD$ 9dsź;[.]G:utHG d/bu3GvN#vq'?;/@̢T""""G a|>}xІ6+ xXLDDD${ 9_~^^6mN#v,;.J*D[HDDD$ 9t`ӈkD#|0i%"""IM?`Nsifrqp W\@?=SAr4CDiAt#)JVGbЫY:ر˗/KH`l;Qx{{ꊧqEDDD #3֯[5N|2'N ..SNqY.^Hbbbۯoܸqloޔ[Tハ ʼ)^8ŋdɒ*W"""SHLAUluvY3_ˋ%JPD +Fr %44L""""9AQ*Cqwf׮]8ppA;FFFNNNQlYY&#4)Rqx8y$'O$..ǏǺuxoNhh(+W!"""H[oki>smۖ޽ϟ9ҥK2Q???X]~zحRw1}t]+VGprҺ3"""rT1P@ؕtoիYz57oʕ+(P+RV-C*U s˗/+V]U w;ؾ};>׮]`ԨQ РATg~^"""uTݑ#{;pɽ `޽^UVvZ aÆtԉ*UwL)_<;wҴ~vڵk6mCLJT|yl6@DDDr;${7q"3XDƍ|,^e˖qyhҤ f͢nݺ[n9;;Ξ=˺uXr%&Mo߾.\f͚Ѯ];4iEDD$7RAg 0{6L :a=WINNfŊ||W\p*UЯ_?7oC=ьlOvh׮޽K_0g)BTTZQF*K"""IɞM^^ХI䦍7h"_Ndd$ QQQ,Yxy*URJ >Ǐ__OP@:t@.]YqEDDbZ^[7п~[ԩSkQvmäIgŊ[()U}aʕ={_]vQV-?~>>VG?Kٺu+? 6^TRDEEa#HSAW?n. 90 -[F:uٳ:uTP=ü1{lN>|r㉈HQAGN5:(eddh"*WLc֭tԉ|YQH|ܹ3۶mcϟf͚QJ>S222("""H-Z>>дIŋA׮][.?3K.%22hׯ7|?Lڵԩ˗gҥVGld,'lْSB˔)S(S$)S)SgiѢZ"66h"""Tѣ};kguċ/H 8qk׮eŔ.]hbegzj9By饗rDDD$ ٛ  N␾{*V… :u*۷onݺVǒ\~ر~yQbE6olu,*Hf __؍7۷/kצF:tnݺDa<ԪU}bu4gOa*h$ѣԭ[3gyFHbb<ΛoɌ3WǏ:C*Hd.HLƍN0mF5v۷o^fY+KNNfرԬY… [Ol6֭[t5j`ΝV@ɞl~~nu`ԩ#<͛:A9x]]wB lٲJ*QV-.\hu$TΝP hM6N:Ѯ];>S (`u$|guӓ>֭[ӱcGOnu$\ ?[͚5޽{3h ƍ)uݙ7oŋ͍]ZKDDD ًdط~$vmɒ%ٓ!Cke9ڷoM4aذa 8'''شi ((ǏCjXn]:tVZ1tP:vHdd$w`ոɺuHLLcǎl6ׯ޽{عs'Ŋw/$&&ŋOVZjٳ'W\?]vjժ4jSRR>|8{|oW^͡jֳl 0#_a]Kڙ#ص}ٿ$v+661wnuaaF˖-8cɒ%/vZc޼ybg'88(Sabx{{ᙯFbbaq5ψ'55ըSn8q4cѣGZjaFN23a4n3.]d 64y?'3 &666_xnܸy\ի_exqrrD0|piڴ)l߾72gñll}uU/~)"9rfqy8jjf5 VjgYg‘7SoR}9/}~|Xz5Νcƍ|Ypۨ^Ŋys; k׮dddXIDDD R~fI6e:)ٝ3gŊcСԪU˗/`[ضm[ls̜9I&vӋ7nG}aB) IDAT;vLꫯ7oݻw}ͭ*e[4uΝ`m֭[b *e^ggg,X}x#"""`( bb?111曼TP8Yǎٽ{7M4!22z駟u;lڴP?~cGrk濔;v{2339v|RJL87xX㈈] 11P)'π-&OL`` |dff2nܸE6l@޽e˖YP ð}M۶m)[,&L˄ҿ"##yW{Bjj*SNiym#G}74hKfĉVGPA/NVAzgϞe3'''d{ХK(WM\/=Ke˖-̝;6jcbbbptt_~Z#Gf {^ \sv6mȤIxY`cǎeȐ!ݛÇȑ#Yz5]6rYH"3/3E)HHooS;~)t(ŋԪU_ӰaC޴ܹsp.\ ..۷;#' AAAL8ooo^{5>gȐ!<#y_ѨQ3fM={6'N`ҤI$&&2c [3f YvaÆq9,X?8k׮%88{`6oL5ׯǏg]vŅ>("""rvƍ p!tlΗ:w6\١\94 :I("88hnZ^z{m6HAT^_3b!K#Hŕ+pÿ˟g׮]<3VGI˖-ٹsmt;TT?EZknGZjITTQDDD*Hի*HѣSti且Fio߾lݺTr7eʔ͍#GXEDDDnUGL( f斄 nnn$&>>"""r +33GGMdddXCDDDn$m&!!OOOc-TҥK*IHBBI||<[EDDDn$VժU1 ={X:;3]6#Fx;v,5'٘z*'O'Dddd0rHN:1Vjq XʕRJZ(Y~=&L`РA9z/~Ӷ{9s0tP&L%KM#VG;PAZjԭ[7Ϭ|rv3c9s5+߿?W\ۿRRRHLLdĈ=p7oNxx8dff~z B前aÆpҥa۶mcذa/_'OҪU+U7nvƍW^a̘11˗/<|=z~\9bԩԯ_*UXEDDDĸ_6K:̟ܷ 6j*]v5ڵk7m嗍E aƕ+WRJݺu퓞nԯ_2 0~0 øviTRŶŋ  m?rIIIF``1~x۶gF 3g[l1 x뭷իW/|ӱ322˗>|ach8p#33hҤѫW/ȑ#qvec+VvvvƖ-[""^=u ~iI  ЩS' pQܲm6<==qrriIKKcyOMڵYd III| ކ ѣpppD>|vLool>e>L~lJ*رc9v.uԱM<зo_6mܹso֭[B-n/b;v ^ Ȇt>`㧟ɜ9*Uʲ"""Tر#* ~$/ w\۶m)[,&L˄ҿ"##yW0`M;;;Zl `+^VneGV\y*5k쁎{/аa;~Oǻ>o6~- b:w??h >͛DDDv*HRtڕ:y\? HNNカ׏UV1rH, AAAvͥKe˖-̝;6cbbblHII}/ڵk۶9Pf͚E\\mٳ[. -- "vZDD<#GdդvZbccnuֽs8w! u 3Pwnzם1 )_&Lxℇ”)Spt$>3իѣ)]t0۶mM1b>mooW|\GBTY/ϗ)ժQ`P=5P4hՋ7_a :s43]ask׮4wv8}4'O&""l=߿=zpQ,YB֭$h>:v}{z::8}9\摦&$)ڷoOtt4=ժUc„ w;TV7xٳgy򪔔FiXo߾uCzz:/-FS2330aիWח)G,>={”)|9‘#x1 E%>_ٳg֭[ :ֽqw'475/ѻXΟ Ҽ0kzȚ"""9LI?8{a޼y5O>ѣG3d-juC^juѣ:/`w߅f͠D [2TDA*U믉Yf 2 *0m4㭎'ҥKL23l0ZhCꫯ :^"{om4%'#M Bs'cNn4xӱcV }X"sgʔ)ѭ[7V^MVVeee?еkWxy饗8~8g:br}iؼf6'z^2խRG aɜ9s A-(S fϞ=VG{E~(Y$Z"++EǤI(U Gj9,Mqq/lNKж-. ud =kuz)D4_PHڴiC6mO>/ߧvڴk׎벬<,]%Kc|||x饗NʕWx/O?m>;yv-[`FLed@`Y5 1KH6SA&AAAL6ɓ'߲xbNѣ }oߞ{{ 榬,~G,Y’%K8tŋM63-ZPѱqFDE#N[1LŊ֫gu%""H6srr]vk׎t֯_7|Δ)S(UO=M4I&TPѣGYf k׮eڵ?2eЮ];fϞMFTGG󞥰0sb0gû^/i04iIDD^ '''5kFf͘={6۷ogժU]_~ *T`+K 4ӧٰa?~'''j׮/L-]v]0yaѳc͛a S:а!TbmnTDr=uԡN:dddEDDՋk׮#|Itt4a@XX#F ,,ڵkS\Hк̄0 n.hC%yMB͚$ODDTD%JвeKZliv9"##$**>|4ʖ-k+L+Vߟʕ+GҥqppܓL8q111p>̡C8}4Erѽ{w[,Y@c5""ĉ0z4*e^w>&&BII$+U-ZEm?~h8`s9sƶX~~~S|yJ.7^^^xyy޿q_{U'!!yc!:}4888Pti*UDPP[&88 ʗ/˞#7Np4zyI4h`.խk$"" H>@ŊXMM>}Febbb8xM%33䄛Bzz潱.]jժѪU+)WtotkaJL4`Z֯ŋ!+ *W6_j,MV'$R899Q|yʗ/Op SBBҽdNbb"YYYlz|wOOO9E6BSOW$gxzB6Iu࣏j׆-̅nm"" RpOG Fd,xqh|\kך}!g.\Crf%J@Nf9{͒0r$/+B~BWZWDDFDDDP1j\ ۶hRr<sMGXՉEDhIDD$+f3_᧟`siXx1ZF5k5-TDDDr9Z4f ld.Nz5j~k)OOh,TgXXDDPA..f)23^7!<ܜg 6"" Uoӧ,KeOeA**H"""V+]^zɜ!)\wvmJsfaf0 ӊh*H"""y#ԫgޗt8lmP>>IED $$4 N4GZyGR%="#N*"R` zJӧ#K۷Cp9}xkIED5$μGi4s{[7Ek+T0G:H$""߅„ wkB'4g:w"" HAaoÇB\,[+:- 7kV'ɳTDDD "Euk?.\0g+ZJ=!"BӆBIDD+Zڴ1'tWsDinh W7'~8{""y HaR bNС>i"HO:eTDDD `srhkr.]ogXPD$ש vNNбyOҩSз/̙c6iTID $BJ t UduB$"""sv^`6sBF4 <:HPA?V̝kt;xPy]f ED ww={jԀ/}J"R qp瞃!* ^z *W6'wz""LIDDD\jdN,y҄ pDD u%Kӧ)(H>$"""MXx5cѣ!>t""JIDDD90r$|yһBjDDJIDDDr9t4 '?L$"y b`(޽!4 t""6*H"""{J߆#GE ԁ:$"""Vٳa~(QxڴGN&" X'0V as]eH!$"""ɼ7a T T"R m~'!ox[ۍ!":NNQQPth.:`u2)DTD6(%.r[oo7n%JQ"RД/}KBD<0|թDPA@]bEcO=.&BMؽڶkW8T"R vvуHD %`NһuN%" Q':aAǞtD"R5m {%5ibޫtթDRA;ƛ4>#i7$Bf΄?O?u͙DD UwEm۳Ȣ;-H$"[BJ Ԯm$"MTDю"m{Ж$Mժ=I> IDAT-[Bv0mՉDPArŕv '6'hO{\q090v,t WXJD9$C/d> xD""VիᩧH>$"wx4O[HD5!.ՃÇN$" !'BP܉իÎm$=ju"ɇTDOu ׸F:tqDDIXќH>s'"Rh$%%q\BBB>LFFYvYx ,2䄛m_\\\XbIDb{Z/L""@IɓrΟ?9wgϞ}JJJGo J,Iɒ%TR,YRJC2etIDn%K{7LSH>$sa9v'O=lzyyc+&!!!]]]qwwWWW+'؎憓-=ˍ%ʕ+HJJ $''Djj9s~bb˗J*RR۳oosf }{$wȝ Q111ڵ}~:Dzz:/_ *@)Wʕ# }䄷߿iiiJމ'8qǏg?~,)Bʕ !445jPfMʖ-]OID "ooX ^x/;;SH$9sm۶ɮ]ܹs899#DΝ &((`-julQhQ*UDJWMtt47 ==¨Y&aaa<<-ƍ7`8H$b}e"""ؼy3qqq+V5jF׮] #88ZٙիSzgffrA"##dݺu{\|___իGӦM[.}:4oޜVZѾ}{-"F ^#mPH6JOOgٲet ??? @jj*SNɓ޽7xFz)&OLTT'N`ʔ)\|_~___:wIOO:WWC0'l H68|0Ϗ:|ٳgYr%/2V,xo9{,s!>>g}2e0tP9buLi /[FD$`ڵmۖ`V^?ObbbիVGoWɓ=UVDYnE$'M 0kID$QAy˖-F4i҄˗/l2СC:'???ٷoK,!11z5kb HN([͙N#"y }غu+ק}k.֬YCVӍ=mڴaݺuOTPmҰaConu<nCV|ID$QAΝsԭ["E}v-Zģ>ju4!aaa,^m۶aggG:uxpD$(/gEID$?7PjU~';֬YCZ%vڬ_˗m6y.]ju,.{ñcE7*H"wF޽yhӦ QQQ<3VjՊ={ТE ڷoϋ/ȵk׬%"Uժ裰hID$PA$Zl7|ҥK;w.Vyxx,ZVZlu,}-ev" 4lؐ~zڶmku$cO/ШQ#ݗ$ߵjqqID$PAAFF]t!!![j\VvmFau{Ɩ-[p?>>/^<Α*VȊ+غuk)v"r}HvYDD$lٲYf1k,ydcǎѭ[4hЀ &XEDT p)D$PAXv-Çϕm6l˗ɓj ///jժƍm&&&2bFMxx8͛7'<y3#F`ooOrr2}̙3Osq:ij>˫Jiذ!QQQdff~z B前aÆ0}ێ… ի 40 .]J߾})S ΝgÃZj/>}:?ذa`ptt48`$%%m_{Y#00ШPoaŋ7 0vgϞ5 0#((rq~0 øviTRŸze{뭷իW/|c]xѶ=++ˈ1 x׍Ǐ+W4N:1caooo\p0 Ø={C] ?OWDQ)^=u ~iI8|0899hݺ5L< Э[7&MDFFӧOgʔ)>|~پTR;cǎop9.]̙3bҤI8;;w=ΰa=z9(QÇShQԩc{~}iӦ̝;77;e˖qQ\9Zh?m0lTum۶+)BPPH6qr-,";RSSquuۛ )RĶK [lm )i̙Cb:t(jxxx=8s̜9I&FFFm^fpnˋk7SarJۥ͚5sf7WWW\죂$(QgZ6jn+oqOOO5ٽ{7M4!22z駟 ٴi2~q/z뭷?~|g9s %K󊈈HQA\ȑ#;w(\x F\w} $'O&00K2337nmGuwѲeKba5ӟd޽l߾~=l9رcԬY3W+"""KIhܸ1̟?ߒ_/ȑ# e֬Y={6ue{it邗ʕחX4ҥKƲeΝKbb";v &&42tc%''bvUu}ٽ,_M6j*nJttMyEFr"""TD0ӧSN%i^Ν˅ pqqql߾\]]ٶmݺuW^ 6#GRdI֬Y#`:ժU_ӰaCfpvvfѢE~;+BPP'NۛaÆ;. 6lw}ݭǺ|m‰ӧO3c z-۔ٓ&M"113f 1cHMM'$%%>}ТE ֭Kpp0Kfry۷/...rNvƭ,\]=\"ulp9|Iŋ 'oɕ5tKϟυ 2dYYYƲn:ʅ raЮ];~'wl|"OTP^߯Θ?/ D|׬XSZG믿N=իm=e˖N:TX13L^{wyzDDD$w "<<3f?)))9v?M߾}mkɽ7o `Q~}:vȮ]?>+WΑfff2p@FY4hPGDDDrDxzzҧO?LҥnnnL6iӦe1 #fϞ猋O>^?ݻEDD$giI.zIDDjժ,^Hb RjU<ڵkUDDD $?РAС:uCmu4aNO>TV"""3gnnnVG$r5kݻOYz5:th͢߿?]?~zh"""TD==z ::wykRJڵkƍ'i۶-!!!_{ /`o.EDD _-Z͆ (Z(O= <ݻw[Qݻ>sKf͚œO>Inh۶-VǔİtRKoN2e֭z"$$x"""b! dPMƉ'X"G& G}qƱcǎYxVXVV۷ogر<ꫯ?':uʑhI$988ЬY35kիWYv-K.O>7LJ=F6mhԨAAAVG.W_}E||<vvvR\9ʕ+G@@*U J,i{X0 .\9U$Cb9vJ|||x'L[)9wgϞ}JJJ III$''sYHMM%55vd222̧2o䄛m_\\\XbPdIpuu3J*erppȩo}SAV!Ci<FooS@ҥRt`! x""""yyPNA.Ц T0eJ(G""""`TDWJ9RT9K]D^ !!V'H؉܏u_?r1c`pq:d ܋D4*Uso#E#H"/̑"E`rhD""""C4$r711fE^U9)4$r'|ckT(,[[[HDDDDrFDn{sA,u*G""""FD[;;;xH.ȵk0z4m cʑH!$)܎5/;rD""""b!$)֬OOؼj԰:XLIᓕe^R׬i{$)l.]az3]R'""""7QAs(%VuN$""""y.azx (QvR9;RA_Msg(,iu"ɣt\0p ̝ ӧV'wTʕ+e}Nob_N$&&w^onܹK.aggGҥP>>>у%KZgs\]]34ٳgرc=z~~w9BBBNNNT^5jX+W$;BN%$$k.֮]ڵkY~=.\@BoPzuʗ/O\̎lUpa .LjzDFFco֭[ꫯPBsѰaC~i&IW*Hb#G`Fcyo8-[Ə?Ȳe˸pEc4hЀ *Œ IDATdҐ+W.VJժUyWcvl[~1cзo_ *Dfhժ/" 09d7*Hby󌙣&MN\t oFBB 6d4jԈʕ+1Rre*WL޽سgk֬!,,Ν;cggGFh߾=ڵ"""dvoB:.!!˗ӹsg-oM5;d*Hb aCSd̙3)_<ǏgРA#vJ=ؾ};u1;VW^=vA.]ܹ3Ç7;d2Pd} _ƍ̝;=zIn7o^>sUo͑#G>}:q("""*Hbl{bw,Z_~#}*Uvakk˗_~iv$td\9S0w\.]r4i҄K2{l dvT$c]Af'IsK.eܸqL> GQÆ 2e cƌaٲef I:}ڸ/Zi,66^zѽ{wufvyL]tw\|8"""b"$XHssqϨQ̎jǎTX3f7n\?d^*H.]2 47GJHH믿8r!:wiIÃwyt>ɜT$cHC˗/'&&^{(rqZh3g28i=֣ѣ'N`ժU|""" Iƺv͸Fi{I& <~akkK\\~-{!&&7|wHڴiàAҥ 6䯿"!!kҧOJ.Mtt4 6ӓ &_|w>.ݱcG+yxx_;牎fƍ|WByf;Ƶ,C){i׮]?dN*H"/_>ڴi+Ξ=ٳg9y$6m"O<͛p:wLnfE+ϝ;Gڵ>|8AAA4lؐy0rHrMhhCs<8ƍ`;TX?7n`vaɔ׮]cʔ)kN `6;o?:vu`ϟon`c?p5eUucǎQJ:th|-ZаaC̎#"""&SAI#,\www5kbԸ|2'::0.|M#Ih:6i»,8x#TDPl׭[T?~Ǝbbqs]vQn]'$aL y rm[:,Hm@TDҘ7n ___.]jv$Ï?*T۱'` x=ȟ~t!wn([`0 'ۊHJfɎY|9o&ٓ &dv-66>}ҳgOLB\3n>!.""`.ؽ۸M/- O? իߺ- 'JI$8::7[oիK˖-͎#7nFVI @zvǎei.ع-c!13}*\DDD$SSAIgm۶Ϗ ZncǎN:fGׯ 'N5u,iܚ7 |mnݾ._65ojw4@D2s%<<Bzh۶-fG˶6nH֭_>̞=;~]6lav9ڷ7͛0Z4P:uaZt)}#SA@uaݺu,ZGハ .$A+ZBB ,^z͏?ڵkUVrp0_X(IAvp|)<<@'%+yJDDD21A֭iݺ5۶mcҤIt'''ݻ75j0;bafϞMhh(qqqtԉ/"s~mm|y֡í)3bb<<^=(\؜"""ٜ j֬ɬY8p 3gdܹ̘1^yZjE͎)?~0{6mڄ={Gx{{%`b(غmxcFg[:P]DDDREME2oooƍǘ1cXr%gfԮ]:TR%j޽xbnJ `С4n;;;# sgc[b"gmیy!o^,խk0թc+V%JPD <<<(X NNN{ggg, /^Cbccx".]"66zI;lj1ܨX"*TiӦT^Zj⒞_XġZ5vQӸ: _>0:um"""9 H6BӦMiڴi.\ 22Ǐ[o'O$""5kXիWI[>gd,170.\a_o/ZdTC^xrr"" ȣ)Zڷ7n.KAp0Q#dIss<$y2NN ٤;ajFa*ZԘ]747 HڰuQUcv)w߅7n-o0N3 HȓV6ݚaK"*=CӦ̔ITDD$cϟ0+Yaa0ck*5onJ278ZUDDQ,̛g_0b\}BP f'""TDD|66P>\i~=L/ B0f gvbɦTDD$7K=nC`Dpq#recwo'cIDD$ HW4ùsR` l-[BBҤIpiED$ SA٥?8_Lh> 6;d1*H""y{K;ƌ'eF cH$""GЦ |9c0l O=[Ҫx""r*H""=B͚0l]DqH^VP(tj8]lvZ$TDD$gR A#8y:w"E%g͂N*""&RAti U * >bcנX1h.xHSAti֭hcKcG=&&TDD2 H"E7gt44m ,^m,).""ْ Ƚ8;觟 2; >11f4$""0eAk ͛dIcq uSHPAyUرp(,^ JxŊ۷PDDRAIDDIC`qQ `^xYT ƌ1c,EIDD$V2f^xF4 n5;<"$30e 8};v@ZPLqqf'PAIÖ-o4i!!f6evB$V" 'Tn|$" d.5QƢDD2$fk ͚ep8tl,dlS X16 0.F;o1d\kIDD2 Hf ~QA!y""!TDDD2y 76$""JIDD$3ش8q]w7Vt$""Bǎg,^ ;wBСDFND$QA{.q=mWbvLƘQڲN5fz EӉd*H"r'?)tǏIoO~6"9QQ0f |-TӦABDD<$K%*aCÎT̀D"rGGX o_\BCN&" ]p MX찣)Mq-]3sqU+8|d""Y SH}O$.tD"@+’%jT &;Ǥ$"ԊV8xq20<ص(GÆ3@x٩DD $|챧5K^C 9lEBf'TD^nr7+bB"y,} ̚5jmfTD^EpkN4 Dtb, ^:ԩfɔTDpp!ŶtLMD3adN%" u37/7Ag:HDRkWذ.]2f~D"" :[3n2 ʝ*H"ЅI8H6ӫ,Z˖A&pىDDLuND$UfϞͬY̎l _hv4׭[7tQE b-[7+(av*S ~ov4e=X(ij,YDIJ㼤&M֬N%"TDA͚5>}1t"qa٦MVUN%"tl,]QN$"TDDD$%WWcd$]|xõkf'*H"""rovwCf*H"""r0s&̞ 3fFD$ݩ ȃm #fIW*H"""p#F@rн;X,fI7*H"""pװq#Lfvt$"""zux]C84""BIDDD݈+cvt$"""._> S!64""iNIDDD{-|IDDҜ <WEDD$y|]¾}kIDDҔ d+/^4;HP+?lv4$ԩS~#駟R^=\]]͎#3ᅴDD$M *T(Ŷcǎzܴ#-ʝ;7>'1112Cԩ7BD$M K,aРA?:tΝ;j̴#-ʓ'EI<"T ){H:~8-Z !!1c,`^^nj$L|'уg}v +W3g:uLJ PX1j׮;}عs'M4`ԪU={XMHH`t֍ ߲gbbbx7kϞ=4i҄ӯ_?lmmiӆAѥK6l_EBBk׮O>.]h6l'&LX\~yk+WCDQZED˝~b,)0иe`|o@Kc-e޽m7)RkIHHDFFZeŊGZKٲe-G\xѲsN `iҤIϝ;g,+Vnm)T%11bX,Z:uc/_eX,ׯ[ ,h\%>>޲qFKܹ-eԨQUVYzikG4jҭ[7kX, ܼiL_$~??O6z&}d y;mܸٳg3{[n-Z\rB&M(Q 駟ݝ-[剳>}3i$0br}5&puu%** GGG|||(Y$QQQՋB q59{,k֬᯿eETT^yLvvƽlDId[lۛ$˗m߿NJ۷/sa899w޽{ˤIsA IDATx"׮]͛Ǔӝ+a_X㋈<)mBd/_СC< ڷoώ;hԨ۶mח3gwSJʗ/СCɟ?=þ& 66$y{{sUƌb={W^ѱcG~mJ*u1Ο?Oll,7nd޽͛7SX1k7oboϝc=k… ߿?ŋחp([3DDD$ rŚ5khժ/&88ӧOĩS|8AAA4lؐysqQ`Ay*V 7Κ/88;vX?α5U+*U]vTT 63лwo>l"""5X^e㈈""9]KZ;17&I?A{X,l޼S٫2W? WUe,BTDbi&>ʔ)C:uXh:t`s[:tE]6eʔ>`ӦM*K"""-;ƍ,_P~Ν;G۷/-[L2)g=z4bɒ%2~x\]]i޼9888DDDD Ht{)矹p>>>ܳK2e "(((EYjժ...K*K""" ׯ_gŊtR.^}ZtOc=ʆ  N%K$(( 6pQ Ftt4=zH"0k,\bvTaTD˗/[K={`ԩ:uZJ(arGWD kYaԩ777kY|IEDD$'PAR%iӦqI~'vJ…MNznnntڕ~'O2m4(K,řTDDD+$LRF)V~ .l-K111ֲ$"""BI$t=KS"WWWf7x#RllIEDD$+RA`*EiPB*K"""TD23g4iZKь3R"f]...)Ҍ3,ˤI8sIEDD$3SAI'O"  3gԩS*Et)fΜ  ZN>mvTdTDЩSXb <////^筥iN:l-Kϟgxyy1x`+f-KN2;d*H"c-EŋgȐ!RtiFy5;jqwwL͛z^ӧeiȐ!/^Zbbb̎*"""&7;HVtIϟOhh(͛6m0`ɓ'3Ԓ%K̎ؒR@@W^eՄ2d[.t㊈H #(Q K1SQv'O{,PD RttQEDD$ <'dɒ|G%$$vZCҥaÆxzz2j(lll Ў?޺b?ҫW//ӧiӦ NNNԮ]ݻw?>9ϟOnhР#ba„ tԉ7|GGGkf,YRɒ%eĉetd?X,؜%MV_=R~}ꫯZ,Ybz,oٸq%w2j(˪U,={Y,w-11r1K-eÇ[~g `y};wX*VX7qDٳb/,o߾E|LW^,YꫯZ,[Fm̎'b~|'>tp5k.\#͚5￧Eϟ)8::Cɒ%W^*Tm666(QbŊIHHuG'˔?-[ Bh߾=iJ3s綞te.]ʂ oȑO_˗IəTDtkY2dHktwlΒ:t077GZ~lz*W&440\Bz $00bŊ1S3ggϞO>$&&oF߾}9{l䈎&44Pɗ/[&00]Wa)2lO}$'|Aрe)$$ZڷoO͎ >Cry6[[[J(e˖M?q ,ӪU+ @ƍmHΣCD@rYJ>g),, ///>#<==8q쨙† Re ٳ9<Ș1cӓ>///8u9#MI$%_Pt֬Y:uZJ%R Æ 1;ifϞo͜9s(V~~~oߞ۷3gΜ4[ 6*UPlYFR$"""CDQrY ڵk\P&N7+/_ݝ/"]Ǝ'44={F6m=z4M41]WDDD$ h-K ʔ)SRΝ;ge6̝;|qF6>}:"""E;٥X|3uT*Vh= ofGʹo=|bŊL:/v-G9=411\fvTBTDLv{YiӦQR%kYڷoQMo>k)TӦMߟ9Y&3\^ '|e H槂$^N8a-KӧOrֲw^f{2l0fT|s[):q®ɇѹBW?qLa G?QҴ%OɯLDDD2#$L~eiƌx{{[Ҟ={̎c)fƌt)qp=<=}晇[ VC ӘFVN{yGNrz9c˴TH6$%}kʕ+Zh-ErJ^{5"""طoc;?=~C|0x08o 9̘ X"6xIѸ"""9 @ φӱcG~G(_<d/_???~G:vHxxx -|˷>ǓvKho,koBݺ믩 0YDK Q2 cEDD*H" ueܸq:t?vqil̡]vl޼C1n8֭MfHE>{$(MiF2.W~""Lh7}R /&1==X*P R5d,$/j׮رcR>SgرԪU+Kѝ P;[lqđcU^}ټa|Xи¨QpZ24aӛLduF)Ū{"""i Hd-]Ha'N8u!=m FA*WfJer(BF0c>f(Nq2O"""~TD$ӪHEB;}ާxg&Zb-kI (8{wл={R?/y "}*RH"""TD$S@PLqޑ4Mi|'*V̘=ZXV-0W .|' *UJa[DDDҖ djسa 8x,7,3^7=aӦjwK׫g9 0>Q- iv"""z*H"9D>1l;f1@S-\`0Bzu._NݸIPe3Ŗ-I""" d ]¯6?8A˔a9N 1Ԣ1BN $!DҞg=X@L^y|}yshN].YЋ^}'BVR !rvcXrЇ$[{{XL7ހ(MCXc3?%ti !"7I+ 6Л$m337N\v>]%7LpB!r)V+Z-[$}_#GyIy*T'pÍe4!BR !r&4w~g3@nPA/45g=o>o4!BR !rִfXJF1J  Νв%xzºuŠLex} >!„I$@[ڲc>Aa*OXv"]Œe,Y\ҕ.qBS$B<:Lc3Ow=4I5aӒ4!;IqkG!0R !.c}ӏEFCV 2 6V]m,sm3>#hЇ|-m5@ 0a!\qe?iIKӜg!@ !?pp.]ŧS^bG!= P ~X0t =qoaD>](nvcxH.qBN $!6̠ag?nkcƍǘ>]x5ENjas_hD#:ґWX|!|ڃvE)^hE(XB\N $!D]jܹд)ctIZQp}1*d&N4Ct_)g\^Z,d=qƙV"HbGm XV)6Q41~G!ȩ@B38ŋþ}EQ7?yxݻ0dAiY P>xyAP'A|.P@u>[p DM^o۶vQ$'u#BDR !.5kp<ܼ+;W-R)b sw'ɸ@#ܽ VV䔱y %(jVczT 't l`UJ+ZqSB!r)WrO? wxXL-BCA([sWW{QMg#?2Y`~`buap.ag+[IMZRzB@BdFHj{KNV7n 3gKs$$ ֭jر7Šլ;iC/@X„$>XD $! $!DlꚔ}r GYz|a S V#7k;I)=IK,(YA $!D*x1ܺel.@-j1Lf2gITzjڱcInלx>Kb'0AR !ү\9iL(Tl CB7W_z(XboFcә?9 B )"BD ֮U6ذ ԧ>iiNOP2Na@BLǞ_|l}/b^k(lFЀ4lZ+r0b'0AR !S)La"ֲ%> k(+ߩA Іs5adI$hq/}=}MNN0`ub-[By'O )A[[BhH $!Ј9,e) ,]v:K^'hF3qM"UC!4$Bh e,rT`0|8v) P {ē0t)9)&H $!`Ә d|G?'t$ 3I$0AR !0c)K}ôiwo\qe'; !7xx$Ȇ@B )B)$&9뿨A>P:..vqSxOȞ lmD!4#; !]𘕕:FMHF 023&M௿Mb=2?hMk}~,+X8233:!ЌHBi?;}yS{5^chMkyx@ǎYV 4 YM+eE6+&G !ְaBF瓃5)=Pr/~Bf|:x/_xי|>#4Kc I$0AR !7/xyϱ7ߔG0w|ou޼i􍓆A b,c@,/ r6,htB))i xBzxdd"7؄ {ړŦ2t=8,/ I$H[˖Pг/TZȺ|rьk3]@͛C0q`9 5IG:rYbn=B@R !fa=z+= zT钏||gclذA~ƚMl"hG;bD$! Il={>wKyw(A !//075k zs+ d!9,"=HB$ݡD;;u`%bs+ʟx// bSqլe-?-R !Llb"D.p}"""'""8}vGFFK|||ܹCRR3 `XXX/_s[[[lmm)X`)RGGG«Ϟq'=|23tXHQvo%y$&14!"C5s0țW]5Q!LHB`IIIĵk&88bDFFˇŃ`ԭu#<<*R`A-#EٙRJBRpuuxɓG)\ {v|ʧC/zqbktJ"¤Ha@"y&gϞܹsυ  %11r1ǜ,:X1DFI$0QR $''s?9q~~~=5 B TT͛Bҥ)U%JHN찳pTX&&&Bpp0W^%((K.q/_۷(Z(UVVZ7777s޴ `(C ">Q@T}Pȏɛ%dtJ"#BC@BiJ\ƍ߿?p)FԮ]=zEF+ \]]quuoܸsٳpBbbbȗ/իWN:4nܘƍ׫'=(Va >@Ŋ`m Ne +]Mo24 Y*:  B!4'YcϞ=ヿ?VVVԫWz1x`jժE rdoފ-JѢEiڴi걤$R{ݎ9w}GBB*UiӦ4i҄f͚ k/Xb} $ TI- X@ j0e鈗u atB9)ٶmaΝ'xxxPzl94.ȓ'Oܤ DN:Ν;9p&22eҡC:vH&Msr@f(u}*Uyͤ|c+լ;ݍNIݻp-kt&B9T&ٱc\rtЁӤIVڳvԮ]q[la˖-̝;"EЮ];z쉧+5)/Oڷ4d0PGHB@ÇSdIڷoO`` ƍܹs\t9sЪU+) `kkK֭7o/_ߟqq%ڵkGɒ%1bǎ3$?3E/ֳEŋ?3/ƚTDzKI$D&?RZ5֭ݻ>|8W\=+WR%F >`ΝԩSW_}E9u ⋯(`IoYbptDzBb`+X !LHBd@pp0ǏŅ#GҤI8}4ǏE:.]'ǩSpwwgḸ0qD,ɣpÍlԾ% 9O5mhûK"ٳ uB%/ʕ+t֍ҥK0m4?,X@ժUNOdҫ… :u*֭ՕnݺqUl` U $jժ?X|Ϗ r!UƧ~ʝ;wtop㜶 GcbmWcP pF#%AB,)x˗SL.]ʬY wԄάʕ+|7,Z777~w]5!E(h۰z>!$+S eBKR ׏~N:qY0ʅ,--ٳnݚ7|wyHM!h.vi.)+'&0_fxIΩsڪT1:!ЅHBܹsԬYm۶i&.]i ,X_~ 6RV-kkp.T`e]: SL7:gdDI$ߏ%JtD6o燓$<%RN!? tӯ_?m۶YMcgV{윛7o~Hy,R(gVӧOUOH'NT%446~gPƌsʡ|ʣINNV++c[VR۾~( 4xk6m(NدWPPBmڹSw(TT>P>0:-$D}mt&Ȇ2L>d?&  9ɆJ=!K9ѕݎ=JʕQ?p_zN&g(P Sבs?fѢE 0 uԴiO3nF]|LbvZH PE$lcѩ^GB BI$r=.^-7oдigSre>}c?s/qsscΝ$%%>k)=E)=3)RJz^Mz#=GRRgΜ̜9 60~xCJy5n8SĠHڴeW\iHCֱTr={׌B!t'5kFɒ% z+Vdȑ>Zt777  ʕ+裏>|8nٳg.ݽ{wpuux℆r)ƎK*U7oaaam,XwwwH9w(J걔RM:͛7~/:D@@cʂ puuM-.3*0 SK,I,<Ѧ-u3[B"[F]d@tڃ?h!DN Ä ?>gΜ/&""8|0|Fʼn'uϮ]ԩ6l`ԨQܸq+W>s>Q7oR^=&O̰ahڴ)VL:֮] Ջ}2j(Ǝ#vakksbbb:u*!!!|L6k׮_ŷ~Khh(&M".. ͻK۶mqwwbŊ+V+Wf;rYp!&LtU!8Qf@p0,]{JWnq |N%9xY33Bݙ)i`]);M_<`fW?*h֬7nȑ#888bŊ?&=ס絮X@rr2ٳ#Fy'ၕxx|YM$la6 V:)ڴgT S]&N 93O6!'1W7L%=HB]zm,&OL>}۷o1sssJ,IF(W9ӣG2]ǫAv\RtxF+HB1CM]X1ѦlN#wPؼڷ7:!2R vvv̞=={pY裏2:5n߾̈́ pssKR7˗/3buԠp؞ Hը9ѩ[];uBR  (_|APPƍ~\rՋ,C~rdG=(Wk֬aĉ矓?~]+(ld#]pHR\ѩmD!HBd@B7n\`4iB2e7nN2:EN'Od̘1.]f͚o˗3f  ̒hL"KI$D&XXXo~.^;Æ QUTaҤIdt⁤$:ĤI\25kdӦM\x}E\rL2+Y^- *A{YW_0]WCFg"YN6B 4A̙3k׮m6v{ݻw)[,xxxI2eN٤\r;vsN8@XXu|7n'''L\xk۰TmلN\iU<=D!HBoooիIHHrԭ[ڵkSV-jԨѩ111O,dooO6mh`sll,f?|W'O*VHڵR *TRJ)SKKK r98{,ǎ# $Uݻwq4h@\plb ߼ !!&ۃT .gcbΟS`,3BCH$h޼9͛7O=vސ'NdILLҒeRR%pqqtҔ*URJeيkzuAAAsUtΝ#00,,,(WUV孷ޢVZԪUE~`6Ѝn6|zoD%~I]أiS3BCH$D6D۶mi#' s?۷o'88[ngoo+8::ފ+#E[[[pppL E!22X'<<ˆ <<7nBPPѩ/TJ͍=zPre*WL屲%g#,bF^jP08;kn62.8311&BHBVVVTVjiDGGĵk&88ù|2ׯ_ƍĤٶ ,X[[[lY7_|X18Lwt؈Yj־l",ɝ:bRprl !Dn%P $G3@"]B&,(PǎA޼Pmg)`bcrVBB $!A(R: N5Lz2AO?A\n,,/C $!Q {8L20u/;f X HJR7 2:!0HB@z<C O=L@W!}m׮ȑFg"قHB@ p;`_Q u~6!fR._L"[eHYa6u  &XF9mFg"ن !)I$sF>,jfJи1jet&BmH8&x#ﲒ9c򡾁F ˿ilM!D*ABpp)๷nii9)1$ KhU\q5:mL"[$!D`}h 22 CJCқ% 4Z 5i\)v0:!v@BK,veύ #ӱ5G8|cr ׸FzF5}:4h-[Bd;R !@IqL`=Am`[.Y!hs21:lGB 2I!N>3"`:ӳ&cbY΢PF$'ÇBǎ2H!A $!H:8!kf1+kV[KH5 4,y+=H|9̙Fg"ٖHBb ,x#66`f&p d -hdMPZ&r T\~4 {/WSB9HBb\őHW|UYPT5 ?dt9*}ft&Bɟ߄Hy3i|ǔtUW%37 8FMjJ9RY!3oR!DH-ޢ5Ȭ ~44}.qpeP8gt&B;!qI W8),A` 4ju1 rXaE-LflueF!=) eO[~ }ԠA5M j`ѩ 110t(t&z !D:;!bmʥ=H׹NӃw' UB|Y;0gt9ԩ sBR !H +2ߐO.0X`<ġCbx]int*9C@̚.]!D!E4l+T0>x8~$jHNjLNo089^" з1l"G!vBAzIqsSWWz uR~~7|:?a-\>}tI|`؇_)gϪ񭞿H&6a=+wfpL4uFt|4\ХC)RYganf7ۿŠk7`@¥ccuF|rm(|s:We߅}-R#_yk[B.x̓;Ӗ#s806LbB 쿸?N6E̙ 'N T!2B~z !AJG~dLecoHjTsgqjқoEsޅ!CI }U51I$tF3l޽PzțWYSMyܹoZH1^u+]ŏ?Eݸ4ݻjϑs/3vtL=fgnl\۵6 pa^:C,RhY%<>ݝ{йfgZSRěfMvF`ffƠX|`1wq?\giKuJ+Pީ<Ͻ>MDDt |-#vmŁqxrSUVGT\ ,e\s]}I$m~zۨ/Myc?)9)㚚3vU BdHBzL@&6 3Ol1:%޽j1P{eXL=|zizhYSw0Ԯ ܹjOGR:O9gAǎ/=eq;6^xx-ʧUc+,سހ's92/ M~<+{.EQHZ|ʎ:uluKM}|É qX~xc5wL&AzB\LyZk@![7~cЂ^r*Sz~#%s i%K$fDy9 q21:U:~ff~FYt6t_85k=3.~yZ)2ԁR/&6ѝ:->[19usuP!B" !Ŗ82н{&s1|,fcKKg۶ /4jAԛ#X:Yv5Ġ9uڰLQUnt6BarI-^wl"4Y g8KX;<$tm4i.lִ%N%r{yzl$I$Ю)..GHXhF3]@z 3UA`G>!* :vW^F!L B`Mb a0 Fپ׍DW?3)L':JGo_CBdwR !bC{6o3toF_5:((/tV0t4ԅ 6:!0i2NiJWF2,f\$&֭ɴ{UvK\bN%{1VPXlIB!vqq9@Z*ЇьfӌNW6i4:m 'ERVFg#HBl%x$' !v[B?.`&ps D7WFbCGuպ#F!r b'[x#a=H+];Bfau)`* ["Qt5:c8mB׮wFg#HBlQL K)yLfқ||w98u^D7ijXq.^6m8/B!C$AA7I%*юvi??9(RD]UKQYrg<3|3!FrVMz/-n_W{M~3`!Ȏ@"pOnqH"S t yH&vKӂ:+'Ptf}IϕL2>KXrӋ say83M"Lc3Fchuxu9H!r%)ȅnr\&{{HKٍ4k;v@BB $͛ke1 $Зg=`h>};DFBϞFg`XS1F\˰w/BZ2I\h,cQP{N x<=. f8LgYYG)ULt_ѕd{ԞVu)ʕH!r5)ȅQ f~Sc NPY.///{8Lw4%'jaJ!قHBRf1c H-Z<] ss92o_w>JP"Kk1u3IC>AS +WЪ !xHBbO^>u$%q -y_'N xƳ i^W/+4ΟzgS:)֬QW'leBF $!r1; ,L=f%miFڶˇ; bC=vͶFڊ.mìUJiڪFkIĨ4vBBsɹw_q=#Zd ËrP9&> e5)G9R@)IIӡ AAF+ hF-ܺ%hزE#F1 i4PKT+P٣Ǘ|I}d#ݎg'CٲgK,_-hs\ԣG/o"FѼF h4#&&p8}4gΜܹs\~1~y@dd$111<^^^H&nnfx{{#GrE޼yɕ+9rf/E..ﲓoU+IsMl3?sӬfR˹s2'=ض 3ZFh^m4'$>>cǎ~8ٿ?'N >^2xzz&ooo|q^F*eD^Hyni IDAT c&&&Hܹí˗đlوqpVZExxxruu@,Y%JKɒ%)X .L0Mi;lg>3{6H'6 Ǐ9J nlNh4'F$ x"ܹ q*TZnMѢEɝ;7y%k֬6˶?>>N:ř3g8z(!!!,^aÆCڴiP+VB TTL2%< f PjeG(?>DNxsRǁRg+ZHh4/6H b۶m]uֱ~(Q*Uu֔/_… [f-ȑ9rzSb N||e4̜ b \`4D  Ҧ5ZFh6HI?dYwKݺu=z4+W&/^ŋӡC@1 5kְzj9g*O®%4lTRر26sf؜ =b֯ߖF;lPFhl6HM&..իW3sL/U&M7$6xyyQvmj׮ sXj .u$K Ү];իgACYLjWV0ZF2U")c{,VI=<=Vh4+pՅF<;w?~6lHDDGN0 ;vt:s$gNNXf ΝcȑӠAСC0Zm7NjW1ZM!O4c{-sԬ̙͑F8 i4I'NЩS'ѣiԨd֭|ᇏ4/xȜ931۷og4hЀ#G'O:wɓ'xlng{g<9D&--?fwh4΀6HMԩStؑEvZƌٳg4iŋ7Z^חɓ'ѣYz5EsΜ>}hy/_@_7ZM9Y[+rh9#&:tSaDptOFyWt@޽˷~7nd„ ;vO?4aNݻsqƏڵkaȐ!ܻwhy/c|JlNOzRlǍҩsgi4hĺu(Q#F믿ȑ#|$Khi#Yd|GݛaÆƍ|UĦf5 XD&≓9p l 5cFq:AhL\\^z/^Cѷo_'On4ӓC%9=| ?~jժq9%=`Z !CVbSb(Ch[и1YHh4vF$;v ضmJ2Z+Cҥٺu+J)9qђ^=(Wh%6#(ю4=퍖cgз/@Fy%I3׮]7$C l޼Y-#{lٲiR~}_n5k (6VO.qL6ZuDEJht8\\Vh4 FcGiܸ1qqq] 2-%cƌ^۷oӬY3bcc3p ԯele+c&lFI<׮AFRw4otd"F8m4;ܹs9JdɒuV&Mdի%zDs"=yxxBCSwfF+h4h؉ D>}Tr4gϞߟ;^!R{Tm'яH"xVqTFyqAhĈ#H*0ŒBӇɓ3j(xJi=pckG`"H2h9cxmVe dn"F6Hc޼y|'Nh9ɓjh/Dڴi㏙;w.qqq9hl,!*8v7xi@h9/OL ||5  fجh4< i4v`ƍ\tm-!ӰaC.]dM6\p͛7;? Na9Q(ZӚxLӵkWj֬ɮ]dԩܽ{Yfѯ_?ϟ}_5EN:ԪUPҤIc7oޜϳf\\\ %**}ү_?fʏ?J[(_fϞMbpqqŅuqFm.^իW0a Fy9&OuaCom4FDAh@z]*_OOτ5n !]3ӧO`|||PJ=hذ!E}0eRJ_|A }S#N۷oxIEjرc z#6vaPiݣ} >ns,XIo]ڬϜ ɒJh4In)9 m˞X113ٳgٳ7%ɓ'}cgvȑ͚5c޽ԬYݻw?XϩS%6mZ'DBh(#)R8g~w~g.sLfТt5K7c!a_s:tc7.ヒwB3lٲq9@޽)^8'N$"""9&O| =Xp!ɒ%A9@@,Z$)vnn9$wx|pKBҐ)+HԹ|r(ntxd|u$g0<)SRn]NJ||]5}t._˗ 000%gϞݻZ 6ФIzŋ3g3;؁D]*T~g}Fՙ?>Æ #y 0eʔЪU+ڵkGϞ=ݻ72ebÆ ?DINiiqqqL:Ҳ)dkT޲;xiMkq,%=x#X)chSNӆSNT%U~ڵvMQ56d%sRtp?Լ" `*U3f8w/ܯ_G&W\,]zߵoߞ?ԩS3rz=6m!!! l*Q$3a LV-ܾ :eRեъ4fgʭh3e]#J`AUh^NKL\,׍|||h׮ … F'""ҩS'XM>w~gx*Qh9Im*9Ҽ 11k/oZ:l7s4V T)x Yv-qf&[6A]o,)S&1'O!|wxzzҬY3mdϨ8;Wv ;B@:әnt3ZγY^ɒ"hE{dT0'mk eVa=bt4b iѢjCdd$͛7gҥ4l>:sFj2`$#YJf3ld3ZΓ9sa*i͑!u뤞~}XzT)X֭=rZW6H҉c?|h%֓?|uc7/8a Sn]֭[Ƕm(W0Z?P\9Y~=jղ,Yw ; 0Ԡr̖-P=ع5ZL o`,\h1 t\9"m|| $hSB?Ԕ)#i{ *W޽{ɔ)+Vdĉ H؆XƏOʕɚ5+{졢=?0{%OnؑO/dOC/ Yc-0ki0>42G:AZL4J4/ ҙ3b'w.E`ʗ77Ikxɞ=;7n>G/_ޔM*]޽ٳ'ׯ'[6;)%Q*Uww;rc41X-qbbd׵+ $7SJ  izƍ(3%Z5XKh%dI{-vJVfK^;Vb >={:ujiӦ Ǐ7Zi uTVtұw^ hlH4cS@_hD 0>`.@0g̟}Yٿ&N{0Ҭ= SW_Gm\"W>h%&۶5Z%yפeؘ)QB:CDlY z*Uze#H͛={6;vXb|v qi:uꄏAAA̙37Rzݓkhy0ZңKٳc4on"3r #F Vb=cHzcHVI ^el$Yҹ%fF )scQpg%...nݚ#G0uT6nH…i޼9k֬$g#>>իWӬY3 *Ė-[駟8r-[QɓKIzwJV&ufIzM"bJ4ZƙX 6oѣeC60Ir4M 4Wҥ H!ۍVb= ͛Vb=uBdtA8z(+/^^z(PAjD9z($_|ԯ_+W0k,9BN0/ m‰#lf3' njի!CUi%}ukiaf/ g "c:u2Z%VIo@.۶6T)wn&Gpwwe˖lٲz-&MD…)Wcƌ3 OfԨQ)SE2e6mJHH6ms10xtkJ$w=PkנA'7 18/qqТMb:Ufҩr0vMI0VI6Haabv*WNvWz7tJaCXhIbŊ1n8.\֭[c̘1ɓ еkW-Z׍j3_΢Eڵ+'o޼?Uk..\رc)Zq"CBdA2`麩m`Cl}T 6Fck A J99u z=DGC2jVfQufM"qQJ'͝;0mi`Y6&2RB\۷Kta0rk2Ynk׮e߾}$OrQbE*UDŊə3R_0 $((]vMRSkצZjx$LM{Mkԥ.>S IHJ,YٳHlkرнj=(}v2os~)'03۶A0oD+y-dJltMktr!ɒERNRxJn]۰o̸8ȜYRz4Zix"6l`l۶Gl(Q>>> E1cFCt^tGBHHСCDDD憯/~~~SfM2ednԩ#M4}/{y7C17ȑR?1e4hĺhYSfoG0wD 6Zul ɓqzea" mF֑.ԩKi1>Tg=㏥QF+qnݺE`` pa9;wH2%y%wʕ\rH.ޤAMLL ܹsk׮qGaaa9s3gp)_hQ+F)_<+V$RƗ-$pT*e(r㉧ђMI[&M.]VqVlr$;)E[52Zu\ e@brk>RCySGµAڿ_&%3.Vڈk 4ϩS ̙3qiΜ9ùsLMttUL0Z9r W\͛7.\_/-;v49J>'eK?89zUxv FIg̀O>ԴtVc:{׌Vca3c]1{[bsٽ_S\?p7yPB6lslwݓiȑHc?e3]ظQf륋mk4͟oFA0# @ *DҶ:CȻLyVb=k.F+-k4jL΁0GwKpf RE 0a6GOo/cԢ 9sdiHxiK~4{ѫ R+X//hTҹ?|DʚUFs(^ns:a3)IIc['^n0D IDATtٱ^J^F+eˤ^U+YhYB2zYfF)龹j,h" yAru9αxmN Vb=m@TF+/POh˖IΘ1I~qrۄz㋯qbܑue7n9hŲeR_K>vRɰh O77ŋ\:uaÌVc=~+k_6'>mm™3vxC&NnIRvaƍ3hQI!;h4}[͛$=6oݬg=0ĦM2${ k.з/l.[fz%M5+o>n,;q={F+nS#N>۰h%0`ܸ!7$L 1{:5nsv3Ym-W%nx)2EfYp N595J6 [^IXT^<^駲fG9w$Wt8XObƎVc~~R0xJ4i&0ddbK,-i6Q2ٹS1,V.5^Mfyϝ>-mg"8sF%sgYGt| g"PJehYsuh"yqԶ-d WW)=[.HfGշJgX9J42 )WN$Q≧+]X*S"._,+_/IKTre(P@dNZUoF+kנQ#i$p!Ll#c晼,Y2!4e.] _>+XO V$y_~ 11FѼ,ƏO XbiG;2?Zrh_7v/]* 9V1X?֮LVx_&AbF|yi~=ъ#2Rϟ/f[7i?PvnM Λ'ݕN6߽JgI>h%W/&XjHQ4 Y:Qznlf|/=6 ʖ]d7t֮ Ve Hd/KY[Ub"p۱֬ +tMĉαߴ))z\]%y~%zٹhINqm(<[M$ 6}t[W".U*iмz\(ݺs6|jfMG\=Ymٳ:.^,Z5iY츸$+ )YRvԾn4Zu 9y՘3e߯&67A}'9*KYx^hPҀ\]!0~]F` I9 cʂլ\*,d,)uKHKo3wTJ6Ț7:u$8W.Ui/ac3f mR>f%o^=<5Z9{Vnݺ%cr>(6V%KJmDRQbEL58!+W,R;u}dER0wD#. kR1KJ70ݻΛ?sIʓԈ,X \]aikvRe.Vc|#MBTj4FnIk]TNv=@\\Jds؛'E iR4856Ite"nnF+K<b\yGlf&*J*IѾ}o)mԫ'͟#L*fpaYL _͊@EDHNFc+́}jU5Ԧ6Z֒t{8UiǯG\?$oCVpjI}\JΜ27bd0tI>ɢ&41h2 we$~իǏ?0K9^ /R o殈(Xrp Q^ܟXV-cHهI&JÆ%D̚ʩ+ֿ+Ҥydg2ERn6YqO'QBY΀ݶysp|||.`Wg\l.K`x` F~}1Bqqb,?3y×.݃yF+Ә\~e͛v9Cqu"Eqc8qhEӦ%g3!ykKF$,[ F5PlOEX1N/ 8|X:e*6zKZ%T3r:! :z.رCjv-:Z+')gJ f'FF 1k&kl} RʔRrD+UvTraɚT_t'&qH!oРۘkR2[6o d ShBZъśDtYh&$mJtQ 6m\ɒB߫tt3#'NȦB"R_,g͂eVxΜ̙[7I;;z[Ѭ(%Fvm:%@Nig$o#G$:ۥM+&)wnٵp4x}(Hƌ2IH{Y͙#EP `1ŏ;/Yu\K˖W%~Bݲ[c?]%F i2u*>-l2剉%Kn],\(3g^oM8h 0܍Znܐ_r~IݒV)( !5x(!M+jԐuPѪeS{ ^=hN v"Q޽|"|whO{L#_ ޕ]ѣ/H~kRR?mDR%K$Ӭ<( JK#3G@R_qDVO-RBX\~U6>;w L `6N*HǴV K)t4;3 ^=ZUZ*e*̯\\$`P#VM"|4s^Dܾ-)AJI$i nH yJJrEL;hi.׮IC3`:b\K͚y4#1CӹscG63y͞-]ҰzuYOP#2̺Ԙ}]Yln-rX% l͚I~;$}'U*1ϋHhU/Ɍg4cGxQw h齅-4)֐/۷CR(޹ș~b5&qq9Sj9@.-5z :-OOI3ٕ+rO5KJI|Rcifl@#YG:yqܪE ں|u*,{O&Qϝ+8fiSزEΧbEi][B/M55Z.Y֐+]Js3$'S)ZX~PthlɶmyXP;j֔EwÆ2b1RhDR)˗KGVHѣbfX&,X#j5p춪3e1b*z+T$;MHŲh&{Ov:vѣh^ݻ%WR+@ `0z^}w\;^R-(Fc+.\ܹbsgI:yS6)g͒e״i<|`\"QЪU-ю~-mKqqRG0h.MS<=/Xܺ%b\ < (v3GEIr֯/M$7"…zm._M5JYbf.׭ukY;9C$L|(;WdɔjNhd؜+JF :}h5TJ(fc*RPqc5Z9XV)PM)ynn3VWaCeSy:b*ʡTJ)#ݻ+u}Ej^ nRjLjՒVTJiYΩaC'WSpRw:.]RjxruC.JmݪT\y^J~QRykLK9Ԃ) T*S&*WvˡCJ)TƌJYc0uՕ 7Zc1IoTTj>ɍZ2HV~֑)5}=Z69TίW\%WT-uY9vLwTJ_ƹk\JK'ZU*5ޱJmؠTJO/T,#"Vgw*Jnl<իԬYJݼi:vMVvm&g̨ԇʚOhW*gN^{MgVc;wQÇ*UJټY)ooU t,;O3Gw4.oLH֭4a2Uꢺ(bsׯ˵C%NMcNbbZZN@R+5ry]{)JRjj,ܺ%ޓ{Mԅ Fe#)y"aGQ)Tar&&MKaqъ^ÇʓGd'_t6lx~iFj:{VP,Ŋ)klԭyu^USTJRUs11B!R3""&!:5NFt~@r1B'V8.^Tj INBCJrNk:>&k )%TC,ssj^mITREdqVP!-Yb0{RSKņO:O1L'' ̙95J"E V9HاREO^uFq @ʂ{xs;+ThV*|wwMlÇe #ר4im(>H~]m%r*)a4/6HF0u4h\[Q^Nο*U~x&$)s劤7KS?9S/p%da-WJR*?"3 (ռw5i>][>kJը!lRJI]…bdyPh1fn'5}J9-圝^(Rbr͚Ω mb*ٙ(ZT}Vc[VV*kVy,]j뉉Q盧PJ*8wO]\dO8AAO X->;U~PW05"UkZ*W5@ xzх ҁ]ҥ0BcRbbd{ws֬^28^ 5{%gN9eMvMTmJ)O5`׮G#aD^c5΃6HFr,0%SjsE'GXD\\9քJjeKs.DM||c.?$I#9+oP9j#wPTEUQ^WwFAtJ-;tK~6R;`,N͖f+*IWWd"Y)u !fժ% @ FAJ*)sҤg""BR@f1;&$I1K,8XR@y|2aF)S:k2>qtsG V_'IU**6>Y9wN_~%u.wn+hDBt $,…c%2Tモ.[V uO~85lY1}..Dvz2M))lR9rHnYF-QQr#JBsYܺnCF+z>11J!/P`G[K)7Ft,ÇC$&A;լyV*ZT%RK r9k@zRK?? IDAT-ހC!y%^*U11w/X zuUKnnF+}>sY^;v;Y[W;?JزΞk:Ԯ-Jٳr>>L ..裄ﹺ6mG~ݝ4iMڴiI&M#UbLEǎ0k\bceK7dy^R O5GƤ\7Y_V6 2fv:͖h'>ðu|tjUQCoҽ.?hعS32r/լfɓn֭plT*eBF+81 {`yd#Goʶ;| (\hU5y&LY3y&ΟqCO5%K!R\pΞ=KDDΝKx={ׯs xyyҦMCl T{y#CddF4iH.dϞ=#GeF9Ț5+Yd=1^'YZ]RRs [Ĺ P>ynUXA CdYl8!zD̰Ў֭Aٶ ^s/ơZ5sFQ`.yvǕ+rVMի=LXn;vH!J7\ӥ3ZB$3q,'OرrptA*es &#Gʅ>)Ф \) -~:'N="""IY///rI֬Yə3'ٲe#C x{{?ɱ<,QW/ Nqu\BDD?0n߾TϔϳT)B~>{; =PlXT"Qb;7 qqܶM fի!^]LFc پܹVe;,FZR1ZYoص {O^3##dr|? ]=+r9x =zǏsʕr!gΜ `̙3!+W.`4n"<<9 <˔)V$ Y3D\ݺIc̙Vf;bc.c)Qr4ZYP .~dҪP!c"ĈIʗ DbݻǞ={ؿ:p׮] s̔,Y% @ϟdɒLMݻw9y$ǎK>|s%ҧO/%Jdɒ,Y2eE1AH=*.o.GP%d\\HL|X4mիTaC)҈J=tvr]ZLkɦYwO^s۽W>s>>rNP9_< 伂Z^ø8_G*rOʳF/ߊQj^lEqw#>^jGg jF,%ͥAyJ~FDH^wK^\-] /*6A} د:tݻw}vmѣG#SL*U ʖ-K)TiҤW7o¾}tnnnd]7c& *32Z^OYJ*%ﻒ%D YE9|Y69,f;wW,uIa!5 ٳ8}ZL{7ܼ)Ѻҥ%(PhsdH\.->>̐gZYc?_;WQct4̝ K_os-.NgmZ HOZdWnb?I*]V` aYvZnʎ; PBTR???(Rnf|mLD\\GalgOl'lMRFTr ?JE9PJR,Xp|.}}%RC6,m{`kMzPܹjvǎ/}u?o}WTA?_N1xblݺݻw;={gϞt҅@9̮]8{,+WK.<<) {ܔE ݛ=2Rn4onfY0  ֭U /A[P| y_͛-Jl pA}UVQiIRY˗Gj]׮];c$$?WRt#?1*Mw 6ruwWAՔ,,`XR-HqqqO^?Uҽ{wzAϞ=qyeBdddnXڹs'iiitԉ~'|իeWzzyk._V/}|)Wut$3g6iVyEJK!ȼ꾡_5jQ*n(8!8{VM]-8EU+{,mJ/}T^竒^^쳥㗘`z[UpjUUV{eis|%KN.|CW++_IJJb^ lllׯC iXe\zz:[nddggӽ{ẁx/&z CF ٪VU? m[T؋iCյF as{p옺Iףvm5ysuFJc:^0u?ְjRB Hѣj֏?wWe›65uˊVB] )cƨI֪$PT(4 iܹŋqFàAٳr*==;vvZ~g߿?F[nҨsQ3L+LuJꅨa\V^2)I [srX-[͚wMS BCBfꓧg^2Ҹ~2&` U 3 ԨhBw!IRyv횚嗪\g hο+~ p#F@^^TI;+--Eq!|||=z4C&qu~-ZDxx8[f̘1 2J漗NI16TذP/D A\eeewyGXXzʕoC=**`00ܦׯV}17>&6VI_CAO//uk (%$ 5*oZb*Fje]Tҷߪп? Jh4_oQ~ދy*˗/GtR2228p cƌCpQVٳ~+sobꦕt5bvE^ߴvt55= o4+oo]|׫wT]|:A5*\,#'Gɼ0t: \90]z7OŒI@EGòe*@:~jj9-. ׯ}~֮U{X[@8h h;߼^l5N!'Zd,Y^y{9-$.. ͨQ}:O>$P\?999[SO?ʹip+2ׯ2=WC0Knwk0uBzڻ93gfR:jUUCMm+V99*)l$BM{`!J% Hũv-ڥ<ֻz,qvTai&5Mwx?%B _Q|@'NW^?W_á +ʔ&O̒%Kҥ .Ӹe ^|/gocӜ9TUм5{jOh+ II*0F ""TVm2sB ŋyEclmBF*c A/2R}_:Ѹ5B9D0XNL5o_5=ysShee*xt ]ԭ۝_M ɑoӦ-_ٙ/=z<|߄xH۷o_&&&y/cOm`maq^_::wnBG $(K5-/0?J˚$sё˗PJ*BA:톏!Ij $ի'a}B H襥-[ڥ˗;{C*DwNTv?P5 K]-nRJCdCJJ Fb͚5{ؚ2M6tԉ>M1K7o| C aѢET?7:^]mXmiIŊyt:ڶq)EamI3gU7Im@BŋyS]FT0[4 +KDž yAD֫F4P ԁUaV$ w K۶VԻ=z@vЃΆRa)(HV{:uR xT_|q)Ν#00D-[F.]CҥKԫWdHvx뭷Lֆ`Ν 65jqFV3g§w FYX#;[[tLMU>!CUʕ }ww5R {62b8舝jga#.. #\wFdHq$ ءSԻо/[} KnllT>_,P!$$@\]]ٸqc>;waÆgS7E!**@jGD6qq~1kkxUraЮS"{SM?sႺty;8ё ^9ٹFDJYFǗ./^Ts.KK5WP7hwH@u J ]\++5 :tڵMҢ1gn;P#m:iwlݺҵkWV^M%s._L^QT8wʕQڵUzDQMS/^ d?QQyR~}5%^dήm4tbbTbb>6˗Ukk^?ԯ9nn+($ 󒒢jջkCy߿tOO˺u!XZ G0`+V(3n8y233;w.III̟?SbooO?͢EHJJҒLaԩ888~~'֭[ǟK/޽{iҤ 1;v9:uB׳n:l¹s?_زe [lȑ#=;w7|/1o<8=}rYQȑ#Yz5.4<SM?OS/Ԕ՘$#C}ֶ`5  yo fiF? +~`.SrrT)Oo_/Ə 9y})aBb IdUUPWWkZܧi*Nx /;;7H|/XTbMtt4qqqt: ŋU:ZjСC6ḿ aРAoЯ_?._ѣIOOѣ;w焆I||<իWÃ'Np6mJjj*ӧOgذa?~>}о}{ 0aT^/W^y'K]rrr; iu!!!G7{1~7ӱ!66'''ڶmKHHH}mM-==]SHH(X:|%`*DG!0DEge^9֩Wƪ!ũЗ_ PFdvΪM!DUL\.Kllڤ˿3jM M^^ U!ѣ V ]\ԜuՋ;TӄeeqxݺrK{9Əϊ+ϱZ MժU <ީS'ſh{A 5]!~n}L@4о}{oΖ-[x'HXyۿ֖~Y^^urirZba/JzK/tFG '&FC(_ ;''jT%}/tT o8k5kS ?yըcBQ"$ u*xy%'t:~]V/ԎMSh*o=ќ IDAT{j3q.8uVV^͎;]VT܇K/Ν; `>y9~:3-*J=n ;VV\ysX$I@*Gc6v U娜ZU%/6ILL$$$???nܸ?8p wرc9tw OOON:EvvvnK2g>LŊ:'%%;;;\\\|2 6… Nsqq!***w=Yt)o6...Qzu\]] L+OΟ:ElӦ<@o1PNÆtR yΣ7?whjӑG* !D kXZPG~٪4!4EDUE+˒!< -$%|^`VhL}sF-Z'x܆#P61k׮裏g0k,&LڵkRJ0c /ԬY;wbu_͓O> իWٿ?oyzsҘ5kW\O?͛\p3f0vX;UDbk׎  /x.GGG,X33ѡH0b 7nJ^GEEk.ƏO\\\?giqF ӽO*kqt1}B2DFxPyn 6a$I>ZhS={, >}:.֥XXXPn]ڷoOI+{1FZ[S(kJ.LB!&;Չgg+WN\S4 ,,HqwںYΤ[,33y̛7׵hƁx뭷X|y>_iRBζlɇ]Pꫪxuw*S!BE0+W ~gebժXÌjtt@F%2.557|3wMШQrFsyYbtؑraVXQ5jH㲲R%́ӧUSHN>[j-BRIG* 5IU@ǎy#ܶIlNc&j%W_%,,ݻwXWؼY헔VN[!x@IbgJw|}|8:u'<!C0f*TN=իK,!""+99I&S7G!(?4!J(^{WMݔ~i 233sў}YĉCUz988h۷o.^ZF9shѣG5@ٳg~hxyyiժUrrr4MӴk111^#99Ysww}bbb4wwwU6mڤjohrJJ*vs _.]UREӧkϟ׶l٢Zs駟jZ\\ipB Ə[>ٳ*iGhS7E!5?ehշ?lQ$.]t:6uSr5h@/؞={4cӦMuk [v{NNNc 5jh6oS5k]~:L>c裏j*ۮQR%BBB:t(Ç_7ߤf͚ܹ++믉#..W~*Vh9kٹ_3fħ~JTTT͛k׎T^xq:t耧'kfʕ߾}XXX0x{}ki|Ӈ}i& GB!4s|/D49s;пۊ&>}^sɩSP9AX8ƍ{صkǏ'...~_]xy6o̙34iRA!_OkXcV* 2E[ooo>7oίZmٲeYUF+/Oγ>snݺoߞF>ӧOJ6myرC‘BaF$ 2[n9rVZѧOzܩXɉu1~B+וu zsDpp0V_tz-/_i{3g$((e͋Õ+Wx' ߟ#GХK{~!Bܛ$QfթSݻwNƍ6mZ(/LfxYpa?HMM7 F~y˗/_fŊ8;;ӱcGÇYbM4!++˗?P^"{dڴisi~B!0I 7od|4mڔw}?&BKNN6lL4ɓ'ckkk !D QFTXӧ'O>$͛7gڵ䘺ya1h ||| cڴiB3'I+;v&M0x`|}}XUbŊ0tP eʕ D!|I@咷7k׮%""  'OkHc;wcRV-FAǎ9{,WB!}$5WWW+=/sGS7OݻwSOҥK?W_}'B ILJ r,Xӧܹ3̝;˗/L\tsC.]8{l;2b$BnȧJ*=#GB֭>}: 4GeѢEř]v/ְ!3fߟsa^|E*Wlf !Ho!!==[j*6oLVV=z`<ԬYM 666 ըA *`f !%J| !'`İtR5jkצUV[ڵD6###ɓ'ӲeKj׮ѣe᯿<~_|y1b\Fa;w.;&B)*!!Ǐs!:Dxx8aaaddd舗޸ٙ%#993g{?~pP>>>xyyѪU+Zj78|*VQf4FV >F ~'ԓ$(qɄrI""" 22@`iiIqqqvԩS'''qrrN:Ԯ]ZjaiiiNKtt4QQQrbcc"::+Wp%z=cF 4k֌U[[f|&25QQx1|9;!$!Y M!"66WrUn޼{888`ggw=vvvX;֖+`eeuBvv6Err2III$&&|ۑHRR999׫TRn3:u!777UV,_Wc·|\C ̛>] =֬?P~'ԑ$(uRRR $$${8}CyXVVV888舃CqժUٙZj\#@E-LV0r :1LgYS !($ !ʭ[Gx c* 6`P2jݒ%*BdK!DqttQ@lbG8>d$3v 9p,Xо=n ˖AVVwB!$ !DhNs3a0ywq%{_J5JMڱC矇adr;!B HBQҐ9"yX:pc8{_@U1Ço_V^~N*N!$!(v1DbsCC?LqiLMt y6mMO5$KHB"'I! 6 ca NG:Қ,czHj݅ o`azAXB! HBQtG?v'xhA ;2ȸE,,Mu:cbBQI@Bօ.la 8#|7d&%_3F(]V-4 ""`*=eKRzzvB!(c$ !cXAKXQҌf{,iQ 8x||WaC6M'!Bܓ$!08#OsŤchPVjӧu°aj%!Bܑ$!0Cѣ38ҐiL3~+̙}:Jڵ7BQH@B3ք&g>99S c'9iETQю'̟ii !$@-j1i\ _97AY.'woxmpvVe/\(N!$!(E*Pᶍg{ЃVb&۸ 5iF`tXTBa$ !D)dEƳ87ތd$HqWG2б#n =deoGB3#I!Jd839̡>X.rѸX[2{2^^ P*~B!D)'I!ʈ4dsEf0 l1yL*4} 4j[Bs I!ʘTe,c99ֱK\-m EUyKS7R !e$!( Ba{pƙ! O30B0aZmܼ :@x1BQ H@Br ְC=y7iB>H0":]^#GMUaCY$̐$~,e)8dz<ˇ|H= pq!?+&iX\\`08q/B7 HBQ9lfs|ax:%''5ztnw@jI!(e$ !D9f 1=8`SJ#͸ UF`vE Y$T$P6Ӝ7yqSuZ*딄B BИg>QD1ϸF?}_(:ѣϡAu_) !0SB{2"5:Ёִf&۸ _gZԯkB%I!]` an< -N T1-a2*N!F$hNq@ ЀьEuJ>> Pi/>!w#I!}kDuJ36G1mys5ztZ`A:'B!H@Bc,c9YV\=hIKt,] Ӷ IDAT=p΅?ooY$I@BЬf>r|xWpŕiL#8.T ǏÆ j=U+Y$DH@BQZъe,p3e8q.baFvPIÈ B !IBbs.'/=&6waz8u { &MRi.N!(w$ !(VuJD&' nwƍUh`JpqQ#Mo'BB ,G? & qghBf3) jR\kv-!e$!%f '@f2g#̸)= C'̟7oo'BIB|Dͧ|^/i2Mq 5kI{oCÆtx#SB!B*T=PxgӸu.Ը=:^zIU[ 'B! HB!̆&6qS bqnpլF._ŋAgBܓ$!fw3(_| 2*ѣ76r BrCBf(A Hӄ&g>iilgoo94QSdY!$T0 st-g27B-[ѣӧᩧwUcՔ@mH3w9!&!I!Dg5D0 >*+lİ\?Km<C^z:qJUsrZO>) !(IB)h2qa nO;l`mhåjQhF0JWpTI7TYq!$!eRmj3i\2KX)Nі5XF6y%q]hA r5a Cpiw3fI%E!@iB!ʦ`XzQьE^dXRK*R_t̻@6L^_XXѰp!t%УJzz:ܸqty&$$$8?%%|Gλ >ׯ_ 񤦦Bzz:)))B^ʕ RSS*sTX{{{lmm^:ժUF=VRj|$!V f4P _~͛UKK5%orz"oܸŋr /_.~||mRJBBjժTR[[[8zc$%EדLZZ$%%qD+== O\\]bŊԫWիW5jX_(dI!(êR` Gڿ__@7=E֮UU`*Dzz:DFFFFF~[....8;;ӢE ԩCڵoI/YZZz}3K.qU._LXXQQQ`x8ruu͍FV^()($ !(6hy^gBKZ \Qo]{SVby-(_>4nܘ:Cգr%(s,--Y&5kּYYY)***wt.225kpYnܸuSᾷ7k.n !JLBQnu#G9FChFX`a)y:Dd?8&'idTnnn具7nnnR%$$vTZ&M~Oĭ蕇)vBKc=d>f:r!l4n5D G:Bhh(aaa?~ ,,,puuYfЬY3|}}qssں$(ٕ+W8~8ǎ#,,C֭iӦ6ROBQ]?Z4QQ\˹Fe6 B"///Tb~ ̙3NѦӶm[ڶm?-[,bB<, HB!D9s ޽{믿믿HJJbŊlْVm[֏N;ѸqcS7Wׯ_߹X[[G۶miӦ ݺuN:nw$I!(z= ((;wBVV<#ӦM|||zB߹ܸqooouFyG3uS%I!(N8Ν; b$%%J޽;]v}qD $$ 8x :uFnh׮}o+DQ$Bl߾kײm6]Fzx޽;:ucܸq}#G`ccCׯI@B!J vɆ ظq#4k֌H˖-0u30ŋ_ٰavBѽ{w @`` j2uE9 I!(E_ٺu+iiitؑӿ\]]MD!Drr2۶mcÆ lݺڷoϠA:t(իW7uE%I!(oYb ݛ'x>} EQeee{n6nȚ5kHNN&00#FгgO,--MDQ$s BJ|x{{>}:_aÆI8債5=z?'::͛70`j֬ѣ9r䈉[)D!I!Dri^|E\]]9s&۷'$$`F(XXXн{w֬YCDD&L ((VZѥK~Wdw'I!Dp! DӦMٻw/ ,ի,YmۚyBu;pYv܉=}EzS7Q$I!4M6@֭IHH? <<ʕ+B=NG.]ذa<<󸸸0m4LD!̊$!f۶m#((S7"88^LL Wf̙w}A%&&>5DA̟?03gM6o%'',H@BaVbbbxs{nze▕=L2jժѱc{ߦM&N'>}:O?4˗/c+==3gҮ];)Q5jŋ56mb arBMoiڴ);?tM+UᅬQ;99QZ56mܹs |-&LԩS2Q\\\/9r/l a2BܥKѣG^ <<Lݴ2O=R/[o~\X26lMŊUC_Gח;v?aضm%IH@BaRk֬ϏX<ȇ~HJL,!ʥN=ݻ7cǎ%==DI@Bazc2d^{5>%?ƏϞ={YÇөS^jj*>#Futޝgff2uT^yLĉIKK+.w}?̊+hӦ /_6u(1VnB'33Çn:kFa&sQ5 jΝ;rל5j777Μ9@)7!!!ݛ.]yxMo$A!"$Vk.jRZuNtRn[tw[:NT 5RZs1XcBHd8G\ $;'y?$gw':uԱ:H%v""Rd1dҥ*GL=HMMJ*`РAӇ-[ZI4$""믿ȑ#L0(rSNo/s7nǎ 993n8x7c„ DEE1f>ٴi%RSS_;={6O?4Ǐoۛ[ne˖Q~}nׯϪU`Ȑ!:tlk ?Znرc"R(\1""RrchҤ ͛7/:8󉌌$:: XGP0'q>ϵY3H""RvItt4s4nܘݻӧO|Iz-~i>ξ}طoÇ?w}rJV^C=d>f֯_/Y={h߾=7x#wq&MҬ,FMllC8q5kЩS'8)d 2fY,_w}z^z7|3׶#G뵓&M2˗7&))_̜9Ӿm֬YL:5׾5k4IMM͵}׮]iӦ[n1۷oo6|Z o?xiڴiҤټyRvv6m3>}4ڵky!!!0mΝ3YU߃T\ΝkԩcBBB֭[s&11߿w7iiiVG"_%3}-"""̶mی2eQ ,::"?L۶mo Lz 5Ov `rm/)vaaaa6mjj׮\,**4ncLzz 3ٳy|rs=*YWuwxSZ5rI125y88m^{5JCA%v""R4i°axgHHH:5l <ʕ+cccٳ''N.U.lロ_ٶmoʕspƎ )Sسg/2*Ts:Я_k=BkơC.3<<n.1*U/i)iTDDHTP~iuk2o<6oLnۖ-[FٲeP+V 8~Oʎ;ؼy3|'@=L}coߞ[9̘1AѮ];+vɱc:te3Ο?Cr9C%%%dFŘ1c9r$]veȑ$%%o !>>SfMN:籆|@?pwwO>W}?tr.5|ڴisWWW.]zs~;'Of$>.O?8"DDڲe2 2Vɷ{&###aÆrʙӧOcraZ0`}Ls뭷 5u1\jc4h`ɓ\_=s 5/}[BB 5k6ǎ3W60ƍ3K,1=/>}R;vlu)[jՌ_YƼMݺu `RRR\^\k .w7od̙L0(bp 9s2eʘG}imUd{ttĉzeLrr1Ƙs皏?l>ScLMu1m6C ?ok)S5Ss|c̈#LV.G+k/;  `ʔ)cL p͋\}+{. 2+Vd{\\Lu`ܹL2fVGKDDHy|w|ߟsY骎;FJ.ްaCn6>S1'N )))oFBBBZ={;222HHH 44|}}WO>o߾ 48"NIDDw… _i߾=:ZbO<[neÆ ;;u]LB_D8PAKtܙkג7ȏ?hu y>IPP 4jԈCi&q{\<w`/^WaYkqa\}X"׿.) !!!PzsĘ1cHII}e˖L4Ozz:SLjg^5=]y ' 3gWJ'mڴ/믿_W9RCIDD,ƍ;۷/eWVj׮gϞٳ<ΐ!CXhG}QbEԩkSNիHNN`؏qqq $>>޾ddd*/GQF|=zԾ}ĉi火ufj…$$$%m+VdΜ9deeq7vZ{91ưrJT̸L2___nVf̘a?sαl2zEÆ Ǹ] y.~¶gbrퟜ̐!C\m޼.]… 󜡻dV峂1>nt6l%R&(+M@@ 43gδ:N.˗/7Yxqϟ8qŒ1"׶/¬]}?sSR%nVXa&Md*Udvj:dƌc_am&99|嗦RJ^l]v_|5ƘFetbFiFe^{5nRRRرc|ꩧ͛~TVvmK.EVXaFmwfΜ9INN6ƍ3͛77}k׮{5?ʵ3g믿n"""iҤͫ5h) IDATCkW\ix_xgc1{1/+WիWaaaCC^zL20_}Yry^ݫW/s]w?+N4ɸ?sQ۵ki߾qss3#G4Ν:CaDDDw)~iLB6mxwhժձ; c„ VG'׫W/Ϭ,+ӤI&OLfͬ%T0'q>ϵY؉HǗ_~ɺupqquDFFn:W_`YyLkײwbѣGyg[.O?eƍ*GR HӼysVX9s8vZcǎ,]ԲL㏌1"4"oҥK,6lk믿_d޽ <ؾrHi DDغ;Y~=6mJ*tڕ&M0uv=6m믿ĉ2336m~-dX~=znݺXO?ƌ%D#݃$""Ncƍ̚5Pz!~Ufu4b̝;/%Kиqc}Y $bo~`׮]q;ԬY>}0o;)=ԩS>Gڿ8p ׶t\]] N:ԩS-ZаaC5jD5(Wg$"EIDDtLEll,G%&&Gj*ONrr}eRZ5U+W w4%СC CVVV׻SbE*Tޔ/_|||___<<<7%c+Vu'lr;ӧOs)))sRSSIOO'99sΑӧIKK#==$mJ*aHH+WF/p8e-/H$""$ #,,,_'''gR.Ξ=Kzz:gϞUN,$;{%ZZr%rxxxPR%{a;~MWjԫT󩖫 kP6~*VsGIDD'KBWWW^wf6U,x/Pzltwܡ$"ЧډHyzzRR>}S M<ذ] aa9%tC3sSA҄&f6sÓrlP)TDDD "%,!X"$.Ъ̝xCؠ"R HT,f1NI/́GbEIDDDJ&4a! yQ]aT>ܱ!EXQA9\q &N_tlH)6ܭ """RІY"H|e 6P߾ /ؠ"b9$)ҕo{|Ø 4hO;T6*ʱ!EȨ H !s?oVʖ3Ivسǡ9Eh H }COz ̓#GTD +SB~m`CErR.ؠ"RTDDDDSJ;ѕlbS%K ##rӧTD EP̤5; s]ll *"BIDDDoR̤1D'v`5n ڵ0hl *"$"""OG:pC{sx5fRA?ߨNuZѪy'|!2|cCè \7,a h@G:Mt:>Y )"$""")|KRW{5<URD H>](IhD':$w\vkץl˖]`f*H""""BIv_ nnШtGӡU+^r\p$kG\$ˌfYJ7rQf&8 YH^TDDDD /~' 6scnv_~G:u*=|Pg "yQA) %):Ёl ^ 7+R|,`o{vv}HZ~ uē&pzыy L2-lŻw7|ξywwBL/"$"""rS>.y 7^K_q#i9%3&OλMZZ>}tΝ;k+U0UZ j֬IPP=4$;v{o>öFZI}*mIpp0AAATV{5sS\9|||H-HNN&==DN<ɉ'rDϊ+8rLhhQ^=իG@@@ȵQA)3gΰm6غu+QQQٳgAݺuWݻwf͚ӟ;RJ|||w9qqqqÑ#Gػw/ ,`߾}?oooˆ <}зo_:t蠲THTDDDDJÇ駟矓@xx8_~ԫWxr?3ؾ};ժUG%88x% 3ưh">#.\?>  R)*v͔)S/ILLgϞ 6]~%( I"""Rdgg駟r 7-"..7xC_>ƍ#>>EQlYzIF:u*VGbNIDDDJ~[nCrM7Ō3ܹ-*E\]]ܹ33f`˖-ԯ_x-Z0|I1KHk.nVzMݺuf̙4jhbƍ3k,vA:u]v޽hR S[nѣ,Y3fРAI1ӰaCf̘ŋ[na„ NrQAu)vʳ>˰aضm:u:s]taǎ<<3t֍ӧO[K $qJ{UVDGGeu,q^^^?~c۶mjՊ?XR ٲe -[Ã?֭[[IT۶m?pwwe˖l۶Hb1$q*111q4i҄իWSV-#ߴhтQFY#BBBXz5ק[nYI,$"""Nf1p@7o*T:Cq * ???K3\+oooϟ7?6Hb$q'Ofڵ|wx{{[ǡ<Ȁ8㧟~瞳4CA߲rJ ETDDD)dggnugϞ8qXStM :_]H 8~X|";1kO‘#Gѣ4oޜ+VMNNfԨQ3#GҵkWFIRR};wҵkW^xF+gϞ嫯bΝ;vC^5׵sl9̘1AѮ];1̝;G}5jpq郷7͛7gCR\9\\\쏢SOqa~"=FDDD ˦^zEz̬,3ovBBL˖-8Z׮]C=dɱPt8WWW qulٲml߾իWPb\k׮k࣏֬>|1͛z&ׯZoc~rosqqח ֭[caKty6͆%k SY&:]Ձq8:t(>зo_lBNشim۶jiwq7zɏ^zɓ'C7n/u[P{gl!l\Kx(g'"""%F9x ۶m: 'Orr]0q#0 oҥKo楗^c_8vs}#;;;vn:}]fϞ͘1c,ٲe Gs*H /c*$q z+?޲ .]J9r$GQF|=zԾĉiӦ O<Ǐ/}=k $>>[^5ǵlW;sYRRR9+]pa ٽ̛7+Wh"֬YÞ={r]WT}4h@֭ŝ H1رc:ugHbb"Geݺuxzzڵk0` 駟f믿̶4oޜc9Ã~9ef9gT|M0aƍk$''3axHKKUVswЦMׯOjo GvV\ɷ~رc|yqgpsxyʋc"##bqׯϞ={(?6 }ILLd@" ,_#Fc]ll,-Zy̞=Џ猚ЄWy(Osm 8 LB޽qncǎgРAmѺuknBϐH/,9լQTDDDĩxbΜ9C˖-+/S }Xjso+mذ{iӦ9xsNZhAZZ/׷Pq$ *$q:j? 00VZhѢB9NJJ G/裏ZvSa90m4{1kWέJ߾}ټy3_5sرn…nݚ`֭[GPPzP AСCꫯxy/III<|W IDATXd sa*G]?VG)T*H"""zMtt4{{E,\XR̟?͛3`Ktt4Vr[BP?WALJI&eٳ'-[dl6El6EFF֭[:S""QTDDDDiڴ)?#7oZjՋzosqIIHH୷ޢnݺDFFDTT?7:"hiB:$)"""3g;wgϞ[s}xb(ŢE{Y&{f̚5MZima iq XЩ HV~}&L@\\&Mbt֍5j㏳j*l\{@>L\\~.^Z,a $--"""޽{>}:ӧO'::`NuF(_ RSSY|9/fܹиqc^֭ku ]F5Q[.̷ jL> eʔ)C۶mڵ+7꘥Zvv6۷o_~aŬZ,n&wNiԨ1K 2D%>C38$"""re]K2o|^(_<Axx8T^.*A~08JU8 Hщe߾}G!...DժU\2~~~<*WL P>>>x{{ٜ9sdΞ=KJJ NqIN:EBBqqq4jԨApp0GzQFљx}/k..@y@7oIaaDq,ՅWR//84. TDDDD1///j֬y7 6ފx`زL(%QI|˷eQDDDDNp >?.x0[ȩ 8Ds_F3UAqbARAcxGxy_|U;'yΓI&6l+]rt)AgAffv0pQaK&nb,># 8$+AĕT 6򁲲`Ĉ$?hE+QяhMocZ*H""""N1iCp2=>PϞ_ ڶƍ#!ы^%.vPJVG+TDDDDI/K O?} jRHa chHCq,e3K] b1Va#bŐ8/H&Õ]ZZ..9<}Jr] QxQh Lڬ""""NW3׿pr9upi ruKg>p wqmh01*GŐ8y\zQ7nrb_g: l247iF3p/@'$"""d|e0)ClJҵkF)N6lLe*3Mlg; eu< $'4ṖF5C@~sy3?Ӛ bը*V14$TDDDDP(t3y#gLBC$iL#pwYrV:\#$'OׯNt:uʙ9̄r|$'yWA !"`3Y*:xR@XDDDDD *D{=؏l|Օj9߮ 7n}{|7,OCJ$b(11ݻwsA∋ȑ#KRRϟA@$u]:Ώܘz{S\9Q5jԠf͚T^ j׮MXXUTqy:l#>?y0T:8>(VDDDBIIIlڴM6{nv޽{9ueʔ!00`/χ[ͩS8y$N<:EDLwQ1M#17ҰNZihY2NjXSn53mS˥)TnIKb"")Qˁ<.=^o|5$RSSۛf͚Hpp0{/իWw{d,X =ִyg  \j]ʐ(VIDDDvϖ-[o%11Zjqw@@@РA\-qnȑ#$$$p=IOOϏ`ڶmKΝ{p>Ke|ɗT*ST:w۷o]'8'W8OЈF[J!$믿l2̙Crr2={dС<,ظq#K.%223~xJŊmlg5YzNp4f0*q R@c.^Ȃ ;w. 6ǗJ$x }V;v,_;5ja5jduIR;waڵk111 GHHH}Av툏$qR H""""ӧ޽;5bԯ_: 6dԫW=zpK'$"""˗ݻ7_///K^:6lŅ>}`٬.I{oqqqlܸQ6*jժƍ9psεq2 H"""R%$$0c f͚Eƍ.駟JU?ԤIfΜ/̑#G.Gkf͢Yf >RD Tj) #GߟV"NDIDDDʭϳzjFܶdwNzzz觤3zh>3.\`u9$DDDZ~=<0 bbb?~<5"))nݺEHH[noĉ>_ cǦFƍL0 #((6vaѫW/#--0 BU~nUۙ3g M6Ƹq:8!0>i HD ֿݻwϿkFhh( bƌ2w\f͚űc9rdjbԩ$&&2sLWٳgY`v3fY亊ϭj={v^#1P@rܹsTV㸺<<<ٳ'dǎTZBCCعs'.+Wfܸqwqqo؊Oakkt$OOO.]1P@r^z$''[2v:u3x\ 'O@~ׯ{sұcG.]z1n؊Oakkt3g1r.$)6l-;##٘z?z0O_'**+VǴijSn0 Gf68NJoإ$"""Vxx8N?򿎊"00&MDYp!?s~EѡC}Y͛_hذ![Q~ [ۭ^l۶SNѫW/!N_ʕo^¥ZYf\:8|%K/)?k.*^ vLL 3f`Ȑ!h777j֬ɖ-[pw7?eddСCIOO',,z 3gի{~SRBV+Wy9l qBc\NDDD|7o/"I&#00#Gxǎe˖̞=cǖظ!(ͯ٥SDDD\;v,a0l03fHYsuRv) HƂ fl6_k3g۷o筷ͭD'rX H"""R;'|Rl^pI&#,x1&M_W\;&NIZjԸaAbر,Y˗ӧOˑ]'xQF1o<ˑj4K8p]Ab޼y<3׏7|r:gf99sX]eШQ̷nnn,\???&L޽{Yh^^^VV={ѣGfϟs=guIR֝<  uƍ뉎El޼ʭM6ѢE m#)'O•#_OIDDD<]vtڕz*!qSNO# ,qplYn$QVbժU|s%KsZ/^W_% ;vvZV\եؽ\]Mwk;BwaTPgy___Ks )))̞=>^yFM .M͔)ppDDDDԩS,Xŋc>|8Fʤcǎd9r$cǎN:V&ΪKh.-pm84rI8]ؽ{7{!;;+Ҿ}{?t8z :xDDDDJflxxxдiS Ϗڵk닯/>>>P>}9;qG!!!~!֖-[rLpp0-ZáܖWiЮ$"""R l6N8ABBGѣ$$$HZZyyyヷwTZ>dee)qgϞ%##g^>}kצqp]wq]wѬY34;$e}AfǿLIDDD%55$RRRHNN&33`s`s9 àj\\\̠uUn]֭K ݲ.R,vv~30|\:DӰo|-jyq^3%SIDAT0|x+ Z\]aРB5W@甓o C@j:DIDDDDDӒ%S$q>/È[DDDDD>ddVDDDDDĹ+̞m\WvU@2m\ӧPYDDDDD޽`@CE>\3H"""""v9BCͥofDDDDD9,[f }VAq7^xZnDDDDDlx{:NDDDDDʶɓ!)b'""",`R~{.!|=<<駡ZOdZx9PEJ0 bO+' ]b>퐓c J)N6o `tX $""",v]]͚8]u8gJc~] gW8 WWxq'P8۵ ڶgQ`߾R@IDDDĹ x5H׳6"r$ڙF0kV=z H""""$$6FM+GʑK-٢+azhʊDIDDDॗ`sǬhg͚/>KqNkԩ 潍jִ?D3H""""&07mio0n\Hǖ-2S{p H""""i`pw{ww2ĺz3 4_'RXP9Ǐúuru)ܼ6` kk#) .3gcI++ZNDDDʭLKp( ,p.!F +rի[]Be)sÿ s3@jVWWDDD\3f e8BJѣYhe-=,'ƌ>},SDDD\JOO'44iӦY]CU6qե8Ԍ3HOO!'6meUV5W=9R$"""嘏]t )/ocXӡ}{:bE+5DDDDDɓb| Ǜ - O<MZ]]$""""LRS})իDgX]a$""""R֥'3kTɼ)*X]a$""""R%$_۷߂'<9sԭ+M H"""""e֭y3_GBZУL =PT DDDDDJ#5ͰclТy=JHi QQа!t /<UX]SS@Jj*i.GtS ,jY$""""Rv3O۱ F?` 4ЛoD+[[k9$"""" ۷k.P9C4|تN+EDDDDD8t C}An.@v+ZOb $|- }潈 A=gMX@IDDDDf->lU[Cǎfj5w}.GHH0PBǛ_gd5\]ukfq$)uΝ;WviwuMݺd"͛Cq"H)Ѷm[BCCy7..]bΜ9_ݻwW] Aef ܠ^=N`3)Hiヷ5Oԯ_[}OOO"""3gv?W_wBֹ6 zq H""""ĺu>11m۶8(I+VVZd^)7ffT'H)L݋|YqQdTcuRƹZ]HYq^}U}G.]8x |' 8۳fԩCHH ۷pUF6m7//UV1dBCC#55QFn]qqq3e&N+ϟiYYYL8ɓ'Axx8dffb111?FDn"$$[Ma3ƴi3fL~-H9Կnoۍ'|҈2jժedeeyyyѣG 26md$%%ѤIc֬Yƹs}~M`?w7dx{{v0 իV`oL>=4hܸq#224c„ 7|c,_ܨRn:tm u2dH~Ǐ7܌~L-SfDDD\*m۶@[ddaf>ԫW>>>Fկyc N0͛g0 _4#%%>>C0&Nhaq63cjslٲe`߿Z[ HR\tH!|wa`f޽;...7Wra-w}ʕ+3n8BBB掛,RcVzWO۹s'D6={?EVmn_M^S~E>Bp^c"c޽tܙX:vҥK l{5|mذ>~'z衛@XXX=:siӦ[FeEDDD G3c N:Ń>H||{M[cTTDDDg۷gڵL4uұcGbbbHII~I& [lW^f>}˗swƔ)S(6mď?)S?mΜ99slfΜ S?> 3gӓիWnm0>ST111 4!C0~x&MD͚5ٲe |ɒ%9s3g?k.*VX6zڴiCtt4<}vZjȑ#9y/Jb8DDDDʉj*+)9rQ0mJ~R\4$"""""r5Q6)kDDDD$߅ 4iRB #Fȿ7RQڈUIDDD%]\$+DDDDDDP@BIDDDDD $+DDDDDDP@BIDDDDD $+DDDDDDP@BIDDDDD w f#332l6<<<.CK^oooKb2p@K'bau""""%-55CY]ロڵk[]q H""""""Wh+DDDDDDptxвԉIENDB`upstart-1.13.2/conf/0000775000175000017500000000000012402042416011223 500000000000000upstart-1.13.2/conf/Makefile.in0000664000175000017500000003625312402042374013224 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = conf DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_init_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(initdir)" DATA = $(dist_init_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ initdir = $(sysconfdir)/init dist_init_DATA = \ rc-sysinit.conf \ rc.conf \ rcS.conf \ control-alt-delete.conf all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu conf/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu conf/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_initDATA: $(dist_init_DATA) @$(NORMAL_INSTALL) @list='$(dist_init_DATA)'; test -n "$(initdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(initdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(initdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(initdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(initdir)" || exit $$?; \ done uninstall-dist_initDATA: @$(NORMAL_UNINSTALL) @list='$(dist_init_DATA)'; test -n "$(initdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(initdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(initdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_initDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_initDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_initDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_initDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/conf/Makefile.am0000664000175000017500000000025612373101356013210 00000000000000## Process this file with automake to produce Makefile.in initdir = $(sysconfdir)/init dist_init_DATA = \ rc-sysinit.conf \ rc.conf \ rcS.conf \ control-alt-delete.conf upstart-1.13.2/conf/rc-sysinit.conf0000664000175000017500000000271012373101356014124 00000000000000# rc-sysinit - System V initialisation compatibility # # This task runs the old System V-style system initialisation scripts, # and enters the default runlevel when finished. description "System V initialisation compatibility" author "Scott James Remnant " start on startup stop on runlevel # Default runlevel, this may be overriden on the kernel command-line # or by faking an old /etc/inittab entry env DEFAULT_RUNLEVEL=2 emits runlevel # There can be no previous runlevel here, but there might be old # information in /var/run/utmp that we pick up, and we don't want # that. # # These override that env RUNLEVEL= env PREVLEVEL= task console owner script # Check for default runlevel in /etc/inittab if [ -r /etc/inittab ] then eval "$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL="\1";/p' /etc/inittab || true)" fi # Check kernel command-line for typical arguments for ARG in $(cat /proc/cmdline) do case "${ARG}" in -b|emergency) # Emergency shell [ -n "${FROM_SINGLE_USER_MODE}" ] || sulogin ;; [0123456sS]) # Override runlevel DEFAULT_RUNLEVEL="${ARG}" ;; -s|single) # Single user mode [ -n "${FROM_SINGLE_USER_MODE}" ] || DEFAULT_RUNLEVEL=S ;; esac done # Run the system initialisation scripts [ -n "${FROM_SINGLE_USER_MODE}" ] || /etc/init.d/rcS # Switch into the default runlevel telinit "${DEFAULT_RUNLEVEL}" end script upstart-1.13.2/conf/rcS.conf0000664000175000017500000000125312373101356012550 00000000000000# rcS - System V single-user mode compatibility # # This task handles the old System V-style single-user mode, this is # distinct from the other runlevels since running the rc script would # be bad. description "System V single-user mode compatibility" author "Scott James Remnant " start on runlevel S stop on runlevel [!S] console owner exec /sbin/sulogin post-stop script # Don't switch runlevels if we were stopped by an event, since that # means we're already switching runlevels if [ -n "${UPSTART_STOP_EVENTS}" ] then exit 0 fi # Switch, passing a magic flag start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y end script upstart-1.13.2/conf/control-alt-delete.conf0000664000175000017500000000054412373101356015521 00000000000000# control-alt-delete - emergency keypress handling # # This task is run whenever the Control-Alt-Delete key combination is # pressed, and performs a safe reboot of the machine. description "emergency keypress handling" author "Scott James Remnant " start on control-alt-delete task exec shutdown -r now "Control-Alt-Delete pressed" upstart-1.13.2/conf/rc.conf0000664000175000017500000000056112373101356012426 00000000000000# rc - System V runlevel compatibility # # This task runs the old System V-style rc script when changing between # runlevels. description "System V runlevel compatibility" author "Scott James Remnant " start on runlevel [0123456] stop on runlevel [!$RUNLEVEL] export RUNLEVEL export PREVLEVEL task console output exec /etc/init.d/rc $RUNLEVEL upstart-1.13.2/compile0000755000175000017500000001624512373101367011612 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: upstart-1.13.2/ABOUT-NLS0000644000175000017500000022532612373101360011456 000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. 1.1 Quick configuration advice ============================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. 1.2 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the included GNU `gettext' library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will, respectively, bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might not be desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.3 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.4 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.5 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of November 2007. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo +----------------------------------------------------+ Compendium | [] [] [] [] | a2ps | [] [] [] [] [] | aegis | () | ant-phone | () | anubis | [] | ap-utils | | aspell | [] [] [] [] [] | bash | [] | bfd | | bibshelf | [] | binutils | | bison | [] [] | bison-runtime | [] | bluez-pin | [] [] [] [] [] | cflow | [] | clisp | [] [] [] | console-tools | [] [] | coreutils | [] [] [] [] | cpio | | cpplib | [] [] [] | cryptonit | [] | dialog | | diffutils | [] [] [] [] [] [] | doodle | [] | e2fsprogs | [] [] | enscript | [] [] [] [] | fetchmail | [] [] () [] [] | findutils | [] | findutils_stable | [] [] [] | flex | [] [] [] | fslint | | gas | | gawk | [] [] [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] | gip | [] | gliv | [] [] | glunarclock | [] | gmult | [] [] | gnubiff | () | gnucash | [] [] () () [] | gnuedu | | gnulib | [] | gnunet | | gnunet-gtk | | gnutls | [] | gpe-aerial | [] [] | gpe-beam | [] [] | gpe-calendar | | gpe-clock | [] [] | gpe-conf | [] [] | gpe-contacts | | gpe-edit | [] | gpe-filemanager | | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] | gpe-package | | gpe-sketchbook | [] [] | gpe-su | [] [] | gpe-taskmanager | [] [] | gpe-timesheet | [] | gpe-today | [] [] | gpe-todo | | gphoto2 | [] [] [] [] | gprof | [] [] | gpsdrive | | gramadoir | [] [] | grep | [] [] | gretl | () | gsasl | | gss | | gst-plugins-bad | [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] [] | gst-plugins-ugly | [] [] | gstreamer | [] [] [] [] [] [] [] | gtick | () | gtkam | [] [] [] [] | gtkorphan | [] [] | gtkspell | [] [] [] [] | gutenprint | [] | hello | [] [] [] [] [] | herrie | [] | hylafax | | idutils | [] [] | indent | [] [] [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] [] | iso_639 | [] [] [] [] | jpilot | [] | jtag | | jwhois | | kbd | [] [] [] [] | keytouch | [] [] | keytouch-editor | [] | keytouch-keyboa... | [] | latrine | () | ld | [] | leafpad | [] [] [] [] [] | libc | [] [] [] [] | libexif | [] | libextractor | [] | libgpewidget | [] [] [] | libgpg-error | [] | libgphoto2 | [] [] | libgphoto2_port | [] [] | libgsasl | | libiconv | [] [] | libidn | [] [] [] | lifelines | [] () | lilypond | [] | lingoteach | | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] | man-db | [] [] [] | minicom | [] [] [] | nano | [] [] [] | opcodes | [] | parted | [] [] | pilot-qof | | popt | [] [] [] | psmisc | [] | pwdutils | | qof | | radius | [] | recode | [] [] [] [] [] [] | rpm | [] | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] | shared-mime-info | [] [] [] [] () [] [] [] | sharutils | [] [] [] [] [] [] | shishi | | skencil | [] () | solfege | | soundtracker | [] [] | sp | [] | system-tools-ba... | [] [] [] [] [] [] [] [] [] | tar | [] [] | texinfo | [] [] [] | tin | () () | tuxpaint | [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] [] | util-linux-ng | [] [] [] [] | vorbis-tools | [] | wastesedge | () | wdiff | [] [] [] [] | wget | [] [] [] | xchat | [] [] [] [] [] [] [] | xkeyboard-config | [] | xpad | [] [] [] | +----------------------------------------------------+ af am ar az be bg bs ca cs cy da de el en en_GB eo 6 0 2 1 8 26 2 40 48 2 56 88 15 1 15 18 es et eu fa fi fr ga gl gu he hi hr hu id is it +--------------------------------------------------+ Compendium | [] [] [] [] [] | a2ps | [] [] [] () | aegis | | ant-phone | [] | anubis | [] | ap-utils | [] [] | aspell | [] [] [] | bash | [] | bfd | [] [] | bibshelf | [] [] [] | binutils | [] [] [] | bison | [] [] [] [] [] [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | cflow | [] | clisp | [] [] | console-tools | | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cpplib | [] [] | cryptonit | [] | dialog | [] [] [] | diffutils | [] [] [] [] [] [] [] [] [] | doodle | [] [] | e2fsprogs | [] [] [] | enscript | [] [] [] | fetchmail | [] | findutils | [] [] [] | findutils_stable | [] [] [] [] | flex | [] [] [] | fslint | | gas | [] [] | gawk | [] [] [] [] () | gcal | [] [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] | gliv | () | glunarclock | [] [] [] | gmult | [] [] [] | gnubiff | () () | gnucash | () () () | gnuedu | [] | gnulib | [] [] [] | gnunet | | gnunet-gtk | | gnutls | | gpe-aerial | [] [] | gpe-beam | [] [] | gpe-calendar | | gpe-clock | [] [] [] [] | gpe-conf | [] | gpe-contacts | [] [] | gpe-edit | [] [] [] [] | gpe-filemanager | [] | gpe-go | [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] | gphoto2 | [] [] [] [] [] | gprof | [] [] [] [] [] | gpsdrive | [] | gramadoir | [] [] | grep | [] [] [] | gretl | [] [] [] () | gsasl | [] [] | gss | [] [] | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] | gstreamer | [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | [] | hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | herrie | [] | hylafax | | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] [] [] | iso_15924 | [] | iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | [] | iso_4217 | [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] | jpilot | [] [] | jtag | [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] [] [] | keytouch-editor | [] | keytouch-keyboa... | [] [] | latrine | [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] [] | libexif | [] | libextractor | [] | libgpewidget | [] [] [] [] [] | libgpg-error | [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] | libgsasl | [] [] | libiconv | [] [] [] | libidn | [] [] | lifelines | () | lilypond | [] [] [] | lingoteach | [] [] [] | lprng | | lynx | [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] | man-db | [] | minicom | [] [] [] [] | nano | [] [] [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] | pilot-qof | | popt | [] [] [] [] | psmisc | [] [] | pwdutils | | qof | [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] [] [] | sed | [] [] [] [] [] | shared-mime-info | [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] | soundtracker | [] [] [] | sp | [] | system-tools-ba... | [] [] [] [] [] [] [] [] [] | tar | [] [] [] [] [] | texinfo | [] [] [] | tin | [] () | tuxpaint | [] [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux | [] [] [] [] [] [] [] | util-linux-ng | [] [] [] [] [] [] [] | vorbis-tools | | wastesedge | () | wdiff | [] [] [] [] [] [] [] [] | wget | [] [] [] [] [] [] [] [] | xchat | [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] | xpad | [] [] [] | +--------------------------------------------------+ es et eu fa fi fr ga gl gu he hi hr hu id is it 85 22 14 2 48 101 61 12 2 8 2 6 53 29 1 52 ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn +--------------------------------------------------+ Compendium | [] | a2ps | () [] [] | aegis | () | ant-phone | [] | anubis | [] [] [] | ap-utils | [] | aspell | [] [] | bash | [] | bfd | | bibshelf | [] | binutils | | bison | [] [] [] | bison-runtime | [] [] [] | bluez-pin | [] [] [] | cflow | | clisp | [] | console-tools | | coreutils | [] | cpio | [] | cpplib | [] | cryptonit | [] | dialog | [] [] | diffutils | [] [] [] | doodle | | e2fsprogs | [] | enscript | [] | fetchmail | [] [] | findutils | [] | findutils_stable | [] | flex | [] [] | fslint | | gas | | gawk | [] [] | gcal | | gcc | | gettext-examples | [] [] [] | gettext-runtime | [] [] [] | gettext-tools | [] [] | gip | [] [] | gliv | [] | glunarclock | [] [] | gmult | [] [] [] | gnubiff | | gnucash | () () () | gnuedu | | gnulib | [] [] | gnunet | | gnunet-gtk | | gnutls | [] | gpe-aerial | [] | gpe-beam | [] | gpe-calendar | [] | gpe-clock | [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] | gpe-today | [] [] | gpe-todo | [] | gphoto2 | [] [] | gprof | [] | gpsdrive | [] | gramadoir | () | grep | [] [] | gretl | | gsasl | [] | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] | gtick | [] | gtkam | [] [] | gtkorphan | [] | gtkspell | [] [] | gutenprint | [] | hello | [] [] [] [] [] [] [] | herrie | [] | hylafax | | idutils | [] | indent | [] [] | iso_15924 | [] | iso_3166 | [] [] [] [] [] [] [] [] | iso_3166_2 | [] | iso_4217 | [] [] [] | iso_639 | [] [] [] [] | jpilot | () () | jtag | | jwhois | [] | kbd | [] | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | | latrine | [] | ld | | leafpad | [] [] | libc | [] [] [] | libexif | | libextractor | | libgpewidget | [] | libgpg-error | | libgphoto2 | [] | libgphoto2_port | [] | libgsasl | [] | libiconv | [] | libidn | [] [] | lifelines | [] | lilypond | [] | lingoteach | [] | lprng | | lynx | [] [] | m4 | [] [] | mailfromd | | mailutils | | make | [] [] [] | man-db | | minicom | [] | nano | [] [] [] | opcodes | [] | parted | [] [] | pilot-qof | | popt | [] [] [] | psmisc | [] [] [] | pwdutils | | qof | | radius | | recode | [] | rpm | [] [] | screem | [] | scrollkeeper | [] [] [] [] | sed | [] [] | shared-mime-info | [] [] [] [] [] [] [] | sharutils | [] [] | shishi | | skencil | | solfege | () () | soundtracker | | sp | () | system-tools-ba... | [] [] [] [] | tar | [] [] [] | texinfo | [] [] | tin | | tuxpaint | () [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] | util-linux-ng | [] [] | vorbis-tools | | wastesedge | [] | wdiff | [] [] | wget | [] [] | xchat | [] [] [] [] | xkeyboard-config | [] [] [] | xpad | [] [] [] | +--------------------------------------------------+ ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn 51 2 25 3 2 0 6 0 2 2 20 0 11 1 103 6 or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta +--------------------------------------------------+ Compendium | [] [] [] [] [] | a2ps | () [] [] [] [] [] [] | aegis | () () | ant-phone | [] [] | anubis | [] [] [] | ap-utils | () | aspell | [] [] [] | bash | [] [] | bfd | | bibshelf | [] | binutils | [] [] | bison | [] [] [] [] [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] [] | cflow | [] | clisp | [] | console-tools | [] | coreutils | [] [] [] [] | cpio | [] [] [] | cpplib | [] | cryptonit | [] [] | dialog | [] | diffutils | [] [] [] [] [] [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | fetchmail | [] [] [] | findutils | [] [] [] | findutils_stable | [] [] [] [] [] [] | flex | [] [] [] [] [] | fslint | [] | gas | | gawk | [] [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] [] | gip | [] [] [] [] | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] [] | gmult | [] [] [] [] | gnubiff | () [] | gnucash | () [] | gnuedu | | gnulib | [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] [] [] [] [] [] [] | gpe-filemanager | [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] [] [] [] [] [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] | gphoto2 | [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | gretl | [] [] [] | gsasl | [] [] [] | gss | [] [] [] [] | gst-plugins-bad | [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] | gstreamer | [] [] [] [] | gtick | [] | gtkam | [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] | gutenprint | [] | hello | [] [] [] [] [] [] [] [] | herrie | [] [] [] | hylafax | | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] | jpilot | | jtag | [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | latrine | | ld | [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] | libextractor | [] [] | libgpewidget | [] [] [] [] [] [] [] [] | libgpg-error | [] [] [] | libgphoto2 | [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] | libiconv | [] [] [] | libidn | [] [] () | lifelines | [] [] | lilypond | | lingoteach | [] | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] [] [] | make | [] [] [] [] | man-db | [] [] [] [] | minicom | [] [] [] [] [] | nano | [] [] [] [] | opcodes | [] [] | parted | [] | pilot-qof | | popt | [] [] [] [] | psmisc | [] [] | pwdutils | [] [] | qof | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] | rpm | [] [] [] [] | screem | | scrollkeeper | [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | shared-mime-info | [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] [] | solfege | [] | soundtracker | [] [] | sp | | system-tools-ba... | [] [] [] [] [] [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | () | tuxpaint | [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] [] | util-linux-ng | [] [] [] [] | vorbis-tools | [] | wastesedge | | wdiff | [] [] [] [] [] [] [] | wget | [] [] [] [] | xchat | [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | xpad | [] [] [] | +--------------------------------------------------+ or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta 0 5 77 31 53 4 58 72 3 45 46 9 45 122 3 tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu +---------------------------------------------------+ Compendium | [] [] [] [] | 19 a2ps | [] [] [] | 19 aegis | [] | 1 ant-phone | [] [] | 6 anubis | [] [] [] | 11 ap-utils | () [] | 4 aspell | [] [] [] | 16 bash | [] | 6 bfd | | 2 bibshelf | [] | 7 binutils | [] [] [] [] | 9 bison | [] [] [] [] | 20 bison-runtime | [] [] [] [] | 18 bluez-pin | [] [] [] [] [] [] | 28 cflow | [] [] | 5 clisp | | 9 console-tools | [] [] | 5 coreutils | [] [] [] | 18 cpio | [] [] [] [] | 11 cpplib | [] [] [] [] [] | 12 cryptonit | [] | 6 dialog | [] [] [] | 9 diffutils | [] [] [] [] [] | 29 doodle | [] | 6 e2fsprogs | [] [] | 10 enscript | [] [] [] | 16 fetchmail | [] [] | 12 findutils | [] [] [] | 11 findutils_stable | [] [] [] [] | 18 flex | [] [] | 15 fslint | [] | 2 gas | [] | 3 gawk | [] [] [] | 16 gcal | [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] | 29 gettext-runtime | [] [] [] [] [] [] | 28 gettext-tools | [] [] [] [] [] | 20 gip | [] [] | 13 gliv | [] [] | 11 glunarclock | [] [] [] | 15 gmult | [] [] [] [] | 16 gnubiff | [] | 2 gnucash | () [] | 5 gnuedu | [] | 2 gnulib | [] | 10 gnunet | | 0 gnunet-gtk | [] [] | 3 gnutls | | 4 gpe-aerial | [] [] | 14 gpe-beam | [] [] | 14 gpe-calendar | [] [] | 7 gpe-clock | [] [] [] [] | 21 gpe-conf | [] [] [] | 16 gpe-contacts | [] [] | 10 gpe-edit | [] [] [] [] [] | 22 gpe-filemanager | [] [] | 7 gpe-go | [] [] [] [] | 19 gpe-login | [] [] [] [] [] | 21 gpe-ownerinfo | [] [] [] [] | 21 gpe-package | [] | 6 gpe-sketchbook | [] [] | 16 gpe-su | [] [] [] [] | 21 gpe-taskmanager | [] [] [] [] | 21 gpe-timesheet | [] [] [] [] | 18 gpe-today | [] [] [] [] [] | 21 gpe-todo | [] [] | 8 gphoto2 | [] [] [] [] | 21 gprof | [] [] | 13 gpsdrive | [] | 5 gramadoir | [] | 7 grep | [] | 12 gretl | | 6 gsasl | [] [] [] | 9 gss | [] | 7 gst-plugins-bad | [] [] [] | 13 gst-plugins-base | [] [] | 11 gst-plugins-good | [] [] [] [] [] | 16 gst-plugins-ugly | [] [] [] | 13 gstreamer | [] [] [] | 18 gtick | [] [] | 7 gtkam | [] | 16 gtkorphan | [] | 7 gtkspell | [] [] [] [] [] [] | 27 gutenprint | | 4 hello | [] [] [] [] [] | 38 herrie | [] [] | 8 hylafax | | 0 idutils | [] [] | 15 indent | [] [] [] [] [] | 28 iso_15924 | [] [] | 4 iso_3166 | [] [] [] [] [] [] [] [] [] | 54 iso_3166_2 | [] [] | 4 iso_4217 | [] [] [] [] [] | 24 iso_639 | [] [] [] [] [] | 26 jpilot | [] [] [] [] | 7 jtag | [] | 3 jwhois | [] [] [] | 13 kbd | [] [] [] | 13 keytouch | [] | 8 keytouch-editor | [] | 5 keytouch-keyboa... | [] | 5 latrine | [] [] | 5 ld | [] [] [] [] | 10 leafpad | [] [] [] [] [] | 24 libc | [] [] [] | 19 libexif | [] | 5 libextractor | [] | 5 libgpewidget | [] [] [] | 20 libgpg-error | [] | 6 libgphoto2 | [] [] | 9 libgphoto2_port | [] [] [] | 11 libgsasl | [] | 8 libiconv | [] [] | 11 libidn | [] [] | 11 lifelines | | 4 lilypond | [] | 6 lingoteach | [] | 6 lprng | [] | 2 lynx | [] [] [] | 15 m4 | [] [] [] | 18 mailfromd | [] [] | 3 mailutils | [] [] | 8 make | [] [] [] | 20 man-db | [] | 9 minicom | [] | 14 nano | [] [] [] | 20 opcodes | [] [] | 10 parted | [] [] [] | 11 pilot-qof | [] | 1 popt | [] [] [] [] | 18 psmisc | [] [] | 10 pwdutils | [] | 3 qof | [] | 4 radius | [] [] | 7 recode | [] [] [] | 25 rpm | [] [] [] [] | 13 screem | [] | 2 scrollkeeper | [] [] [] [] | 26 sed | [] [] [] [] | 23 shared-mime-info | [] [] [] | 29 sharutils | [] [] [] | 23 shishi | [] | 3 skencil | [] | 7 solfege | [] | 3 soundtracker | [] [] | 9 sp | [] | 3 system-tools-ba... | [] [] [] [] [] [] [] | 38 tar | [] [] [] | 17 texinfo | [] [] [] | 15 tin | | 1 tuxpaint | [] [] [] | 19 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux | [] [] [] | 20 util-linux-ng | [] [] [] | 20 vorbis-tools | [] [] | 4 wastesedge | | 1 wdiff | [] [] | 23 wget | [] [] [] | 20 xchat | [] [] [] [] | 29 xkeyboard-config | [] [] [] | 14 xpad | [] [] [] | 15 +---------------------------------------------------+ 76 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu 163 domains 0 3 1 74 51 0 143 21 1 57 7 45 0 2036 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If November 2007 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.6 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. upstart-1.13.2/NEWS0000664000175000017500000013675212402042205010727 000000000000001.13.2 2014-09-04 "It looks lush from the side" * Enforce 'initctl set-env' from being called from system job (LP: #1356824). * Defer use of remove-on-empty to stop session-level cgroup jobs from racing with cgmanager which can remove the cgroup before subsequent job processes have been moved into them (LP: #1357252). 1.13.1 2014-07-16 "Heureka" * Fix for Session Init crasher triggered by restarting a job that runs 'initctl unset-env' (LP: #1222705). 1.13 2014-07-11 "poor paul pore paw pole pour poll pull poole pool pawl" * Fix for handling upgrade from non-stateful-re-exec instance to a stateful-re-exec-capable one (LP:#1303891). * Disable chroot sessions by default. A new '--chroot-sessions' command-line option restores the old default behaviour. * New tests and improved documentation. * Fix for Session Init umask change on re-exec (LP: #1302117). * Allow '--confdir' to look for system jobs in multiple locations, which also adds new command-line options '--append-confdir' and '--prepend-confdir' for full flexibility (LP: #1315060). * Allow initctl(8) commands 'set-env' and 'unset-env' to operate on multiple environment variables (LP: #1324096). * Support for cgroups via a new 'cgroup' stanza. This makes use of cgmanager(8) and is available to both System and Session Inits. Support for cgroups can be disabled at built-time if required. See init(5) for 'cgroup' stanza syntax and examples. 1.12.1 2014-03-11 "Standing Room Only" * Fixed re-exec breakage caused by incorrect D-Bus API usage. * Tests updated to catch this issue. 1.12 2014-03-07 "Water Table" * Stop Upstart indirectly stealing console ownership (most noticeably when run in a container). * Fixed bug that could result in incorrect output from initctl(8) environment commands. * Fixed incorrect variable usage which could result in a crash (LP: #1222705). * Fixed stateful re-exec issue triggered by invalid jobs (LP: #1269731). * Stateful re-exec fix to serialise the D-Bus session bus (LP: #1258098). * init-checkconf(8) now uses a Session Init and can also now be run as root. * upstart-socket-bridge(8) now supports IPv6 (thanks to Kai Mast and Cameron Norman). * Allow telinit(8) to work on systems with no D-Bus system bus. * Numerous test improvements. * Lots of man-page improvements. 1.11 2013-11-14 "Quoi de neuf?" * Add '--no-dbus' command-line option for the init(8) daemon (allowing event propagation to the Session Init via the upstart-event-bridge(8) to be disabled). * Serialise Session Init job environment table on re-exec (LP: #1238078). * upstart-{dbus,socket}-bridge(8): Don't clobber existing PATH (LP: #1234898). * upstart-file-bridge(8): - Allow watching for directory creation (LP: #1221466). - Reduce default output. * upstart-local-bridge(8): Handle arbitrary numbers of pairs and additional checks on input validity (LP: #1234898). * Improved Session Init shutdown speed (LP: #1227212). * New configure options: '--disable-local-bridge', '--disable-socket-bridge'. * Added upstart-file-bridge(8) and Session Init re-exec integration tests. * Retain umask for Session Init (LP: #1240686). * Make Session Init connect to D-Bus Session Bus on request (LP: #1203595, #1235649) * Improved build-time ABI compliance checking. * Doc updates and lots of test refinements. 1.10 2013-08-23 "Swim to the buoy" * upstart-local-bridge: New bridge for starting jobs on local socket connections. * upstart-dconf-bridge: New bridge for Session Inits. * upstart-dbus-bridge: New '--bus-name' option to allow bus name variable to be included in dbus-event(7). * New "reload signal" stanza to allow jobs to specify a custom signal that will be sent to the main process (rather than the default SIGHUP). * Inclusion of Session Init sample jobs. * Re-exec fixes for handling chroot sessions. * Shutdown fix for Session Inits. * New python3 module and accompanying integration test suite for testing Upstart running as PID 1 and as a Session Init (priveleged and non-privileged). 1.9.1 2013-07-04 "The all-inclusive deal" * Fix respawn behaviour regression (introduced in version 1.8) affecting jobs which also specify shell meta-characters in the exec stanza (LP: #1181789). * Fix common bug which could cause a bridge to crash (LP: #1197225). * Various fixes for libupstart. * initctl2dot: Layout improvements. 1.9 2013-06-28 "This village isn't even on the map" * Apparmor support added by means of two new stanzas: 'apparmor load' and 'apparmor switch' (thanks Marc Deslauriers). * Stateful re-exec: now serialises all objects, not just the minimum set. * Allow inherited environment variables to be unset for Session Inits. * Ability to specify multiple configuration directories when running as a Session Init. * libupstart: Client library for communicating with Upstart. * upstart-dbus-bridge: New bridge to allow jobs to react to D-Bus signals. * The usual round of fixes and doc improvements. 1.8 2013-03-22 "Scone + Radish = Gherkin?" * upstart-file-bridge: New bridge to allow jobs to react to file, directory and file glob events (create/modify/delete). * upstart-monitor: Simple cli/gui tool that shows event flows. 1.7 2013-03-04 "We've all got one now" * New initctl commands: set-env, unset-env, get-env, list-env, reset-env, list-sessions (all except last with corresponding D-Bus methods). * New D-Bus-only signals EventEmitted, Restarted, and EndSession method. * Ability to run with PID >1 to allow Upstart to manage a user session. Running Upstart as a 'Session Init' in this way provides features above and beyond those provided by the original User Jobs such that the User Job facility has been removed entirely: to migrate from a system using User Jobs, simply ensure the user session is started with 'init --user'. * New upstart-event-bridge bridge which proxies system-level events down to Session Inits, allowing users jobs to react to udev events. * Ability to read job configuration and override files from multiple freedesktop-compliant locations (Session Init only). * Ability to shutdown both via a system shutdown request and via a user logout request (Session Init only). 1.6.1 2012-12-07 "It glows in the dark" * Improved re-exec performance. * Minor logger fixes for unflushed data. * Handle re-exec scenario when requested from within a chroot. * Minor serialisation data format change to handle chroots and user sessions. * Added extra re-exec tests including explicit upgrade tests reading from pre-prepared JSON data files. * Make jobs running within a chroot log their output within the chroot. * Added "Restart" D-Bus method. * Changed 'telinit u' to use "Restart" D-Bus method rather than sending SIGTERM to play nicely when busybox(1) is init. * Added "GetState" D-Bus method allowing current serialised internal state to be queried. 1.6 2012-11-15 "The turbine, the fish and the glass partition" * 'telinit u' now performs a stateful re-exec, allowing Upstart to continue to supervise jobs after an upgrade of either itself, or any of its dependent libraries. Adds dependency on libjson (JSON-C). * Added initramfs-less boot support. * Allow tests to work in sbuild environment. * Improved error handling. * Fixed crasher if 'kill signal' specified as a particular numeric. * Documentation fixes. 1.5 2012-03-22 "Birdsong" * Lots of "console log" improvements (and new tests). * New 'early logging' facility which allows jobs that end before the log disk is writeable to have their output peristed to disk when the disk later becomes writeable. * Upstart is now able to detect jobs which leak file descriptors: a message is generated when run with debug enabled ('--debug' / "initctl log-priority debug"). * New "usage" stanza which allows instance jobs to display a usage message explaining how job should be started. The usage is displayed when the user has not specified the correct variables to allow the job to be started, or when the user queries the usage using "initctl usage ". 1.4 2011-12-13 "Let them speak" * Improved console setting. * New "log" argument to console stanza allowing a system jobs stdout/stderr to be captured to a file. New options added to support this feature: '--default-console', '--logdir', '--no-log'. This feature only currently applies to system jobs: user jobs which specify "console log" will be treated as if they had specified "console none". * New "setuid" and "setgid" stanzas to allow system jobs to be run under the specified uid/gid corresponding to the given name/group. * Improvements to upstart-udev-bridge to handle problematic hardware (such as some batteries) which pass non-printable bytes to userspace. 1.3 2011-06-14 "Concordia" * New upstart-socket-bridge application which allows jobs to be started when an incoming client socket connection is initiated (requires a suitably modified server daemon since jobs only need call accept(2) before reading from the socket). * User session support allowing non-privileged users to manipulate their own jobs (not available within a chroot environment). * Chroot support allowing jobs to be controlled within chroot environments. * Updated bash completion script. * Updated vim syntax script. * init-checkconf script used to check syntax of Job Configuration Files (including script sections). * initctl2dot script to convert initctl(8) output to GraphViz dot(1) format for analysing relationships between jobs and events. * New "check-config" initctl command to check for jobs whose * "start on" and "stop on" events cannot be satisfied. * New "show-config" initctl command to display "start on", "stop on" and emits" information in parseable format. * New initctl command-line option: "--session" for D-Bus session connection. * New init command line options (mostly for testing): - "--session" for D-Bus session bus. - "--confdir ". - "--startup-event ". - "--no-startup-event". * New "kill signal" stanza to allow override of SIGTERM when stopping jobs. * Add support for the oom_score_adj procfs API. * Improved POSIX compliance when running shell scripts. 1.2 2011-03-22 "This sort of thing is my bag, baby" * Fixed incorrect shell redirection syntax that broke at least pdksh. (Bug: #739984) 1.1 2011-03-16 "It's probably 'cause you think you're cooler than me" * When /sbin/halt is called (without -p), this now results in the system being halted and not powered down. If you meant it to be powered down, use /sbin/poweroff. (Bug: #532366) * Fixed file descriptor leak of /proc/self/fd/NN to shell scripts executed by Upstart. (Bug: #619269) * Fixed bug where console was closed too early, causing loss of error messages and non-functioning keyboard-request event, (Bug: #707151) * Fixed bug where environment variables containing unusual characters were not accepted due to a mis-reading of POSIX. (Bug: #567068). * Fixed non-removal of symlinks on "make uninstall". (Bug: #604227) * Reduced priority of job termination messages from warn to info if the exit status or signal is listed in "normal exit". (Bug: #522197) 1.0 2011-03-01 "This is a fertile land, and we will thrive" * Fixed an assertion when a file named /etc/init/.conf is created. Discovered by Коренберг Марк (Bug: #720573) * utmp entries will be replaced with DEAD_PROCESS ones when a pid supervised by Upstart terminates. (Bug: #183729) * shutdown now correctly returns error code if it fails to shutdown the system. * Included bash completion script in contrib directory. (Bug: #672067) 0.6.7 2010-12-14 "Return of the Mole" * A new "manual" stanza has been added to the configuration, this removes any previously defined "start on" stanza for job so that the job can only be started with initctl "start". This allows quick disabling of a job with: echo "manual" >> /etc/init/jobname.conf * Upstart now emits a "GoalChanged" D-Bus signal immediately after changing the "goal" property of an instance, a "StateChanged" signal after changing the "state" property, and a "Failed" signal after marking an instance as failed. * Job objects now include "start_on", "stop_on" and "emits" properties containing the appropriate information from the configuration. * For developers, a "debug" stanza has been added; if present in a job, the job will wait before the exec call and can be attached to by gdb to examine Upstart's state. * Manpage fixes. (Bugs: #677392, #686734) 0.6.6 2010-04-27 "No, she's dead, this is her son" * Upstart will automatically mount /proc and /sys on boot if they have not already been mounted by the kernel or initramfs. (Bug: #426263) * Fixed double-quoting issue with the --with-local-libnih configure option. (Bug: #530385) * libnih 1.0.2 is now required. 0.6.5 2010-02-04 "Our last, best hope for victory" * Since libnih has been separated out into its own project, Upstart no longer includes its source and now uses the installed version by default. * The external nih-dbus-tool means that cross-compilation is trivial, the path to it may be overriden with NIH_DBUS_TOOL=... as an argument to configure. (Bug: #426740) * Developers may still build against a local libnih source tree by passing --with-local-libnih=/path/to/libnih to configure. * There is a new initctl "reload" command, with matching /sbin/reload symlink. This sends the SIGHUP signal to the running main process of the named job instance. * Event operator matches in jobs now support "!=" in addition to the usual "=", e.g.: start on net-device-added INTERFACE!=eth* (Bug: #513035) * Moved D-Bus system bus reconnection trigger from SIGHUP to SIGUSR1, since SIGHUP is already used for a forced configuration reload and causes Upstart to "forget" state. * Fixed bug where the default runlevel would be lost when an /etc/inittab file exists without an initdefault line. (Bug: #405847) * Fixed "Unhandled error" message from shutdown. (Bug: #426332) * Fixed "Unhandled error" assertion crash from Upstart child processes when failing to spawn a job. (Bug: #451917) * No longer holds /dev/console open, so the SAK SysRq key will not kill Upstart. (Bug: #486005) * Restored sync() call before reboot(). * Added missing OPTIONS section to init(8) manpage. (Bug: #449883) 0.6.3 2009-08-02 "Our last, best hope for peace" * Fixed an assertion when a job's main process is terminated while in the stopping state. (Bug: #406408) * Fixed compilation on ia64. * nih-dbus-tool(1) manpage will not be installed, since the binary is not. (Bug: #403103) 0.6.2 2009-07-21 "Buggrit, millennium hand and shrimp" * Fixed an assertion when a job receives a stop event or the stop command while still in the starting state. * Changed exec() trace handling to allow the main process to exec another before fork()ing while still following (e.g. main script exec'ing a daemon) * Restored missing chdir("/") call when catching crashes. 0.6.1 2009-07-16 "Born in the wagon of a travelling show" * D-Bus 1.2.16 is now required. * Updated ptrace() code to handle receiving the trapped stopped child _before_ we receive the trapped fork() syscall, which seems to be the most common way the race goes when running as init. This seems to make "expect fork/daemon" largely work. (Bug: #264711) * runlevel will now output "unknown" and exit with an error when called before the first telinit call. (Bug: #400248) * runlevel will prefix error messages with the utmp filename being used. (Bug: #400241) 0.6.0 2009-07-09 "How appropriate, you fight like a cow" * The licence for Upstart has been changed back to version 2 of the GNU GPL. * D-Bus 1.2.15 is now required, this is the current GIT HEAD pending a 1.2.16 release. * Configuration paths have changed. Global configuration now resides in "/etc/init.conf" while jobs are now configured in "/etc/init" * Job configuration filenames must now end in ".conf" * Default configuration files are now supplied in the "conf" sub-directory of the source, and installed into "/etc/init". These match the Debian/Ubuntu sysvinit configuration so may require some tweaking for other distributions, but provide an excellent base. The old example-jobs tarballs are deprecated. * The D-Bus interface remains unstable, to reflect this the current interface name has changed to "com.ubuntu.Upstart0_6" and the name of the job and instance interfaces have changed to match. * The "EmitEvent" D-Bus method gains a wait argument, when given as TRUE (the recommended setting) the method call will be blocked until all effects of the event have finished. When FALSE the method call will return once the event has been queued. * The "Start", "Stop" and "Restart" D-Bus methods of jobs and instances gain a similar wait argument. * The Upstart D-Bus object now has "version" and "log_priority" properties. The former is to obtain the version of the init daemon, the latter allows you to obtain and change the logging priority. * Job D-Bus objects now have "name", "description", "author" and "version" properties to obtain the job name and the contents of the equivalent job file fields for the others. * Instance D-Bus objects now have "name", "goal", "state" and "processes" properties to obtain the instance name, goal, state and list of running processes and their pids respectively. * The default D-Bus security policy now permits use of the "Get" methods by all users, including obtaining values of properties. * initctl has been rewritten with functionality more along the lines of Upstart 0.3.x than before; since many distributions are still shipping 0.3.x the summary of changes for the tool reflects both changes from 0.3.x and 0.5.x * The global "-p"/"--pid" argument has been dropped, since communication is over D-Bus. New "--system" and "--dest" arguments have been added to force communication over the system bus, and specify the destination, instead of using the private socket (this is the default when run as non-root to permit "list" and "status" to work for ordinary users). * The "-i"/"--id" and "--show-ids" options to commands have been dropped since jobs no longer have ids. * Since instances may now have names, these will be displayed in brackets after the job name when one is present. The output of the goal and state are now expressed as "start/running" instead of "(start) running" to disambiguate. * initctl "start" and "stop" now only output the final state of the job, not intermediate states it passes through. When called with "--no-wait", the commands now output a status before returning (which may not be the final status). * initctl "start", "stop" and "status" now only accept a single job name. Further arguments are taken as KEY=VALUE environment variables to pass to the job, replacing the previous "-e" option. * There is a new initctl "restart" command, with matching /sbin/restart symlink. This is the atomic equivalent of calling "stop" and "start" with the exception that a stopped job will not be started again. * In keeping with the newer instance model, instance jobs are now output on separate lines with their full names rather than indented under a "master" instance. * initctl "status" will exit non-zero if the job name was not found. (Bug: #328323) * initctl "status" now outputs information for multi-instance jobs. (Bug: #331407) * initctl "list" no longer accepts a pattern, use grep. Output is no longer sorted. * initctl "emit" no longer outputs changes that occur as a result of the event. * When initctl "emit" is called with "--no-wait", it will return immediately. (Bug: #324890) * initctl "emit" now only accepts a single event name. Further arguments are taken as KEY=VALUE environment for the event, replacing the previous "-e" option. * initctl "jobs" and "events" have been dropped. * initctl "log-priority" may be called without arguments, in which case it will output the current priority. (Bug: #280529) * initctl "reload" has been renamed to "reload-configuration" to avoid confusion with reloading a job's configuration. * initctl(8) man page updated. (Bug: #285753) * runlevel no longer accepts the --set and --reboot arguments, instead telinit and shutdown write these records into utmp and wtmp. * runlevel(7) man page added to describe the runlevel event, and the implementation of runlevels and System V compatibility in Upstart. (Bug: #60429) * telinit will no longer silently ignore the "a", "b" or "c" runlevels. * telinit now accepts the previously ignored "-e" argument, passing the environment variables given along with the runlevel event. * telinit now officially accepts the "q"/"Q" and "u"/"U" arguments, the former will reload the Upstart configuration while the latter will re-execute Upstart. * telinit q will also attempt to reconnect to the D-Bus system bus if the connection has not been made, or has been lost. (Bug: #323022) * reboot no longer silently ignores the "-t" option. * reboot now silently ignores the "-n", "-i" and "-h" options; it will no longer sync your disks, down your network interfaces or spin down your hard drives. This functionality is all handled by the kernel on a modern system. (Bug: #92685) * reboot now writes a "shutdown" record to /var/log/wtmp, this means that the "-w" option is honoured with its original intent. We still silently ignore the "-d" option. * shutdown message generation fixed to be more easily translatable. (Bug: #102565) * The TERM/KILL timeout, and other system timeouts, now use the monotonic clock so are unaffected by system clock changes. (Bug: #389588) * Respawn detection now uses the monotonic clock so is unaffected by system clock changes. (Bug: #389586) * Significant improvement in the amount of manual pages included with Upstart and their content. (Bug: #60429) * A manual page refering people from /etc/inittab to /etc/init is also included. (Bug: #72058) 0.5.3 2009-06-22 "Britain's Flag Carrier" * Fixed segfault when initctl status called with arguments. (Bug: #388753) * Fixed segfault when initctl log-priority called with no argument. (Bug: #280529) * Fixed shutdown to pass $INIT_HALT variable as last argument, not as first. (Bug: #303574) * Added temporary support for "telinit u" until we have true re-exec support. This will be replaced by an initctl command in future. (Bug: #388742) * Corrected formatting of initctl(8) manpage. (Bug: #388745) 0.5.2 2009-06-17 "Something, something, something, D-Bus" * The licence for Upstart has been updated to GNU GPL v3. * Overhaul of the automatically generated D-Bus bindings code, fixing many issues with memory leaks, inconsistent return values and loss of method returns after the method has taken place. * D-Bus 1.2.4 is now required, and must be patched to fix https://bugs.freedesktop.org/show_bug.cgi?id=22316 * D-Bus Job objects now have "name", "description", "author" and "version" properties. * D-Bus Instance object now have "name", "goal" and "state" properties. * initctl now obtains the name properties for display instead of printing the mangled object path component. (Bug: #299290) * D-Bus configuration updated now that the daemon is fixed to be deny-by-default, and updated to avoid bare "send_interface" stanzas. (Bug: #323021) * Fixed assertion caused by the post-start or pre-stop scripts exiting after the main process of a respawning job had exited (Bug: #381048) * The /proc filesystem need not be mounted if the "oom_adj" configuration stanza is not used. (Bug: #259801) * Overly large values to configuration stanzas are now caught and rejected. (Bug: #340134) * The --enable-compiler-warnings configure option has been extended to add -Wextra, but turns off a few of the more extreme warnings * GNU C Library v2.4 (or backported inotify support) is required * pkg-config 0.22 is now required, it probably was anyway but we now explicitly check for it. * Dependency on Python for the D-Bus binding tool has been dropped and replaced with a dependency on expat 2.0.0 0.5.1 2009-01-29 "Unexpected item in bagging area" * Major rewrite of the memory allocator used by Upstart; the old allocator had several limitations and a few issues. I must stress that none of the issues were known to affect Upstart itself, however it pays to be prudent. * An issue where an object in a linked list would be freed after the linked list was freed was fixed. Upstart had some twisty code logic to work around it, which has now been dropped. * An issue where a string could fail to be appended in an OOM situation was fixed; if Upstart is affected, this could cause D-Bus Introspection data to be corrupted. * An issue where multiple socket watches being freed could lead to bad memory access has been fixed; Upstart 0.5.0 included a temporary fix for the D-Bus connection handling, this replaces that with a proper fix that also corrects the same problem for timers and other main loop watches that Upstart was not believed to be affected by. * Compiler warnings when compiling the test suite with -O1 and above have been fixed where found. * A race condition in the test cases for a process stopping with SIGSTOP has been fixed, this could sometimes cause this test to hang. 0.5.0 2008-08-12 "One of those deaf-mutes" * The relationship between job definitions and their running instances has been overhauled completely. Jobs may have zero or more instances, each one uniquely identified by their instance name which is set by expanding the argument to the "instance" stanza against the instance's environment. For example, a job with "instance $TTY" in its definition will have new instances created when started with TTY=tty1 and TTY=tty2, but starting again with TTY=tty1 will fail if that instance is already running. * The default job configuration remains to be a singleton, however this is now accomplished simply by having the default for the instance stanza set to a static string. * Job events now include the instance name in a new $INSTANCE variable, and will always have $UPSTART_INSTANCE set in the environment of their processes. * Jobs may export environment from themselves into the job events using the new "export" stanza. * Events no longer have both arguments and environment, instead the order the environment is specified in is remembered and is used when matching. * The "start on" and "stop on" stanzas may now only be specified once, multiple events should be joined with the new "or" operator. A new "and" operator exists as well, and parentheses are permitted, allowing arbitrarily complicated expression matches. * All environment from the matched start events is placed in the job, with the list of matched events placed in the $UPSTART_EVENTS variable, replacing the previous singular $UPSTART_EVENT variable. * The matches for the "stop on" stanza may refer to variables from the job environment, which comes from the "start on" stanza. For example: start on started apache or started httpd stop on stopping $JOB * Job environment from the start command or events is available to all scripts, including "pre-stop" and "post-stop". * Environment from the matched stop events is only available to the "pre-stop" script, with the list of matched events placed in the $UPSTART_STOP_EVENTS variable so that the list of events that started the job is still available. * Environment is no longer lost after a respawn. * Environment from the kernel or initramfs may be included in a job by use of the "env NAME" stanza without a value set. * The "started" event is no longer emitted if the pre-stop script restarts the job, since the "stopping" event was never emitted. * By default, jobs now have the most suitable settings for a daemon process that would match what they would have had by calling daemon(). In particular, this means that the previous "service" stanza is now the default and tasks need to specify a "task" stanza. It also means that if the job really wishes to be a session leader (e.g. getty), it must specify the new "session leader" stanza. * Processes that fork once may be supervised with the new "expect fork" stanza, processes that fork twice (most daemons) may be supervised with the new "expect daemon" stanza and processes that do not fork may signal readiness by SIGSTOP with the new "expect stop" stanza. * The "pid file", "pid timeout" and "daemon" stanzas have been removed in favour of the new functionality. * "respawn" now works for tasks, this will repeat the task until it finishes with a zero exit status or any other specified by "normal exit". * "respawn limit" now only affects automatic respawns, not those done by command. * If the main process fails to start due to exec() error, or other process setup error, it will not be respawned. * "respawn limit" may be "unlimited". * The "stalled" event has been removed. * "logd" was not maintained, and did not function correctly, so has been removed from the source. The "console logged" stanza has also been removed. * New "oom" stanza allows adjustment of the OOM killer priority of the process and may be "never" to inhibit it. * The configuration directory has now changed to /etc/init/jobs.d * Configuration is still reloaded with inotify, but may be forced by sending init a HUP signal or with "initctl reload". * Support for the STOP, CONT and TERM signals has been removed. * libupstart and the native IPC mechanism has been removed, communication is now via D-Bus which is a new dependency. * The dependency on D-Bus introduces build-dependencies on pkg-config and Python. * The minimal recommended kernel version is now 2.6.24 * The compat directory has been removed, the utilities are now considered part of Upstart. * initctl jobs has been dropped. * initctl commands do not support --no-wait yet * initctl status with no arguments now shows all jobs. * initctl events no longer exists 0.3.10 2009-06-17 "Two minutes to Belgium" * Compilation fixes * Fixed assertion caused by the post-start or pre-stop scripts exiting after the main process of a respawning job had exited (Bug: #381048) 0.3.9 2007-10-11 "Highway to the Danger Zone" * Fixed crasher caused by starting a job with a no-arguments event. * Initialisation order changed so that the control socket is opened and configuration parsed after inherited file descriptors are closed and the console opened. Otherwise if we inherit fewer than the standard three file descriptors (e.g. from OpenVZ) we closed our own control socket, etc. (Bug: #87173) * Kill all processes in a supervised process's process group so that we catch looping or sleeping processes that a shell is waiting for. (Bug: #121733) * Missing inotify support detected correctly and warning suppressed. * Stanza names in configuration may no longer be placed inside quotes. * Fix dangling halt and poweroff symlinks when Upstart compiled without --enable-compat=sysv. (Bug: #93356) * Fix that --with-included-gettext did not include libintl.a as it should have. (Bug: #117848) * Updated hacking requirements to Automake 1.10 and Gettext 0.16.1 since this version of Automake makes it easier for package maintainers because it causes us to ship libtool.m4 ourselves. 0.3.8 2007-03-11 "I had a little drink about an hour ago" * Fix an assertion error that occurred whenever a stop event for an instance job was emitted. * Correct a bug where calling "stop" from a job without arguments would stop the running job, and attempt to block until it was stopped. This can obviously never happen since it won't stop until stop unblocks. * Add "version" and "log-priority" commands to initctl. 0.3.7 2007-03-09 "Lines of communication" * The "normalexit" stanza has been changed to "normal exit". * The "respawn COMMAND" short-cut for specifying both "respawn" and "exec" in the same stanza has been removed. Jobs that previously used syntax such as: respawn /sbin/getty 38400 tty1 Should be changed to use: exec /sbin/getty 38400 tty1 respawn While the shortcut saved a little typing, it caused confusion and hid the fact that "exec" and "script" were both options for respawning services. * The "on EVENT" stanza has been removed, change your jobs to use the identical "start on EVENT" instead. This is because the "on" stanza may be useful for other things in future. * Stanzas in job definitions may no longer be surrounded by single or double quotes, allowing them to be turned into ordinary tokens by quoting them. * Configuration of running jobs is no longer immediately changed when the definition is changed on disk; the job must be stopped first. If the job is an instance job, all instances must be stopped before an instance of the changed job definition will be started. This ensures that the post-stop process run when the job is stopped matches the pre-start process run when it was started, and for instance jobs ensures that any locking between them is identical. Jobs marked for deletion, or jobs that have not yet replaced another, will not ordinarily show up in the output of initctl "status" or "list" unless addressed by id. They cannot be started or stopped, even when addressed by id. * Job definitions may safely omit "exec"/"script"; the job will stay in the running state with no process until it is stopped manually or by an event. This allows a service to define hardware configuration; for example the mixer service could restore the ALSA mixer in its pre-start script and save the mixer state in its stop script. "start mixer" would restore the state, "status mixer" would show it was running and "stop mixer" would save the state again and presumably mute it. * Sending the SIGPWR signal to init will emit the power-status-changed event. A simple job can hook this event, check the /etc/powerstatus file and take further action. * As well as their name, all jobs now also have a unique id exported in the UPSTART_JOB_ID environment variable and viewable with initctl by using the "--show-ids" option to "status" or "list". The unique id is changed whenever the job is reloaded from disk, or whenever a new instance is started. "start" and "stop" now default to UPSTART_JOB_ID if no arguments are given (falling back to UPSTART_JOB if that is not present either). This means they act on the current instance of the job, rather than spawning a new instance or stopping all instances. "start", "status" and "stop" also accept a new "--by-id" option which makes them expect job ids as arguments instead of job names. * The initctl "status" and "list" commands group instances of instance jobs together in their output, rather than repeating them without further clarification. E.g.: foo (instance) (start) starting (start) running, process 1000 (stop) post-stop, process 1050 The "stop" command will stop all instances when given the name of an instance job; individual instances can be stopped using "--by-id" after obtaining the id from "status --show-ids". * Wildcard patterns of job names to be listed can be given as an argument to the initctl "list" command. * Starting and stopping jobs with initctl will now block until the job reaches its goal state, outputting all status changes and process ids until the goal is reached and will also output an error and exit with a non-zero status if the job fails. Remember that jobs default to being tasks, so "start" will actually block until the job finishes and returns back to "(stop) waiting". Use the "service" or "respawn" stanza to turn them into services to that they only block until the "(start) running" state is reached. 0.3.5 2007-02-10 "Wear flowers in your hair" * Serialisation of job state between upstart processes is disabled; though upstart will still re-exec itself when sent the TERM signal, the new copy will not have any of the state of the old. This will be restored in a later release. * WARNING: if you have any job declared "console owner" which is run by the "stalled" event, comment out the "start on" stanza before sending the TERM signal -- otherwise the newly started process will start that job, which will kill your running X server. * logd and the "console logged" (default) option are currently disabled, pending large-scale changes to the way that this works. * Job scripts have been renamed; "start" to "pre-start" and "stop" to "pre-stop". * A new "post-start" script has been added, it's run after the main process has been started and the "started" event is not emitted until it finished. * A new "pre-stop" script has also been added, it's run when a request or event comes in to stop a job, before the "stopping" event is emitted and before the job is killed. If this restarts the job, it will not be stopped. * Job processes now have an UPSTART_JOB environment variable containing the name of the job. * initctl start, stop and status will default to using UPSTART_JOB if no arguments are given. Therefore you can just put "stop" or "start" into a job script. * Where a job was started or stopped by an event, the processes now have an UPSTART_EVENT environment variable containing the name of the event. * Events may now have arguments and environment variables attached, these can be specified with initctl, e.g. # initctl emit network-interface-up eth0 -eADDR=00:11:22:33:44:55:66 * These arguments can be matched in the job by placing them after the event name for the "start on" or "stop on" stanzas: start on network-interface-up eth* Additional arguments in the event are assumed to match if not specified in the job definition, and wildcards may be used within the job definition as shown above. * The arguments are also passed to the script of any job started or stopped by this event as positional arguments, and the environment variables are placed into the environment of the job. * The set of events emitted due to a job state change have been completely changed. The new events are as follows: started: this is emitted once the job is running and ready, and receives the job name as an argument. stopped: this is emitted once the job has been fully stopped. As well as the job name, if the job terminated normally it will have the "ok" argument; otherwise it will have the "failed" argument followed by the name of the script that failed ("running" for the main job) and either an EXIT_STATUS or EXIT_SIGNAL environemtn variable indicating why it failed. starting: this is emitted before the job is started (before even the pre-start script is run). Arguments are as "started". The job will not be started until this event has finished. stopping: this is emitted before the job is stopped (but after the pre-stop script is run). Arguments are as "stopped". The job will not be stopped until this event has finished. These events can be usefully combined as follows. If the "hal" job requires "dbus" to be running, and "hal" must be stopped before "dbus" may stop: start on started dbus stop on stopping dbus If the "tomcat" job believes that it must be running before "apache" can run, and should not be stopped until "apache" has been stopped: start on starting apache stop on stopped apache * The event named for the job has been completely removed; thus jobs and events no longer share a namespace. * Jobs have goals to reach; for a task (the default), the goal is to go from stopped, to started and back to stopped again. This means that when used for the "starting" or "stopping" event, the entire task has to complete before the referenced job can actually be started or stopped. Services will normally only want the goal to be to go from stopped to started; thus when used in "starting" in the example above, the referenced job can be started once the service has been started (and not stopped again). A service is defined by specifying either "respawn" or "service" in the definition. * The list of exit codes that determine whether the main process failed or succeeded can be specified by the "normalexit" configuration stanza. The arguments to this stanza can be exit codes or signal names, e.g. normalexit 1 99 100 INT QUIT Zero is implied in the list, unless the job is marked "respawn" since for those jobs, this is the list of exit codes and signals that cause the job to be not respawned. * There is no longer a respawning state, or "respawn script". Jobs will instead be stopped and started through the same scripts. * Jobs marked with the "instance" stanza can be started multiple times; each time they are started, a new instance is created. * If any job whose goal is changed by an event fail to reach their new goal, a further "EVENT-NAME/failed" event will be emitted once the event has finished being handled. This can be used to emit, for example, a "path-unmounting" event and to not proceed to "path-unmounted" unless it succeeds. * initctl emit will block until the event has been handled; it will also output job status information for any job changed by the event and terminate with an exit status of 1 if any of those jobs failed to reach their new goal. * The set of events emitted by the "telinit" compatibility command have been changed. It now only emits a single "runlevel" event, and supplies the new runlevel as an argument to it. You should change job files that use: start on runlevel-2 to use the following: start on runlevel 2 This means also that "stop on runlevel" would stop the job on any runlevel change. * Neither the "telinit" nor "shutdown" commands now emit a "shutdown" event, in fact, this event has been removed altogether. "shutdown" now simply emits the appropriate runlevel event; the -H and -P arguments set the INIT_HALT variable in the environment of that event, just as it does in sysvinit. * Normal output from initctl, etc. is no longer prefixed "initctl:" * The "ctrlaltdel" event has been renamed to "control-alt-delete". 0.3.2 2007-02-06 "Could anybody have tampered with your luggage?" * Fix leak of inotify file descriptor that could allow any process on the system to remove upstart's watch on its configuration directory. * New "emits" configuration stanza, used to list events that are emitted by the job itself. Intended for use by front-ends to draw event graphs and the like. * Dropped "depends" configuration stanza and all related code. This will be replaced by the complex state mechanism. * Rewritten IPC code to be significantly simpler, with the goal of having a stable interface once we hit the end of this milestone series. * Rewritten configuration parser and inotify watch infrastructure to be more maintainable in future. * Now supports systems where inotify is disabled. * Duplicate configuration stanzas are no longer permitted. * Bug fixes, especially concerning malloc failure. 0.3.1 2006-12-13 "The Gathering" * Compilation fixes * Bug fixes. * Massive improvement to test framework, which should make it much easier to test new features. 0.3.0 2006-10-17 * Reverted logd behaviour from previous version, it's up to the init scripts to send messages to the console if they wish. * Compatibility programs must now be explicitly enabled by using ./configure --enable-compat=sysv * "shutdown" and "reboot" are now considered System V compatibility programs, as they emulate the behaviour of those. Dropped some added options to make them fit. * All programs given improved --help text. * "initctl" rewritten, any sub-command can be run directly by making it a symlink to "initctl" itself. * "start", "stop" and "status" are now just symlinks to "initctl"; not a separate binary. 0.2.7 2006-09-20 * logd writes received messages to the console unless "quiet" is on the kernel command-line * runaway jobs are now caught when they start, rather than respawn, so stop/start loops are caught * Include inotify support for compiling under glibc 2.3 0.2.6 2006-09-13 * Fix major bug on architectures with 64-bit kernel and 32-bit user-land caused by an inconsitency between the behaviour of kernel's compat_sys_waitid() vs. sys_waitid() functions. * "halt" now only calls "shutdown -h now" 0.2.5 2006-09-09 * "control-alt-delete" event name changed to "ctrlaltdel". * "initctl shutdown EVENT" added that performs the same job as "shutdown" but without all the usual warnings, timings, etc. * "logd" has now been written, if installed this is started by init before sending the "startup" call and all jobs with "console logged" (the default) will have their output sent to this daemon. It currently just logs to /var/log/boot. * "shutdown -k" implemented. * The "shutdown" utility has been changed to generate "system-halt" for "-H", "power-off" for "-P" and just "halt" if only "-h" given. * If "shutdown" is run when running under sysvinit, it will now send the appropriate /dev/initctl message to allow upgrades. * "telinit S" implemented. * Instead of trying to start or stop jobs, "telinit" now just sends "runlevel-X" events. * The "telinit" utility now ensures a "shutdown" event is sent before switching to runlevel 0, 1 or 6. * If "telinit" is installed and init is called by the super-user, "telinit" is invoked instead. * Basic manual pages included. 0.2.1 2006-09-01 * Compilation fixes 0.2.0 2006-09-01 * "shutdown", "reboot", "halt" and "poweroff" utilities provided that match their traditional equivalents. * "start", "stop" and "status" utilities provided to start, stop and query the status of jobs respectively. * "runlevel" and "telinit" utilities provided for compatibility. * "initctl list" will list active jobs. * Events vastly simplified to just simple strings. * Jobs now generate "jobname/start", "jobname/started", "jobname/stop" and "jobname/stopped" events as they go through state transitions. * Services generate a "jobname" event when they are running. * Tasks generate a "jobname" event when they have finished. * The "shutdown" utility will generate a "shutdown" event followed by one of "maintenance", "reboot", "halt" or "poweroff" or any admin-specified event. * "stalled" event generated when no jobs are running or queued. * "control-alt-delete" event generated when that key combination is pressed * "kbdrequest" event generated when Alt-UpArrow is pressed * Runaway respawning services will now be caught. * init will re-exec on receipt of the SIGUSR1 signal. 0.1.1 2006-08-25 * Minor bug fixes. 0.1.0 2006-08-24 * Initial public release. upstart-1.13.2/init/0000775000175000017500000000000012402042411011234 500000000000000upstart-1.13.2/init/apparmor.h0000664000175000017500000000240312373101356013160 00000000000000/* upstart * * Copyright © 2013 Canonical Ltd. * Author: Marc Deslauriers . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_APPARMOR_H #define INIT_APPARMOR_H #include "job.h" /** * APPARMOR_PARSER: * * Location of apparmor_parser binary * **/ #define APPARMOR_PARSER "/sbin/apparmor_parser" /** * APPARMOR_PARSER_OPTS: * * apparmor_parser options * **/ #define APPARMOR_PARSER_OPTS "-r -W" NIH_BEGIN_EXTERN int apparmor_switch (char *profile) __attribute__ ((warn_unused_result)); int apparmor_available (void) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_APPARMOR_H */ upstart-1.13.2/init/process.c0000664000175000017500000001702412373101356013015 00000000000000/* upstart * * process.c - process definition handling * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "process.h" #include "state.h" /** * process_new: * @parent: parent of new process. * * Allocates and returns a new empty Process structure. * * If @parent is not NULL, it should be a pointer to another allocated * block which will be used as the parent for this block. When @parent * is freed, the returned block will be freed too. * * Returns: newly allocated Process structure or NULL if insufficient memory. **/ Process * process_new (const void *parent) { Process *process; process = nih_new (parent, Process); if (! process) return NULL; process->script = FALSE; process->command = NULL; return process; } /** * process_name: * @process: process type to convert. * * Converts an enumerated process type into the string used for the status * and for logging purposes. * * Returns: static string or NULL if action not known. **/ const char * process_name (ProcessType process) { switch (process) { case PROCESS_MAIN: return N_("main"); case PROCESS_PRE_START: return N_("pre-start"); case PROCESS_POST_START: return N_("post-start"); case PROCESS_PRE_STOP: return N_("pre-stop"); case PROCESS_POST_STOP: return N_("post-stop"); case PROCESS_SECURITY: return N_("security"); default: return NULL; } } /** * process_from_name: * @process: process string to convert. * * Converts a process type string into the enumeration. * * Returns: enumerated action or -1 if not known. **/ ProcessType process_from_name (const char *process) { nih_assert (process != NULL); if (! strcmp (process, "main")) { return PROCESS_MAIN; } else if (! strcmp (process, "pre-start")) { return PROCESS_PRE_START; } else if (! strcmp (process, "post-start")) { return PROCESS_POST_START; } else if (! strcmp (process, "pre-stop")) { return PROCESS_PRE_STOP; } else if (! strcmp (process, "post-stop")) { return PROCESS_POST_STOP; } else if (! strcmp (process, "security")) { return PROCESS_SECURITY; } else { return -1; } } /** * process_serialise: * @process: process to serialise. * * Convert @process into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised Process object, or NULL on error. **/ json_object * process_serialise (const Process *process) { json_object *json; nih_assert (process); json = json_object_new_object (); if (! json) return NULL; if (! state_set_json_int_var_from_obj (json, process, script)) goto error; if (! state_set_json_string_var_from_obj (json, process, command)) goto error; return json; error: json_object_put (json); return NULL; } /** * process_serialise_all: * * @processes: array of Processes. * * Convert array of Process objects to JSON representation. * * Returns: JSON object containing array of Processes, or NULL on error. */ json_object * process_serialise_all (const Process * const * const processes) { json_object *json; json_object *json_process; Process dummy = { 0, NULL }; nih_assert (processes); json = json_object_new_array (); if (! json) return NULL; for (int i = 0; i < PROCESS_LAST; i++) { /* We must encode a blank entry for missing array elements * to ensure correct deserialisation. */ json_process = process_serialise (processes[i] ? processes[i] : &dummy); if (! json_process) goto error; if (json_object_array_add (json, json_process) < 0) goto error; } return json; error: json_object_put (json); return NULL; } /** * process_deserialise: * @json: JSON-serialised Process object to deserialise. * * Convert @json into a Process object. * * Returns: Process object, or NULL on error. **/ Process * process_deserialise (json_object *json, const void *parent) { Process *process = NULL; nih_assert (json); if (! state_check_json_type (json, object)) goto error; process = NIH_MUST (process_new (parent)); if (! state_get_json_int_var_to_obj (json, process, script)) goto error; if (! state_get_json_string_var_to_obj (json, process, command)) goto error; /* All Process slots have to be serialised in the JSON to * guarantee ordering on deserialisation. * * However, here we've found a Process that was merely * an ordering placeholder - no command has been defined, * so ignore it. */ if (! process->command) goto error; return process; error: nih_free (process); return NULL; } /** * process_deserialise_all: * * @json: root of JSON-serialised state, * @parent: parent of @processes, * @processes: newly-allocated array of Process objects. * * Convert JSON representation of processes back into * an array of Process objects. * * Returns: 0 on success, -1 on error. **/ int process_deserialise_all (json_object *json, const void *parent, Process **processes) { json_object *json_processes; int i; nih_assert (json); nih_assert (parent); nih_assert (processes); if (! json_object_object_get_ex (json, "process", &json_processes)) goto error; if (! state_check_json_type (json_processes, array)) goto error; for (i = 0; i < json_object_array_length (json_processes); i++) { json_object *json_process; nih_assert (i <= PROCESS_LAST); json_process = json_object_array_get_idx (json_processes, i); if (! json_process) goto error; if (! state_check_json_type (json_process, object)) goto error; processes[i] = process_deserialise (json_process, parent); } return 0; error: return -1; } /** * process_type_enum_to_str: * * @type: ProcessType. * * Convert ProcessType to a string representation. * * Returns: string representation of @type, or NULL if not known. **/ const char * process_type_enum_to_str (ProcessType type) { state_enum_to_str (PROCESS_INVALID, type); state_enum_to_str (PROCESS_MAIN, type); state_enum_to_str (PROCESS_PRE_START, type); state_enum_to_str (PROCESS_POST_START, type); state_enum_to_str (PROCESS_PRE_STOP, type); state_enum_to_str (PROCESS_POST_STOP, type); state_enum_to_str (PROCESS_SECURITY, type); return NULL; } /** * process_type_str_to_enum: * * @type: string ProcessType. * * Convert @type back into enum value. * * Returns: ProcessType representation of @type, or -1 if not known. **/ ProcessType process_type_str_to_enum (const char *type) { nih_assert (type); state_str_to_enum (PROCESS_INVALID, type); state_str_to_enum (PROCESS_MAIN, type); state_str_to_enum (PROCESS_PRE_START, type); state_str_to_enum (PROCESS_POST_START, type); state_str_to_enum (PROCESS_PRE_STOP, type); state_str_to_enum (PROCESS_POST_STOP, type); state_str_to_enum (PROCESS_SECURITY, type); return -1; } upstart-1.13.2/init/control.h0000664000175000017500000001573612373101356013034 00000000000000/* upstart * * Copyright © 2009-2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_CONTROL_H #define INIT_CONTROL_H #include #include #include #include #include #include #include "event.h" #include "quiesce.h" /** * USE_SESSION_BUS_ENV: * * If this environment variable is set to any value, connect to * D-Bus session bus rather than the system bus. * * Used for testing. **/ #ifndef USE_SESSION_BUS_ENV #define USE_SESSION_BUS_ENV "UPSTART_USE_SESSION_BUS" #endif /** * control_get_job: * * @session: session, * @job: job that will be set, * @job_name: name of job to search for, * @instance: instance of @job_name to search for. * * Determine the Job associated with @job_name and @instance and set it * to @job. * * Returns: -1 on raised error, or nothing on success. **/ #define control_get_job(session, job, job_name, instance) \ { \ if (job_name) { \ JobClass *class; \ \ class = job_class_get_registered (job_name, session); \ if (! class) { \ nih_dbus_error_raise_printf ( \ DBUS_INTERFACE_UPSTART \ ".Error.UnknownJob", \ _("Unknown job: %s"), \ job_name); \ return -1; \ } \ \ job = job_find (session, class, job_name, instance); \ if (! job) { \ nih_dbus_error_raise_printf ( \ DBUS_INTERFACE_UPSTART \ ".Error.UnknownJobInstance", \ _("Unknown instance: %s of job %s"), \ instance ? instance : "(null)", \ job_name); \ return -1; \ } \ } \ } NIH_BEGIN_EXTERN extern DBusServer *control_server; extern DBusConnection *control_bus; extern NihList *control_conns; void control_init (void); void control_cleanup (void); int control_server_open (void) __attribute__ ((warn_unused_result)); void control_server_close (void); int control_bus_open (void) __attribute__ ((warn_unused_result)); void control_bus_close (void); int control_reload_configuration (void *data, NihDBusMessage *message) __attribute__ ((warn_unused_result)); int control_get_job_by_name (void *data, NihDBusMessage *message, const char *name, char **job) __attribute__ ((warn_unused_result)); int control_get_all_jobs (void *data, NihDBusMessage *message, char ***jobs) __attribute__ ((warn_unused_result)); int control_emit_event (void *data, NihDBusMessage *message, const char *name, char * const *env, int wait) __attribute__ ((warn_unused_result)); int control_emit_event_with_file (void *data, NihDBusMessage *message, const char *name, char * const *env, int wait, int file) __attribute__ ((warn_unused_result)); int control_get_version (void *data, NihDBusMessage *message, char **version) __attribute__ ((warn_unused_result)); int control_get_log_priority (void *data, NihDBusMessage *message, char **log_priority) __attribute__ ((warn_unused_result)); int control_set_log_priority (void *data, NihDBusMessage *message, const char *log_priority) __attribute__ ((warn_unused_result)); DBusBusType control_get_bus_type (void) __attribute__ ((warn_unused_result)); void control_prepare_reexec (void); int control_conn_to_index (const DBusConnection *connection) __attribute__ ((warn_unused_result)); DBusConnection *control_conn_from_index (int conn_index) __attribute__ ((warn_unused_result)); int control_bus_release_name (void) __attribute__ ((warn_unused_result)); int control_get_state (void *data, NihDBusMessage *message, char **state) __attribute__ ((warn_unused_result)); int control_restart (void *data, NihDBusMessage *message) __attribute__ ((warn_unused_result)); void control_notify_event_emitted (Event *event); void control_notify_restarted (void); int control_notify_disk_writeable (void *data, NihDBusMessage *message) __attribute__ ((warn_unused_result)); int control_notify_dbus_address (void *data, NihDBusMessage *message, const char *address) __attribute__ ((warn_unused_result)); int control_set_env_multi (void *data, NihDBusMessage *message, char * const *job_details, char * const *vars, int replace) __attribute__ ((warn_unused_result)); int control_set_env (void *data, NihDBusMessage *message, char * const *job_details, const char *var, int replace) __attribute__ ((warn_unused_result)); int control_get_env (void *data, NihDBusMessage *message, char * const *job_details, const char *name, char **value) __attribute__ ((warn_unused_result)); int control_list_env (void *data, NihDBusMessage *message, char * const *job_details, char ***env) __attribute__ ((warn_unused_result)); int control_reset_env (void *data, NihDBusMessage *message, char * const *job_details) __attribute__ ((warn_unused_result)); int control_unset_env_multi (void *data, NihDBusMessage *message, char * const *job_details, char * const *names) __attribute__ ((warn_unused_result)); int control_unset_env (void *data, NihDBusMessage *message, char * const *job_details, const char *name) __attribute__ ((warn_unused_result)); json_object *control_serialise_bus_address (void) __attribute__ ((warn_unused_result)); int control_deserialise_bus_address (json_object *json) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_CONTROL_H */ upstart-1.13.2/init/system.h0000664000175000017500000000265612373101356012675 00000000000000/* upstart * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_SYSTEM_H #define INIT_SYSTEM_H #include #include #include "job_class.h" NIH_BEGIN_EXTERN int system_kill (pid_t pid, int signal) __attribute__ ((warn_unused_result)); int system_setup_console (ConsoleType type, int reset) __attribute__ ((warn_unused_result)); int system_mount (const char *type, const char *dir, unsigned long flags, const char *options) __attribute__ ((warn_unused_result)); void system_mknod (const char *path, mode_t mode, dev_t dev); int system_check_file (const char *path, mode_t type, dev_t dev) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_SYSTEM_H */ upstart-1.13.2/init/Makefile.in0000664000175000017500000035171012402042374013240 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = init$(EXEEXT) @ENABLE_CGROUPS_TRUE@am__append_1 = cgroup.c cgroup.h @ENABLE_CGROUPS_TRUE@am__append_2 = test_cgroup TESTS = $(am__EXEEXT_2) test_conf_preload.sh$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_2) test_conf$(EXEEXT) @ENABLE_CGROUPS_TRUE@am__append_3 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_4 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_5 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_6 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_7 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_8 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_9 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_10 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_11 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_12 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_13 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_14 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_15 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_16 = $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_17 = cgroup.o $(CGMANAGER_LIBS) @ENABLE_CGROUPS_TRUE@am__append_18 = cgroup.o $(CGMANAGER_LIBS) subdir = init DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(dist_man_MANS) \ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) tests_libwrap_inotify_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am_tests_libwrap_inotify_la_OBJECTS = wrap_inotify.lo tests_libwrap_inotify_la_OBJECTS = \ $(am_tests_libwrap_inotify_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = tests_libwrap_inotify_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(tests_libwrap_inotify_la_LDFLAGS) \ $(LDFLAGS) -o $@ am__dirstamp = $(am__leading_dot)dirstamp @ENABLE_CGROUPS_TRUE@am__EXEEXT_1 = test_cgroup$(EXEEXT) am__EXEEXT_2 = test_system$(EXEEXT) test_environ$(EXEEXT) \ test_process$(EXEEXT) test_job_class$(EXEEXT) \ test_job_process$(EXEEXT) test_job$(EXEEXT) test_log$(EXEEXT) \ test_state$(EXEEXT) test_event$(EXEEXT) \ test_event_operator$(EXEEXT) test_blocked$(EXEEXT) \ test_parse_job$(EXEEXT) test_parse_conf$(EXEEXT) \ test_conf_static$(EXEEXT) test_xdg$(EXEEXT) \ test_control$(EXEEXT) test_main$(EXEEXT) $(am__EXEEXT_1) am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(sbin_PROGRAMS) am__init_SOURCES_DIST = main.c paths.h events.h system.c system.h \ environ.c environ.h process.c process.h session.c session.h \ state.c state.h job_class.c job_class.h job_process.c \ job_process.h job.c job.h log.c log.h event.c event.h \ event_operator.c event_operator.h blocked.c blocked.h \ parse_job.c parse_job.h parse_conf.c parse_conf.h conf.c \ conf.h control.c control.h xdg.c xdg.h quiesce.c quiesce.h \ errors.h apparmor.c apparmor.h cgroup.c cgroup.h @ENABLE_CGROUPS_TRUE@am__objects_1 = cgroup.$(OBJEXT) am_init_OBJECTS = main.$(OBJEXT) system.$(OBJEXT) environ.$(OBJEXT) \ process.$(OBJEXT) session.$(OBJEXT) state.$(OBJEXT) \ job_class.$(OBJEXT) job_process.$(OBJEXT) job.$(OBJEXT) \ log.$(OBJEXT) event.$(OBJEXT) event_operator.$(OBJEXT) \ blocked.$(OBJEXT) parse_job.$(OBJEXT) parse_conf.$(OBJEXT) \ conf.$(OBJEXT) control.$(OBJEXT) xdg.$(OBJEXT) \ quiesce.$(OBJEXT) apparmor.$(OBJEXT) $(am__objects_1) am__objects_2 = com.ubuntu.Upstart.$(OBJEXT) am__objects_3 = com.ubuntu.Upstart.Job.$(OBJEXT) am__objects_4 = com.ubuntu.Upstart.Instance.$(OBJEXT) nodist_init_OBJECTS = $(am__objects_2) $(am__objects_3) \ $(am__objects_4) init_OBJECTS = $(am_init_OBJECTS) $(nodist_init_OBJECTS) init_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_blocked_OBJECTS = test_blocked.$(OBJEXT) test_blocked_OBJECTS = $(am_test_blocked_OBJECTS) @ENABLE_CGROUPS_TRUE@am__DEPENDENCIES_3 = cgroup.o \ @ENABLE_CGROUPS_TRUE@ $(am__DEPENDENCIES_1) test_blocked_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_cgroup_OBJECTS = test_cgroup.$(OBJEXT) test_cgroup_OBJECTS = $(am_test_cgroup_OBJECTS) test_cgroup_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o cgroup.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am__objects_5 = am_test_conf_OBJECTS = test_conf.$(OBJEXT) $(am__objects_5) test_conf_OBJECTS = $(am_test_conf_OBJECTS) test_conf_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_conf_static_OBJECTS = test_conf_static.$(OBJEXT) test_conf_static_OBJECTS = $(am_test_conf_static_OBJECTS) test_conf_static_DEPENDENCIES = system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o \ blocked.o parse_job.o parse_conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_control_OBJECTS = test_control.$(OBJEXT) test_control_OBJECTS = $(am_test_control_OBJECTS) test_control_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_environ_OBJECTS = test_environ.$(OBJEXT) test_environ_OBJECTS = $(am_test_environ_OBJECTS) test_environ_DEPENDENCIES = environ.o $(am__DEPENDENCIES_1) am_test_event_OBJECTS = test_event.$(OBJEXT) test_event_OBJECTS = $(am_test_event_OBJECTS) test_event_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_event_operator_OBJECTS = test_event_operator.$(OBJEXT) \ test_util.$(OBJEXT) test_event_operator_OBJECTS = $(am_test_event_operator_OBJECTS) test_event_operator_DEPENDENCIES = system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o \ blocked.o parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_job_OBJECTS = test_job.$(OBJEXT) test_job_OBJECTS = $(am_test_job_OBJECTS) test_job_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_job_class_OBJECTS = test_job_class.$(OBJEXT) test_job_class_OBJECTS = $(am_test_job_class_OBJECTS) test_job_class_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_job_process_OBJECTS = test_job_process.$(OBJEXT) test_job_process_OBJECTS = $(am_test_job_process_OBJECTS) test_job_process_DEPENDENCIES = system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o \ blocked.o parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_log_OBJECTS = test_log.$(OBJEXT) test_log_OBJECTS = $(am_test_log_OBJECTS) test_log_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_main_OBJECTS = test_main.$(OBJEXT) test_main_OBJECTS = $(am_test_main_OBJECTS) test_main_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_parse_conf_OBJECTS = test_parse_conf.$(OBJEXT) test_parse_conf_OBJECTS = $(am_test_parse_conf_OBJECTS) test_parse_conf_DEPENDENCIES = system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o \ blocked.o parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_parse_job_OBJECTS = test_parse_job.$(OBJEXT) test_parse_job_OBJECTS = $(am_test_parse_job_OBJECTS) test_parse_job_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_process_OBJECTS = test_process.$(OBJEXT) test_process_OBJECTS = $(am_test_process_OBJECTS) test_process_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_state_OBJECTS = test_state.$(OBJEXT) test_util.$(OBJEXT) test_state_OBJECTS = $(am_test_state_OBJECTS) test_state_DEPENDENCIES = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_3) am_test_system_OBJECTS = test_system.$(OBJEXT) test_system_OBJECTS = $(am_test_system_OBJECTS) test_system_DEPENDENCIES = system.o $(am__DEPENDENCIES_1) am_test_xdg_OBJECTS = test_xdg.$(OBJEXT) test_xdg_OBJECTS = $(am_test_xdg_OBJECTS) @ENABLE_CGROUPS_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) test_xdg_DEPENDENCIES = xdg.o environ.o $(am__DEPENDENCIES_1) \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(tests_libwrap_inotify_la_SOURCES) $(init_SOURCES) \ $(nodist_init_SOURCES) $(test_blocked_SOURCES) \ $(test_cgroup_SOURCES) $(test_conf_SOURCES) \ $(test_conf_static_SOURCES) $(test_control_SOURCES) \ $(test_environ_SOURCES) $(test_event_SOURCES) \ $(test_event_operator_SOURCES) $(test_job_SOURCES) \ $(test_job_class_SOURCES) $(test_job_process_SOURCES) \ $(test_log_SOURCES) $(test_main_SOURCES) \ $(test_parse_conf_SOURCES) $(test_parse_job_SOURCES) \ $(test_process_SOURCES) $(test_state_SOURCES) \ $(test_system_SOURCES) $(test_xdg_SOURCES) DIST_SOURCES = $(tests_libwrap_inotify_la_SOURCES) \ $(am__init_SOURCES_DIST) $(test_blocked_SOURCES) \ $(test_cgroup_SOURCES) $(test_conf_SOURCES) \ $(test_conf_static_SOURCES) $(test_control_SOURCES) \ $(test_environ_SOURCES) $(test_event_SOURCES) \ $(test_event_operator_SOURCES) $(test_job_SOURCES) \ $(test_job_class_SOURCES) $(test_job_process_SOURCES) \ $(test_log_SOURCES) $(test_main_SOURCES) \ $(test_parse_conf_SOURCES) $(test_parse_job_SOURCES) \ $(test_process_SOURCES) $(test_state_SOURCES) \ $(test_system_SOURCES) $(test_xdg_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ initconfdir = $(sysconfdir)/init AM_MAKEFLAGS = TERM=xterm AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) \ $(JSON_CFLAGS) \ $(CGMANAGER_CFLAGS) AM_LIBADD = $(CGMANAGER_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS) AM_CPPFLAGS = -DLOCALEDIR="\"$(localedir)\"" \ -DCONFFILE="\"$(sysconfdir)/init.conf\"" \ -DCONFDIR="\"$(initconfdir)\"" -DSBINDIR="\"$(sbindir)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) \ -iquote$(srcdir) -I$(top_srcdir)/intl -I$(top_srcdir)/test \ -iquote$(top_srcdir)/test \ -DTEST_DATA_DIR="\"$(TEST_DATA_DIR)\"" dist_man_MANS = \ man/init.8 \ man/init.5 \ man/startup.7 \ man/starting.7 \ man/started.7 \ man/stopping.7 \ man/stopped.7 \ man/control-alt-delete.7 \ man/keyboard-request.7 \ man/power-status-changed.7 \ man/upstart.7 \ man/inittab.5 \ man/session-end.7 init_SOURCES = main.c paths.h events.h system.c system.h environ.c \ environ.h process.c process.h session.c session.h state.c \ state.h job_class.c job_class.h job_process.c job_process.h \ job.c job.h log.c log.h event.c event.h event_operator.c \ event_operator.h blocked.c blocked.h parse_job.c parse_job.h \ parse_conf.c parse_conf.h conf.c conf.h control.c control.h \ xdg.c xdg.h quiesce.c quiesce.h errors.h apparmor.c apparmor.h \ $(am__append_1) nodist_init_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) init_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ $(CGMANAGER_LIBS) \ -lrt com_ubuntu_Upstart_OUTPUTS = \ com.ubuntu.Upstart.c \ com.ubuntu.Upstart.h com_ubuntu_Upstart_XML = \ ../dbus/com.ubuntu.Upstart.xml com_ubuntu_Upstart_Job_OUTPUTS = \ com.ubuntu.Upstart.Job.c \ com.ubuntu.Upstart.Job.h com_ubuntu_Upstart_Job_XML = \ ../dbus/com.ubuntu.Upstart.Job.xml com_ubuntu_Upstart_Instance_OUTPUTS = \ com.ubuntu.Upstart.Instance.c \ com.ubuntu.Upstart.Instance.h com_ubuntu_Upstart_Instance_XML = \ ../dbus/com.ubuntu.Upstart.Instance.xml # These have to be built sources because we can't compile object files # without the header file existing first BUILT_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) CLEANFILES = $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) $(check_SCRIPTS) TEST_DATA_DIR = $(srcdir)/tests/data TEST_DATA_FILES = \ $(TEST_DATA_DIR)/upstart-1.6.json \ $(TEST_DATA_DIR)/upstart-1.8.json \ $(TEST_DATA_DIR)/upstart-pre-security.json \ $(TEST_DATA_DIR)/upstart-1.8+apparmor.json \ $(TEST_DATA_DIR)/upstart-1.8+full_serialisation-apparmor.json \ $(TEST_DATA_DIR)/upstart-1.8+full_serialisation+apparmor.json \ $(TEST_DATA_DIR)/upstart-session2.json \ $(TEST_DATA_DIR)/upstart-session-infinity.json \ $(TEST_DATA_DIR)/upstart-session.json \ $(TEST_DATA_DIR)/upstart-1.9.json \ $(TEST_DATA_DIR)/upstart-1.11.json \ $(TEST_DATA_DIR)/upstart-1.13.json upstart_test_programs = test_system test_environ test_process \ test_job_class test_job_process test_job test_log test_state \ test_event test_event_operator test_blocked test_parse_job \ test_parse_conf test_conf_static test_xdg test_control \ test_main $(am__append_2) @ENABLE_TAP_OUTPUT_FALSE@LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver @ENABLE_TAP_OUTPUT_TRUE@LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh # Ensure a clean test environment (that will not touch the running users # one). Tests that need the variables listed below are expected to set # them to appropriate temporary values as needed. AM_TESTS_ENVIRONMENT = \ unset -v \ XDG_RUNTIME_DIR \ DBUS_SESSION_BUS_ADDRESS \ UPSTART_SESSION \ UPSTART_INSTANCE \ UPSTART_EVENTS \ UPSTART_JOB; EXTRA_DIST = init.supp $(TEST_DATA_FILES) tests/test_conf_preload.sh.in check_SCRIPTS = test_conf_preload.sh$(EXEEXT) test_system_SOURCES = tests/test_system.c test_system_LDADD = \ system.o \ $(NIH_LIBS) test_environ_SOURCES = tests/test_environ.c test_environ_LDADD = \ environ.o \ $(NIH_LIBS) test_process_SOURCES = tests/test_process.c test_process_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_3) test_job_class_SOURCES = tests/test_job_class.c test_job_class_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_4) test_job_process_SOURCES = tests/test_job_process.c test_job_process_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt -lutil \ $(am__append_5) test_job_SOURCES = tests/test_job.c test_job_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_6) test_log_SOURCES = tests/test_log.c test_log_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt -lutil \ $(am__append_7) test_state_SOURCES = tests/test_state.c tests/test_util.c tests/test_util.h test_state_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt -lutil \ $(am__append_8) test_event_SOURCES = tests/test_event.c test_event_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_9) test_event_operator_SOURCES = tests/test_event_operator.c tests/test_util.c tests/test_util.h test_event_operator_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_10) test_blocked_SOURCES = tests/test_blocked.c test_blocked_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_11) test_parse_job_SOURCES = tests/test_parse_job.c test_parse_job_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_12) test_parse_conf_SOURCES = tests/test_parse_conf.c test_parse_conf_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_13) check_LTLIBRARIES = tests/libwrap_inotify.la tests_libwrap_inotify_la_SOURCES = tests/wrap_inotify.c tests_libwrap_inotify_la_LIBADD = -lrt -ldl $(AM_LIBADD) tests_libwrap_inotify_la_LDFLAGS = avoid-version -module -shared -export-dynamic -rpath /nowhere -ldl test_conf_SOURCES = tests/test_conf.c $(check_LTLIBRARIES) test_conf_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_14) test_conf_static_SOURCES = tests/test_conf_static.c test_conf_static_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o control.o quiesce.o session.o log.o \ state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_15) test_xdg_SOURCES = tests/test_xdg.c test_xdg_LDADD = xdg.o environ.o $(NIH_LIBS) \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) -lrt $(am__append_16) test_cgroup_SOURCES = tests/test_cgroup.c test_cgroup_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o cgroup.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ $(CGMANAGER_LIBS) \ -lrt test_control_SOURCES = tests/test_control.c test_control_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_17) test_main_SOURCES = tests/test_main.c test_main_LDADD = system.o environ.o process.o job_class.o \ job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o session.o \ log.o state.o xdg.o apparmor.o com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) $(JSON_LIBS) -lrt \ $(am__append_18) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu init/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu init/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } tests/$(am__dirstamp): @$(MKDIR_P) tests @: > tests/$(am__dirstamp) tests/libwrap_inotify.la: $(tests_libwrap_inotify_la_OBJECTS) $(tests_libwrap_inotify_la_DEPENDENCIES) $(EXTRA_tests_libwrap_inotify_la_DEPENDENCIES) tests/$(am__dirstamp) $(AM_V_CCLD)$(tests_libwrap_inotify_la_LINK) $(tests_libwrap_inotify_la_OBJECTS) $(tests_libwrap_inotify_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list init$(EXEEXT): $(init_OBJECTS) $(init_DEPENDENCIES) $(EXTRA_init_DEPENDENCIES) @rm -f init$(EXEEXT) $(AM_V_CCLD)$(LINK) $(init_OBJECTS) $(init_LDADD) $(LIBS) test_blocked$(EXEEXT): $(test_blocked_OBJECTS) $(test_blocked_DEPENDENCIES) $(EXTRA_test_blocked_DEPENDENCIES) @rm -f test_blocked$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_blocked_OBJECTS) $(test_blocked_LDADD) $(LIBS) test_cgroup$(EXEEXT): $(test_cgroup_OBJECTS) $(test_cgroup_DEPENDENCIES) $(EXTRA_test_cgroup_DEPENDENCIES) @rm -f test_cgroup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_cgroup_OBJECTS) $(test_cgroup_LDADD) $(LIBS) test_conf$(EXEEXT): $(test_conf_OBJECTS) $(test_conf_DEPENDENCIES) $(EXTRA_test_conf_DEPENDENCIES) @rm -f test_conf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_conf_OBJECTS) $(test_conf_LDADD) $(LIBS) test_conf_static$(EXEEXT): $(test_conf_static_OBJECTS) $(test_conf_static_DEPENDENCIES) $(EXTRA_test_conf_static_DEPENDENCIES) @rm -f test_conf_static$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_conf_static_OBJECTS) $(test_conf_static_LDADD) $(LIBS) test_control$(EXEEXT): $(test_control_OBJECTS) $(test_control_DEPENDENCIES) $(EXTRA_test_control_DEPENDENCIES) @rm -f test_control$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_control_OBJECTS) $(test_control_LDADD) $(LIBS) test_environ$(EXEEXT): $(test_environ_OBJECTS) $(test_environ_DEPENDENCIES) $(EXTRA_test_environ_DEPENDENCIES) @rm -f test_environ$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_environ_OBJECTS) $(test_environ_LDADD) $(LIBS) test_event$(EXEEXT): $(test_event_OBJECTS) $(test_event_DEPENDENCIES) $(EXTRA_test_event_DEPENDENCIES) @rm -f test_event$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_event_OBJECTS) $(test_event_LDADD) $(LIBS) test_event_operator$(EXEEXT): $(test_event_operator_OBJECTS) $(test_event_operator_DEPENDENCIES) $(EXTRA_test_event_operator_DEPENDENCIES) @rm -f test_event_operator$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_event_operator_OBJECTS) $(test_event_operator_LDADD) $(LIBS) test_job$(EXEEXT): $(test_job_OBJECTS) $(test_job_DEPENDENCIES) $(EXTRA_test_job_DEPENDENCIES) @rm -f test_job$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_job_OBJECTS) $(test_job_LDADD) $(LIBS) test_job_class$(EXEEXT): $(test_job_class_OBJECTS) $(test_job_class_DEPENDENCIES) $(EXTRA_test_job_class_DEPENDENCIES) @rm -f test_job_class$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_job_class_OBJECTS) $(test_job_class_LDADD) $(LIBS) test_job_process$(EXEEXT): $(test_job_process_OBJECTS) $(test_job_process_DEPENDENCIES) $(EXTRA_test_job_process_DEPENDENCIES) @rm -f test_job_process$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_job_process_OBJECTS) $(test_job_process_LDADD) $(LIBS) test_log$(EXEEXT): $(test_log_OBJECTS) $(test_log_DEPENDENCIES) $(EXTRA_test_log_DEPENDENCIES) @rm -f test_log$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_log_OBJECTS) $(test_log_LDADD) $(LIBS) test_main$(EXEEXT): $(test_main_OBJECTS) $(test_main_DEPENDENCIES) $(EXTRA_test_main_DEPENDENCIES) @rm -f test_main$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_main_OBJECTS) $(test_main_LDADD) $(LIBS) test_parse_conf$(EXEEXT): $(test_parse_conf_OBJECTS) $(test_parse_conf_DEPENDENCIES) $(EXTRA_test_parse_conf_DEPENDENCIES) @rm -f test_parse_conf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_parse_conf_OBJECTS) $(test_parse_conf_LDADD) $(LIBS) test_parse_job$(EXEEXT): $(test_parse_job_OBJECTS) $(test_parse_job_DEPENDENCIES) $(EXTRA_test_parse_job_DEPENDENCIES) @rm -f test_parse_job$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_parse_job_OBJECTS) $(test_parse_job_LDADD) $(LIBS) test_process$(EXEEXT): $(test_process_OBJECTS) $(test_process_DEPENDENCIES) $(EXTRA_test_process_DEPENDENCIES) @rm -f test_process$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_process_OBJECTS) $(test_process_LDADD) $(LIBS) test_state$(EXEEXT): $(test_state_OBJECTS) $(test_state_DEPENDENCIES) $(EXTRA_test_state_DEPENDENCIES) @rm -f test_state$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_state_OBJECTS) $(test_state_LDADD) $(LIBS) test_system$(EXEEXT): $(test_system_OBJECTS) $(test_system_DEPENDENCIES) $(EXTRA_test_system_DEPENDENCIES) @rm -f test_system$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_system_OBJECTS) $(test_system_LDADD) $(LIBS) test_xdg$(EXEEXT): $(test_xdg_OBJECTS) $(test_xdg_DEPENDENCIES) $(EXTRA_test_xdg_DEPENDENCIES) @rm -f test_xdg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_xdg_OBJECTS) $(test_xdg_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apparmor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blocked.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgroup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Instance.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/control.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environ.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event_operator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_class.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_process.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quiesce.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_blocked.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cgroup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conf_static.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_control.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_environ.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_event.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_event_operator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_job_class.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_job_process.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_parse_conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_parse_job.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_process.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_state.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_system.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_xdg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrap_inotify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdg.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< wrap_inotify.lo: tests/wrap_inotify.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT wrap_inotify.lo -MD -MP -MF $(DEPDIR)/wrap_inotify.Tpo -c -o wrap_inotify.lo `test -f 'tests/wrap_inotify.c' || echo '$(srcdir)/'`tests/wrap_inotify.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wrap_inotify.Tpo $(DEPDIR)/wrap_inotify.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/wrap_inotify.c' object='wrap_inotify.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o wrap_inotify.lo `test -f 'tests/wrap_inotify.c' || echo '$(srcdir)/'`tests/wrap_inotify.c test_blocked.o: tests/test_blocked.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_blocked.o -MD -MP -MF $(DEPDIR)/test_blocked.Tpo -c -o test_blocked.o `test -f 'tests/test_blocked.c' || echo '$(srcdir)/'`tests/test_blocked.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_blocked.Tpo $(DEPDIR)/test_blocked.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_blocked.c' object='test_blocked.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_blocked.o `test -f 'tests/test_blocked.c' || echo '$(srcdir)/'`tests/test_blocked.c test_blocked.obj: tests/test_blocked.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_blocked.obj -MD -MP -MF $(DEPDIR)/test_blocked.Tpo -c -o test_blocked.obj `if test -f 'tests/test_blocked.c'; then $(CYGPATH_W) 'tests/test_blocked.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_blocked.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_blocked.Tpo $(DEPDIR)/test_blocked.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_blocked.c' object='test_blocked.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_blocked.obj `if test -f 'tests/test_blocked.c'; then $(CYGPATH_W) 'tests/test_blocked.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_blocked.c'; fi` test_cgroup.o: tests/test_cgroup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cgroup.o -MD -MP -MF $(DEPDIR)/test_cgroup.Tpo -c -o test_cgroup.o `test -f 'tests/test_cgroup.c' || echo '$(srcdir)/'`tests/test_cgroup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cgroup.Tpo $(DEPDIR)/test_cgroup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_cgroup.c' object='test_cgroup.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cgroup.o `test -f 'tests/test_cgroup.c' || echo '$(srcdir)/'`tests/test_cgroup.c test_cgroup.obj: tests/test_cgroup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_cgroup.obj -MD -MP -MF $(DEPDIR)/test_cgroup.Tpo -c -o test_cgroup.obj `if test -f 'tests/test_cgroup.c'; then $(CYGPATH_W) 'tests/test_cgroup.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_cgroup.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_cgroup.Tpo $(DEPDIR)/test_cgroup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_cgroup.c' object='test_cgroup.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_cgroup.obj `if test -f 'tests/test_cgroup.c'; then $(CYGPATH_W) 'tests/test_cgroup.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_cgroup.c'; fi` test_conf.o: tests/test_conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_conf.o -MD -MP -MF $(DEPDIR)/test_conf.Tpo -c -o test_conf.o `test -f 'tests/test_conf.c' || echo '$(srcdir)/'`tests/test_conf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_conf.Tpo $(DEPDIR)/test_conf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_conf.c' object='test_conf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_conf.o `test -f 'tests/test_conf.c' || echo '$(srcdir)/'`tests/test_conf.c test_conf.obj: tests/test_conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_conf.obj -MD -MP -MF $(DEPDIR)/test_conf.Tpo -c -o test_conf.obj `if test -f 'tests/test_conf.c'; then $(CYGPATH_W) 'tests/test_conf.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_conf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_conf.Tpo $(DEPDIR)/test_conf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_conf.c' object='test_conf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_conf.obj `if test -f 'tests/test_conf.c'; then $(CYGPATH_W) 'tests/test_conf.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_conf.c'; fi` test_conf_static.o: tests/test_conf_static.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_conf_static.o -MD -MP -MF $(DEPDIR)/test_conf_static.Tpo -c -o test_conf_static.o `test -f 'tests/test_conf_static.c' || echo '$(srcdir)/'`tests/test_conf_static.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_conf_static.Tpo $(DEPDIR)/test_conf_static.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_conf_static.c' object='test_conf_static.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_conf_static.o `test -f 'tests/test_conf_static.c' || echo '$(srcdir)/'`tests/test_conf_static.c test_conf_static.obj: tests/test_conf_static.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_conf_static.obj -MD -MP -MF $(DEPDIR)/test_conf_static.Tpo -c -o test_conf_static.obj `if test -f 'tests/test_conf_static.c'; then $(CYGPATH_W) 'tests/test_conf_static.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_conf_static.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_conf_static.Tpo $(DEPDIR)/test_conf_static.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_conf_static.c' object='test_conf_static.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_conf_static.obj `if test -f 'tests/test_conf_static.c'; then $(CYGPATH_W) 'tests/test_conf_static.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_conf_static.c'; fi` test_control.o: tests/test_control.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_control.o -MD -MP -MF $(DEPDIR)/test_control.Tpo -c -o test_control.o `test -f 'tests/test_control.c' || echo '$(srcdir)/'`tests/test_control.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_control.Tpo $(DEPDIR)/test_control.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_control.c' object='test_control.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_control.o `test -f 'tests/test_control.c' || echo '$(srcdir)/'`tests/test_control.c test_control.obj: tests/test_control.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_control.obj -MD -MP -MF $(DEPDIR)/test_control.Tpo -c -o test_control.obj `if test -f 'tests/test_control.c'; then $(CYGPATH_W) 'tests/test_control.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_control.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_control.Tpo $(DEPDIR)/test_control.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_control.c' object='test_control.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_control.obj `if test -f 'tests/test_control.c'; then $(CYGPATH_W) 'tests/test_control.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_control.c'; fi` test_environ.o: tests/test_environ.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_environ.o -MD -MP -MF $(DEPDIR)/test_environ.Tpo -c -o test_environ.o `test -f 'tests/test_environ.c' || echo '$(srcdir)/'`tests/test_environ.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_environ.Tpo $(DEPDIR)/test_environ.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_environ.c' object='test_environ.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_environ.o `test -f 'tests/test_environ.c' || echo '$(srcdir)/'`tests/test_environ.c test_environ.obj: tests/test_environ.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_environ.obj -MD -MP -MF $(DEPDIR)/test_environ.Tpo -c -o test_environ.obj `if test -f 'tests/test_environ.c'; then $(CYGPATH_W) 'tests/test_environ.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_environ.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_environ.Tpo $(DEPDIR)/test_environ.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_environ.c' object='test_environ.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_environ.obj `if test -f 'tests/test_environ.c'; then $(CYGPATH_W) 'tests/test_environ.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_environ.c'; fi` test_event.o: tests/test_event.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_event.o -MD -MP -MF $(DEPDIR)/test_event.Tpo -c -o test_event.o `test -f 'tests/test_event.c' || echo '$(srcdir)/'`tests/test_event.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_event.Tpo $(DEPDIR)/test_event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_event.c' object='test_event.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_event.o `test -f 'tests/test_event.c' || echo '$(srcdir)/'`tests/test_event.c test_event.obj: tests/test_event.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_event.obj -MD -MP -MF $(DEPDIR)/test_event.Tpo -c -o test_event.obj `if test -f 'tests/test_event.c'; then $(CYGPATH_W) 'tests/test_event.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_event.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_event.Tpo $(DEPDIR)/test_event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_event.c' object='test_event.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_event.obj `if test -f 'tests/test_event.c'; then $(CYGPATH_W) 'tests/test_event.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_event.c'; fi` test_event_operator.o: tests/test_event_operator.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_event_operator.o -MD -MP -MF $(DEPDIR)/test_event_operator.Tpo -c -o test_event_operator.o `test -f 'tests/test_event_operator.c' || echo '$(srcdir)/'`tests/test_event_operator.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_event_operator.Tpo $(DEPDIR)/test_event_operator.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_event_operator.c' object='test_event_operator.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_event_operator.o `test -f 'tests/test_event_operator.c' || echo '$(srcdir)/'`tests/test_event_operator.c test_event_operator.obj: tests/test_event_operator.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_event_operator.obj -MD -MP -MF $(DEPDIR)/test_event_operator.Tpo -c -o test_event_operator.obj `if test -f 'tests/test_event_operator.c'; then $(CYGPATH_W) 'tests/test_event_operator.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_event_operator.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_event_operator.Tpo $(DEPDIR)/test_event_operator.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_event_operator.c' object='test_event_operator.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_event_operator.obj `if test -f 'tests/test_event_operator.c'; then $(CYGPATH_W) 'tests/test_event_operator.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_event_operator.c'; fi` test_util.o: tests/test_util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_util.o -MD -MP -MF $(DEPDIR)/test_util.Tpo -c -o test_util.o `test -f 'tests/test_util.c' || echo '$(srcdir)/'`tests/test_util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_util.Tpo $(DEPDIR)/test_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_util.c' object='test_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_util.o `test -f 'tests/test_util.c' || echo '$(srcdir)/'`tests/test_util.c test_util.obj: tests/test_util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_util.obj -MD -MP -MF $(DEPDIR)/test_util.Tpo -c -o test_util.obj `if test -f 'tests/test_util.c'; then $(CYGPATH_W) 'tests/test_util.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_util.Tpo $(DEPDIR)/test_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_util.c' object='test_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_util.obj `if test -f 'tests/test_util.c'; then $(CYGPATH_W) 'tests/test_util.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_util.c'; fi` test_job.o: tests/test_job.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_job.o -MD -MP -MF $(DEPDIR)/test_job.Tpo -c -o test_job.o `test -f 'tests/test_job.c' || echo '$(srcdir)/'`tests/test_job.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_job.Tpo $(DEPDIR)/test_job.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_job.c' object='test_job.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_job.o `test -f 'tests/test_job.c' || echo '$(srcdir)/'`tests/test_job.c test_job.obj: tests/test_job.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_job.obj -MD -MP -MF $(DEPDIR)/test_job.Tpo -c -o test_job.obj `if test -f 'tests/test_job.c'; then $(CYGPATH_W) 'tests/test_job.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_job.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_job.Tpo $(DEPDIR)/test_job.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_job.c' object='test_job.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_job.obj `if test -f 'tests/test_job.c'; then $(CYGPATH_W) 'tests/test_job.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_job.c'; fi` test_job_class.o: tests/test_job_class.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_job_class.o -MD -MP -MF $(DEPDIR)/test_job_class.Tpo -c -o test_job_class.o `test -f 'tests/test_job_class.c' || echo '$(srcdir)/'`tests/test_job_class.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_job_class.Tpo $(DEPDIR)/test_job_class.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_job_class.c' object='test_job_class.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_job_class.o `test -f 'tests/test_job_class.c' || echo '$(srcdir)/'`tests/test_job_class.c test_job_class.obj: tests/test_job_class.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_job_class.obj -MD -MP -MF $(DEPDIR)/test_job_class.Tpo -c -o test_job_class.obj `if test -f 'tests/test_job_class.c'; then $(CYGPATH_W) 'tests/test_job_class.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_job_class.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_job_class.Tpo $(DEPDIR)/test_job_class.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_job_class.c' object='test_job_class.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_job_class.obj `if test -f 'tests/test_job_class.c'; then $(CYGPATH_W) 'tests/test_job_class.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_job_class.c'; fi` test_job_process.o: tests/test_job_process.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_job_process.o -MD -MP -MF $(DEPDIR)/test_job_process.Tpo -c -o test_job_process.o `test -f 'tests/test_job_process.c' || echo '$(srcdir)/'`tests/test_job_process.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_job_process.Tpo $(DEPDIR)/test_job_process.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_job_process.c' object='test_job_process.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_job_process.o `test -f 'tests/test_job_process.c' || echo '$(srcdir)/'`tests/test_job_process.c test_job_process.obj: tests/test_job_process.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_job_process.obj -MD -MP -MF $(DEPDIR)/test_job_process.Tpo -c -o test_job_process.obj `if test -f 'tests/test_job_process.c'; then $(CYGPATH_W) 'tests/test_job_process.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_job_process.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_job_process.Tpo $(DEPDIR)/test_job_process.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_job_process.c' object='test_job_process.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_job_process.obj `if test -f 'tests/test_job_process.c'; then $(CYGPATH_W) 'tests/test_job_process.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_job_process.c'; fi` test_log.o: tests/test_log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_log.o -MD -MP -MF $(DEPDIR)/test_log.Tpo -c -o test_log.o `test -f 'tests/test_log.c' || echo '$(srcdir)/'`tests/test_log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_log.Tpo $(DEPDIR)/test_log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_log.c' object='test_log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_log.o `test -f 'tests/test_log.c' || echo '$(srcdir)/'`tests/test_log.c test_log.obj: tests/test_log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_log.obj -MD -MP -MF $(DEPDIR)/test_log.Tpo -c -o test_log.obj `if test -f 'tests/test_log.c'; then $(CYGPATH_W) 'tests/test_log.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_log.Tpo $(DEPDIR)/test_log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_log.c' object='test_log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_log.obj `if test -f 'tests/test_log.c'; then $(CYGPATH_W) 'tests/test_log.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_log.c'; fi` test_main.o: tests/test_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_main.o -MD -MP -MF $(DEPDIR)/test_main.Tpo -c -o test_main.o `test -f 'tests/test_main.c' || echo '$(srcdir)/'`tests/test_main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main.Tpo $(DEPDIR)/test_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_main.c' object='test_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_main.o `test -f 'tests/test_main.c' || echo '$(srcdir)/'`tests/test_main.c test_main.obj: tests/test_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_main.obj -MD -MP -MF $(DEPDIR)/test_main.Tpo -c -o test_main.obj `if test -f 'tests/test_main.c'; then $(CYGPATH_W) 'tests/test_main.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_main.Tpo $(DEPDIR)/test_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_main.c' object='test_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_main.obj `if test -f 'tests/test_main.c'; then $(CYGPATH_W) 'tests/test_main.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_main.c'; fi` test_parse_conf.o: tests/test_parse_conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_parse_conf.o -MD -MP -MF $(DEPDIR)/test_parse_conf.Tpo -c -o test_parse_conf.o `test -f 'tests/test_parse_conf.c' || echo '$(srcdir)/'`tests/test_parse_conf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_parse_conf.Tpo $(DEPDIR)/test_parse_conf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_parse_conf.c' object='test_parse_conf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_parse_conf.o `test -f 'tests/test_parse_conf.c' || echo '$(srcdir)/'`tests/test_parse_conf.c test_parse_conf.obj: tests/test_parse_conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_parse_conf.obj -MD -MP -MF $(DEPDIR)/test_parse_conf.Tpo -c -o test_parse_conf.obj `if test -f 'tests/test_parse_conf.c'; then $(CYGPATH_W) 'tests/test_parse_conf.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_parse_conf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_parse_conf.Tpo $(DEPDIR)/test_parse_conf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_parse_conf.c' object='test_parse_conf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_parse_conf.obj `if test -f 'tests/test_parse_conf.c'; then $(CYGPATH_W) 'tests/test_parse_conf.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_parse_conf.c'; fi` test_parse_job.o: tests/test_parse_job.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_parse_job.o -MD -MP -MF $(DEPDIR)/test_parse_job.Tpo -c -o test_parse_job.o `test -f 'tests/test_parse_job.c' || echo '$(srcdir)/'`tests/test_parse_job.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_parse_job.Tpo $(DEPDIR)/test_parse_job.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_parse_job.c' object='test_parse_job.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_parse_job.o `test -f 'tests/test_parse_job.c' || echo '$(srcdir)/'`tests/test_parse_job.c test_parse_job.obj: tests/test_parse_job.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_parse_job.obj -MD -MP -MF $(DEPDIR)/test_parse_job.Tpo -c -o test_parse_job.obj `if test -f 'tests/test_parse_job.c'; then $(CYGPATH_W) 'tests/test_parse_job.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_parse_job.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_parse_job.Tpo $(DEPDIR)/test_parse_job.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_parse_job.c' object='test_parse_job.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_parse_job.obj `if test -f 'tests/test_parse_job.c'; then $(CYGPATH_W) 'tests/test_parse_job.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_parse_job.c'; fi` test_process.o: tests/test_process.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_process.o -MD -MP -MF $(DEPDIR)/test_process.Tpo -c -o test_process.o `test -f 'tests/test_process.c' || echo '$(srcdir)/'`tests/test_process.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_process.Tpo $(DEPDIR)/test_process.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_process.c' object='test_process.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_process.o `test -f 'tests/test_process.c' || echo '$(srcdir)/'`tests/test_process.c test_process.obj: tests/test_process.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_process.obj -MD -MP -MF $(DEPDIR)/test_process.Tpo -c -o test_process.obj `if test -f 'tests/test_process.c'; then $(CYGPATH_W) 'tests/test_process.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_process.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_process.Tpo $(DEPDIR)/test_process.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_process.c' object='test_process.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_process.obj `if test -f 'tests/test_process.c'; then $(CYGPATH_W) 'tests/test_process.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_process.c'; fi` test_state.o: tests/test_state.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_state.o -MD -MP -MF $(DEPDIR)/test_state.Tpo -c -o test_state.o `test -f 'tests/test_state.c' || echo '$(srcdir)/'`tests/test_state.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_state.Tpo $(DEPDIR)/test_state.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_state.c' object='test_state.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_state.o `test -f 'tests/test_state.c' || echo '$(srcdir)/'`tests/test_state.c test_state.obj: tests/test_state.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_state.obj -MD -MP -MF $(DEPDIR)/test_state.Tpo -c -o test_state.obj `if test -f 'tests/test_state.c'; then $(CYGPATH_W) 'tests/test_state.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_state.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_state.Tpo $(DEPDIR)/test_state.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_state.c' object='test_state.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_state.obj `if test -f 'tests/test_state.c'; then $(CYGPATH_W) 'tests/test_state.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_state.c'; fi` test_system.o: tests/test_system.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_system.o -MD -MP -MF $(DEPDIR)/test_system.Tpo -c -o test_system.o `test -f 'tests/test_system.c' || echo '$(srcdir)/'`tests/test_system.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_system.Tpo $(DEPDIR)/test_system.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_system.c' object='test_system.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_system.o `test -f 'tests/test_system.c' || echo '$(srcdir)/'`tests/test_system.c test_system.obj: tests/test_system.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_system.obj -MD -MP -MF $(DEPDIR)/test_system.Tpo -c -o test_system.obj `if test -f 'tests/test_system.c'; then $(CYGPATH_W) 'tests/test_system.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_system.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_system.Tpo $(DEPDIR)/test_system.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_system.c' object='test_system.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_system.obj `if test -f 'tests/test_system.c'; then $(CYGPATH_W) 'tests/test_system.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_system.c'; fi` test_xdg.o: tests/test_xdg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_xdg.o -MD -MP -MF $(DEPDIR)/test_xdg.Tpo -c -o test_xdg.o `test -f 'tests/test_xdg.c' || echo '$(srcdir)/'`tests/test_xdg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xdg.Tpo $(DEPDIR)/test_xdg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_xdg.c' object='test_xdg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_xdg.o `test -f 'tests/test_xdg.c' || echo '$(srcdir)/'`tests/test_xdg.c test_xdg.obj: tests/test_xdg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_xdg.obj -MD -MP -MF $(DEPDIR)/test_xdg.Tpo -c -o test_xdg.obj `if test -f 'tests/test_xdg.c'; then $(CYGPATH_W) 'tests/test_xdg.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_xdg.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xdg.Tpo $(DEPDIR)/test_xdg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_xdg.c' object='test_xdg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_xdg.obj `if test -f 'tests/test_xdg.c'; then $(CYGPATH_W) 'tests/test_xdg.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_xdg.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf tests/.libs tests/_libs install-man5: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man7: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.7[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-man8: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_LTLIBRARIES) $(check_PROGRAMS) $(check_SCRIPTS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_system.log: test_system$(EXEEXT) @p='test_system$(EXEEXT)'; \ b='test_system'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_environ.log: test_environ$(EXEEXT) @p='test_environ$(EXEEXT)'; \ b='test_environ'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_process.log: test_process$(EXEEXT) @p='test_process$(EXEEXT)'; \ b='test_process'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_job_class.log: test_job_class$(EXEEXT) @p='test_job_class$(EXEEXT)'; \ b='test_job_class'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_job_process.log: test_job_process$(EXEEXT) @p='test_job_process$(EXEEXT)'; \ b='test_job_process'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_job.log: test_job$(EXEEXT) @p='test_job$(EXEEXT)'; \ b='test_job'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_log.log: test_log$(EXEEXT) @p='test_log$(EXEEXT)'; \ b='test_log'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_state.log: test_state$(EXEEXT) @p='test_state$(EXEEXT)'; \ b='test_state'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_event.log: test_event$(EXEEXT) @p='test_event$(EXEEXT)'; \ b='test_event'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_event_operator.log: test_event_operator$(EXEEXT) @p='test_event_operator$(EXEEXT)'; \ b='test_event_operator'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_blocked.log: test_blocked$(EXEEXT) @p='test_blocked$(EXEEXT)'; \ b='test_blocked'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_parse_job.log: test_parse_job$(EXEEXT) @p='test_parse_job$(EXEEXT)'; \ b='test_parse_job'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_parse_conf.log: test_parse_conf$(EXEEXT) @p='test_parse_conf$(EXEEXT)'; \ b='test_parse_conf'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_conf_static.log: test_conf_static$(EXEEXT) @p='test_conf_static$(EXEEXT)'; \ b='test_conf_static'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_xdg.log: test_xdg$(EXEEXT) @p='test_xdg$(EXEEXT)'; \ b='test_xdg'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_control.log: test_control$(EXEEXT) @p='test_control$(EXEEXT)'; \ b='test_control'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_main.log: test_main$(EXEEXT) @p='test_main$(EXEEXT)'; \ b='test_main'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_cgroup.log: test_cgroup$(EXEEXT) @p='test_cgroup$(EXEEXT)'; \ b='test_cgroup'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_conf_preload.sh.log: test_conf_preload.sh$(EXEEXT) @p='test_conf_preload.sh$(EXEEXT)'; \ b='test_conf_preload.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS) \ $(check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f tests/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \ clean-libtool clean-local clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man5 install-man7 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-sbinPROGRAMS uninstall-man: uninstall-man5 uninstall-man7 uninstall-man8 .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \ clean-libtool clean-local clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man5 \ install-man7 install-man8 install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic maintainer-clean-local mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am recheck tags tags-am uninstall \ uninstall-am uninstall-man uninstall-man5 uninstall-man7 \ uninstall-man8 uninstall-sbinPROGRAMS $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=object --prefix=control \ --default-interface=com.ubuntu.Upstart0_6 \ --output=$@ $< $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=object --prefix=job_class \ --default-interface=com.ubuntu.Upstart0_6.Job \ --output=$@ $< $(com_ubuntu_Upstart_Instance_OUTPUTS): $(com_ubuntu_Upstart_Instance_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=object --prefix=job \ --default-interface=com.ubuntu.Upstart0_6.Instance \ --output=$@ $< test_conf_preload.sh$(EXEEXT): tests/test_conf_preload.sh.in Makefile test_conf sed -e 's|[@]abs_builddir[@]|$(abs_builddir)|g' \ -e 's|[@]inotify_preload_library[@]|$(check_LTLIBRARIES)|g' \ $< > $@ chmod +x $@ tests: $(BUILT_SOURCES) $(check_PROGRAMS) $(check_LTLIBRARIES) $(top_builddir)/util/initctl $(top_builddir)/test/libtest_util_common.a install-data-local: $(MKDIR_P) $(DESTDIR)$(initconfdir) clean-local: rm -f *.gcno *.gcda maintainer-clean-local: rm -f *.gcov FORCE: $(top_builddir)/util/initctl $(top_builddir)/test/libtest_util_common.a: FORCE (cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) ) (cd $(top_builddir)/test && $(MAKE) $(AM_MAKEFLAGS) libtest_util_common.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/init/Makefile.am0000664000175000017500000003510712373101356013231 00000000000000## Process this file with automake to produce Makefile.in initconfdir = $(sysconfdir)/init AM_MAKEFLAGS = TERM=xterm AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) \ $(JSON_CFLAGS) \ $(CGMANAGER_CFLAGS) AM_LIBADD = $(CGMANAGER_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS) AM_CPPFLAGS = \ -DLOCALEDIR="\"$(localedir)\"" \ -DCONFFILE="\"$(sysconfdir)/init.conf\"" \ -DCONFDIR="\"$(initconfdir)\"" \ -DSBINDIR="\"$(sbindir)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ -I$(top_srcdir)/intl \ -I$(top_srcdir)/test -iquote$(top_srcdir)/test dist_man_MANS = \ man/init.8 \ man/init.5 \ man/startup.7 \ man/starting.7 \ man/started.7 \ man/stopping.7 \ man/stopped.7 \ man/control-alt-delete.7 \ man/keyboard-request.7 \ man/power-status-changed.7 \ man/upstart.7 \ man/inittab.5 \ man/session-end.7 sbin_PROGRAMS = init init_SOURCES = \ main.c \ paths.h \ events.h \ system.c system.h \ environ.c environ.h \ process.c process.h \ session.c session.h \ state.c state.h \ job_class.c job_class.h \ job_process.c job_process.h \ job.c job.h \ log.c log.h \ event.c event.h \ event_operator.c event_operator.h \ blocked.c blocked.h \ parse_job.c parse_job.h \ parse_conf.c parse_conf.h \ conf.c conf.h \ control.c control.h \ xdg.c xdg.h \ quiesce.c quiesce.h \ errors.h \ apparmor.c apparmor.h nodist_init_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) init_LDADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ $(CGMANAGER_LIBS) \ -lrt if ENABLE_CGROUPS init_SOURCES += cgroup.c cgroup.h endif com_ubuntu_Upstart_OUTPUTS = \ com.ubuntu.Upstart.c \ com.ubuntu.Upstart.h com_ubuntu_Upstart_XML = \ ../dbus/com.ubuntu.Upstart.xml $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=object --prefix=control \ --default-interface=com.ubuntu.Upstart0_6 \ --output=$@ $< com_ubuntu_Upstart_Job_OUTPUTS = \ com.ubuntu.Upstart.Job.c \ com.ubuntu.Upstart.Job.h com_ubuntu_Upstart_Job_XML = \ ../dbus/com.ubuntu.Upstart.Job.xml $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=object --prefix=job_class \ --default-interface=com.ubuntu.Upstart0_6.Job \ --output=$@ $< com_ubuntu_Upstart_Instance_OUTPUTS = \ com.ubuntu.Upstart.Instance.c \ com.ubuntu.Upstart.Instance.h com_ubuntu_Upstart_Instance_XML = \ ../dbus/com.ubuntu.Upstart.Instance.xml $(com_ubuntu_Upstart_Instance_OUTPUTS): $(com_ubuntu_Upstart_Instance_XML) $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=object --prefix=job \ --default-interface=com.ubuntu.Upstart0_6.Instance \ --output=$@ $< # These have to be built sources because we can't compile object files # without the header file existing first BUILT_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) CLEANFILES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) TEST_DATA_DIR = $(srcdir)/tests/data AM_CPPFLAGS += -DTEST_DATA_DIR="\"$(TEST_DATA_DIR)\"" TEST_DATA_FILES = \ $(TEST_DATA_DIR)/upstart-1.6.json \ $(TEST_DATA_DIR)/upstart-1.8.json \ $(TEST_DATA_DIR)/upstart-pre-security.json \ $(TEST_DATA_DIR)/upstart-1.8+apparmor.json \ $(TEST_DATA_DIR)/upstart-1.8+full_serialisation-apparmor.json \ $(TEST_DATA_DIR)/upstart-1.8+full_serialisation+apparmor.json \ $(TEST_DATA_DIR)/upstart-session2.json \ $(TEST_DATA_DIR)/upstart-session-infinity.json \ $(TEST_DATA_DIR)/upstart-session.json \ $(TEST_DATA_DIR)/upstart-1.9.json \ $(TEST_DATA_DIR)/upstart-1.11.json \ $(TEST_DATA_DIR)/upstart-1.13.json upstart_test_programs = \ test_system \ test_environ \ test_process \ test_job_class \ test_job_process \ test_job \ test_log \ test_state \ test_event \ test_event_operator \ test_blocked \ test_parse_job \ test_parse_conf \ test_conf_static \ test_xdg \ test_control \ test_main if ENABLE_CGROUPS upstart_test_programs += test_cgroup endif if ENABLE_TAP_OUTPUT LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh else LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver endif # Ensure a clean test environment (that will not touch the running users # one). Tests that need the variables listed below are expected to set # them to appropriate temporary values as needed. AM_TESTS_ENVIRONMENT= \ unset -v \ XDG_RUNTIME_DIR \ DBUS_SESSION_BUS_ADDRESS \ UPSTART_SESSION \ UPSTART_INSTANCE \ UPSTART_EVENTS \ UPSTART_JOB; TESTS = \ $(upstart_test_programs) \ test_conf_preload.sh$(EXEEXT) EXTRA_DIST = init.supp $(TEST_DATA_FILES) tests/test_conf_preload.sh.in test_conf_preload.sh$(EXEEXT): tests/test_conf_preload.sh.in Makefile test_conf sed -e 's|[@]abs_builddir[@]|$(abs_builddir)|g' \ -e 's|[@]inotify_preload_library[@]|$(check_LTLIBRARIES)|g' \ $< > $@ chmod +x $@ check_PROGRAMS = $(upstart_test_programs) test_conf check_SCRIPTS = test_conf_preload.sh$(EXEEXT) CLEANFILES += $(check_SCRIPTS) tests: $(BUILT_SOURCES) $(check_PROGRAMS) $(check_LTLIBRARIES) $(top_builddir)/util/initctl $(top_builddir)/test/libtest_util_common.a test_system_SOURCES = tests/test_system.c test_system_LDADD = \ system.o \ $(NIH_LIBS) test_environ_SOURCES = tests/test_environ.c test_environ_LDADD = \ environ.o \ $(NIH_LIBS) test_process_SOURCES = tests/test_process.c test_process_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_process_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_job_class_SOURCES = tests/test_job_class.c test_job_class_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_job_class_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_job_process_SOURCES = tests/test_job_process.c test_job_process_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt -lutil if ENABLE_CGROUPS test_job_process_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_job_SOURCES = tests/test_job.c test_job_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_job_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_log_SOURCES = tests/test_log.c test_log_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt -lutil if ENABLE_CGROUPS test_log_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_state_SOURCES = tests/test_state.c tests/test_util.c tests/test_util.h test_state_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt -lutil if ENABLE_CGROUPS test_state_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_event_SOURCES = tests/test_event.c test_event_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_event_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_event_operator_SOURCES = tests/test_event_operator.c tests/test_util.c tests/test_util.h test_event_operator_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_event_operator_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_blocked_SOURCES = tests/test_blocked.c test_blocked_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_blocked_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_parse_job_SOURCES = tests/test_parse_job.c test_parse_job_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_parse_job_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_parse_conf_SOURCES = tests/test_parse_conf.c test_parse_conf_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_parse_conf_LDADD += cgroup.o $(CGMANAGER_LIBS) endif check_LTLIBRARIES = tests/libwrap_inotify.la tests_libwrap_inotify_la_SOURCES = tests/wrap_inotify.c tests_libwrap_inotify_la_LIBADD = -lrt -ldl $(AM_LIBADD) tests_libwrap_inotify_la_LDFLAGS = avoid-version -module -shared -export-dynamic -rpath /nowhere -ldl test_conf_SOURCES = tests/test_conf.c $(check_LTLIBRARIES) test_conf_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_conf_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_conf_static_SOURCES = tests/test_conf_static.c test_conf_static_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_conf_static_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_xdg_SOURCES = tests/test_xdg.c test_xdg_LDADD = \ xdg.o \ environ.o \ $(NIH_LIBS) \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ -lrt if ENABLE_CGROUPS test_xdg_LDADD += $(CGMANAGER_LIBS) endif test_cgroup_SOURCES = tests/test_cgroup.c test_cgroup_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o cgroup.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ $(CGMANAGER_LIBS) \ -lrt test_control_SOURCES = tests/test_control.c test_control_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_control_LDADD += cgroup.o $(CGMANAGER_LIBS) endif test_main_SOURCES = tests/test_main.c test_main_LDADD = \ system.o environ.o process.o \ job_class.o job_process.o job.o event.o event_operator.o blocked.o \ parse_job.o parse_conf.o conf.o control.o quiesce.o \ session.o log.o state.o xdg.o apparmor.o \ com.ubuntu.Upstart.o \ com.ubuntu.Upstart.Job.o com.ubuntu.Upstart.Instance.o \ $(top_builddir)/test/libtest_util_common.a \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(JSON_LIBS) \ -lrt if ENABLE_CGROUPS test_main_LDADD += cgroup.o $(CGMANAGER_LIBS) endif install-data-local: $(MKDIR_P) $(DESTDIR)$(initconfdir) clean-local: rm -f *.gcno *.gcda maintainer-clean-local: rm -f *.gcov FORCE: $(top_builddir)/util/initctl $(top_builddir)/test/libtest_util_common.a: FORCE (cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) ) (cd $(top_builddir)/test && $(MAKE) $(AM_MAKEFLAGS) libtest_util_common.a) upstart-1.13.2/init/job.h0000664000175000017500000002156012401640554012116 00000000000000/* upstart * * Copyright 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_JOB_H #define INIT_JOB_H #include #include #include #include #include #include #include #include "job_class.h" #include "event_operator.h" #include "log.h" #include "com.ubuntu.Upstart.Instance.h" /** * JobGoal: * * There are two ultimate goals for any job, either it should be stopped * or it should be started. In order to achieve these goals, we may need * to go through a number of different states (defined by JobState). **/ typedef enum job_goal { JOB_STOP, JOB_START, JOB_RESPAWN } JobGoal; /** * JobState: * * This is used to identify the current actual state of a job, suggesting * which process (pre-start, post-start, pre-stop, post-stop or the binary * itself) is running, or which interim state we are in. * * This is combined with the job's goal decide what to do with the * processes and which states to move into when changes in process state * (pid obtained or death) occur. **/ typedef enum job_state { JOB_WAITING, JOB_STARTING, JOB_SECURITY_SPAWNING, JOB_SECURITY, JOB_PRE_STARTING, JOB_PRE_START, JOB_SPAWNING, JOB_SPAWNED, JOB_POST_STARTING, JOB_POST_START, JOB_RUNNING, JOB_PRE_STOPPING, JOB_PRE_STOP, JOB_STOPPING, JOB_KILLED, JOB_POST_STOPPING, JOB_POST_STOP } JobState; /** * TraceState: * * We trace jobs to follow forks and detect execs in order to be able to * supervise daemon processes. Unfortunately due to the "unique and arcane" * nature of ptrace(), we need to track some state. **/ typedef enum trace_state { TRACE_NONE, TRACE_NEW, TRACE_NEW_CHILD, TRACE_NORMAL } TraceState; typedef struct job_process_data JobProcessData; /** * Job: * @entry: list header, * @name: unique instance name, * @class: pointer to job class, * @path: D-Bus path of instance, * @goal: whether the job is to be stopped or started, * @state: actual state of the job, * @env: NULL-terminated list of environment variables, * @start_env: environment to use next time the job is started, * @stop_env: environment to add for the next pre-stop script, * @stop_on: event operator expression that can stop this job. * @fds: array of file descriptors associated with events in parent * JobClasses @start_on condition, * @num_fds: number of elements in @fds, * @pid: current process ids, * @blocker: emitted event we're waiting to finish, * @blocking: list of events we're blocking from finishing, * @kill_timer: timer to kill process, * @kill_process: process @kill_timer will kill, * @failed: whether the last process ran failed, * @failed_process: the last process that failed, * @exit_status: exit status of the last failed process, * @respawn_time: time job was first respawned, * @respawn_count: number of respawns since @respawn_time, * @trace_forks: number of forks traced, * @trace_state: state of trace, * @log: pointer to array of log objects for handling job output, * @process_data: transitory async job process metadata. * * This structure holds the state of an active job instance being tracked * by the init daemon, the configuration details of the job are available * from the @class member. **/ typedef struct job { NihList entry; char *name; JobClass *class; char *path; JobGoal goal; JobState state; char **env; char **start_env; char **stop_env; EventOperator *stop_on; int *fds; size_t num_fds; pid_t *pid; Event *blocker; NihList blocking; NihTimer *kill_timer; ProcessType kill_process; int failed; ProcessType failed_process; int exit_status; time_t respawn_time; int respawn_count; int trace_forks; TraceState trace_state; Log **log; JobProcessData **process_data; } Job; /** * JobProcessData: * * @job: job, * @process: job process to run, * @script: optional script that job should run with, * @shell_fd: file descriptor attached to child that @script should be * written to (or -1 when @script is NULL), * @job_process_fd: open readable file descriptor attached to the child * process used to detect child setup errors, * @status: exit status or signal in higher byte (iff * job_process_terminated() ran before the job_register_child_handler() * handlers), * @valid: FALSE once the data has been handled, else TRUE. * * Used to keep track of asynchronously started job processes. **/ typedef struct job_process_data { Job *job; ProcessType process; char *script; int shell_fd; int job_process_fd; int status; int valid; } JobProcessData; /** * job_register_child_handler: * * @_parent: parent pointer, * @_fd: file descriptor to monitor, * @_data: data to pass to nih_io_reopen(). * * Register a watcher to monitor the job process child error file * descriptor @_fd. **/ #define job_register_child_handler(_parent, _fd, _data) \ while (! nih_io_reopen (_parent, _fd, NIH_IO_STREAM, \ (NihIoReader)job_process_child_reader, \ (NihIoCloseHandler)job_process_close_handler, \ NULL, \ _data)) { \ NihError *err; \ err = nih_error_get (); \ if (err->number != ENOMEM) \ nih_assert_not_reached (); \ nih_free (err); \ } NIH_BEGIN_EXTERN Job * job_new (JobClass *class, const char *name) __attribute__ ((warn_unused_result)); void job_register (Job *job, DBusConnection *conn, int signal); void job_change_goal (Job *job, JobGoal goal); void job_change_state (Job *job, JobState state); JobState job_next_state (Job *job); void job_failed (Job *job, ProcessType process, int status); void job_finished (Job *job, int failed); Event *job_emit_event (Job *job); const char *job_name (Job *job); const char *job_goal_name (JobGoal goal) __attribute__ ((const)); JobGoal job_goal_from_name (const char *goal); const char *job_state_name (JobState state) __attribute__ ((const)); JobState job_state_from_name (const char *state); int job_start (Job *job, NihDBusMessage *message, int wait) __attribute__ ((warn_unused_result)); int job_stop (Job *job, NihDBusMessage *message, int wait) __attribute__ ((warn_unused_result)); int job_restart (Job *job, NihDBusMessage *message, int wait) __attribute__ ((warn_unused_result)); int job_reload (Job *job, NihDBusMessage *message) __attribute__ ((warn_unused_result)); int job_get_name (Job *job, NihDBusMessage *message, char **name) __attribute__ ((warn_unused_result)); int job_get_goal (Job *job, NihDBusMessage *message, char **goal) __attribute__ ((warn_unused_result)); int job_get_state (Job *job, NihDBusMessage *message, char **state) __attribute__ ((warn_unused_result)); int job_get_processes (Job *job, NihDBusMessage *message, JobProcessesElement ***processes) __attribute__ ((warn_unused_result)); json_object *job_serialise (const Job *job); Job *job_deserialise (JobClass *parent, json_object *json); json_object *job_serialise_all (const NihHash *jobs) __attribute__ ((warn_unused_result)); int job_deserialise_all (JobClass *parent, json_object *json) __attribute__ ((warn_unused_result)); Job * job_find (const Session *session, JobClass *class, const char *job_class, const char *job_name) __attribute__ ((warn_unused_result)); const char * job_state_enum_to_str (JobState state) __attribute__ ((warn_unused_result)); JobState job_state_str_to_enum (const char *state) __attribute__ ((warn_unused_result)); void job_child_error_handler (Job *job, ProcessType process); int job_needs_cgroups (const Job *job) __attribute__ ((warn_unused_result)); #ifdef ENABLE_CGROUPS int job_last_process (const Job *job, ProcessType process) __attribute__ ((warn_unused_result)); #endif /* ENABLE_CGROUPS */ NIH_END_EXTERN #endif /* INIT_JOB_H */ upstart-1.13.2/init/init.supp0000664000175000017500000001030712373101356013044 00000000000000# This is a valgrind suppressions file. # As in libnih, we often use a heap-allocated list head to link all of # the allocated structures such as the event queue or job list. They # are allocated the first time that we need them with the static *_init # functions; valgrind complains because they are not freed before exit, # as there's little point doing so. { event-init Memcheck:Leak fun:malloc fun:nih_alloc fun:nih_list_new fun:event_init } { event-init Memcheck:Leak fun:malloc fun:nih_alloc_ref_new fun:nih_alloc fun:nih_list_new fun:event_init } { job-class-init Memcheck:Leak fun:malloc fun:nih_alloc fun:nih_hash_new fun:job_class_init } { job-class-init Memcheck:Leak fun:malloc fun:nih_alloc_ref_new fun:nih_alloc fun:nih_hash_new fun:job_class_init } { notify-init Memcheck:Leak fun:malloc fun:nih_alloc fun:nih_list_new fun:notify_init } { notify-init Memcheck:Leak fun:malloc fun:nih_alloc_ref_new fun:nih_alloc fun:nih_list_new fun:notify_init } { conf-init Memcheck:Leak fun:malloc fun:nih_alloc fun:nih_list_new fun:conf_init } { conf-init Memcheck:Leak fun:malloc fun:nih_alloc_ref_new fun:nih_alloc fun:nih_list_new fun:conf_init } { control-init Memcheck:Leak fun:malloc fun:nih_alloc fun:nih_list_new fun:control_init } { control-init Memcheck:Leak fun:malloc fun:nih_alloc_ref_new fun:nih_alloc fun:nih_list_new fun:control_init } # job_run_process will leak its args member to children, knowing full # well they will either exec() or exit() { job-process-run-args Memcheck:Leak fun:realloc fun:_test_realloc fun:nih_realloc fun:nih_str_array_addp fun:nih_str_array_addn fun:nih_str_split fun:job_process_run } # job_name uses a static string which it reuses each time { job-name-string Memcheck:Leak fun:malloc fun:realloc fun:_test_realloc fun:_test_malloc fun:nih_alloc fun:nih_strndup fun:nih_strdup fun:job_name } { job-name-string Memcheck:Leak fun:malloc fun:realloc fun:_test_realloc fun:_test_malloc fun:nih_alloc fun:nih_vsprintf fun:nih_sprintf fun:job_name } # when testing stop events, the stopping event will be emitted and # immediately processed since we're inside event_poll() - and then the # post-stop process will be run inside the finished handler for it, making # the child appear to leak it { job-emit-event-in-event-poll Memcheck:Leak fun:realloc fun:_test_realloc fun:nih_realloc fun:nih_str_array_addp fun:environ_add fun:job_emit_event fun:job_change_state fun:job_change_goal fun:event_pending_handle_jobs fun:event_pending fun:event_poll } # valgrind seems to lose track of this one, it's definitely freed and # just gets leaked when in a child { event-environ-in-event-poll Memcheck:Leak fun:realloc fun:nih_realloc fun:nih_str_array_addp fun:nih_str_array_add fun:test_pending_handle_jobs } # collected environment will appear to be leaked from the child's POV when # we run it inside event poll { event-operator-environment-in-event-poll Memcheck:Leak fun:realloc fun:_test_realloc fun:nih_realloc fun:nih_str_array_addp fun:environ_add fun:event_operator_environment fun:event_pending_handle_jobs fun:event_pending fun:event_poll } { event-operator-environment-in-event-poll Memcheck:Leak fun:malloc fun:realloc fun:_test_realloc fun:_test_malloc fun:nih_alloc fun:nih_strndup fun:nih_strdup fun:environ_add fun:event_operator_environment fun:event_pending_handle_jobs fun:event_pending fun:event_poll } { event-operator-environment-in-event-poll Memcheck:Leak fun:malloc fun:realloc fun:_test_realloc fun:_test_malloc fun:nih_alloc fun:nih_strndup fun:nih_strdup fun:environ_add fun:environ_append fun:event_operator_environment fun:event_pending_handle_jobs fun:event_pending fun:event_poll } # Surely this should be a default suppression? { glibc-setenv Memcheck:Leak fun:realloc obj:/lib/libc-*.so fun:setenv } { glibc-setenv Memcheck:Leak fun:realloc obj:/lib/tls/i686/cmov/libc-*.so fun:setenv } upstart-1.13.2/init/log.h0000664000175000017500000000547312373101356012132 00000000000000/* upstart * * Copyright © 2011 Canonical Ltd. * Authors: Scott James Remnant , * James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_LOG_H #define INIT_LOG_H #include #include #include #include #include #include #include #include "state.h" /** LOG_DEFAULT_UMASK: * * The default file creation mask for log files. **/ #define LOG_DEFAULT_UMASK (S_IXUSR | S_IXGRP | S_IRWXO) /** LOG_DEFAULT_MODE: * * File creation mode for log files. **/ #define LOG_DEFAULT_MODE (S_IRWXU | S_IRGRP) /** LOG_READ_SIZE: * * Minimum buffer size for reading log data. **/ #define LOG_READ_SIZE 1024 /** * Log: * * @fd: Write file descriptor associated with @path, * @path: Full path to log file, * @io: NihIo associated with jobs stdout and stderr, * @uid: User ID of caller, * @unflushed: Unflushed data, * @detached: TRUE if log is no longer associated with a parent (job), * @remote_closed: TRUE if remote end of pty has been closed, * @open_errno: value of errno immediately after last attempt to open @path. **/ typedef struct log { int fd; char *path; NihIo *io; uid_t uid; NihIoBuffer *unflushed; int detached; int remote_closed; int open_errno; } Log; NIH_BEGIN_EXTERN extern NihList *log_unflushed_files; Log *log_new (const void *parent, const char *path, int fd, uid_t uid) __attribute__ ((warn_unused_result)); void log_io_reader (Log *log, NihIo *io, const char *buf, size_t len); void log_io_error_handler (Log *log, NihIo *io); int log_destroy (Log *log) __attribute__ ((warn_unused_result)); int log_handle_unflushed (void *parent, Log *log) __attribute__ ((warn_unused_result)); int log_clear_unflushed (void) __attribute__ ((warn_unused_result)); void log_unflushed_init (void); json_object * log_serialise (Log *log) __attribute__ ((warn_unused_result)); Log * log_deserialise (const void *parent, json_object *json) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_LOG_H */ upstart-1.13.2/init/parse_job.h0000664000175000017500000000245612373101356013313 00000000000000/* upstart * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_PARSE_JOB_H #define INIT_PARSE_JOB_H #include #include #include "session.h" #include "job_class.h" NIH_BEGIN_EXTERN JobClass *parse_job (const void *parent, Session *session, JobClass *update, const char *name, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); EventOperator * parse_on_simple (JobClass *class, const char *stanza_name, const char *string) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_PARSE_JOB_H */ upstart-1.13.2/init/cgroup.c0000664000175000017500000007522712401640554012647 00000000000000/* upstart * * cgroup.c - cgroup support. * * Copyright © 2013-2014 Canonical Ltd. * Author: James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "environ.h" #include "errors.h" #include "state.h" #include "cgroup.h" #include extern int user_mode; /** * disable_cgroups: * * If TRUE, make the cgroup stanza a NOP. **/ int disable_cgroups = FALSE; /** * cgroup_manager_address: * * Address on which the cgroup manager may be reached. Set by 'initctl * notify-cgroup-manager-address' which should be called once the cgroup * manager is running. **/ char *cgroup_manager_address = NULL; /** * cgroup_manager: * * Proxy to the cgroup manager. * * Note: Only used by child processes. **/ NihDBusProxy *cgroup_manager = NULL; static void cgroup_manager_disconnected (DBusConnection *connection); static void cgroup_name_remap (char *str); /** * cgroup_support_enabled: * * Determine if cgroup support is currently enabled. * * Returns: TRUE if enabled, else FALSE. **/ int cgroup_support_enabled (void) { return ! disable_cgroups; } /** * cgroup_new: * @parent: parent of new CGroup object, * @controller: cgroup controller name. * * Allocates and returns a new CGroup object. * * If @parent is not NULL, it should be a pointer to another allocated * block which will be used as the parent for this block. When @parent * is freed, the returned block will be freed too. * * Returns: newly allocated CGroup or NULL if insufficient memory. **/ CGroup * cgroup_new (void *parent, const char *controller) { CGroup *cgroup; nih_assert (controller); cgroup = nih_new (parent, CGroup); if (! cgroup) return NULL; nih_list_init (&cgroup->entry); nih_alloc_set_destructor (cgroup, nih_list_destroy); cgroup->controller = nih_strdup (cgroup, controller); if (! cgroup->controller) goto error; nih_list_init (&cgroup->names); return cgroup; error: nih_free (cgroup); return NULL; } /** * cgroup_serialise: * @cgroup: CGroup to serialise. * * Convert @cgroup into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised CGroup object, or NULL on error. **/ json_object * cgroup_serialise (CGroup *cgroup) { json_object *json; json_object *json_names; nih_assert (cgroup); json = json_object_new_object (); if (! json) return NULL; if (! state_set_json_string_var_from_obj (json, cgroup, controller)) goto error; json_names = cgroup_name_serialise_all (&cgroup->names); if (! json_names) goto error; json_object_object_add (json, "names", json_names); return json; error: json_object_put (json); return NULL; } /** * cgroup_serialise_all: * * @cgroups: list of CGroup objects. * * Convert @cgroups to JSON representation. * * Returns: JSON object containing array of CGroup object in JSON form, * or NULL on error. **/ json_object * cgroup_serialise_all (NihList *cgroups) { json_object *json; json_object *json_cgroup; nih_assert (cgroups); json = json_object_new_array (); if (! json) return NULL; NIH_LIST_FOREACH (cgroups, iter) { CGroup *cgroup = (CGroup *)iter; json_cgroup = cgroup_serialise (cgroup); if (! json_cgroup) goto error; json_object_array_add (json, json_cgroup); } return json; error: json_object_put (json); return NULL; } /** * cgroup_deserialise: * @parent: parent of new CGroup object, * @json: JSON-serialised CGroup object to deserialise. * * Convert @json into a CGroup object. * * Returns: CGroup object, or NULL on error. **/ CGroup * cgroup_deserialise (void *parent, json_object *json) { nih_local char *controller = NULL; CGroup *cgroup; nih_assert (json); if (! state_check_json_type (json, object)) return NULL; if (! state_get_json_string_var (json, "controller", NULL, controller)) return NULL; cgroup = cgroup_new (parent, controller); if (! cgroup) return NULL; if (cgroup_name_deserialise_all (cgroup, &cgroup->names, json) < 0) goto error; return cgroup; error: nih_free (cgroup); return NULL; } /** * cgroup_deserialise_all: * * @parent: parent of new CGroup objects, * @list: list to add new CGroup objects to, * @json: root of JSON-serialised state. * * Convert JSON representation of CGroup objects back into * CGroup objects. * * Returns: 0 on success, -1 on error. **/ int cgroup_deserialise_all (void *parent, NihList *list, json_object *json) { json_object *json_cgroups; nih_assert (list); nih_assert (json); if (! json_object_object_get_ex (json, "cgroups", &json_cgroups)) goto error; for (int i = 0; i < json_object_array_length (json_cgroups); i++) { json_object *json_cgroup; CGroup *cgroup; json_cgroup = json_object_array_get_idx (json_cgroups, i); if (! json_cgroup) goto error; if (! state_check_json_type (json_cgroup, object)) goto error; cgroup = cgroup_deserialise (parent, json_cgroup); if (! cgroup) goto error; nih_list_add (list, &cgroup->entry); } return 0; error: return -1; } /** * cgroup_clear: * * @cgroups: list of CGroup objects, * * Remove all cgroups associated with this job. * * Should be called by the _last_ job process to avoid racing with the * cgroup manager which may remove an empty cgroup before the latest job * process (which needs the cgroup) has been spawned. * * Returns: TRUE on success, FALSE on raised error. **/ int cgroup_clear (NihList *cgroups) { nih_assert (cgroups); nih_assert (cgroup_manager); if (! cgroup_support_enabled ()) return TRUE; if (NIH_LIST_EMPTY (cgroups)) return TRUE; NIH_LIST_FOREACH (cgroups, iter) { CGroup *cgroup = (CGroup *)iter; NIH_LIST_FOREACH (&cgroup->names, iter2) { CGroupName *cgname = (CGroupName *)iter2; char *cgpath; int ret; cgpath = cgname->expanded ? cgname->expanded : cgname->name; /* Get the cgroup manager to delete the cgroup once no more job * processes remain in it. */ ret = cgmanager_remove_on_empty_sync (NULL, cgroup_manager, cgroup->controller, cgpath); if (ret < 0) return FALSE; } } return TRUE; } /** * cgroup_setup: * * @cgroups: list of CGroup objects, * @env: environment table, * @uid: user id that should own the created cgroup, * @gid: group id that should own the created cgroup. * * Use @env to expand all variables in the cgroup names specified * in @cgroups, create the resulting cgroup paths, placing the caller * into each group and applying requested cgroup settings. * * Returns: TRUE on success, FALSE on raised error. **/ int cgroup_setup (NihList *cgroups, char * const *env, uid_t uid, gid_t gid) { const char *upstart_job = NULL; const char *upstart_instance = NULL; nih_local char *suffix = NULL; nih_local char **cgroup_env = NULL; nih_local char *envvar = NULL; int instance = FALSE; uid_t current_uid; gid_t current_gid; /* Value of $UPSTART_CGROUP which takes the form: * * upstart/${UPSTART_JOB} * * Or for instance jobs: * * upstart/${UPSTART_JOB}-${UPSTART_INSTANCE} */ nih_local char *upstart_cgroup = NULL; nih_assert (cgroups); nih_assert (env); if (! cgroup_support_enabled ()) return TRUE; nih_assert (cgroup_manager_available ()); if (NIH_LIST_EMPTY (cgroups)) return TRUE; current_uid = geteuid (); current_gid = getegid (); cgroup_env = nih_str_array_new (NULL); if (! cgroup_env) nih_return_no_memory_error (FALSE); /* Copy the existing environment table */ if (! environ_append (&cgroup_env, NULL, NULL, TRUE, env)) nih_return_no_memory_error (FALSE); upstart_job = environ_get (cgroup_env, "UPSTART_JOB"); nih_assert (upstart_job); upstart_instance = environ_get (cgroup_env, "UPSTART_INSTANCE"); nih_assert (upstart_instance); if (*upstart_instance) instance = TRUE; /* Construct the value of $UPSTART_CGROUP */ suffix = nih_sprintf (NULL, "%s%s%s", upstart_job, instance ? "-" : "", instance ? upstart_instance : ""); if (! suffix) nih_return_no_memory_error (FALSE); /* Remap the standard prefix to avoid creating sub-cgroups erroneously */ cgroup_name_remap (suffix); upstart_cgroup = nih_sprintf (NULL, "upstart/%s", suffix); if (! upstart_cgroup) nih_return_no_memory_error (FALSE); envvar = NIH_MUST (nih_sprintf (NULL, "%s=%s", UPSTART_CGROUP_ENVVAR, upstart_cgroup)); if (! environ_add (&cgroup_env, NULL, NULL, TRUE, envvar)) nih_return_no_memory_error (FALSE); NIH_LIST_FOREACH (cgroups, iter) { CGroup *cgroup = (CGroup *)iter; NIH_LIST_FOREACH (&cgroup->names, iter2) { CGroupName *cgname = (CGroupName *)iter2; char *cgpath; char *p; /* TRUE if the path *starts with* '$UPSTART_CGROUP' */ int has_var = FALSE; size_t len; /* Note that we don't support "${UPSTART_CGROUP}" */ p = strstr (cgname->name, UPSTART_CGROUP_SHELL_ENVVAR); /* cgroup specifies UPSTART_CGROUP initially */ if (p && p == cgname->name) has_var = TRUE; cgname->expanded = environ_expand (cgname, cgname->name, cgroup_env); if (! cgname->expanded) return FALSE; len = strlen (cgname->expanded); /* Remap slash to underscore to avoid unexpected * sub-cgroup creation. */ cgroup_name_remap (has_var && len > strlen (UPSTART_CGROUP_SHELL_ENVVAR) ? cgname->expanded + strlen (UPSTART_CGROUP_SHELL_ENVVAR) : cgname->expanded); if (! strcmp (cgname->name, cgname->expanded)) { /* expanded value is the same as the * original, so don't bother storing the * former. */ nih_free (cgname->expanded); cgname->expanded = NULL; } cgpath = cgname->expanded ? cgname->expanded : cgname->name; if (! cgroup_create (cgroup->controller, cgpath)) return FALSE; if (! cgroup_settings_apply (cgroup->controller, cgpath, &cgname->settings)) return FALSE; if ((uid == current_uid) && (gid == current_gid)) { /* No need to chown */ continue; } if (! cgroup_chown (cgroup->controller, cgpath, uid, gid)) return FALSE; } } return TRUE; } /** * cgroup_name_new: * * @parent: parent of new CGroupName. * @controller: CGroup controller name, * @name: name of cgroup to create, * @key: cgroup setting name (optional), * @value: cgroup setting vlaue (optional if @key not specified). * * Allocates and returns a new CGroupName object. * * If @parent is not NULL, it should be a pointer to another allocated * block which will be used as the parent for this block. When @parent * is freed, the returned block will be freed too. * * Returns: newly allocated CGroupName or NULL if insufficient memory. **/ CGroupName * cgroup_name_new (void *parent, const char *name) { CGroupName *cgroup; nih_assert (name); cgroup = nih_new (parent, CGroupName); if (! cgroup) return NULL; nih_list_init (&cgroup->entry); nih_alloc_set_destructor (cgroup, nih_list_destroy); cgroup->name = nih_strdup (cgroup, name); if (! cgroup->name) goto error; cgroup->expanded = NULL; nih_list_init (&cgroup->settings); return cgroup; error: nih_free (cgroup); return NULL; } /** * cgroup_name_serialise: * @name: CGroupName to serialise. * * Convert @name into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised CGroupName object, or NULL on error. **/ json_object * cgroup_name_serialise (CGroupName *name) { json_object *json; json_object *json_settings; nih_assert (name); json = json_object_new_object (); if (! json) return NULL; if (! state_set_json_string_var_from_obj (json, name, name)) goto error; if (! state_set_json_string_var_from_obj (json, name, expanded)) goto error; json_settings = cgroup_setting_serialise_all (&name->settings); if (! json_settings) goto error; json_object_object_add (json, "settings", json_settings); return json; error: json_object_put (json); return NULL; } /** * cgroup_name_serialise_all: * * @names: list of CGroupName objects. * * Convert CGroupName objects to JSON representation. * * Returns: JSON object containing array of CGroupName objects in JSON * form, or NULL on error. **/ json_object * cgroup_name_serialise_all (NihList *names) { json_object *json; json_object *json_name; nih_assert (names); json = json_object_new_array (); if (! json) return NULL; NIH_LIST_FOREACH (names, iter) { CGroupName *cgname = (CGroupName *)iter; json_name = cgroup_name_serialise (cgname); if (! json_name) goto error; json_object_array_add (json, json_name); } return json; error: json_object_put (json); return NULL; } /** * cgroup_name_deserialise: * * @parent: parent of new CGroup object, * @json: JSON-serialised CGroup object to deserialise. * * Convert @json into a CGroup object. * * Returns: CGroup object, or NULL on error. **/ CGroupName * cgroup_name_deserialise (void *parent, json_object *json) { nih_local char *name = NULL; CGroupName *cgname; nih_assert (json); if (! state_check_json_type (json, object)) return NULL; if (! state_get_json_string_var (json, "name", NULL, name)) return NULL; cgname = cgroup_name_new (parent, name); if (! cgname) return NULL; if (! state_get_json_string_var_to_obj (json, cgname, expanded)) return NULL; if (cgroup_setting_deserialise_all (cgname, &cgname->settings, json) < 0) goto error; return cgname; error: nih_free (cgname); return NULL; } /** * cgroup_name_deserialise_all: * * @parent: parent of new CGroupSetting objects, * @list: list to store cgroup name details in, * @json: JSON-serialised CGroupName objects to deserialise. * * Convert @json back into CGroupName objects. * * Returns: 0 on success, -1 on error. **/ int cgroup_name_deserialise_all (void *parent, NihList *list, json_object *json) { json_object *json_names; nih_assert (json); if (! json_object_object_get_ex (json, "names", &json_names)) goto error; for (int i = 0; i < json_object_array_length (json_names); i++) { json_object *json_name; CGroupName *cgname; json_name = json_object_array_get_idx (json_names, i); if (! json_name) goto error; if (! state_check_json_type (json_name, object)) goto error; cgname = cgroup_name_deserialise (parent, json_name); if (! cgname) goto error; nih_list_add (list, &cgname->entry); } return 0; error: return -1; } /** * cgroup_setting_new: * * @parent: parent of new CGroupSetting, * @key: cgroup setting name, * @value: cgroup setting value (optional if @key not specified). * * Allocates and returns a new CGroupSetting object. * * If @parent is not NULL, it should be a pointer to another allocated * block which will be used as the parent for this block. When @parent * is freed, the returned block will be freed too. * * Returns: newly allocated CGroupSetting or NULL if insufficient memory. **/ CGroupSetting * cgroup_setting_new (void *parent, const char *key, const char *value) { CGroupSetting *setting; nih_assert (key); setting = nih_new (parent, CGroupSetting); if (! setting) return NULL; nih_list_init (&setting->entry); nih_alloc_set_destructor (setting, nih_list_destroy); setting->key = nih_strdup (setting, key); if (! setting->key) goto error; if (value) { setting->value = nih_strdup (setting, value); if (! setting->value) goto error; } else { setting->value = NULL; } return setting; error: nih_free (setting); return NULL; } /** * cgroup_setting_serialise: * @setting: CGroupSetting to serialise. * * Convert @setting into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised CGroupSetting object, or NULL on error. **/ json_object * cgroup_setting_serialise (const CGroupSetting *setting) { json_object *json; nih_assert (setting); json = json_object_new_object (); if (! json) return NULL; if (! state_set_json_string_var_from_obj (json, setting, key)) goto error; if (! state_set_json_string_var_from_obj (json, setting, value)) goto error; return json; error: json_object_put (json); return NULL; } /** * cgroup_setting_serialise_all: * * @names: list of CGroupSetting objects. * * Convert CGroupSetting objects to JSON representation. * * Returns: JSON object containing array of CGroupSetting objects in JSON * form, or NULL on error. **/ json_object * cgroup_setting_serialise_all (NihList *settings) { json_object *json; json_object *json_setting; nih_assert (settings); json = json_object_new_array (); if (! json) return NULL; NIH_LIST_FOREACH (settings, iter) { CGroupSetting *setting = (CGroupSetting *)iter; json_setting = cgroup_setting_serialise (setting); if (! json_setting) goto error; json_object_array_add (json, json_setting); } return json; error: json_object_put (json); return NULL; } /** * cgroup_setting_deserialise: * @parent: parent of new CGroupSetting object, * @json: JSON-serialised CGroupSetting object to deserialise. * * Convert @json into a CGroupSetting object. * * Returns: CGroupSetting object, or NULL on error. **/ CGroupSetting * cgroup_setting_deserialise (void *parent, json_object *json) { nih_local char *key = NULL; nih_local char *value = NULL; CGroupSetting *setting; nih_assert (json); if (! state_check_json_type (json, object)) return NULL; if (! state_get_json_string_var (json, "key", NULL, key)) return NULL; if (! state_get_json_string_var (json, "value", NULL, value)) return NULL; setting = cgroup_setting_new (parent, key, value); if (! setting) return NULL; return setting; } /** * cgroup_setting_deserialise_all: * * @parent: parent of new CGroupSetting objects, * @list: list to store cgroup settings details in, * @json: JSON-serialised CGroupSetting objects to deserialise. * * Convert @json back into CGroupSetting objects. * * Returns: 0 on success, -1 on error. **/ int cgroup_setting_deserialise_all (void *parent, NihList *list, json_object *json) { json_object *json_settings; nih_assert (json); if (! json_object_object_get_ex (json, "settings", &json_settings)) goto error; for (int i = 0; i < json_object_array_length (json_settings); i++) { json_object *json_setting; CGroupSetting *setting; json_setting = json_object_array_get_idx (json_settings, i); if (! json_setting) goto error; if (! state_check_json_type (json_setting, object)) goto error; setting = cgroup_setting_deserialise (parent, json_setting); if (! setting) goto error; nih_list_add (list, &setting->entry); } return 0; error: return -1; } /** * cgroup_manager_available: * * Determine if the cgroup manager is running. * * Returns: TRUE on success, else FALSE. **/ int cgroup_manager_available (void) { return !! cgroup_manager_address; } /** * cgroup_manager_serialise: * * Convert cgroup manager address into a JSON representation for * serialisation. Caller must free returned value using * json_object_put(). * * Returns: JSON string representing cmgroup_manager_address or NULL if * cmgroup_manager_address not set or on error. * * Note: If NULL is returned, check the value of cmgroup_manager_address * itself to determine if the error is real. **/ json_object * cgroup_manager_serialise (void) { /* A NULL return represents a JSON null */ return cgroup_manager_address ? json_object_new_string (cgroup_manager_address) : NULL; } /** * cgroup_manager_deserialise: * @json: JSON-serialised CGroup object to deserialise. * * Convert @json into a CGroup object. * * Returns: 0 on success, -1 on error. **/ int cgroup_manager_deserialise (json_object *json) { const char *address; nih_assert (json); /* address was never set */ if (state_check_json_type (json, null)) return 0; if (! state_check_json_type (json, string)) goto error; address = json_object_get_string (json); if (! address) goto error; cgroup_manager_address = nih_strdup (NULL, address); if (! cgroup_manager_address) goto error; return 0; error: return -1; } /** * cgroup_manager_set_address: * * @address: cgroup manager address. * * Save the address to contact the cgroup manager on. * * Returns: TRUE on success, else FALSE. **/ int cgroup_manager_set_address (const char *address) { nih_assert (address); cgroup_manager_address = nih_strdup (NULL, address); return cgroup_manager_address ? TRUE : FALSE; } /** * cgroup_manager_connect: * * Connect to the cgroup manager. * * Returns: zero on success, negative value on raised error. **/ int cgroup_manager_connect (void) { DBusConnection *connection; DBusError dbus_error; nih_assert (cgroup_manager_address); nih_assert (! cgroup_manager); dbus_error_init (&dbus_error); connection = nih_dbus_connect (cgroup_manager_address, cgroup_manager_disconnected); if (! connection) return -1; dbus_connection_set_exit_on_disconnect (connection, FALSE); dbus_error_free (&dbus_error); cgroup_manager = nih_dbus_proxy_new (NULL, connection, NULL, /* peer-to-peer connection */ DBUS_PATH_CGMANAGER, NULL, NULL); if (! cgroup_manager) { dbus_connection_unref (connection); return -1; } cgroup_manager->auto_start = FALSE; /* Drop initial reference now the proxy holds one */ dbus_connection_unref (connection); return 0; } /** * cgroup_manager_disconnected: * * This function is called when the connection to the cgroup manager * is dropped and our reference is about to be lost. **/ static void cgroup_manager_disconnected (DBusConnection *connection) { nih_assert (connection); nih_assert (cgroup_manager_address); cgroup_manager = NULL; nih_free (cgroup_manager_address); cgroup_manager_address = NULL; } /** * cgroup_create: * @controller: cgroup controller, * @path: relative cgroup path to create. * * Request the cgroup manager create a cgroup. * * The cgroup manager creates cgroups as: * * "/sys/fs/cgroup/$controller/$name". * * Upstart will take the value specified by the cgroup stanza, * prepend * A standard prefix is applied to the specified @path (which must be * relative) such that $cgroup_path_suffix path will in fact be: * * "upstart/$UPSTART_JOB-$UPSTART_INSTANCE/$requested_path". * * Note: No validation is done on @path: that is handled by the CGroup * manager. * * Returns: TRUE on success, FALSE on raised error. **/ int cgroup_create (const char *controller, const char *path) { int ret = 0; int existed = -1; pid_t pid; nih_assert (controller); nih_assert (path); nih_assert (cgroup_manager); if (! user_mode) { pid = getpid (); /* Escape our existing cgroup for this controller by moving to * the root cgroup to avoid creating groups below the current * cgroup. */ ret = cgmanager_move_pid_abs_sync (NULL, cgroup_manager, controller, UPSTART_CGROUP_ROOT, pid); if (ret < 0) return FALSE; } /* Ask the cgroup manager to create the cgroup */ ret = cgmanager_create_sync (NULL, cgroup_manager, controller, path, &existed); if (ret < 0) return FALSE; return TRUE; } /** * cgroup_enter: * * @controller: cgroup controller, * @path: cgroup path to enter, * @pid: pid to move. * * Put the specified pid into the specified controller cgroup. * * Returns: TRUE on success, FALSE on raised error. **/ int cgroup_enter (const char *controller, const char *path, pid_t pid) { int ret; nih_assert (controller); nih_assert (path); nih_assert (pid > 0); nih_assert (cgroup_manager); /* Move the pid into the appropriate cgroup */ ret = cgmanager_move_pid_sync (NULL, cgroup_manager, controller, path, pid); if (ret < 0) return FALSE; return TRUE; } /** * cgroup_name_remap: * * @str: string to modify. * * Replace all occurences of slash in the specified string with * underscore. Used to avoid to avoid erroneous sub-cgroup creation. **/ static void cgroup_name_remap (char *str) { nih_assert (str); for (char *p = str; p && *p; p++) if (*p == '/') *p = '_'; } /** * cgroup_add: * * @parent: parent of new Cgroup, * @cgroups: existing list to store cgroup details in, * @controller: name of cgroup controller, * @name: name of cgroup to create, * @key: cgroup setting name, * @value: value of @key. * * Add specified cgroup details to pre-existing @list. * * Note that all variables in @name must already have been expanded. * * Returns: TRUE on success, FALSE on error. **/ int cgroup_add (void *parent, NihList *cgroups, const char *controller, const char *name, const char *key, const char *value) { CGroup *cgroup = NULL; CGroupName *cgname = NULL; CGroupSetting *setting = NULL; int found_cgroup = FALSE; int found_cgroup_name = FALSE; int found_setting = FALSE; nih_assert (cgroups); nih_assert (controller); /* If no name is specified, use the default Upstart-created * path. */ if (! name) name = UPSTART_CGROUP_SHELL_ENVVAR; if (value) nih_assert (key); NIH_LIST_FOREACH_SAFE (cgroups, iter) { cgroup = (CGroup *)iter; if (! strcmp (cgroup->controller, controller)) { found_cgroup = TRUE; NIH_LIST_FOREACH_SAFE (&cgroup->names, iter2) { cgname = (CGroupName *)iter2; if (! strcmp (cgname->name, name)) { found_cgroup_name = TRUE; if (! key) continue; NIH_LIST_FOREACH_SAFE (&cgname->settings, iter3) { setting = (CGroupSetting *)iter3; if (! strcmp (setting->key, key)) { char *new_value = NULL; found_setting = TRUE; /* Don't bother comparing value - just replace */ if (setting->value) nih_free (setting->value); if (value) { new_value = nih_strdup (NULL, value); if (! new_value) return FALSE; setting->value = new_value; nih_ref (new_value, setting); } else { setting->value = NULL; } return TRUE; } } if (! found_setting) { setting = cgroup_setting_new (cgname, key, value); if (! setting) return FALSE; nih_list_add (&cgname->settings, &setting->entry); } } } if (! found_cgroup_name) { cgname = cgroup_name_new (cgroup, name); if (! cgname) return FALSE; nih_list_add (&cgroup->names, &cgname->entry); if (key) { setting = cgroup_setting_new (cgname, key, value); if (! setting) return FALSE; nih_list_add (&cgname->settings, &setting->entry); } return TRUE; } } } if (! found_cgroup) { cgroup = cgroup_new (parent, controller); if (! cgroup) return FALSE; nih_list_add (cgroups, &cgroup->entry); if (! found_cgroup_name) { cgname = cgroup_name_new (cgroup, name); if (! cgname) return FALSE; nih_list_add (&cgroup->names, &cgname->entry); if (key) { setting = cgroup_setting_new (cgname, key, value); if (! setting) return FALSE; nih_list_add (&cgname->settings, &setting->entry); } } } return TRUE; } /** * cgroup_settings_apply: * * @controller: controller, * @path: expanded path name, * @settings: List of CGroupSettings. * * Note that although @path has had all variables expanded, it is still * effectively a relative path since the cgroup manager handles * expanding it further. * * Returns: TRUE on success, FALSE on raised error. **/ int cgroup_settings_apply (const char *controller, const char *path, NihList *settings) { int ret; nih_assert (controller); nih_assert (path); nih_assert (settings); nih_assert (cgroup_manager); NIH_LIST_FOREACH (settings, iter) { nih_local char *setting_key = NULL; CGroupSetting *setting = (CGroupSetting *)iter; /* setting files in a cgroup directory take the form "controller.key" */ setting_key = nih_sprintf (NULL, "%s.%s", controller, setting->key); if (! setting_key) nih_return_no_memory_error (FALSE); ret = cgmanager_set_value_sync (NULL, cgroup_manager, controller, path, setting_key, setting->value ? setting->value : ""); if (ret < 0) return FALSE; } return TRUE; } /** * cgroup_enter_groups: * * @cgroups: list of CGroup objects. * * Move the current pid into the cgroups specified by @cgroups. * * Returns: TRUE on success, FALSE on raised error. **/ int cgroup_enter_groups (NihList *cgroups) { pid_t pid; nih_assert (cgroups); nih_assert (cgroup_manager_address); pid = getpid (); if (! cgroup_support_enabled ()) return TRUE; if (NIH_LIST_EMPTY (cgroups)) return TRUE; NIH_LIST_FOREACH (cgroups, iter) { CGroup *cgroup = (CGroup *)iter; NIH_LIST_FOREACH (&cgroup->names, iter2) { CGroupName *cgname = (CGroupName *)iter2; if (! cgroup_enter (cgroup->controller, cgname->expanded ? cgname->expanded : cgname->name, pid)) return FALSE; } } return TRUE; } /** * cgroup_chown: * * @controller: controller, * @path: expanded path name, * @uid: user id to change ownership to, * @gid: group id to change ownership to. * * Change the user and group ownership of @path below @controller. * * Returns: TRUE on success, FALSE on raised error. **/ int cgroup_chown (const char *controller, const char *path, uid_t uid, gid_t gid) { int ret = 0; nih_assert (controller); nih_assert (path); nih_assert (cgroup_manager); /* Ask cgmanager to chown the path */ ret = cgmanager_chown_sync (NULL, cgroup_manager, controller, path, uid, gid); if (ret < 0) return FALSE; return TRUE; } upstart-1.13.2/init/state.h0000664000175000017500000011671512373101356012473 00000000000000/* *-------------------------------------------------------------------- * XXX:XXX: * XXX:XXX: * XXX:XXX: * XXX:XXX: * XXX:XXX: * XXX:XXX: * * - XXX: Deferred work: * - handling of Upstart-in-initramfs - for this to work, it would be * necessary to serialise ConfSources (done) along with the following: * * (1) inode number of source->path * (2) inode number of '/' * (3) the FS device details (stat /|grep ^Device) * * (1)-(3) would allow the deserialisation logic to discriminate * between two job configuration files with the same name, but * different contents (one from the initramfs, one from the root * filesystem). * * XXX: Further, to support Upstart-in-initramfs would require * changes to the 'restart' logic since currently, no initial event * will be emitted when Upstart is re-exec'd. * * Since this isn't implemented, there is a restriction currently * (that can only be handled procedurally!) of not supporting * Upstart-in-initramfs or more precisely not supporting a job with * the same name in two different filesystem contexts. * * Note too that (2)+(3) are the only reliable method for Upstart to * detect that is *has* changed filesystem context. * * - parent/child timeout handling: we won't support down-grading initially. * * - dbus-connections: only be re-exec'ing post-boot so bridges won't * suffer too much. Bridges could be modified to auto-reconnect on * disconnect. * * XXX:XXX: * XXX:XXX: * XXX:XXX: * XXX:XXX: * XXX:XXX: * XXX:XXX: *-------------------------------------------------------------------- */ /* *-------------------------------------------------------------------- * = Design = * * == Serialisation == * * - Each object provides a _serialise() function which * converts a single object into a JSON-representation. * * - Each object provides a _serialise_all() function which * converts all objects from their appropriate list/hash/tree into a * JSON array representation. * * == Deserialisation == * * - Each object provides a _deserialise() function which * converts a single JSON-representation of an object back into an * internal object. * * - Each object provides a _deserialise_all() function which * converts all objects either back into a list/hash/tree (by * calling _new() as appropriate), or back into some object * type that can then be attached to another object (for example * process_deserialise_all() converts a JSON array of processes back * into an array of Process objects which are then hooked onto a * JobClass object). * * == Error Handling == * * If stateful re-exec fails, Upstart must perform a stateless reexec: * this obviously is not ideal since it results in all state being * discarded, but atleast init continues to run. * * === Serialisation === * * Upstart will serialise all internal objects in as rich a * serialisation format as possible. Note however, that the strategy is * to only serialise objects (and elements of objects) that *need* to be * deserialised. * * For example, if a JobClass has a 'start on' condition, it is * serialised, but if not, we simply do not encode a value (not even a * "null" one. * * Another example is the log_unflushed_files list. This is ignored * entirely since it would only need to be serialised if Upstart were * upgraded before the log disk became writeable. This is currently an * impossible situation, but if Upstart were to run in the initramfs, * we would need to serialise this data. * * The error handling strategy for serialisation is easy: if any of the * serialisation steps fail, error immediately. * * === Deserialisation === * * This is the more difficult aspect: deserialisation must contend * with possible partial errors and handle them intelligently: * * - missing keys and/or values in the JSON: * * - indicates either a bug or a change in the JSON serialisation data * format of the higher-numbered versioned of Upstart. * * - deserialise as 0 or NULL as appropriate if possible. * * - unexpected JSON entries: * * - ignored as this indicates a downgrade (and it's clearly * unreasonable to expect a lower-numbered version of Upstart to * understand the syntax from a higher-numbered version of Upstart). * * - invalid JSON entries: * * - only strategy is to error immediately. * * Note that the deserialisation process does NOT read and validate every * part of the JSON - it merely looks for, validates and consumes expected data. * This makes for a more flexible design that could accommondate downgrade * scenarios for example. * * Note that the ordering of handling internal objects is important: * * 1) Session objects * 2) Event objects * 3) Log objects * 4) JobClass objects * 5) Job objects * * Sessions are handled first since they do not reference any other * objects so are discrete. * * Log objects are handled next to ensure they are known before the * Jobs are handled. * * Event, JobClass and Job objects are more difficult since: * * a) Events can reference Jobs via event->blocked * (list of Blocked objects). * b) Jobs can reference Events via the job->blocker Event * and the job->blocking list. * c) JobClasses reference Jobs via class->instances hash * of Job instances. * d) Jobs reference JobClasses via job->class. * * Circular dependencies are broken by referencing index numbers rather * than actual objects in the JSON. This allows the objects to be * serialised into a JSON array after their index numbers have been * referenced. * * For example, if an event is blocking a job (that is to say * "a job is blocked on the event"), internal to Upstart... * * - event->blocking will contain a Blocked object pointing to the job. * - job->blocker will point to the event. * * However, in the JSON... * * - event->blocking will be represented as a "blocking" object (within * the "event" object) that references the job being blocked * indirectly by its parent class name and instance name. * - job->blocker will be represented as a "blocker" object (within * the "job" object) that references the event the job is blocked on * by event index number. * * See: * - state_serialise_blocked() * - state_deserialise_resolve_deps() * * == Macros == * * Some of the macros defind here may appear needlessly trivial. * However, their value lies in their ability to avoid having to * duplicate element names (where it would be easy to forget to * update some part of an expresion and end up corrupting/duplicating * data elements). Safety first! :) * * == Data Types == * * Care has to be taken to ensure no data loss in handling typedef'ed * values as they are nominally opaque and may have unusually large * representations on some systems. * * Although RFC 4627, the JSON "memo" (not a spec!) alludes to * JSON being a subset of ECMA-262, it does not specify the size of * integer types! However, ECMA-262 specifies them as 64-bit. * * JSON-C up to version 0.9 encoded all integers as a native 'int' * type (which may have been 32-bit or 64-bit) but with version 0.10 it * now provides a 32-bit and 64-bit integer interface (although all * integers are actually stored as 64-bit internally). * * As such, we have to check the size of all typedef'd types and * encode/decode them using either the 32-bit or 64-bit JSON-C integer * interfaces (note that technically it is only the decoding that can * cause data loss due to JSON-C storing all integer values as 64-bit * internally). * * An example of a problematic platform is Linux on AMD64 where: * * - sizeof(int) == 4 bytes * - sizeof(time_t) == 8 bytes * * For platforms such as this, using JSON-C 0.90 it would be necessary * to encode all opaque types whose size is greater than sizeof(int) * as strings to avoid data loss. However, this makes for ugly * and error-prone code. * * == Enum Handling == * * Handling enums is problematic since is we JSON-encode the enum _value_ * as an integer, and if the newer version of Upstart has either: * * (a) changed the _order_ of the enum entries, or * (b) removed the encoded value entirely... * * We cannot proceed with stateful re-exec as undefined behaviour would * result since not only would the deserialised enum value be incorrect, * but the two scenarios above cannot even be detected at runtime. * * The only safe solution is to encode all enum values as strings, * requiring two new functions per enum type: one to map an enum value * to a string and another to convert a string representation back into * an enum value. * * With this strategy, both scenarios above are handled: if either * function fails to find the provided value, the error scenario * can be handled (by reverting to stateless re-exec. Keeping the two * extra functions per enum updated to match changes in * the actual enum provides an extra maintenance burden but this problem * is vastly more preferable than having to deal with insiduous data * corruption caused by an incorrect program. The burden is minimized by * using the following two macros... * * state_get_json_enum_var () * state_set_json_enum_var () * * ... coupled with the typedefs EnumSerialiser and EnumDeserialiser * along with the two extra functions per enum. * * === Alternative Approach === * * An alternative approach would be to create a meta header in the JSON which * encodes a "version" number for each enum type. If the encoded version * number differs from the currently running enum version number, it * would be necessary to call a function to convert the old value to the * new enum value. Something like: * * _remap_ (int old_value); * * For example, * * JobGoal job_remap_jobgoal (int old_value); * * Note that old_value must be an 'int' since it may no longer be a * legitimate enum value. * * However, this strategy is more burdensome since any change to any * enum must also be coupled with a version bump and that is easy to * forget. With the approach adopted, this is never a problem since * forgetting to update one of the two functions per enum is guaranteed * to result in an error condition. Whereas, if the enum-specific version * number is not bumped, silent corruption could occur as no error * scenario could be detected. * * == Circular Dependencies == * * Events can refer to Jobs via event->blocking and Jobs can refer to * Events via job->blocker and job->blocking, hence a circular * dependency may exist. * * === Serialisation === * * Serialisation is handled "in a single pass" by iterating the events * list and encoding any blocking objects found, then iterating the * JobClasses instances list to encoding any blocking objects found for * each Job. A single pass works in this case since we're just encoding * the names of Jobs and Events. Some of these might not yet have been * encoded, but we know they _will_ eventually be encoded. * * === Deserialisation === * * Deserialisation is more difficult. The process is as follows: * * - Convert all JSON-encoded events back into real Events. * Note that event->blocking and event->blockers will _NOT_ be * set at this stage. * - Convert all JSON-encoded jobs back into real Jobs. * Note that job->blocker and job->blocking will _NOT_ be * set at this stage. * - Re-iterate over all Jobs and... * - set job->blocker if encoded in the JSON. * - create any job->blocking links to other jobs. * - create any job->blocking links to any events. * - create any job->blocking links to any D-Bus messages. * - Re-iterate over all Events and... * - create any event->blocking links to any jobs. * - create any event->blocking links to any D-Bus messages. * * == Ptrace handling == * * Fortuitously, it transpires that if a process is ptrace(2)-ing one * or more other processes and that parent "debugger" process _itself_ * execs, post-exec, it still continues to be a debugger. What this * means is that NO special handling needs to be performed for jobs * which are being ptraced prior to the re-exec. *-------------------------------------------------------------------- */ /* upstart * * Copyright © 2012 Canonical Ltd. * Author: James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_STATE_H #define INIT_STATE_H #include #include #include #include #include #include #include #include /** * STATE_WAIT_SECS: * * Time to wait in seconds for the re-exec state file descriptor to be * ready for reading/writing. If this timeout is reached, the new PID 1 * instance must either have got into trouble or not support stateful * re-exec. **/ #define STATE_WAIT_SECS 3 /** * STATE_WAIT_SECS_ENV: * * Name of environment variable that if set to an integer value will * take preference over STATE_WAIT_SECS. Special cases: * * If 0, do not wait. * If -1, wait forever. **/ #define STATE_WAIT_SECS_ENV "UPSTART_STATE_WAIT_SECS" /** * STATE_FILE: * * Name of file that is written below the job log directory if the * newly re-exec'ed init instance failed to understand the JSON sent to * it by the old instance (or if requested by STATE_FILE_ENV). * * This could happen for example if the old instance generated invalid * JSON, or JSON in an unexected format. **/ #define STATE_FILE "upstart.state" /** * state_get_timeout: * * @var: name of long integer var to set to timeout value. * * Set @var to timeout. */ #define state_get_timeout(var) \ { \ char *timeout_env_var; \ timeout_env_var = getenv (STATE_WAIT_SECS_ENV); \ \ var = timeout_env_var ? atol (timeout_env_var) : STATE_WAIT_SECS; \ } /** * state_enum_to_str: * * Helper macro for EnumSerialiser functions. **/ #define state_enum_to_str(enum_value, num) \ if (enum_value == num) \ return #enum_value /** * state_str_to_enum: * * Helper macro for EnumDeserialiser functions. **/ #define state_str_to_enum(enum_value, str) \ if (! strcmp (#enum_value, str)) \ return enum_value /** * state_check_json_type: * * @object: JSON object, * @type: type of JSON primitive (without prefix). * * Compare type of @object with @type. * * Note: This could be achieved entirely as a macro but for * the fact that JSON-C does not define a 64-bit integer type * (and yet allows integers to be handled either as 32-bit * or 64-bit). * * Returns: TRUE if type of @object is @type, else FALSE. **/ #define state_check_json_type(object, type) \ ((json_object_get_type (object) == state_get_json_type (#type)) || \ (state_get_json_type (#type) == json_type_string && \ json_object_is_type (object, json_type_null))) /** * state_new_json_int: * * @value: value to encode * * Encode @value as a JSON integer. * * Returns: json_object that encodes @value. */ #define state_new_json_int(value) \ (sizeof (value) > sizeof (int) \ ? json_object_new_int64 (value) \ : json_object_new_int (value)) /* * state_get_json_var_full: * * @json: json_object pointer, * @name: string name to search for in @json, * @json_type: type of JSON primitive (without prefix), * @json_var: name of json_object variable that will store value. * * Query @json, setting @json_var to be the JSON value of @name where * @json_var is of type @type. * * XXX: Although you may use this macro, it is unlikely you will need to * as there are more specific macros available. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_var_full(json, name, type, json_var) \ ((json_object_object_get_ex (json, name, &(json_var))) && \ state_check_json_type (json_var, type)) /** * _state_get_json_num_var: * * @json: json_object pointer, * @name: string name to search for in @json, * @type_json: type of @var (without prefix), * @var: variable of type @type to set to value encoded in @json. * * Specialisation of state_get_json_var_full() that works for JSON * types int, boolean, and double. * * Note that a distinct macro is required for non-string types since * unlike strings they can legitimately have the value of zero. * * Query @json, setting @var to value of @name. * * XXX: Do not call directly (to avoid hard-coding assumptions about * XXX: integer sizes) - use state_get_json_int* macros instead. * * Returns: TRUE on success, or FALSE on error. **/ #define _state_get_json_num_var(json, name, type_json, var) \ ({json_object *_json_var = NULL; \ int _ret = state_get_json_var_full (json, name, type_json, _json_var); \ errno = 0; \ if (_json_var) \ var = json_object_get_ ## type_json (_json_var); \ _json_var && _ret && errno != EINVAL;}) /** * state_get_json_int32_var: * * @json: json_object pointer, * @name: string name of 32-bit numeric element within * @json to be deserialised, * @var: variable to set to value encoded in @json. * * Query @json, setting @var to 32-bit integer value of @name. * * XXX: May be called directly, but preferable to call * XXX: state_get_json_int_var() to ensure portability. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_int32_var(json, name, var) \ (_state_get_json_num_var (json, name, int, var)) /** * state_get_json_int64_var: * * @json: json_object pointer, * @name: string name of 64-bit numeric element within * @json to be deserialised, * @var: variable to set to value encoded in @json. * * Query @json, setting @var to 64-bit integer value of @name. * * XXX: May be called directly, but preferable to call * XXX: state_get_json_int_var() to ensure portability. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_int64_var(json, name, var) \ (_state_get_json_num_var (json, name, int64, var)) /** * state_get_json_int_var: * * @json: json_object pointer, * @name: string name of numeric element within * @json to be deserialised, * @var: variable to set to value encoded in @json. * * Query @json, setting @var to integer value of @name. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_int_var(json, name, var) \ (sizeof (var) == (size_t)4 \ ? state_get_json_int32_var (json, name, var) \ : state_get_json_int64_var (json, name, var)) /** * _state_get_json_num_var_to_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be deserialised, * @name: name of numeric element within @object to be deserialised, * @type_json: type of @name in @json (without prefix). * * Extract stringified @name from @json and set numeric element named * @name in @object to its value. * * XXX: Do not call directly (to avoid hard-coding assumptions about * XXX: integer sizes) - use state_get_json_int* macros instead. * * Returns: TRUE on success, or FALSE on error. **/ #define _state_get_json_num_var_to_obj(json, object, name, type_json) \ (_state_get_json_num_var (json, #name, type_json, ((object)->name))) /** * state_get_json_int32_var_to_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be deserialised, * @name: name of 32-bit numeric element within @object to be deserialised. * * Extract stringified @name from @json and set 32-bit integer element * named @name in @object to its value. * * XXX: May be called directly, but preferable to call * XXX: state_get_json_int_var_to_obj() to ensure portability. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_int32_var_to_obj(json, object, name) \ (_state_get_json_num_var_to_obj (json, object, name, int)) /** * state_get_json_int64_var_to_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be deserialised, * @name: name of 64-bit numeric element within @object to be deserialised. * * Extract stringified @name from @json and set 64-bit integer element * named @name in @object to its value. * * XXX: May be called directly, but preferable to call * XXX: state_get_json_int_var_to_obj() to ensure portability. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_int64_var_to_obj(json, object, name) \ (_state_get_json_num_var_to_obj (json, object, name, int64)) /** * state_get_json_int_var_to_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be deserialised, * @name: name of numeric element within @object to be deserialised. * * Extract stringified @name from @json and set integer element named * @name in @object to its value. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_int_var_to_obj(json, object, name) \ (sizeof (object->name) == (size_t)4 \ ? state_get_json_int32_var_to_obj (json, object, name) \ : state_get_json_int64_var_to_obj (json, object, name)) /** * state_get_json_string_var: * * @json: json_object pointer, * @name: string name to search for in @json, * @parent: parent of @var, * @var: string variable to set to value of @name in @json. * * Specialisation of state_get_json_var_full() that works for * the JSON string type. * * Query @json, setting @var to be a newly allocated string copy of * value of @name (or NULL if value is JSON 'null'). * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_string_var(json, name, parent, var) \ ({int _ret; \ json_object *_json_var; \ _ret = state_get_json_var_full (json, name, string, _json_var); \ if (_ret) { \ if (json_object_is_type (_json_var, json_type_null)) { \ var = NULL; \ } else { \ const char *value = NULL; \ _ret = ((value = json_object_get_string (_json_var)) \ && (var = nih_strdup (parent, value))); \ } \ } \ _ret ;}) /** * state_get_json_string_var_strict: * * @json: json_object pointer, * @name: string name to search for in @json, * @parent: parent of @var, * @var: string variable to set to value of @name in @json. * * Specialisation of state_get_json_string_var() where @var value * must not be NULL. * * Query @json, setting @var to be a newly allocated string copy of * value of @name. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_string_var_strict(json, name, parent, var) \ (state_get_json_string_var (json, name, parent, var) && var != NULL) /** * state_get_json_string_var_to_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be deserialised, * @name: name of element within @object to be deserialised, * * Extract stringified @name from @json and set string element named * @name in @object to a newly allocated string copy or NULL if * JSON-encoded value was of type 'null'. * * @name will have a parent of @object. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_string_var_to_obj(json, object, name) \ state_get_json_string_var (json, #name, object, (object->name)) /** * state_get_json_string_var_to_obj_strict: * * @json: json_object pointer, * @object: pointer to internal object that is to be deserialised, * @name: name of element within @object to be deserialised, * * Specialisation of state_get_json_string_var_to_obj() where value * of @name must not be NULL. * * Extract stringified @name from @json and set string element named * @name in @object to a newly allocated string copy. * * @name will have a parent of @object. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_string_var_to_obj_strict(json, object, name) \ state_get_json_string_var_strict (json, #name, object, (object->name)) /** * _state_get_json_str_array_generic: * * @parent: parent object for new array (may be NULL), * @json: json_object pointer, * @array: array to hold output, * @len: length of @array, * @env: TRUE if @json represents an array of environment variables, * else FALSE, * @clean: TRUE to have the array assigned to NULL on error and if @len is zero, * else FALSE. * * Convenience wrapper around _state_deserialise_str_array(). * * Returns: TRUE on success, or FALSE on error. **/ #define _state_get_json_str_array_generic(parent, json, array, len, env, clean) \ ({int _ret = 0; \ _ret = _state_deserialise_str_array (parent, json, \ array, len, env); \ if (clean) { \ if (_ret < 0 || ! *len) \ *(array) = NULL; \ } \ _ret == 0;}) /** * state_deserialise_str_array: * * @parent: parent object for new array (may be NULL), * @json: JSON array object representing a string array, * @array: string array. * * Specialisation of state_deserialise_str_array(). * * Convert JSON array object @json into a string array. If the array is * empty, return NULL. * * Returns: TRUE on success, or FALSE on error. **/ #define state_deserialise_str_array(parent, json, array) \ ({size_t len; \ int _ret = 0; \ _ret = _state_get_json_str_array_generic (parent, json, \ array, &len, FALSE, TRUE); \ _ret;}) /** * state_deserialise_env_array: * * @parent: parent object for new array (may be NULL), * @json: JSON array object representing a string array, * @array: string array. * * Convert JSON array object @json into a string array. If the array is * empty, return NULL. * * Returns: TRUE on success, or FALSE on error. **/ #define state_deserialise_env_array(parent, json, array) \ ({size_t len; \ int _ret = 0; \ _ret = _state_get_json_str_array_generic (parent, json, \ array, &len, TRUE, TRUE); \ _ret;}) /** * _state_get_json_str_array_to_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be deserialised, * @name: name of element within @object to be deserialised, * @is_env: TRUE if @name is an environment array, * @len: length of array. * * Deserialise stringified @name from @json into an array of strings and * assign to @name within @object. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_str_array_to_obj(json, object, name) \ ({json_object *json_var = NULL; \ size_t len; \ int _ret = 0; \ int _ret2 = 0; \ _ret = state_get_json_var_full (json, #name, array, json_var); \ if (_ret) { \ _ret2 = _state_get_json_str_array_generic (object, \ json_var, &object->name, &len, FALSE, TRUE); \ if (_ret2 && ! len) \ object->name = NULL; \ } \ _ret && _ret2;}) /** * state_get_json_env_array_to_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be deserialised, * @name: name of element within @object to be deserialised, * * Deserialise stringified @name from @json into an array of environment * variable strings and assign to @name within @object. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_env_array_to_obj(json, object, name) \ ({json_object *json_var = NULL; \ size_t len; \ int _ret = 0; \ int _ret2 = 0; \ _ret = state_get_json_var_full (json, #name, array, json_var); \ if (_ret) { \ _ret2 = _state_get_json_str_array_generic (object, \ json_var, &object->name, &len, TRUE, TRUE); \ if (_ret2 && ! len) \ object->name = NULL; \ } \ _ret && _ret2;}) /** * state_get_json_enum_var: * * @json: json_object pointer, * @func: function to convert string value of enum to a real enum, * @name: name of enum value within @json to deserialise, * @var: name of enum variable to assign value extracted from JSON to. * * Extract the string value of an enum of type @name from JSON and * assign value to @var. * * @func must accept a stringified enum value name and return an integer * enum value. * * Returns: TRUE on success, or FALSE on error. **/ #define state_get_json_enum_var(json, func, name, var) \ ({int tmp = -1; \ nih_local char *_value = NULL; \ EnumDeserialiser f = (EnumDeserialiser)func; \ int _ret; \ _ret = state_get_json_string_var_strict (json, name, NULL, _value); \ if (_ret) { \ tmp = f (_value); \ if (tmp != -1) \ var = tmp; \ } _ret && tmp != -1; }) /** * state_set_json_enum_var: * * @json: json_object pointer, * @func: function to convert enum value into a string representation, * @name: name to associate with enum value in @json, * @value: enum value to add. * * Add enum with value @value to @json with string name @name. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_enum_var(json, func, name, value) \ ({const char *enum_value; \ EnumSerialiser f = (EnumSerialiser)func; \ enum_value = f (value); \ enum_value && \ state_set_json_string_var (json, name, enum_value);}) /** * state_set_json_var_full: * * @json: json_object pointer, * @name: string name to add as key in @json, * @value: value corresponding to @name, * @type_json: JSON type (without prefix) representing type of @value. * * Add @value to @json with name @name and type @type. * * XXX: Although you may use this macro, it is unlikely you will need to * as there are more specific macros available. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_var_full(json, name, value, type_json) \ ({json_object *_json_var; \ _json_var = json_object_new_ ## type_json (value); \ if (_json_var) json_object_object_add (json, name, _json_var); \ _json_var;}) /** * state_set_json_num_var_from_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be serialised, * @name: name of element within @object to be serialised, * @type_json: JSON type (without prefix) for field to be added, * @type: native type of object represented by @name. * * Add value of numeric entity @name in object @object to * @json with stringified @name. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_num_var_from_obj(json, object, name, type_json, type) \ ({json_object *_json_var = \ json_object_new_ ## type_json ((type)(object ? (object)->name : 0)); \ if (_json_var) json_object_object_add (json, #name, _json_var); \ _json_var;}) /** * state_set_json_int32_var_from_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be serialised, * @name: name of 32-bit integer element within @object to be serialised, * * Add value of 32-bit integer entity @name in object @object to * @json with stringified @name. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_int32_var_from_obj(json, object, name) \ (state_set_json_num_var_from_obj (json, object, name, int, int32_t)) /** * state_set_json_int64_var_from_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be serialised, * @name: name of 64-bit integer element within @object to be serialised, * * Add value of 64-bit integer entity @name in object @object to * @json with stringified @name. * * Note: The @type pased to state_set_json_num_var_from_obj() looks * wrong, but remember that there is only a single 'json_type_int' * value (which encompasses both 32-bit and 64-bit values). * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_int64_var_from_obj(json, object, name) \ (state_set_json_num_var_from_obj (json, object, name, int64, int64_t)) /** * state_set_json_int32_var: * * @json: json_object pointer, * @name: name to give @var in @json, * @var: 32-bit integer variable to be serialised. * * Add value of 32-bit integer entity @var to @json with name @name. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_int32_var(json, name, var) \ (state_set_json_var_full (json, name, var, int)) /** * state_set_json_int64_var: * * @json: json_object pointer, * @name: name to give @var in @json, * @var: 64-bit integer variable to be serialised. * * Add value of 64-bit integer entity @var to @json with name @name. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_int64_var(json, name, var) \ (state_set_json_var_full (json, name, var, int64)) /** * state_set_json_int_var: * * @json: json_object pointer, * @name: name to give @var in @json, * @var: integer variable to be serialised. * * Add value of integer entity @var to @json with name @name. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_int_var(json, name, var) \ (sizeof (var) == (size_t)4 \ ? state_set_json_int32_var (json, name, var) \ : state_set_json_int64_var (json, name, var)) /** * state_set_json_int_var_from_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be serialised, * @name: name of integer element within @object to be serialised, * * Add value of integer entity @name in object @object to * @json with stringified @name. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_int_var_from_obj(json, object, name) \ (sizeof (object->name) == (size_t)4 \ ? state_set_json_int32_var_from_obj (json, object, name) \ : state_set_json_int64_var_from_obj (json, object, name)) /** * state_set_json_string_var: * * @json: json_object pointer, * @name: string name of element to add to @json, * @value: value to assign @name in @json. * * Add @name to @json with value @value. If @value is NULL, it will be * encoded as a JSON null. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_string_var(json, name, value) \ ({json_object *_json_var = NULL; \ if (value != NULL) _json_var = json_object_new_string (value); \ if (_json_var || value == NULL) json_object_object_add (json, name, _json_var); \ value ? _json_var != NULL : TRUE;}) /** * state_set_json_string_var_from_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be serialised, * @name: name of element within @object to be serialised, * @type: JSON type (without prefix) for field to be added. * * Add @name (which will be stringified) to @json taking the value * from the @object element of name @name. * * String specialisation that can also handle NULL strings (by encoding * them with a nul string value). * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_string_var_from_obj(json, object, name) \ state_set_json_string_var (json, #name, (object->name)) /** * state_set_json_str_array_from_obj: * * @json: json_object pointer, * @object: pointer to internal object that is to be serialised, * @name: name of element within @object to be serialised. * * Copy string array @name from @object to @json. * * Returns: TRUE on success, or FALSE on error. **/ #define state_set_json_str_array_from_obj(json, object, name) \ ({json_object *_json_var; \ _json_var = object->name \ ? state_serialise_str_array (object->name) \ : json_object_new_array (); \ if (_json_var) json_object_object_add (json, #name, _json_var); \ _json_var;}) /** * state_serialise_int_array: * * @type: native type of elements within @array, * @array: array to serialise * @len: length of @array. * * Returns: JSON-serialised @array, or NULL on error. **/ #define state_serialise_int_array(type, array, len) \ (sizeof (type) == (size_t)4 \ ? state_serialise_int32_array ((int32_t *)array, len) \ : state_serialise_int64_array ((int64_t *)array, len)) /** * state_deserialise_int_array: * * @parent: parent object for new array, * @json: JSON array object representing an integer array, * @type: native type of elements within @array, * @array: array of integers, * @len: length of @array. * * Convert JSON array object @json into an array of integers whose size * is the same as the size of @type. * * Returns: 0 on success, -1 on ERROR. **/ #define state_deserialise_int_array(parent, json, type, array, len) \ (sizeof (type) == (size_t)4 \ ? state_deserialise_int32_array (parent, json, (int32_t **)array, len) \ : state_deserialise_int64_array (parent, json, (int64_t **)array, len)) NIH_BEGIN_EXTERN /** * EnumSerialiser: * * @value: enum value. * * Convert @value to a string value. * * Returns: string value of @value, or NULL if @value is unknown. **/ typedef const char *(*EnumSerialiser) (int value); /** * EnumDeserialiser: * * @name: string representation of an enum value. * * Convert @name to an enum value. * * Returns: enum value of @name, or -1 if @name is unknown. **/ typedef int (*EnumDeserialiser) (const char *name); int state_read (int fd) __attribute__ ((warn_unused_result)); int state_write (int fd, const char *state_data, size_t len) __attribute__ ((warn_unused_result)); int state_read_objects (int fd) __attribute__ ((warn_unused_result)); int state_write_objects (int fd, const char *state_data, size_t len) __attribute__ ((warn_unused_result)); int state_to_string (char **json_string, size_t *len) __attribute__ ((warn_unused_result)); int state_from_string (const char *state) __attribute__ ((warn_unused_result)); int state_modify_cloexec (int fd, int set); json_object * state_serialise_str_array (char ** const array) __attribute__ ((warn_unused_result)); json_object * state_serialise_int32_array (int32_t *array, int count) __attribute__ ((warn_unused_result)); json_object * state_serialise_int64_array (int64_t *array, int count) __attribute__ ((warn_unused_result)); int _state_deserialise_str_array (void *parent, json_object *json, char ***array, size_t *len, int env) __attribute__ ((warn_unused_result)); int state_deserialise_int32_array (void *parent, json_object *json, int32_t **array, size_t *len) __attribute__ ((warn_unused_result)); int state_deserialise_int64_array (void *parent, json_object *json, int64_t **array, size_t *len) __attribute__ ((warn_unused_result)); json_object * state_rlimit_serialise_all (struct rlimit * const *rlimits) __attribute__ ((warn_unused_result)); int state_rlimit_deserialise_all (json_object *json, const void *parent, struct rlimit *(*rlimits)[]) __attribute__ ((warn_unused_result)); char *state_collapse_env (const char **env) __attribute__ ((warn_unused_result)); enum json_type state_get_json_type (const char *short_type) __attribute__ ((warn_unused_result)); int state_deserialise_resolve_deps (json_object *json) __attribute__ ((warn_unused_result)); json_object * state_serialise_blocking (const NihList *blocking) __attribute__ ((warn_unused_result)); int state_deserialise_blocking (void *parent, NihList *list, json_object *json) __attribute__ ((warn_unused_result)); int state_fd_valid (int fd) __attribute__ ((warn_unused_result)); char * state_data_to_hex (void *parent, const void *data, size_t len) __attribute__ ((warn_unused_result)); int state_hex_to_data (void *parent, const void *hex_data, size_t hex_len, char **data, size_t *data_len) __attribute__ ((warn_unused_result)); json_object *state_rlimit_serialise (const struct rlimit *rlimit) __attribute__ ((warn_unused_result)); struct rlimit *state_rlimit_deserialise (json_object *json) __attribute__ ((warn_unused_result)); int state_get_version (void) __attribute__ ((warn_unused_result)); extern char **args_copy; extern int restart; void perform_reexec (void); void stateful_reexec (void); void clean_args (char ***argsp); NIH_END_EXTERN #endif /* INIT_STATE_H */ upstart-1.13.2/init/xdg.h0000664000175000017500000000345312373101356012127 00000000000000/* upstart * * Copyright © 2012 Canonical Ltd. * Author: Dmitrijs Ledkovs . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_XDG_H #define INIT_XDG_H #include "paths.h" #include /** * INIT_XDG_PATH_MODE: * * Absolute mode to create XDG-compliant directory elements with. **/ #define INIT_XDG_PATH_MODE 0700 NIH_BEGIN_EXTERN char * get_env_subdir (const char *envvar, const char *suffix, int create) __attribute__ ((warn_unused_result)); char * get_home_subdir (const char * suffix, int create) __attribute__ ((warn_unused_result)); char * xdg_get_config_home (void) __attribute__ ((warn_unused_result)); char * xdg_get_cache_home (void) __attribute__ ((warn_unused_result)); char * xdg_get_runtime_dir (void) __attribute__ ((warn_unused_result)); char ** xdg_get_config_dirs (void) __attribute__ ((warn_unused_result)); char ** get_user_upstart_dirs (void) __attribute__ ((warn_unused_result)); char * get_user_log_dir (void) __attribute__ ((warn_unused_result)); char * get_session_dir (void) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_XDG_H */ upstart-1.13.2/init/process.h0000664000175000017500000000606512373101356013025 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_PROCESS_H #define INIT_PROCESS_H #include #include /** * ProcessType: * * This is used to enumerate the array of process definitions attached to * a job class, and the array of pids attached to a job instance. * * Note that PROCESS_INVALID would ideally be -1 but that isn't possible * since process_type_str_to_enum() would then not be able to distinguish * between an invalid ProcessType and the default value assigned to a * ProcessType. It also cannot be zero since that would upset iterating * through the (non-invalid) entries. **/ typedef enum process_type { /* initial value denoting no process */ PROCESS_INVALID = -2, PROCESS_MAIN = 0, PROCESS_PRE_START, PROCESS_POST_START, PROCESS_PRE_STOP, PROCESS_POST_STOP, PROCESS_SECURITY, PROCESS_LAST, } ProcessType; /** * Process: * @script: whether a shell will be required, * @command: command or script to be run. * * This structure is used for process definitions in the job class, defining * processes that will be run by its instances. * * When @script is FALSE, @command is checked for shell characters; if there * are none, it is split on whitespace and executed directly using exec(). * If there are shell characters, or @script is TRUE, @command is executed * using a shell. **/ typedef struct process { int script; char *command; } Process; NIH_BEGIN_EXTERN Process * process_new (const void *parent) __attribute__ ((warn_unused_result)); const char *process_name (ProcessType process) __attribute__ ((const)); json_object *process_serialise (const Process *process) __attribute__ ((warn_unused_result)); Process *process_deserialise (json_object *json, const void *parent) __attribute__ ((warn_unused_result)); json_object * process_serialise_all (const Process * const * const processes) __attribute__ ((warn_unused_result)); ProcessType process_from_name (const char *process) __attribute__ ((warn_unused_result)); int process_deserialise_all (json_object *json, const void *parent, Process **processes) __attribute__ ((warn_unused_result)); const char * process_type_enum_to_str (ProcessType type) __attribute__ ((warn_unused_result)); ProcessType process_type_str_to_enum (const char *type) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_PROCESS_H */ upstart-1.13.2/init/xdg.c0000664000175000017500000001662012373101356012122 00000000000000/* upstart * * xdg.c - XDG compliant path constructor * * Copyright © 2012 Canonical Ltd. * Author: Dmitrijs Ledkovs * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "paths.h" #include "xdg.h" /** * get_subdir: * @dir: initial directory, * @suffix: sub-directory of @dir, * @create: flag to create sub-directory. * * Construct path by appending @suffix to @dir. If @create * flag is TRUE, also attempt to create that directory. * * Errors upon directory creation are ignored. * * Returns: Newly-allocated path, or NULL on error. **/ char * get_subdir (const char *dir, const char *suffix, int create) { char *newdir; nih_assert (dir != NULL); nih_assert (suffix != NULL); nih_assert (suffix[0]); if (dir[0] == '/') { newdir = nih_sprintf (NULL, "%s/%s", dir, suffix); if (! newdir) return NULL; if (create) mkdir (newdir, INIT_XDG_PATH_MODE); return newdir; } return NULL; } /** * get_home_subdir: * * @suffix: sub-directory name, * @create: flag to create sub-directory. * * Construct path to @suffix directory in user's HOME directory. * If @create is TRUE, also attempt to create that directory. * * Errors upon directory creation are ignored. * * Returns: Newly-allocated path, or NULL on error. **/ char * get_home_subdir (const char *suffix, int create) { char *env; env = getenv ("HOME"); if (! env) return NULL; return get_subdir (env, suffix, create); } /** * xdg_get_cache_home: * * Determine an XDG compliant XDG_CACHE_HOME * * Returns: newly-allocated path, or NULL on error. **/ char * xdg_get_cache_home (void) { char *dir; dir = getenv ("XDG_CACHE_HOME"); if (dir && dir[0] == '/') { mkdir (dir, INIT_XDG_PATH_MODE); dir = nih_strdup (NULL, dir); return dir; } /* Per XDG spec, we should only create dirs, if we are * attempting to write and the dir is not there. Here we * anticipate logging to happen really soon now, hence we * pre-create the cache dir. That does not protect us from * this directory disappering while upstart is running. =/ * hence this dir should be created each time we try to write * log... */ dir = get_home_subdir (".cache", TRUE); return dir; } /** * xdg_get_config_home: * * Determine an XDG compliant XDG_CONFIG_HOME * * Returns: newly-allocated path, or NULL on error. **/ char * xdg_get_config_home (void) { char *dir; dir = getenv ("XDG_CONFIG_HOME"); if (dir && dir[0] == '/') { mkdir (dir, INIT_XDG_PATH_MODE); dir = nih_strdup (NULL, dir); return dir; } /* Per XDG spec, we should only create dirs, if we are * attempting to write to the dir. But we only read config * dir. But we rather create it, to place inotify watch on * it. */ dir = get_home_subdir (".config", TRUE); return dir; } /** * xdg_get_runtime_dir: * * Determine an XDG compliant XDG_RUNTIME_DIR. * * Note: No attempt is made to create this directory since if it does * not exist, a non-priv user is unlikely be able to create it anyway. * * Returns: newly-allocated path, or NULL on error. **/ char * xdg_get_runtime_dir (void) { char *dir; dir = getenv ("XDG_RUNTIME_DIR"); if (dir && dir[0] == '/') dir = nih_strdup (NULL, dir); return dir; } /** * get_session_dir: * * Determine full path to XDG-compliant session directory used to store * session files. * * Returns: Newly-allocated path, or NULL on error. **/ char * get_session_dir (void) { nih_local char *runtime_dir = NULL; nih_local char *dir = NULL; char *session_dir; runtime_dir = xdg_get_runtime_dir (); if (runtime_dir && runtime_dir[0] == '/') { dir = get_subdir (runtime_dir, INIT_XDG_SUBDIR, TRUE); if (! dir) return NULL; session_dir = get_subdir (dir, INIT_XDG_SESSION_SUBDIR, TRUE); return session_dir; } return NULL; } /** * xdg_get_config_dirs: * * Determine a list of XDG compliant XDG_CONFIG_DIRS * * Returns: newly-allocated array of paths, or NULL on error. **/ char ** xdg_get_config_dirs (void) { char *env_path; char **dirs = NULL; env_path = getenv ("XDG_CONFIG_DIRS"); if (! env_path || ! env_path[0]) env_path = "/etc/xdg"; dirs = nih_str_split (NULL, env_path, ":", TRUE); return dirs; } /** * get_user_upstart_dirs: * * Construct an array of user session config source paths to config * dirs for a particular user. This array is sorted in highest * priority order and therefore can be iterated to add each of these * directories as config source dirs, when e.g. upstart is running as * user session init. * * Returns: newly-allocated array of paths, or NULL or error. **/ char ** get_user_upstart_dirs (void) { char *path = NULL; char **dirs = NULL; char **all_dirs = NULL; all_dirs = nih_str_array_new (NULL); if (! all_dirs) goto error; /* The current order is inline with Enhanced User Sessions Spec */ /* User's: ~/.config/upstart or XDG_CONFIG_HOME/upstart */ path = xdg_get_config_home (); if (! path) goto error; if (path && path[0]) { if (! nih_strcat_sprintf (&path, NULL, "/%s", INIT_XDG_SUBDIR)) goto error; mkdir (path, INIT_XDG_PATH_MODE); if (! nih_str_array_add (&all_dirs, NULL, NULL, path)) goto error; nih_free (path); path = NULL; } /* Legacy User's: ~/.init */ path = get_home_subdir (USERCONFDIR, FALSE); if (! path) goto error; if (path && path[0]) { if (! nih_str_array_add (&all_dirs, NULL, NULL, path)) goto error; nih_free (path); path = NULL; } /* Systems': XDG_CONFIG_DIRS/upstart */ dirs = xdg_get_config_dirs (); if (! dirs) goto error; for (char **p = dirs; p && *p; p++) { if (*p[0] != '/') continue; if (! nih_strcat_sprintf (p, NULL, "/%s", INIT_XDG_SUBDIR)) goto error; if (! nih_str_array_add (&all_dirs, NULL, NULL, *p)) goto error; } nih_free (dirs); dirs = NULL; /* System's read-only location */ if (! getenv ("UPSTART_NO_SYSTEM_USERCONFDIR")) { if (! nih_str_array_add (&all_dirs, NULL, NULL, SYSTEM_USERCONFDIR)) goto error; } return all_dirs; error: if (path) nih_free (path); if (dirs) nih_free (dirs); if (all_dirs) nih_free (all_dirs); return NULL; } /** * get_user_log_dir: * * Constructs an XDG compliant path to a cache directory in the user's * home directory. It can be used to store logs. * * Returns: newly-allocated array of paths, or NULL or error. **/ char * get_user_log_dir (void) { nih_local char *path = NULL; char *dir = NULL; path = xdg_get_cache_home (); if (path && path[0] == '/') { dir = nih_sprintf (NULL, "%s/%s", path, INIT_XDG_SUBDIR); if (! dir) return NULL; mkdir (dir, INIT_XDG_PATH_MODE); return dir; } return NULL; } upstart-1.13.2/init/event_operator.c0000664000175000017500000007370712373101356014405 00000000000000/* upstart * * event.c - event queue and handling * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include "environ.h" #include "event.h" #include "event_operator.h" #include "blocked.h" #include "errors.h" /** * event_operator_new: * @parent: parent object for new operator, * @type: type of operator, * @name: name of event to match, * @env: NULL-terminated array of environment variables to match. * * Allocates and returns a new EventOperator structure with the @type given, * if @type is EVENT_MATCH then the operator will be used to match an event * with the given @name and @arguments using event_match(). * * @env is optional, and may be NULL; if given it should be a NULL-terminated * array of environment variables in KEY=VALUE form. @env will be referenced * by the new event. After calling this function, you should never use * nih_free() to free @env and instead use nih_unref() or nih_discard() if * you no longer need to use it. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned operator. When all parents * of the returned operator are freed, the returned operator will also be * freed. * * Returns: newly allocated EventOperator structure, or NULL if * insufficient memory. **/ EventOperator * event_operator_new (const void *parent, EventOperatorType type, const char *name, char **env) { EventOperator *oper; nih_assert ((type == EVENT_MATCH) || (name == NULL)); nih_assert ((type == EVENT_MATCH) || (env == NULL)); nih_assert ((type != EVENT_MATCH) || (name != NULL)); oper = nih_new (parent, EventOperator); if (! oper) return NULL; nih_tree_init (&oper->node); oper->type = type; oper->value = FALSE; if (oper->type == EVENT_MATCH) { oper->name = nih_strdup (oper, name); if (! oper->name) { nih_free (oper); return NULL; } oper->env = env; if (oper->env) nih_ref (oper->env, oper); } else { oper->name = NULL; oper->env = NULL; } oper->event = NULL; nih_alloc_set_destructor (oper, event_operator_destroy); return oper; } /** * event_operator_copy: * @parent: parent object for new operator, * @old_oper: operator to copy. * * Allocates and returns a new EventOperator structure which is an identical * copy of @old_oper; including any matched state or events. * * If @old_oper is referencing an event, that status is also copied into the * newly returned operator; which will hold an additional block if * appropriate, on the event. * * If @old_oper has children, these will be copied as well, and will be * given their parent as their nih_alloc() parent. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned operator. When all parents * of the returned operator are freed, the returned operator will also be * freed. * * Returns: newly allocated EventOperator structure, or NULL if * insufficient memory. **/ EventOperator * event_operator_copy (const void *parent, const EventOperator *old_oper) { EventOperator *oper, *child; nih_assert (old_oper != NULL); oper = event_operator_new (parent, old_oper->type, old_oper->name, NULL); if (! oper) return NULL; oper->value = old_oper->value; if (old_oper->env) { oper->env = nih_str_array_copy (oper, NULL, old_oper->env); if (! oper->env) { nih_free (oper); return NULL; } } if (old_oper->event) { oper->event = old_oper->event; event_block (oper->event); } if (old_oper->node.left) { child = event_operator_copy ( oper, (EventOperator *)old_oper->node.left); if (! child) { nih_free (oper); return NULL; } nih_tree_add (&oper->node, &child->node, NIH_TREE_LEFT); } if (old_oper->node.right) { child = event_operator_copy ( oper, (EventOperator *)old_oper->node.right); if (! child) { nih_free (oper); return NULL; } nih_tree_add (&oper->node, &child->node, NIH_TREE_RIGHT); } return oper; } /** * event_operator_destroy: * @oper: operator to be destroyed. * * Unblocks and unreferences the event referenced by @oper and unlinks it * from the event tree. * * Normally used or called from an nih_alloc() destructor so that the list * item is automatically removed from its containing list when freed. * * Returns: zero. **/ int event_operator_destroy (EventOperator *oper) { nih_assert (oper != NULL); if (oper->event) event_unblock (oper->event); nih_tree_destroy (&oper->node); return 0; } /** * event_operator_update: * @oper: operator to update. * * Updates the value of @oper to reflect the value of its child nodes * when combined with the particular operation this represents. * * This may only be called if the type of @oper is EVENT_OR or EVENT_AND. **/ void event_operator_update (EventOperator *oper) { EventOperator *left, *right; nih_assert (oper != NULL); nih_assert (oper->node.left != NULL); nih_assert (oper->node.right != NULL); left = (EventOperator *)oper->node.left; right = (EventOperator *)oper->node.right; switch (oper->type) { case EVENT_OR: oper->value = (left->value || right->value); break; case EVENT_AND: oper->value = (left->value && right->value); break; default: nih_assert_not_reached (); } } /** * event_operator_match: * @oper: operator to match against. * @event: event to match, * @env: NULL-terminated array of environment variables for expansion. * * Compares @oper against @event to see whether they are identical in name, * and whether @event contains a superset of the environment variables * given in @oper. * * @env is optional, and may be NULL; if given it should be a NULL-terminated * array of environment variables in KEY=VALUE form. * * Matching of environment is done first by position until the first variable * in @oper with a name specified is found, and subsequently by name. Each * value is matched against the equivalent in @event as a glob, undergoing * expansion against @env first. * * This may only be called if the type of @oper is EVENT_MATCH. * * Returns: TRUE if the events match, FALSE otherwise. **/ int event_operator_match (EventOperator *oper, Event *event, char * const *env) { char * const *oenv; char * const *eenv; nih_assert (oper != NULL); nih_assert (oper->type == EVENT_MATCH); nih_assert (oper->node.left == NULL); nih_assert (oper->node.right == NULL); nih_assert (event != NULL); /* Names must match */ if (strcmp (oper->name, event->name)) return FALSE; /* Match operator environment variables against those from the event, * starting both from the beginning. */ for (oenv = oper->env, eenv = event->env; oenv && *oenv; oenv++, eenv++) { nih_local char *expoval = NULL; char *oval, *eval; int negate = FALSE; int ret; oval = strstr (*oenv, "!="); if (! oval) oval = strchr (*oenv, '='); if (oval) { /* Hunt through the event environment to find the * equivalent entry */ eenv = environ_lookup (event->env, *oenv, oval - *oenv); /* != means we negate the result (and skip the !) */ if (*oval == '!') { negate = TRUE; oval++; } /* Value to match against follows the equals. */ oval++; } else { /* Value to match against is the whole string. */ oval = *oenv; } /* Make sure we haven't gone off the end of the event * environment array; this catches both too many positional * matches and no such variable. */ if (! (eenv && *eenv)) return FALSE; /* Grab the value out by looking for the equals, we don't * care about the name if we're positional and we've already * matched it when not. */ eval = strchr (*eenv, '='); nih_assert (eval != NULL); eval++; /* Expand operator value against given environment before * matching; silently discard errors, since otherwise we'd * be excessively noisy on every event. */ while (! (expoval = environ_expand (NULL, oval, env))) { NihError *err; err = nih_error_get (); if (err->number != ENOMEM) { nih_free (err); return FALSE; } nih_free (err); } ret = fnmatch (expoval, eval, 0); if (negate ? (! ret) : ret) return FALSE; } return TRUE; } /** * event_operator_handle: * @root: operator tree to update, * @event: event to match against, * @env: NULL-terminated array of environment variables for expansion. * * Handles the emission of @event, matching it against EVENT_MATCH nodes in * the EventOperator tree rooted at @root, and updating the values of other * nodes to match. * * @env is optional, and may be NULL; if given it should be a NULL-terminated * array of environment variables in KEY=VALUE form and will be used to expand * EVENT_MATCH nodes before matching them, * * If @event is matched within this tree, it will be referenced and blocked * by the nodes that match it. The blockage and references can be cleared * using event_operator_reset(). * * Note that this returns to indicate whether a successful match was made; * you should also check the value of @root to make sure you react to this, * as that still may be FALSE. * * Returns: TRUE if @event matched an entry in the tree under @root, FALSE * otherwise. **/ int event_operator_handle (EventOperator *root, Event *event, char * const *env) { int ret = FALSE; nih_assert (root != NULL); nih_assert (event != NULL); /* A post-order traversal will give us the nodes in exactly the * order we want. We get a chance to update all of a node's children * before we update the node itself. Simply iterate the tree and * update the nodes. */ NIH_TREE_FOREACH_POST (&root->node, iter) { EventOperator *oper = (EventOperator *)iter; switch (oper->type) { case EVENT_OR: case EVENT_AND: event_operator_update (oper); break; case EVENT_MATCH: if ((! oper->value) && event_operator_match (oper, event, env)) { oper->value = TRUE; oper->event = event; event_block (oper->event); ret = TRUE; } break; default: nih_assert_not_reached (); } } return ret; } /** * event_operator_filter: * @data: not used, * @oper: EventOperator to check. * * Used when iterating the operator tree to filter out those operators and * their children for which the value is not TRUE. * * Returns: TRUE if operator should be ignored, FALSE otherwise. **/ static int event_operator_filter (void *data, EventOperator *oper) { nih_assert (oper != NULL); return oper->value != TRUE; } /** * event_operator_environment: * @root: operator tree to collect from, * @env: NULL-terminated array of environment variables to add to, * @parent: parent object for new array, * @len: length of @env, * @key: key of variable to contain event names. * * Collects environment from the portion of the EventOperator tree rooted at * @oper that are TRUE, ignoring the rest. * * Environment variables from each event (in tree order) will be added to * the NULL-terminated array at @env so that it contains the complete * environment of the operator. * * @len will be updated to contain the new array length and @env will * be updated to point to the new array pointer. * * Note that on failure, some of the entries may have been appended to * @env already. This is normally not a problem, since entries will be * replaced in @env if this is repeated. * * If @key is not NULL, a key of that name will be set in @env (which must * not be NULL) containing a space-separated list of event names. * * If the array pointed to by @env is NULL, the array will be allocated and * if @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned array. When all parents of the * returned array are freed, the returned array will also be freed. * * When the array pointed to by @env is not NULL, @parent is ignored; * though it usual to pass a parent of @env for style reasons. * * Returns: pointer to new array on success, NULL on insufficient memory. **/ char ** event_operator_environment (EventOperator *root, char ***env, const void *parent, size_t *len, const char *key) { nih_local char *evlist = NULL; nih_assert (root != NULL); nih_assert (env != NULL); nih_assert (len != NULL); /* Initialise the event list variable with the name given. */ if (key) { evlist = nih_sprintf (NULL, "%s=", key); if (! evlist) return NULL; } /* Always return an array, even if its zero length */ if (! *env) { *env = nih_str_array_new (parent); if (! *env) return NULL; } /* Iterate the operator tree, filtering out nodes with a non-TRUE * value and their children. The rationale for this is that this * then matches only the events that had an active role in starting * the job, not the ones that were also blocked, but the other half * of their logic wasn't present. */ NIH_TREE_FOREACH_FULL (&root->node, iter, (NihTreeFilter)event_operator_filter, NULL) { EventOperator *oper = (EventOperator *)iter; if (oper->type != EVENT_MATCH) continue; nih_assert (oper->event != NULL); /* Add environment from the event */ if (! environ_append (env, parent, len, TRUE, oper->event->env)) return NULL; /* Append the name of the event to the string we're building */ if (evlist) { if (evlist[strlen (evlist) - 1] != '=') { if (! nih_strcat_sprintf (&evlist, NULL, " %s", oper->event->name)) return NULL; } else { if (! nih_strcat (&evlist, NULL, oper->event->name)) return NULL; } } } /* Append the event list to the environment */ if (evlist) if (! environ_add (env, parent, len, TRUE, evlist)) return NULL; return *env; } /** * event_operator_fds: * @root: operator tree to update, * @parent: parent object for new array, * @fds: output location for array of ints * @num_fds: number of elements in @fds, * @env: NULL-terminated array of environment variables to add to, * @len: length of @env, * @key: key of variable to contain event names. * * Iterate over tree rooted at @root adding all file descriptor values found * to the dynamically allocated @fds array. In addition, all file * descriptors found are also added to @env will contain a new entry with key @key * whose value is a space-separated list of file descriptor numbers. * * Returns: 1 on success, NULL on failure. **/ int * event_operator_fds (EventOperator *root, const void *parent, int **fds, size_t *num_fds, char ***env, size_t *len, const char *key) { nih_local char *evlist = NULL; nih_assert (root != NULL); nih_assert (fds != NULL); nih_assert (num_fds != NULL); nih_assert (env != NULL); nih_assert (len != NULL); nih_assert (key != NULL); /* Initialise the event list variable with the name given. */ evlist = nih_sprintf (NULL, "%s=", key); if (! evlist) return NULL; *num_fds = 0; NIH_TREE_FOREACH_FULL (&root->node, iter, (NihTreeFilter)event_operator_filter, NULL) { EventOperator *oper = (EventOperator *)iter; if (oper->type != EVENT_MATCH) continue; nih_assert (oper->event != NULL); if (oper->event->fd >= 0) { *fds = nih_realloc (*fds, parent, sizeof (int) * (*num_fds + 1)); if (! *fds) return NULL; (*fds)[(*num_fds)++] = oper->event->fd; if (evlist[strlen (evlist) - 1] != '=') { if (! nih_strcat_sprintf (&evlist, NULL, " %d", oper->event->fd)) return NULL; } else { if (! nih_strcat_sprintf (&evlist, NULL, "%d", oper->event->fd)) return NULL; } } } if (*num_fds) if (! environ_add (env, parent, len, TRUE, evlist)) return NULL; return (void *)1; } /** * event_operator_events: * @root: operator tree to collect from, * @parent: parent object for blocked structures, * @list: list to add events to. * * Collects events from the portion of the EventOperator tree rooted at @root * that are TRUE, ignoring the rest. * * Each event is blocked and a Blocked structure will be appended to @list * for it. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned structures. When all parents * of a returned structure are freed, the returned structure will also be * freed. **/ void event_operator_events (EventOperator *root, const void *parent, NihList *list) { nih_assert (root != NULL); nih_assert (list != NULL); /* Iterate the operator tree, filtering out nodes with a non-TRUE * value and their children. The rationale for this is that this * then matches only the events that had an active role in starting * the job, not the ones that were also blocked, but the other half * of their logic wasn't present. */ NIH_TREE_FOREACH_FULL (&root->node, iter, (NihTreeFilter)event_operator_filter, NULL) { EventOperator *oper = (EventOperator *)iter; Blocked *blocked; if (oper->type != EVENT_MATCH) continue; nih_assert (oper->event != NULL); blocked = NIH_MUST (blocked_new (parent, BLOCKED_EVENT, oper->event)); nih_list_add (list, &blocked->entry); event_block (blocked->event); } } /** * event_operator_reset: * @root: operator tree to update. * * Resets the EventOperator tree rooted at @oper, unblocking and * unreferencing any events that were matched by the tree and changing * the values of other operators to match. **/ void event_operator_reset (EventOperator *root) { nih_assert (root != NULL); /* A post-order iteration means we visit children first, perfect! */ NIH_TREE_FOREACH_POST (&root->node, iter) { EventOperator *oper = (EventOperator *)iter; switch (oper->type) { case EVENT_OR: case EVENT_AND: event_operator_update (oper); break; case EVENT_MATCH: oper->value = FALSE; if (oper->event) { event_unblock (oper->event); oper->event = NULL; } break; default: nih_assert_not_reached (); } } } /** * event_operator_collapse: * * @condition: start on/stop on condition. * * Collapsed condition will be fully bracketed. Note that as such it may * not be lexicographically identical to the original expression that * resulted in @condition, but it will be logically identical. * * The condition is reconstructed from the EventOperator tree by using * a post-order traversal (since this allows the tree to be traversed * bottom-to-top). Leaf nodes (EVENT_MATCH) are ignored when visited, * allowing non-leaf nodes (EVENT_AND and EVENT_OR) to simply grab the * value of their children, construct a bracketed expression and add it * to a stack. If a child is a leaf node, the value can be read * directly. If a child is a non-leaf node, the value is obtained by * popping the stack before adding the new value back onto the stack. * When finally the root node is visited, the final expression can be * removed from the stack and returned. A single-node tree (comprising a * lone EVENT_MATCH at the root) is special-cased. * * Returns: newly-allocated flattened string representing @condition * on success, or NULL on error. **/ char * event_operator_collapse (EventOperator *condition) { nih_local NihList *stack = NULL; NihListEntry *latest = NULL; NihTree *root; nih_assert (condition); root = &condition->node; stack = NIH_MUST (nih_list_new (NULL)); NIH_TREE_FOREACH_POST (root, iter) { EventOperator *oper = (EventOperator *)iter; EventOperator *left; EventOperator *right; NihListEntry *expr; NihTree *tree; nih_local char *left_expr = NULL; nih_local char *right_expr = NULL; tree = &oper->node; left = (EventOperator *)tree->left; right = (EventOperator *)tree->right; if (oper->type == EVENT_MATCH) { /* Entire expression comprises a single event, * so push it and leave. */ if (tree == root) { nih_local char *env = NULL; if (oper->env) env = NIH_MUST (state_collapse_env ((const char **)oper->env)); expr = NIH_MUST (nih_list_entry_new (stack)); expr->str = NIH_MUST (nih_sprintf (expr, "%s%s%s", oper->name, env ? " " : "", env ? env : "")); nih_list_add_after (stack, &expr->entry); break; } else { /* We build the expression from visiting the logical * operators (and their children) only. */ continue; } } /* oper cannot now be a leaf node, so must have children */ nih_assert (left); nih_assert (right); expr = NIH_MUST (nih_list_entry_new (stack)); /* If a child is an EVENT_MATCH, expand its event * details and push onto the stack. * If a child is not an EVENT_MATCH, to obtains it * value, pop the stack. * * Having obtained the child values, construct a new * bracketed expression and push onto the stack. * * Note that we must consider the right child first. * This is because since the tree is traversed * left-child first, any value pushed onto the stack by * a right child is at the top so must be removed before * any left child value. Failure to do this results in * tree reflection which although logically equivalent * to the original could confuse as the resultant * expression will look rather different. */ if (right->type != EVENT_MATCH) { nih_assert (! NIH_LIST_EMPTY (stack)); latest = (NihListEntry *)nih_list_remove (stack->next); right_expr = NIH_MUST (nih_strdup (NULL, latest->str)); } else { nih_local char *env = NULL; if (right->env) env = NIH_MUST (state_collapse_env ((const char **)right->env)); right_expr = NIH_MUST (nih_sprintf (NULL, "%s%s%s", right->name, env ? " " : "", env ? env : "")); } if (left->type != EVENT_MATCH) { nih_assert (! NIH_LIST_EMPTY (stack)); latest = (NihListEntry *)nih_list_remove (stack->next); left_expr = NIH_MUST (nih_strdup (NULL, latest->str)); } else { nih_local char *env = NULL; if (left->env) env = NIH_MUST (state_collapse_env ((const char **)left->env)); left_expr = NIH_MUST (nih_sprintf (NULL, "%s%s%s", left->name, env ? " " : "", env ? env : "")); } expr->str = NIH_MUST (nih_sprintf (expr, "(%s %s %s)", left_expr, oper->type == EVENT_OR ? "or" : "and", right_expr)); nih_list_add_after (stack, &expr->entry); } nih_assert (! NIH_LIST_EMPTY (stack)); latest = (NihListEntry *)nih_list_remove (stack->next); nih_assert (NIH_LIST_EMPTY (stack)); return NIH_MUST (nih_strdup (NULL, latest->str)); } /** * event_operator_type_enum_to_str: * * @type: EventOperatorType. * * Convert EventOperatorType to a string representation. * * Returns: string representation of @type, or NULL if not known. **/ const char * event_operator_type_enum_to_str (EventOperatorType type) { state_enum_to_str (EVENT_OR, type); state_enum_to_str (EVENT_AND, type); state_enum_to_str (EVENT_MATCH, type); return NULL; } /** * event_operator_type_str_to_enum: * * @type: string EventOperatorType value. * * Convert @expect back into an enum value. * * Returns: EventOperatorType representing @type, or -1 if not known. **/ EventOperatorType event_operator_type_str_to_enum (const char *type) { nih_assert (type); state_str_to_enum (EVENT_OR, type); state_str_to_enum (EVENT_AND, type); state_str_to_enum (EVENT_MATCH, type); return -1; } /** * event_operator_serialise: * @oper: EventOperator to serialise. * * Convert @oper into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised EventOperator object, or NULL on error. **/ json_object * event_operator_serialise (const EventOperator *oper) { json_object *json; int event_index; nih_assert (oper); json = json_object_new_object (); if (! json) return NULL; if (! state_set_json_enum_var (json, event_operator_type_enum_to_str, "type", oper->type)) goto error; if (! state_set_json_int_var_from_obj (json, oper, value)) goto error; if (oper->name) { if (! state_set_json_string_var_from_obj (json, oper, name)) goto error; } if (oper->env) { if (! state_set_json_str_array_from_obj (json, oper, env)) goto error; } if (oper->event) { event_index = event_to_index (oper->event); if (event_index < 0) goto error; if (! state_set_json_int_var (json, "event", event_index)) goto error; } return json; error: json_object_put (json); return NULL; } /** * event_operator_serialise_all: * * @root: operator tree to serialise, * * Convert EventOperator tree to JSON representation. * * Returns: JSON object containing array of EventOperator nodes in post-order, * or NULL on error. */ json_object * event_operator_serialise_all (EventOperator *root) { json_object *json; json_object *json_node; nih_assert (root); json = json_object_new_array (); if (! json) return NULL; NIH_TREE_FOREACH_POST (&root->node, iter) { EventOperator *oper = (EventOperator *)iter; json_node = event_operator_serialise (oper); if (! json_node) goto error; if (json_object_array_add (json, json_node) < 0) goto error; } return json; error: json_object_put (json); return NULL; } /** * event_operator_deserialise: * @parent: parent, * @json: JSON-serialised EventOperator object to deserialise. * * Create EventOperator from provided JSON. * * Returns: EventOperator object, or NULL on error. **/ EventOperator * event_operator_deserialise (void *parent, json_object *json) { EventOperator *oper = NULL; EventOperatorType type = -1; nih_local char *name = NULL; nih_local char **env = NULL; nih_assert (json); if (! state_check_json_type (json, object)) goto error; if (json_object_object_get_ex (json, "name", NULL)) { if (! state_get_json_string_var_strict (json, "name", NULL, name)) goto error; } if (! state_get_json_enum_var (json, event_operator_type_str_to_enum, "type", type)) goto error; if (json_object_object_get_ex (json, "env", NULL)) { json_object *json_env; if (! state_get_json_var_full (json, "env", array, json_env)) goto error; /* XXX: note that we have to treat the environment array * as a plain string array (rather than an environ * array) at this point since the values are not * expanded (do not necessarily contain '='), and hence * would be discarded by the environ-handling routines. */ if (! state_deserialise_str_array (NULL, json_env, &env)) goto error; } oper = event_operator_new (parent, type, name, env); if (! oper) goto error; if (! state_get_json_int_var_to_obj (json, oper, value)) goto error; if (json_object_object_get_ex (json, "event", NULL)) { int event_index; if (! state_get_json_int_var (json, "event", event_index)) goto error; oper->event = event_from_index (event_index); if (! oper->event) goto error; } return oper; error: if (oper) nih_free (oper); return NULL; } /** * event_operator_deserialise_all: * * @parent: parent, * @json: root of JSON-serialised state. * * Convert EventOperator tree to JSON representation. * * Returns: EventOperator tree root node on success, or NULL on error. */ EventOperator * event_operator_deserialise_all (void *parent, json_object *json) { EventOperator *oper = NULL; EventOperator *left_oper = NULL; EventOperator *right_oper = NULL; nih_local NihList *stack = NULL; NihListEntry *item; nih_assert (json); stack = NIH_MUST (nih_list_new (NULL)); if (! state_check_json_type (json, array)) goto error; for (int i = 0; i < json_object_array_length (json); i++) { json_object *json_event_operator; nih_local NihList *left = NULL; nih_local NihList *right = NULL; json_event_operator = json_object_array_get_idx (json, i); if (! json_event_operator) goto error; if (! state_check_json_type (json_event_operator, object)) goto error; oper = event_operator_deserialise (parent, json_event_operator); if (! oper) goto error; item = nih_list_entry_new (stack); if (! item) goto error; switch (oper->type) { case EVENT_AND: case EVENT_OR: left = NIH_MUST (nih_list_new (NULL)); right = NIH_MUST (nih_list_new (NULL)); /* pop the top two stack elements */ nih_assert (! NIH_LIST_EMPTY (stack)); right = nih_list_add (right, stack->next); nih_assert (! NIH_LIST_EMPTY (stack)); left = nih_list_add (left, stack->next); left_oper = (EventOperator *)((NihListEntry *)left)->data; right_oper = (EventOperator *)((NihListEntry *)right)->data; nih_assert (left_oper); nih_assert (right_oper); /* Attach them as children of the new operator */ nih_tree_add (&oper->node, &left_oper->node, NIH_TREE_LEFT); nih_tree_add (&oper->node, &right_oper->node, NIH_TREE_RIGHT); /* FALL THROUGH: * * This will re-add the operator to the stack. */ case EVENT_MATCH: item->data = oper; nih_list_add_after (stack, &item->entry); break; default: nih_assert_not_reached (); } } nih_assert (! NIH_LIST_EMPTY (stack)); oper = ((NihListEntry *)stack->next)->data; nih_list_remove (stack->next); nih_assert (NIH_LIST_EMPTY (stack)); return oper; error: if (oper) nih_free (oper); return NULL; } upstart-1.13.2/init/job_class.c0000664000175000017500000020701612373101356013300 00000000000000/* upstart * * job_class.c - job class definition handling * * Copyright 2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "environ.h" #include "process.h" #include "session.h" #include "job_class.h" #include "job.h" #include "event_operator.h" #include "blocked.h" #include "conf.h" #include "control.h" #include "parse_job.h" #ifdef ENABLE_CGROUPS #include "cgroup.h" #endif /* ENABLE_CGROUPS */ #include "com.ubuntu.Upstart.h" #include "com.ubuntu.Upstart.Job.h" #include extern json_object *json_classes; extern int user_mode; extern int no_inherit_env; extern char **environ; /* Prototypes for static functions */ static void job_class_add (JobClass *class); static int job_class_remove (JobClass *class, const Session *session); /** * default_console: * * If a job does not specify a value for the 'console' stanza, use this value. * * Only used if value is >= 0; **/ int default_console = -1; /** * job_classes: * * This hash table holds the list of known job classes indexed by their name. * Each entry is a JobClass structure; multiple entries with the same name * are not permitted. **/ NihHash *job_classes = NULL; /** * job_environ: * * Array of environment variables that will be set in the jobs * environment. **/ static char **job_environ = NULL; /** * initial_umask: * * Value of umask at startup. **/ mode_t initial_umask; /** * job_class_init: * * Initialise the job classes hash table. **/ void job_class_init (void) { if (! job_classes) job_classes = NIH_MUST (nih_hash_string_new (NULL, 0)); } /** * job_class_environ_init: * * Initialise the job_environ array. **/ void job_class_environment_init (void) { char * const default_environ[] = { JOB_DEFAULT_ENVIRONMENT, NULL }; if (job_environ) return; job_environ = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (environ_append (&job_environ, NULL, 0, TRUE, default_environ)); if (user_mode && ! no_inherit_env) NIH_MUST(environ_append (&job_environ, NULL, 0, TRUE, environ)); } /** * job_class_environment_reset: * * Reset the environment back to defaults. * * Note: not applied to running job instances. **/ void job_class_environment_reset (void) { job_class_environment_clear (); job_class_environment_init (); } /** * job_class_environment_clear: * * Clear the environment table. **/ void job_class_environment_clear (void) { if (job_environ) { nih_free (job_environ); job_environ = NULL; } } /** * job_class_environment_set: * * @var: environment variable to set in form 'name[=value]', * @replace: TRUE if @name should be overwritten if already set, else * FALSE. * * Set specified variable in job environment. * * Returns: 0 on success, -1 on error. **/ int job_class_environment_set (const char *var, int replace) { nih_assert (var); nih_assert (job_environ); if (! environ_add (&job_environ, NULL, NULL, replace, var)) return -1; /* Update all running jobs */ NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; NIH_HASH_FOREACH (class->instances, job_iter) { Job *job = (Job *)job_iter; if (! environ_add (&job->env, job, NULL, replace, var)) return -1; } } return 0; } /** * job_class_environment_unset: * * @var: name of environment variable to unset. * * Remove specified variable from job environment array. * * Returns: 0 on success, -1 on error. **/ int job_class_environment_unset (const char *name) { nih_assert (name); nih_assert (job_environ); if (! environ_remove (&job_environ, NULL, NULL, name)) return -1; /* Update all running jobs */ NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; NIH_HASH_FOREACH (class->instances, job_iter) { Job *job = (Job *)job_iter; if ( ! environ_remove (&job->env, job, NULL, name)) return -1; } } return 0; } /** * job_class_environment_get_all: * * @parent: parent for new environment array. * * Obtain a copy of the entire environment a job will be provided with. * * Returns: Newly-allocated copy of the job environment array, * or NULL on error. **/ char ** job_class_environment_get_all (const void *parent) { nih_assert (job_environ); return nih_str_array_copy (parent, NULL, job_environ); } /** * job_class_environment_get: * * @name: name of variable to query. * * Determine value of variable @name in job environment. * * XXX: The returned value must not be freed. * * Returns: pointer to static storage value of @name, or NULL if @name * does not exist in job environment. **/ const char * job_class_environment_get (const char *name) { nih_assert (name); nih_assert (job_environ); return environ_get (job_environ, name); } /** * job_class_new: * * @parent: parent for new job class, * @name: name of new job class, * @session: session. * * Allocates and returns a new JobClass structure with the given @name * and @session. It will not be automatically added to the job classes * table, it is up to the caller to ensure this is done using * job_class_register() once the class has been set up. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned job class. When all parents * of the returned job class are freed, the returned job class will also be * freed. * * Returns: newly allocated JobClass structure or NULL if insufficient memory. **/ JobClass * job_class_new (const void *parent, const char *name, Session *session) { JobClass *class; int i; nih_assert (name != NULL); nih_assert (strlen (name) > 0); class = nih_new (parent, JobClass); if (! class) return NULL; nih_list_init (&class->entry); nih_alloc_set_destructor (class, nih_list_destroy); class->name = nih_strdup (class, name); if (! class->name) goto error; class->session = session; if (class->session && class->session->chroot) { class->path = nih_dbus_path (class, DBUS_PATH_UPSTART, "jobs", session->chroot, class->name, NULL); } else { class->path = nih_dbus_path (class, DBUS_PATH_UPSTART, "jobs", class->name, NULL); } if (! class->path) goto error; class->instance = nih_strdup (class, ""); if (! class->instance) goto error; class->instances = nih_hash_string_new (class, 0); if (! class->instances) goto error; class->description = NULL; class->author = NULL; class->version = NULL; class->env = NULL; class->export = NULL; class->start_on = NULL; class->stop_on = NULL; class->emits = NULL; class->process = nih_alloc (class, sizeof (Process *) * PROCESS_LAST); if (! class->process) goto error; for (i = 0; i < PROCESS_LAST; i++) class->process[i] = NULL; class->expect = EXPECT_NONE; class->task = FALSE; class->kill_timeout = JOB_DEFAULT_KILL_TIMEOUT; class->kill_signal = SIGTERM; class->reload_signal = SIGHUP; class->respawn = FALSE; class->respawn_limit = JOB_DEFAULT_RESPAWN_LIMIT; class->respawn_interval = JOB_DEFAULT_RESPAWN_INTERVAL; class->normalexit = NULL; class->normalexit_len = 0; class->console = default_console >= 0 ? default_console : CONSOLE_LOG; class->umask = (user_mode && ! no_inherit_env) ? initial_umask : JOB_DEFAULT_UMASK; class->nice = JOB_NICE_INVALID; class->oom_score_adj = JOB_DEFAULT_OOM_SCORE_ADJ; for (i = 0; i < RLIMIT_NLIMITS; i++) class->limits[i] = NULL; class->chroot = NULL; class->chdir = NULL; class->setuid = NULL; class->setgid = NULL; class->deleted = FALSE; class->debug = FALSE; class->usage = NULL; class->apparmor_switch = NULL; class->cgmanager_wait = FALSE; nih_list_init (&class->cgroups); return class; error: nih_free (class); return NULL; } /** * job_class_get_registered: * * @name: name of JobClass to search for, * @session: Session of @class. * * Determine the currently registered JobClass with name @name for * session @session. * * Returns: JobClass or NULL if no JobClass with name @name and * session @session is registered. **/ JobClass * job_class_get_registered (const char *name, const Session *session) { JobClass *registered = NULL; nih_assert (name); job_class_init (); /* If we found an entry, ensure we only consider the appropriate session */ do { registered = (JobClass *)nih_hash_search (job_classes, name, registered ? ®istered->entry : NULL); } while (registered && registered->session != session); return registered; } /** * job_class_consider: * @class: job class to consider. * * Considers adding @class to the job classes hash table as the best * available class, if there is no existing class with the name or the * existing class can be replaced. * * Returns: TRUE if @class is now the registered class, FALSE otherwise. **/ int job_class_consider (JobClass *class) { JobClass *registered = NULL; JobClass *best = NULL; nih_assert (class != NULL); job_class_init (); best = conf_select_job (class->name, class->session); nih_assert (best != NULL); nih_assert (best->session == class->session); registered = job_class_get_registered (class->name, class->session); if (registered != best) { if (registered) { job_class_event_block (NULL, registered, best); if (! job_class_remove (registered, class->session)) { /* Couldn't deregister, so undo */ if (best->start_on) event_operator_reset (best->start_on); return FALSE; } } job_class_add (best); } return (class == best ? TRUE : FALSE); } /** * job_class_reconsider: * @class: job class to reconsider. * * Reconsiders whether @class should be the best available class in the * job classes hash table, if it is the existing class and can be * replaced by a better then it will be. * * Note that the best class may be itself unless you have first removed * @class from any configuration sources before calling. * * Returns: FALSE if @class is still the hash table member, TRUE otherwise. **/ int job_class_reconsider (JobClass *class) { JobClass *registered = NULL; JobClass *best = NULL; nih_assert (class != NULL); job_class_init (); best = conf_select_job (class->name, class->session); registered = job_class_get_registered (class->name, class->session); if (registered == class) { if (class != best) { if (! job_class_remove (class, class->session)) return FALSE; job_class_add (best); return TRUE; } else { return FALSE; } } return TRUE; } /** * job_class_event_block: * * @parent: parent object for list, * @old: original JobClass currently registered in job_classes, * @new: new "best" JobClass that is not yet present in job_classes. * * Compare @old and @new start on EventOperator trees looking for * matching events that occur in both (_and_ which implicitly still exist * in the global events list). Events that satisfy these criteria will have * their reference count elevated to allow @new to replace @old in job_classes * without the destruction of @old freeing the events in question. * * Note that the reference count never needs to be decremented back * again since this function effectively passes "ownership" of the event * block from @old to @new, since @old will be replaced by @new but @new * should replicate the EventOperator state of @old. **/ void job_class_event_block (void *parent, JobClass *old, JobClass *new) { EventOperator *old_root; EventOperator *new_root; if (! old || ! new) return; old_root = old->start_on; new_root = new->start_on; /* If either @old or @new are NULL, or have no start_on * condition, there is no need to modify any events. */ if (! old_root || ! new_root) return; /* The old JobClass has associated instances meaning it * will not be possible for job_class_remove() to replace it, so * we don't need to manipulate any event reference counts. */ NIH_HASH_FOREACH (old->instances, iter) return; NIH_TREE_FOREACH_POST (&old_root->node, iter) { EventOperator *old_oper = (EventOperator *)iter; Event *event; if (old_oper->type != EVENT_MATCH) continue; /* Ignore nodes that are not blocking events */ if (! old_oper->event) continue; /* Since the JobClass is blocking an event, * that event must be valid. */ event = old_oper->event; NIH_TREE_FOREACH_POST (&new_root->node, niter) { EventOperator *new_oper = (EventOperator *)niter; if (new_oper->type != EVENT_MATCH) continue; /* ignore the return - we just want to ensure * that any events in @new that match those in * @old have identical nodes. */ (void)event_operator_handle (new_oper, event, NULL); } } } /** * job_class_add: * @class: new class to select. * * Adds @class to the hash table and registers it with all current D-Bus * connections. @class may be NULL. **/ static void job_class_add (JobClass *class) { control_init (); if (! class) return; nih_hash_add (job_classes, &class->entry); NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; job_class_register (class, conn, TRUE); } } /** * job_class_add_safe: * @class: new class to select. * * Adds @class to the hash table iff no existing entry of the * same name exists for the same session. **/ void job_class_add_safe (JobClass *class) { JobClass *registered = NULL; nih_assert (class); nih_assert (class->name); control_init (); registered = job_class_get_registered (class->name, class->session); nih_assert (! registered); job_class_add (class); } /** * job_class_remove: * @class: class to remove, * @session: Session of @class. * * Removes @class from the hash table and unregisters it from all current * D-Bus connections. * * Returns: TRUE if class could be unregistered, FALSE if there are * active instances that prevent unregistration, or if @session * does not match the session associated with @class. **/ static int job_class_remove (JobClass *class, const Session *session) { nih_assert (class != NULL); if (class->session != session) return FALSE; control_init (); /* Return if we have any active instances */ NIH_HASH_FOREACH (class->instances, iter) return FALSE; nih_list_remove (&class->entry); NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; job_class_unregister (class, conn); } return TRUE; } /** * job_class_register: * @class: class to register, * @conn: connection to register for * @signal: emit the JobAdded signal. * * Register the job @class with the D-Bus connection @conn, using the * path set when the class was created. Since multiple classes with the * same name may exist, this should only ever be called with the current * class of that name, and job_class_unregister() should be used before * registering a new one with the same name. **/ void job_class_register (JobClass *class, DBusConnection *conn, int signal) { nih_assert (class != NULL); nih_assert (conn != NULL); NIH_MUST (nih_dbus_object_new (class, conn, class->path, job_class_interfaces, class)); nih_debug ("Registered job %s", class->path); if (signal) NIH_ZERO (control_emit_job_added (conn, DBUS_PATH_UPSTART, class->path)); NIH_HASH_FOREACH (class->instances, iter) { Job *job = (Job *)iter; job_register (job, conn, signal); } } /** * job_class_unregister: * @class: class to unregistered, * @conn: connection to unregister from. * * Unregister the job @class from the D-Bus connection @conn, which must * have already been registered with job_class_register(). **/ void job_class_unregister (JobClass *class, DBusConnection *conn) { nih_assert (class != NULL); nih_assert (conn != NULL); NIH_HASH_FOREACH (class->instances, iter) nih_assert_not_reached (); NIH_MUST (dbus_connection_unregister_object_path (conn, class->path)); nih_debug ("Unregistered job %s", class->path); NIH_ZERO (control_emit_job_removed (conn, DBUS_PATH_UPSTART, class->path)); } /** * job_class_environment: * @parent: parent object for new table, * @class: job class, * @len: pointer to variable to store table length. * * Constructs an environment table containing the standard environment * variables and defined in the job's @class. * * This table is suitable for storing in @job's env member so that it is * used for all processes spawned by the job. * * If @len is not NULL it will be updated to contain the new array length. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned array. When all parents * of the returned array are freed, the returned array will also be * freed. * * Returns: new environment table or NULL if insufficient memory. **/ char ** job_class_environment (const void *parent, JobClass *class, size_t *len) { char **env; nih_assert (class != NULL); nih_assert (job_environ); env = nih_str_array_new (parent); if (! env) return NULL; if (len) *len = 0; /* Copy the set of environment variables, usually these just * pick up the values from init's own environment. */ if (! environ_append (&env, parent, len, TRUE, job_environ)) goto error; /* Copy the set of environment variables from the job configuration, * these often have values but also often don't and we want them to * override the builtins. */ if (! environ_append (&env, parent, len, TRUE, class->env)) goto error; return env; error: nih_free (env); return NULL; } /** * job_class_get_instance: * @class: job class to be query, * @message: D-Bus connection and message received, * @env: NULL-terminated array of environment variables, * @instance: pointer for instance name. * * Implements the GetInstance method of the com.ubuntu.Upstart.Job * interface. * * Called to obtain the path of an instance based on @env, which is used * to locate the instance in the same way that Start, Stop and Restart do. * * If no such instance is found, the com.ubuntu.Upstart.Error.UnknownInstance * D-Bus error will be returned immediately. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_instance (JobClass *class, NihDBusMessage *message, char * const *env, char **instance) { Job *job; nih_local char **instance_env = NULL; nih_local char *name = NULL; size_t len; nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (env != NULL); /* Verify that the environment is valid */ if (! environ_all_valid (env)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Env must be KEY=VALUE pairs")); return -1; } /* Construct the full environment for the instance based on the class * and that provided. */ instance_env = job_class_environment (NULL, class, &len); if (! instance_env) nih_return_system_error (-1); if (! environ_append (&instance_env, NULL, &len, TRUE, env)) nih_return_system_error (-1); /* Use the environment to expand the instance name and look it up * in the job. */ name = environ_expand (NULL, class->instance, instance_env); if (! name) { NihError *error; nih_local char *error_message = NULL; error = nih_error_get (); if (error->number != ENOMEM) { error = nih_error_steal (); error_message = nih_strdup (NULL, error->message); if (! error_message) nih_return_system_error (-1); if (class->usage) { if (! nih_strcat_sprintf (&error_message, NULL, "\n%s: %s", _("Usage"), class->usage)) { nih_return_system_error (-1); } } nih_dbus_error_raise (DBUS_ERROR_INVALID_ARGS, error_message); nih_free (error); } return -1; } job = (Job *)nih_hash_lookup (class->instances, name); if (! job) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.UnknownInstance", _("Unknown instance: %s"), name); return -1; } *instance = nih_strdup (message, job->path); if (! *instance) nih_return_system_error (-1); return 0; } /** * job_class_get_instance_by_name: * @class: class to obtain instance from, * @message: D-Bus connection and message received, * @name: name of instance to get, * @instance: pointer for object path reply. * * Implements the GetInstanceByName method of the com.ubuntu.Upstart.Job * interface. * * Called to obtain the path to a D-Bus object for the instance named * @name of this job which will be stored in @job. If no instance with * that name exists, the com.ubuntu.Upstart.Error.UnknownInstance D-Bus * error will be raised. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_instance_by_name (JobClass *class, NihDBusMessage *message, const char *name, char **instance) { Job *job; nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (name != NULL); nih_assert (instance != NULL); job = (Job *)nih_hash_lookup (class->instances, name); if (! job) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.UnknownInstance", _("Unknown instance: %s"), name); return -1; } *instance = nih_strdup (message, job->path); if (! *instance) nih_return_system_error (-1); return 0; } /** * job_class_get_all_instances: * @class: class to obtain instance from, * @message: D-Bus connection and message received, * @instances: pointer for array of object paths reply. * * Implements the GetAllInstances method of the com.ubuntu.Upstart.Job * interface. * * Called to obtain the paths of all instances for the given @class, which * will be stored in @instances. If no instances exist, @instances will * point to an empty array. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_all_instances (JobClass *class, NihDBusMessage *message, char ***instances) { char **list; size_t len; nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (instances != NULL); len = 0; list = nih_str_array_new (message); if (! list) nih_return_system_error (-1); NIH_HASH_FOREACH (class->instances, iter) { Job *job = (Job *)iter; if (! nih_str_array_add (&list, message, &len, job->path)) { nih_error_raise_system (); nih_free (list); return -1; } } *instances = list; return 0; } /** * job_class_start: * @class: job class to be started, * @message: D-Bus connection and message received, * @env: NULL-terminated array of environment variables, * @wait: whether to wait for command to finish before returning. * * Implements the top half of the Start method of the com.ubuntu.Upstart.Job * interface, the bottom half may be found in job_finished(). * * This is the primary method to start new instances of jobs. The given * @env will be used to locate an existing instance, or create a new one * if necessary; in either case, the instance will be set to be started * (or restarted if it is currently stopping) with @env as its new * environment. * * If the instance goal is already start, * the com.ubuntu.Upstart.Error.AlreadyStarted D-Bus error will be returned * immediately. If the instance fails to start, the * com.ubuntu.Upstart.Error.JobFailed D-Bus error will be returned when the * problem occurs. * * When @wait is TRUE the method call will not return until the job has * finished starting (running for tasks); when @wait is FALSE, the method * call returns once the command has been processed and the goal changed. * * Returns: zero on success, negative value on raised error. **/ int job_class_start (JobClass *class, NihDBusMessage *message, char * const *env, int wait) { Session *session; Blocked *blocked = NULL; Job *job; nih_local char **start_env = NULL; nih_local char *name = NULL; size_t len; nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (env != NULL); /* Don't permit out-of-session modification */ session = session_from_dbus (NULL, message); if (session != class->session) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job: %s"), class->name); return -1; } #ifdef ENABLE_CGROUPS /* Job has specified a cgroup stanza but since the cgroup * manager has not yet been contacted, the job cannot be started. */ if (job_class_cgroups (class) && ! cgroup_manager_available ()) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.CGroupManagerNotAvailable", _("Job cannot be started as cgroup manager not available: %s"), class->name); return -1; } #endif /* ENABLE_CGROUPS */ /* Verify that the environment is valid */ if (! environ_all_valid (env)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Env must be KEY=VALUE pairs")); return -1; } /* Construct the full environment for the instance based on the class * and that provided. */ start_env = job_class_environment (NULL, class, &len); if (! start_env) nih_return_system_error (-1); if (! environ_append (&start_env, NULL, &len, TRUE, env)) nih_return_system_error (-1); /* Use the environment to expand the instance name and look it up * in the job. */ name = environ_expand (NULL, class->instance, start_env); if (! name) { NihError *error; nih_local char *error_message = NULL; error = nih_error_get (); if (error->number != ENOMEM) { error = nih_error_steal (); error_message = nih_strdup (NULL, error->message); if (! error_message) nih_return_system_error (-1); if (class->usage) { if (! nih_strcat_sprintf (&error_message, NULL, "\n%s: %s", _("Usage"), class->usage)) { nih_return_system_error (-1); } } nih_dbus_error_raise (DBUS_ERROR_INVALID_ARGS, error_message); nih_free (error); } return -1; } job = (Job *)nih_hash_lookup (class->instances, name); /* If no instance exists with the expanded name, create a new * instance. */ if (! job) { job = job_new (class, name); if (! job) nih_return_system_error (-1); } if (job->goal == JOB_START) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.AlreadyStarted", _("Job is already running: %s"), job_name (job)); return -1; } if (wait) blocked = NIH_MUST (blocked_new (job, BLOCKED_JOB_START_METHOD, message)); if (job->start_env) nih_unref (job->start_env, job); job->start_env = start_env; nih_ref (job->start_env, job); job_finished (job, FALSE); if (blocked) nih_list_add (&job->blocking, &blocked->entry); job_change_goal (job, JOB_START); if (! wait) NIH_ZERO (job_class_start_reply (message, job->path)); return 0; } /** * job_class_stop: * @class: job class to be stopped, * @message: D-Bus connection and message received, * @env: NULL-terminated array of environment variables, * @wait: whether to wait for command to finish before returning. * * Implements the top half of the Stop method of the com.ubuntu.Upstart.Job * interface, the bottom half may be found in job_finished(). * * This is the primary method to stop instances of jobs. The given @env * will be used to locate an existing instance which will be set to be * stopped with @env as the environment passed to the pre-stop script. * * If no such instance is found, the com.ubuntu.Upstart.Error.UnknownInstance * D-Bus error will be returned immediately. If the instance goal is already * stop, the com.ubuntu.Upstart.Error.AlreadyStopped D-Bus error will be * returned immediately. If the instance fails to stop, the * com.ubuntu.Upstart.Error.JobFailed D-Bus error will be returned when the * problem occurs. * * When @wait is TRUE the method call will not return until the job has * finished stopping; when @wait is FALSE, the method call returns once * the command has been processed and the goal changed. * * Returns: zero on success, negative value on raised error. **/ int job_class_stop (JobClass *class, NihDBusMessage *message, char * const *env, int wait) { Session *session; Blocked *blocked = NULL; Job *job; nih_local char **stop_env = NULL; nih_local char *name = NULL; size_t len; nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (env != NULL); /* Don't permit out-of-session modification */ session = session_from_dbus (NULL, message); if (session != class->session) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job: %s"), class->name); return -1; } /* Verify that the environment is valid */ if (! environ_all_valid (env)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Env must be KEY=VALUE pairs")); return -1; } /* Construct the full environment for the instance based on the class * and that provided; while we don't pass this to the instance itself, * we need this to look up the instance in the first place. */ stop_env = job_class_environment (NULL, class, &len); if (! stop_env) nih_return_system_error (-1); if (! environ_append (&stop_env, NULL, &len, TRUE, env)) nih_return_system_error (-1); /* Use the environment to expand the instance name and look it up * in the job. */ name = environ_expand (NULL, class->instance, stop_env); if (! name) { NihError *error; error = nih_error_get (); if (error->number != ENOMEM) { error = nih_error_steal (); nih_dbus_error_raise (DBUS_ERROR_INVALID_ARGS, error->message); nih_free (error); } return -1; } job = (Job *)nih_hash_lookup (class->instances, name); if (! job) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.UnknownInstance", _("Unknown instance: %s"), name); return -1; } if (job->goal == JOB_STOP) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.AlreadyStopped", _("Job has already been stopped: %s"), job_name (job)); return -1; } if (wait) blocked = NIH_MUST (blocked_new (job, BLOCKED_JOB_STOP_METHOD, message)); if (job->stop_env) nih_unref (job->stop_env, job); job->stop_env = nih_str_array_copy (job, NULL, env); if (! job->stop_env) nih_return_system_error (-1); job_finished (job, FALSE); if (blocked) nih_list_add (&job->blocking, &blocked->entry); job_change_goal (job, JOB_STOP); if (! wait) NIH_ZERO (job_class_stop_reply (message)); return 0; } /** * job_restart: * @class: job class to be restarted, * @message: D-Bus connection and message received, * @env: NULL-terminated array of environment variables, * @wait: whether to wait for command to finish before returning. * * Implements the top half of the Restart method of the com.ubuntu.Upstart.Job * interface, the bottom half may be found in job_finished(). * * This is the primary method to restart existing instances of jobs; while * calling both "Stop" and "Start" may have the same effect, there is no * guarantee of atomicity. * * The given @env will be used to locate the existing instance, which will * be stopped and then restarted with @env as its new environment. * * If no such instance is found, the com.ubuntu.Upstart.Error.UnknownInstance * D-Bus error will be returned immediately. If the instance goal is already * stop, the com.ubuntu.Upstart.Error.AlreadyStopped D-Bus error will be * returned immediately. If the instance fails to restart, the * com.ubuntu.Upstart.Error.JobFailed D-Bus error will be returned when the * problem occurs. * * When @wait is TRUE the method call will not return until the job has * finished starting again (running for tasks); when @wait is FALSE, the * method call returns once the command has been processed and the goal * changed. * Returns: zero on success, negative value on raised error. **/ int job_class_restart (JobClass *class, NihDBusMessage *message, char * const *env, int wait) { Session *session; Blocked *blocked = NULL; Job *job; nih_local char **restart_env = NULL; nih_local char *name = NULL; size_t len; nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (env != NULL); /* Don't permit out-of-session modification */ session = session_from_dbus (NULL, message); if (session != class->session) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job: %s"), class->name); return -1; } /* Verify that the environment is valid */ if (! environ_all_valid (env)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Env must be KEY=VALUE pairs")); return -1; } /* Construct the full environment for the instance based on the class * and that provided. */ restart_env = job_class_environment (NULL, class, &len); if (! restart_env) nih_return_system_error (-1); if (! environ_append (&restart_env, NULL, &len, TRUE, env)) nih_return_system_error (-1); /* Use the environment to expand the instance name and look it up * in the job. */ name = environ_expand (NULL, class->instance, restart_env); if (! name) { NihError *error; error = nih_error_get (); if (error->number != ENOMEM) { error = nih_error_steal (); nih_dbus_error_raise (DBUS_ERROR_INVALID_ARGS, error->message); nih_free (error); } return -1; } job = (Job *)nih_hash_lookup (class->instances, name); if (! job) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.UnknownInstance", _("Unknown instance: %s"), name); return -1; } if (job->goal == JOB_STOP) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.AlreadyStopped", _("Job has already been stopped: %s"), job->name); return -1; } if (wait) blocked = NIH_MUST (blocked_new (job, BLOCKED_JOB_RESTART_METHOD, message)); if (job->start_env) nih_unref (job->start_env, job); job->start_env = restart_env; nih_ref (job->start_env, job); if (job->stop_env) nih_unref (job->stop_env, job); job->stop_env = NULL; job_finished (job, FALSE); if (blocked) nih_list_add (&job->blocking, &blocked->entry); job_change_goal (job, JOB_STOP); job_change_goal (job, JOB_START); if (! wait) NIH_ZERO (job_class_restart_reply (message, job->path)); return 0; } /** * job_class_get: * * @name: name of job class, * @session: session of job class. * * Obtain JobClass with name @name and session @session. * * Returns: JobClass, or NULL if no matching job class found. **/ JobClass * job_class_get (const char *name, Session *session) { JobClass *class = NULL; NihList *prev = NULL; nih_assert (name); job_class_init (); do { class = (JobClass *)nih_hash_search (job_classes, name, prev); if (! class) return NULL; if (class && class->session == session) return class; nih_assert (class); prev = (NihList *)class; } while (TRUE); nih_assert_not_reached (); } /** * job_class_get_name: * @class: class to obtain name from, * @message: D-Bus connection and message received, * @name: pointer for reply string. * * Implements the get method for the name property of the * com.ubuntu.Upstart.Job interface. * * Called to obtain the name of the given @class, which will be stored in * @name. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_name (JobClass *class, NihDBusMessage *message, char **name) { nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (name != NULL); *name = class->name; nih_ref (*name, message); return 0; } /** * job_class_get_description: * @class: class to obtain name from, * @message: D-Bus connection and message received, * @description: pointer for reply string. * * Implements the get method for the description property of the * com.ubuntu.Upstart.Job interface. * * Called to obtain the description of the given @class, which will be stored * in @description. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_description (JobClass *class, NihDBusMessage *message, char **description) { nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (description != NULL); if (class->description) { *description = class->description; nih_ref (*description, message); } else { *description = nih_strdup (message, ""); if (! *description) nih_return_no_memory_error (-1); } return 0; } /** * job_class_get_author: * @class: class to obtain name from, * @message: D-Bus connection and message received, * @author: pointer for reply string. * * Implements the get method for the author property of the * com.ubuntu.Upstart.Job interface. * * Called to obtain the author of the given @class, which will be stored * in @author. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_author (JobClass *class, NihDBusMessage *message, char **author) { nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (author != NULL); if (class->author) { *author = class->author; nih_ref (*author, message); } else { *author = nih_strdup (message, ""); if (! *author) nih_return_no_memory_error (-1); } return 0; } /** * job_class_get_version: * @class: class to obtain name from, * @message: D-Bus connection and message received, * @version: pointer for reply string. * * Implements the get method for the version property of the * com.ubuntu.Upstart.Job interface. * * Called to obtain the version of the given @class, which will be stored * in @version. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_version (JobClass *class, NihDBusMessage *message, char **version) { nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (version != NULL); if (class->version) { *version = class->version; nih_ref (*version, message); } else { *version = nih_strdup (message, ""); if (! *version) nih_return_no_memory_error (-1); } return 0; } /** * job_class_get_start_on: * @class: class to obtain events from, * @message: D-Bus connection and message received, * @start_on: pointer for reply array. * * Implements the get method for the start_on property of the * com.ubuntu.Upstart.Job interface. * * Called to obtain the set of events that will start jobs of the given * @class, this is returned as an array of the event tree flattened into * reverse polish form. * * Each array element is an array of strings representing the events, * or a single element containing "/OR" or "/AND" to represent the * operators. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_start_on (JobClass * class, NihDBusMessage *message, char **** start_on) { size_t len = 0; nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (start_on != NULL); *start_on = nih_alloc (message, sizeof (char ***)); if (! *start_on) nih_return_no_memory_error (-1); len = 0; (*start_on)[len] = NULL; if (class->start_on) { NIH_TREE_FOREACH_POST (&class->start_on->node, iter) { EventOperator *oper = (EventOperator *)iter; *start_on = nih_realloc (*start_on, message, sizeof (char ***) * (len + 2)); if (! *start_on) nih_return_no_memory_error (-1); (*start_on)[len] = nih_str_array_new (*start_on); if (! (*start_on)[len]) nih_return_no_memory_error (-1); switch (oper->type) { case EVENT_OR: if (! nih_str_array_add (&(*start_on)[len], *start_on, NULL, "/OR")) nih_return_no_memory_error (-1); break; case EVENT_AND: if (! nih_str_array_add (&(*start_on)[len], *start_on, NULL, "/AND")) nih_return_no_memory_error (-1); break; case EVENT_MATCH: if (! nih_str_array_add (&(*start_on)[len], *start_on, NULL, oper->name)) nih_return_no_memory_error (-1); if (oper->env) if (! nih_str_array_append (&(*start_on)[len], *start_on, NULL, oper->env)) nih_return_no_memory_error (-1); break; } (*start_on)[++len] = NULL; } } return 0; } /** * job_class_get_stop_on: * @class: class to obtain events from, * @message: D-Bus connection and message received, * @stop_on: pointer for reply array. * * Implements the get method for the stop_on property of the * com.ubuntu.Upstart.Job interface. * * Called to obtain the set of events that will stop jobs of the given * @class, this is returned as an array of the event tree flattened into * reverse polish form. * * Each array element is an array of strings representing the events, * or a single element containing "/OR" or "/AND" to represent the * operators. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_stop_on (JobClass * class, NihDBusMessage *message, char **** stop_on) { size_t len = 0; nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (stop_on != NULL); *stop_on = nih_alloc (message, sizeof (char ***)); if (! *stop_on) nih_return_no_memory_error (-1); len = 0; (*stop_on)[len] = NULL; if (class->stop_on) { NIH_TREE_FOREACH_POST (&class->stop_on->node, iter) { EventOperator *oper = (EventOperator *)iter; *stop_on = nih_realloc (*stop_on, message, sizeof (char ***) * (len + 2)); if (! *stop_on) nih_return_no_memory_error (-1); (*stop_on)[len] = nih_str_array_new (*stop_on); if (! (*stop_on)[len]) nih_return_no_memory_error (-1); switch (oper->type) { case EVENT_OR: if (! nih_str_array_add (&(*stop_on)[len], *stop_on, NULL, "/OR")) nih_return_no_memory_error (-1); break; case EVENT_AND: if (! nih_str_array_add (&(*stop_on)[len], *stop_on, NULL, "/AND")) nih_return_no_memory_error (-1); break; case EVENT_MATCH: if (! nih_str_array_add (&(*stop_on)[len], *stop_on, NULL, oper->name)) nih_return_no_memory_error (-1); if (oper->env) if (! nih_str_array_append (&(*stop_on)[len], *stop_on, NULL, oper->env)) nih_return_no_memory_error (-1); break; } (*stop_on)[++len] = NULL; } } return 0; } /** * job_class_get_emits: * @class: class to obtain events from, * @message: D-Bus connection and message received, * @emits: pointer for reply array. * * Implements the get method for the emits property of the * com.ubuntu.Upstart.Job interface. * * Called to obtain the list of additional events of the given @class * which will be stored as an array in @emits. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_emits (JobClass * class, NihDBusMessage *message, char *** emits) { nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (emits != NULL); if (class->emits) { *emits = nih_str_array_copy (message, NULL, class->emits); if (! *emits) nih_return_no_memory_error (-1); } else { *emits = nih_str_array_new (message); if (! *emits) nih_return_no_memory_error (-1); } return 0; } /** * job_class_console_type: * @console: string representing console type. * * Returns: ConsoleType equivalent of @string, or -1 on invalid @console. **/ ConsoleType job_class_console_type (const char *console) { if (! strcmp (console, "none")) { return CONSOLE_NONE; } else if (! strcmp (console, "output")) { return CONSOLE_OUTPUT; } else if (! strcmp (console, "owner")) { return CONSOLE_OWNER; } else if (! strcmp (console, "log")) { return CONSOLE_LOG; } return (ConsoleType)-1; } /** * job_class_get_usage: * @class: class to obtain usage from, * @message: D-Bus connection and message received, * @usage: pointer for reply string. * * Implements the get method for the usage property of the * com.ubuntu.Upstart.Job interface. * * Called to obtain the usage of the given @class * which will be stored as an string in @usage. * * Returns: zero on success, negative value on raised error. **/ int job_class_get_usage (JobClass * class, NihDBusMessage *message, char ** usage) { nih_assert (class != NULL); nih_assert (message != NULL); nih_assert (usage != NULL); if (class->usage) { *usage = nih_strdup (message, class->usage); } else { *usage = nih_strdup (message, ""); } if (! *usage) { nih_return_no_memory_error (-1); } return 0; } /** * job_class_serialise_job_environ: * * Serialise the global job environment table. * * Returns: JSON-serialised global job environment table, or NULL on error. **/ json_object * job_class_serialise_job_environ (void) { json_object *json; job_class_environment_init (); json = state_serialise_str_array (job_environ); if (! json) goto error; return json; error: json_object_put (json); return NULL; } /** * job_class_deserialise_job_environ * @json: JSON-serialised global job environment table to deserialise. * * Create the global job environment table from provided JSON. * * Returns: 0 on success, < 0 on error. **/ int job_class_deserialise_job_environ (json_object *json) { nih_assert (json); nih_assert (! job_environ); if (! state_check_json_type (json, array)) goto error; if (! state_deserialise_str_array (NULL, json, &job_environ)) goto error; return 0; error: return -1; } /** * job_class_serialise: * @class: job class to serialise. * * Convert @class into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised JobClass object, or NULL on error. **/ json_object * job_class_serialise (JobClass *class) { json_object *json; json_object *json_export; json_object *json_emits; json_object *json_processes; json_object *json_normalexit; json_object *json_limits; json_object *json_jobs; json_object *json_start_on; json_object *json_stop_on; int session_index; #ifdef ENABLE_CGROUPS json_object *json_cgroups; #endif /* ENABLE_CGROUPS */ nih_assert (class); nih_assert (job_classes); json = json_object_new_object (); if (! json) return NULL; session_index = session_get_index (class->session); if (session_index < 0) goto error; if (! state_set_json_int_var (json, "session", session_index)) goto error; if (! state_set_json_string_var_from_obj (json, class, name)) goto error; if (! state_set_json_string_var_from_obj (json, class, path)) goto error; if (! state_set_json_string_var_from_obj (json, class, instance)) goto error; json_jobs = job_serialise_all (class->instances); if (! json_jobs) goto error; json_object_object_add (json, "jobs", json_jobs); if (! state_set_json_string_var_from_obj (json, class, description)) goto error; if (! state_set_json_string_var_from_obj (json, class, author)) goto error; if (! state_set_json_string_var_from_obj (json, class, version)) goto error; if (! state_set_json_str_array_from_obj (json, class, env)) goto error; json_export = class->export ? state_serialise_str_array (class->export) : json_object_new_array (); if (! json_export) goto error; json_object_object_add (json, "export", json_export); if (class->start_on) { json_start_on = event_operator_serialise_all (class->start_on); if (! json_start_on) goto error; json_object_object_add (json, "start_on", json_start_on); } if (class->stop_on) { json_stop_on = event_operator_serialise_all (class->stop_on); if (! json_stop_on) goto error; json_object_object_add (json, "stop_on", json_stop_on); } json_emits = class->emits ? state_serialise_str_array (class->emits) : json_object_new_array (); if (! json_emits) goto error; json_object_object_add (json, "emits", json_emits); json_processes = process_serialise_all ( (const Process const * const * const)class->process); if (! json_processes) goto error; json_object_object_add (json, "process", json_processes); if (! state_set_json_enum_var (json, job_class_expect_type_enum_to_str, "expect", class->expect)) goto error; if (! state_set_json_int_var_from_obj (json, class, task)) goto error; if (! state_set_json_int_var_from_obj (json, class, kill_timeout)) goto error; if (! state_set_json_int_var_from_obj (json, class, kill_signal)) goto error; if (! state_set_json_int_var_from_obj (json, class, reload_signal)) goto error; if (! state_set_json_int_var_from_obj (json, class, respawn)) goto error; if (! state_set_json_int_var_from_obj (json, class, respawn_limit)) goto error; if (! state_set_json_int_var_from_obj (json, class, respawn_interval)) goto error; json_normalexit = state_serialise_int_array (int, class->normalexit, class->normalexit_len); if (! json_normalexit) goto error; json_object_object_add (json, "normalexit", json_normalexit); if (! state_set_json_enum_var (json, job_class_console_type_enum_to_str, "console", class->console)) goto error; if (! state_set_json_int_var_from_obj (json, class, umask)) goto error; if (! state_set_json_int_var_from_obj (json, class, nice)) goto error; if (! state_set_json_int_var_from_obj (json, class, oom_score_adj)) goto error; json_limits = state_rlimit_serialise_all (class->limits); if (! json_limits) goto error; json_object_object_add (json, "limits", json_limits); if (! state_set_json_string_var_from_obj (json, class, chroot)) goto error; if (! state_set_json_string_var_from_obj (json, class, chdir)) goto error; if (! state_set_json_string_var_from_obj (json, class, setuid)) goto error; if (! state_set_json_string_var_from_obj (json, class, setgid)) goto error; if (! state_set_json_int_var_from_obj (json, class, deleted)) goto error; if (! state_set_json_int_var_from_obj (json, class, debug)) goto error; if (! state_set_json_string_var_from_obj (json, class, usage)) goto error; if (! state_set_json_string_var_from_obj (json, class, apparmor_switch)) goto error; if (! state_set_json_int_var_from_obj (json, class, cgmanager_wait)) goto error; #ifdef ENABLE_CGROUPS json_cgroups = cgroup_serialise_all (&class->cgroups); if (! json_cgroups) goto error; json_object_object_add (json, "cgroups", json_cgroups); #endif /* ENABLE_CGROUPS */ return json; error: json_object_put (json); return NULL; } /** * job_class_serialise_all: * * Convert existing JobClass objects in job classes hash to JSON * representation. * * NOTE: despite its name, this function does not _necessarily_ * serialise all JobClasses - there may be "best" (ie newer) JobClasses * associated with ConfFiles that have not yet replaced the existing * entries in the job classes hash if the JobClass has running instances. * * However, this is academic since although such data is not serialised, * after the re-exec conf_reload() is called to recreate these "best" * JobClasses. This also has the nice side-effect of ensuring that * should jobs get created in the window when Upstart is statefully * re-exec'ing, it will always see the newest versions of on-disk files * (which is what the user expects). * * Returns: JSON object containing array of JobClass objects, * or NULL on error. **/ json_object * job_class_serialise_all (void) { json_object *json; job_class_init (); json = json_object_new_array (); if (! json) return NULL; NIH_HASH_FOREACH (job_classes, iter) { json_object *json_class; JobClass *class = (JobClass *)iter; json_class = job_class_serialise (class); if (! json_class) goto error; json_object_array_add (json, json_class); } return json; error: json_object_put (json); return NULL; } /** * job_class_deserialise: * @json: JSON-serialised JobClass object to deserialise. * * Create JobClass from provided JSON and add to the * job classes table. * * Returns: JobClass object, or NULL on error. **/ JobClass * job_class_deserialise (json_object *json) { json_object *json_normalexit; JobClass *class = NULL; ConfFile *file = NULL; Session *session; int session_index = -1; int ret; nih_local char *name = NULL; nih_local char *path = NULL; json_object *json_start_on = NULL; json_object *json_stop_on = NULL; nih_assert (json); nih_assert (job_classes); if (! state_check_json_type (json, object)) goto error; if (! state_get_json_int_var (json, "session", session_index)) goto error; if (session_index < 0) goto error; session = session_from_index (session_index); /* XXX: chroot and old user session jobs not currently supported */ if (session) { nih_info ("WARNING: deserialisation of user/chroot " "sessions not currently supported"); goto error; } if (! state_get_json_string_var_strict (json, "name", NULL, name)) goto error; /* Create the class and associate it with the ConfFile */ class = job_class_new (NULL, name, session); if (! class) goto error; /* Lookup the ConfFile associated with this class. * * Don't error if this fails since previous serialisation data * formats did not encode ConfSources and ConfFiles. */ file = conf_file_find (name, session); if (file) file->job = class; /* job_class_new() sets path */ if (! state_get_json_string_var_strict (json, "path", NULL, path)) goto error; nih_assert (! strcmp (class->path, path)); /* Discard default instance as we're about to be handed a fresh * string from the JSON. */ nih_free (class->instance); if (! state_get_json_string_var_to_obj (json, class, instance)) goto error; if (! state_get_json_string_var_to_obj (json, class, description)) goto error; if (! state_get_json_string_var_to_obj (json, class, author)) goto error; if (! state_get_json_string_var_to_obj (json, class, version)) goto error; if (! state_get_json_env_array_to_obj (json, class, env)) goto error; if (! state_get_json_env_array_to_obj (json, class, export)) goto error; /* start and stop conditions are optional */ if (json_object_object_get_ex (json, "start_on", &json_start_on)) { if (state_check_json_type (json_start_on, array)) { class->start_on = event_operator_deserialise_all (class, json_start_on); if (! class->start_on) goto error; } else { nih_local char *start_on = NULL; /* Old format (string). * * Note that we re-search for the JSON key here * (json, rather than json_start_on) to allow * the use of the convenience macro. This is * of course slower, but its a legacy scenario. */ if (! state_get_json_string_var_strict (json, "start_on", NULL, start_on)) goto error; if (*start_on) { class->start_on = parse_on_simple (class, "start", start_on); if (! class->start_on) { NihError *err; err = nih_error_get (); nih_error ("%s %s: %s", _("BUG"), _("'start on' parse error"), err->message); nih_free (err); goto error; } } } } if (json_object_object_get_ex (json, "stop_on", &json_stop_on)) { if (state_check_json_type (json_stop_on, array)) { class->stop_on = event_operator_deserialise_all (class, json_stop_on); if (! class->stop_on) goto error; } else { nih_local char *stop_on = NULL; /* Old format (string) - re-search as above */ if (! state_get_json_string_var_strict (json, "stop_on", NULL, stop_on)) goto error; if (*stop_on) { class->stop_on = parse_on_simple (class, "stop", stop_on); if (! class->stop_on) { NihError *err; err = nih_error_get (); nih_error ("%s %s: %s", _("BUG"), _("'stop on' parse error"), err->message); nih_free (err); goto error; } } } } if (! state_get_json_str_array_to_obj (json, class, emits)) goto error; if (! state_get_json_enum_var (json, job_class_expect_type_str_to_enum, "expect", class->expect)) goto error; if (! state_get_json_int_var_to_obj (json, class, task)) goto error; if (! state_get_json_int_var_to_obj (json, class, kill_timeout)) goto error; if (! state_get_json_int_var_to_obj (json, class, kill_signal)) goto error; /* reload_signal is new in upstart 1.10+ */ if (json_object_object_get_ex (json, "reload_signal", NULL)) { if (! state_get_json_int_var_to_obj (json, class, reload_signal)) goto error; } if (! state_get_json_int_var_to_obj (json, class, respawn)) goto error; if (! state_get_json_int_var_to_obj (json, class, respawn_limit)) goto error; if (! state_get_json_int_var_to_obj (json, class, respawn_interval)) goto error; if (! state_get_json_enum_var (json, job_class_console_type_str_to_enum, "console", class->console)) goto error; if (! state_get_json_int_var_to_obj (json, class, umask)) goto error; if (! state_get_json_int_var_to_obj (json, class, nice)) goto error; if (! state_get_json_int_var_to_obj (json, class, oom_score_adj)) goto error; if (! state_get_json_string_var_to_obj (json, class, chroot)) goto error; if (! state_get_json_string_var_to_obj (json, class, chdir)) goto error; if (! state_get_json_string_var_to_obj (json, class, setuid)) goto error; if (! state_get_json_string_var_to_obj (json, class, setgid)) goto error; if (! state_get_json_int_var_to_obj (json, class, deleted)) goto error; if (! state_get_json_int_var_to_obj (json, class, debug)) goto error; if (! state_get_json_string_var_to_obj (json, class, usage)) goto error; /* If we are missing this, we're probably importing from a * previous version that didn't include PROCESS_SECURITY. */ if (json_object_object_get_ex (json, "apparmor_switch", NULL)) { if (! state_get_json_string_var_to_obj (json, class, apparmor_switch)) goto error; } if (! json_object_object_get_ex (json, "normalexit", &json_normalexit)) goto error; ret = state_deserialise_int_array (class, json_normalexit, int, &class->normalexit, &class->normalexit_len); if (ret < 0) goto error; if (state_rlimit_deserialise_all (json, class, &class->limits) < 0) goto error; if (process_deserialise_all (json, class->process, class->process) < 0) goto error; if (file) { /* Add the class to the job_classes hash if ConfFiles were * available in the serialisation data. */ job_class_consider (class); } else { /* No ConfSources and ConfFiles were available in the * serialisation data, so special-case the insertion. */ job_class_add_safe (class); } /* Any jobs must be added after the class is registered * (since you cannot add a job to a partially-created * class). */ if (job_deserialise_all (class, json) < 0) goto error; #ifdef ENABLE_CGROUPS if (json_object_object_get_ex (json, "cgmanager_wait", NULL)) { if (cgroup_deserialise_all (class, &class->cgroups, json) < 0) goto error; if (! state_get_json_int_var_to_obj (json, class, cgmanager_wait)) goto error; } #endif /* ENABLE_CGROUPS */ return class; error: if (class) nih_free (class); return NULL; } /** * job_class_deserialise_all: * * @json: root of JSON-serialised state. * * Convert JSON representation of JobClasses back into JobClass objects. * * Returns: 0 on success, -1 on error. **/ int job_class_deserialise_all (json_object *json) { JobClass *class = NULL; nih_assert (json); job_class_init (); if (! json_object_object_get_ex (json, "job_classes", &json_classes)) goto error; if (! state_check_json_type (json_classes, array)) goto error; for (int i = 0; i < json_object_array_length (json_classes); i++) { json_object *json_class; json_class = json_object_array_get_idx (json_classes, i); if (! json_class) goto error; if (! state_check_json_type (json_class, object)) goto error; /* Responsible for associating a JobClass with its * parent ConfFile. */ class = job_class_deserialise (json_class); /* Either memory is low or -- more likely -- a JobClass * with a session was encountered, so keep going. */ if (! class) { int session_index = -1; if (state_get_json_int_var (json_class, "session", session_index) && session_index > 0) { /* Although ConfSources are now serialised, ignore * JobClasses with associated user/chroot sessions to avoid * behavioural changes for the time being. */ continue; } else { goto error; } } } return 0; error: if (class) nih_free (class); return -1; } /** * job_class_expect_type_enum_to_str: * * @expect: ExpectType. * * Convert ExpectType to a string representation. * * Returns: string representation of @expect, or NULL if not known. **/ const char * job_class_expect_type_enum_to_str (ExpectType expect) { state_enum_to_str (EXPECT_NONE, expect); state_enum_to_str (EXPECT_STOP, expect); state_enum_to_str (EXPECT_DAEMON, expect); state_enum_to_str (EXPECT_FORK, expect); return NULL; } /** * job_class_expect_type_str_to_enum: * * @expect: string ExpectType value. * * Convert @expect back into an enum value. * * Returns: ExpectType representing @expect, or -1 if not known. **/ ExpectType job_class_expect_type_str_to_enum (const char *expect) { nih_assert (expect); state_str_to_enum (EXPECT_NONE, expect); state_str_to_enum (EXPECT_STOP, expect); state_str_to_enum (EXPECT_DAEMON, expect); state_str_to_enum (EXPECT_FORK, expect); return -1; } /** * job_class_console_type_enum_to_str: * * @console: ConsoleType. * * Convert ConsoleType to a string representation. * * Returns: string representation of @console, or NULL if not known. **/ const char * job_class_console_type_enum_to_str (ConsoleType console) { state_enum_to_str (CONSOLE_NONE, console); state_enum_to_str (CONSOLE_OUTPUT, console); state_enum_to_str (CONSOLE_OWNER, console); state_enum_to_str (CONSOLE_LOG, console); return NULL; } /** * job_class_console_type_str_to_enum: * * @console: string ConsoleType value. * * Convert @console back into enum value. * * Returns: ExpectType representing @console, or -1 if not known. **/ ConsoleType job_class_console_type_str_to_enum (const char *console) { if (! console) goto error; state_str_to_enum (CONSOLE_NONE, console); state_str_to_enum (CONSOLE_OUTPUT, console); state_str_to_enum (CONSOLE_OWNER, console); state_str_to_enum (CONSOLE_LOG, console); error: return -1; } /** * job_class_prepare_reexec: * * Prepare for a re-exec by clearing the CLOEXEC bit on all log object * file descriptors associated with their parent jobs. **/ void job_class_prepare_reexec (void) { job_class_init (); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; NIH_HASH_FOREACH (class->instances, job_iter) { Job *job = (Job *)job_iter; nih_assert (job->log); for (int process = 0; process < PROCESS_LAST; process++) { int fd; Log *log; log = job->log[process]; /* No associated job process or logger has detected * remote end of pty has closed. */ if (! log || ! log->io) continue; nih_assert (log->io->watch); fd = log->io->watch->fd; if (fd < 0) continue; if (state_modify_cloexec (fd, FALSE) < 0) goto error; fd = log->fd; if (fd < 0) continue; if (state_modify_cloexec (fd, FALSE) < 0) goto error; } } } return; error: nih_warn (_("unable to clear CLOEXEC bit on log fd")); } /** * job_class_max_kill_timeout: * * Determine maximum kill timeout for all running jobs. * * Returns: Maximum kill timeout (seconds). **/ time_t job_class_max_kill_timeout (void) { time_t kill_timeout = JOB_DEFAULT_KILL_TIMEOUT; job_class_init (); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; NIH_HASH_FOREACH (class->instances, job_iter) { Job *job = (Job *)job_iter; if (job->class->kill_timeout > kill_timeout) { kill_timeout = job->class->kill_timeout; break; } } } return kill_timeout; } /** * job_class_get_index: * @class: JobClass to search for. * * Returns: index of @class in the job classes hash, * or -1 if not found. **/ ssize_t job_class_get_index (const JobClass *class) { ssize_t i = 0; nih_assert (class); NIH_HASH_FOREACH (job_classes, iter) { JobClass *c = (JobClass *)iter; if (! strcmp (c->name, class->name) && c->session == class->session) return i; i++; } return -1; } /** * job_class_induct_job: * @class: Start a job of a given class * * Returns: TRUE on success, otherwise FALSE. **/ int job_class_induct_job (JobClass *class) { nih_local char **env = NULL; nih_local char *name = NULL; size_t len; Job *job; nih_assert (class); job_class_init (); /* Construct the environment for the new instance * from the class and the start events. */ env = NIH_MUST (job_class_environment ( NULL, class, &len)); NIH_MUST (event_operator_environment (class->start_on, &env, NULL, &len, "UPSTART_EVENTS")); /* Expand the instance name against the environment */ name = NIH_SHOULD (environ_expand (NULL, class->instance, env)); if (! name) { NihError *err; err = nih_error_get (); nih_warn (_("Failed to obtain %s instance: %s"), class->name, err->message); nih_free (err); event_operator_reset (class->start_on); return FALSE; } /* Locate the current instance or create a new one */ job = (Job *)nih_hash_lookup (class->instances, name); if (! job) job = NIH_MUST (job_new (class, name)); nih_debug ("New instance %s", job_name (job)); /* Start the job with the environment we want */ if (job->goal != JOB_START) { if (job->start_env) nih_unref (job->start_env, job); job->start_env = env; nih_ref (job->start_env, job); nih_discard (env); env = NULL; job_finished (job, FALSE); NIH_MUST (event_operator_fds (class->start_on, job, &job->fds, &job->num_fds, &job->start_env, &len, "UPSTART_FDS")); event_operator_events (job->class->start_on, job, &job->blocking); job_change_goal (job, JOB_START); } event_operator_reset (class->start_on); return TRUE; } #ifdef ENABLE_CGROUPS /** * job_class_induct_jobs: * * Start all jobs waiting on a cgmanager. * * Returns: TRUE on success, if induction of any job fails returns FALSE. **/ int job_class_induct_jobs (void) { nih_assert (cgroup_manager_available ()); job_class_init (); int success = TRUE; NIH_HASH_FOREACH_SAFE (job_classes, iter) { JobClass *class = (JobClass *)iter; if (! class->start_on) continue; if (! class->cgmanager_wait) continue; nih_assert (class->start_on->value); if (! job_class_induct_job (class)) success = FALSE; /* Unref the events that were ref'ed * whilst waiting for the cgroup manager * to become available. */ event_operator_reset (class->start_on); class->cgmanager_wait = FALSE; } return success; } /** * job_class_cgroups: * * @class: JobClass. * * Determine if the specified class needs cgroup support. * * Returns TRUE if cgroups are required, else FALSE. * **/ int job_class_cgroups (JobClass *class) { nih_assert (class); if (NIH_LIST_EMPTY (&class->cgroups)) return FALSE; return TRUE; } #endif /* ENABLE_CGROUPS */ upstart-1.13.2/init/main.c0000664000175000017500000007350512373101356012271 00000000000000/* upstart * * Copyright 2009-2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #ifdef HAVE_SYS_PRCTL_H #include #ifndef PR_SET_CHILD_SUBREAPER #define PR_SET_CHILD_SUBREAPER 35 #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "paths.h" #include "events.h" #include "system.h" #include "job_class.h" #include "job_process.h" #include "event.h" #include "conf.h" #include "control.h" #include "state.h" #include "xdg.h" /* Prototypes for static functions */ #ifndef DEBUG static int logger_kmsg (NihLogLevel priority, const char *message); static void crash_handler (int signum); #endif /* DEBUG */ static void term_handler (void *data, NihSignal *signal); #ifndef DEBUG static void cad_handler (void *data, NihSignal *signal); static void kbd_handler (void *data, NihSignal *signal); static void pwr_handler (void *data, NihSignal *signal); static void hup_handler (void *data, NihSignal *signal); static void usr1_handler (void *data, NihSignal *signal); #endif /* DEBUG */ static void handle_confdir (void); static void handle_logdir (void); static int console_type_setter (NihOption *option, const char *arg); static int conf_dir_setter (NihOption *option, const char *arg); static int prepend_conf_dir_setter (NihOption *option, const char *arg); static int append_conf_dir_setter (NihOption *option, const char *arg); /** * state_fd: * * File descriptor to read serialised state from when performing * stateful re-exec. If value is not -1, attempt stateful re-exec. **/ static int state_fd = -1; /** * conf_dirs: * * Array of full paths to job configuration file directories. **/ static char **conf_dirs = NULL; /** * prepend_conf_dirs: * * Array of full paths to job configuration file directories that will * be added to before the other values in conf_dirs. **/ static char **prepend_conf_dirs = NULL; /** * append_conf_dirs: * * Array of full paths to job configuration file directories that will * be added to conf_dirs. **/ static char **append_conf_dirs = NULL; /** * initial_event: * * Alternate event to emit at startup (rather than STARTUP_EVENT). **/ static char *initial_event = NULL; /** * disable_startup_event: * * If TRUE, do not emit a startup event. **/ static int disable_startup_event = FALSE; /** * disable_dbus: * * If TRUE, do not connect to a D-Bus bus * (only connect to the private socket). **/ static int disable_dbus = FALSE; extern int no_inherit_env; extern int user_mode; extern int chroot_sessions; extern int disable_job_logging; extern int use_session_bus; extern int default_console; extern int write_state_file; extern char *log_dir; extern DBusBusType dbus_bus_type; extern mode_t initial_umask; extern int debug_stanza_enabled; #ifdef ENABLE_CGROUPS extern int disable_cgroups; #endif /* ENABLE_CGROUPS */ /** * options: * * Command-line options we accept. **/ static NihOption options[] = { { 0, "append-confdir", N_("specify additional directory to load configuration files from"), NULL, "DIR", NULL, append_conf_dir_setter }, { 0, "chroot-sessions", N_("enable chroot sessions"), NULL, NULL, &chroot_sessions, NULL }, { 0, "confdir", N_("specify alternative directory to load configuration files from"), NULL, "DIR", NULL, conf_dir_setter }, { 0, "default-console", N_("default value for console stanza"), NULL, "VALUE", NULL, console_type_setter }, { 0, "logdir", N_("specify alternative directory to store job output logs in"), NULL, "DIR", &log_dir, NULL }, #ifdef ENABLE_CGROUPS { 0, "no-cgroups", N_("do not support cgroups"), NULL, NULL, &disable_cgroups, NULL }, #endif /* ENABLE_CGROUPS */ { 0, "no-dbus", N_("do not connect to a D-Bus bus"), NULL, NULL, &disable_dbus, NULL }, { 0, "no-inherit-env", N_("jobs will not inherit environment of init"), NULL, NULL, &no_inherit_env , NULL }, { 0, "no-log", N_("disable job logging"), NULL, NULL, &disable_job_logging, NULL }, { 0, "no-startup-event", N_("do not emit any startup event (for testing)"), NULL, NULL, &disable_startup_event, NULL }, { 0, "prepend-confdir", N_("specify additional initial directory to load configuration files from"), NULL, "DIR", NULL, prepend_conf_dir_setter }, /* Must be specified for both stateful and stateless re-exec */ { 0, "restart", N_("flag a re-exec has occurred"), NULL, NULL, &restart, NULL }, /* Required for stateful re-exec */ { 0, "state-fd", N_("specify file descriptor to read serialisation data from"), NULL, "FD", &state_fd, nih_option_int }, { 0, "session", N_("use D-Bus session bus rather than system bus (for testing)"), NULL, NULL, &use_session_bus, NULL }, { 0, "startup-event", N_("specify an alternative initial event (for testing)"), NULL, "NAME", &initial_event, NULL }, { 0, "user", N_("start in user mode (as used for user sessions)"), NULL, NULL, &user_mode, NULL }, { 0, "write-state-file", N_("attempt to write state file on every re-exec"), NULL, NULL, &write_state_file, NULL }, /* Ignore invalid options */ { '-', "--", NULL, NULL, NULL, NULL, NULL }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char **args = NULL; int ret; conf_dirs = NIH_MUST (nih_str_array_new (NULL)); append_conf_dirs = NIH_MUST (nih_str_array_new (NULL)); prepend_conf_dirs = NIH_MUST (nih_str_array_new (NULL)); args_copy = NIH_MUST (nih_str_array_copy (NULL, NULL, argv)); nih_main_init (args_copy[0]); nih_option_set_synopsis (_("Process management daemon.")); nih_option_set_help ( _("This daemon is normally executed by the kernel and given " "process id 1 to denote its special status. When executed " "by a user process, it will actually run /sbin/telinit.")); args = nih_option_parser (NULL, argc, argv, options, FALSE); if (! args) exit (1); if (nih_log_priority == NIH_LOG_DEBUG) debug_stanza_enabled = TRUE; handle_confdir (); handle_logdir (); if (disable_job_logging) nih_debug ("Job logging disabled"); if (getenv (USE_SESSION_BUS_ENV)) use_session_bus = TRUE; if (! user_mode) no_inherit_env = TRUE; #ifndef DEBUG if (use_session_bus == FALSE && user_mode == FALSE) { int needs_devtmpfs = 0; /* Check we're root */ if (getuid ()) { nih_fatal (_("Need to be root")); exit (1); } /* Check we're process #1 */ if (getpid () > 1) { execv (TELINIT, argv); /* Ignore failure, probably just that telinit doesn't exist */ nih_fatal (_("Not being executed as init")); exit (1); } /* Clear our arguments from the command-line, so that we show up in * ps or top output as /sbin/init, with no extra flags. * * This is a very Linux-specific trick; by deleting the NULL * terminator at the end of the last argument, we fool the kernel * into believing we used a setproctitle()-a-like to extend the * argument space into the environment space, and thus make it use * strlen() instead of its own assumed length. In fact, we've done * the exact opposite, and shrunk the command line length to just that * of whatever is in argv[0]. * * If we don't do this, and just write \0 over the rest of argv, for * example; the command-line length still includes those \0s, and ps * will show whitespace in their place. */ if (argc > 1) { char *arg_end; arg_end = argv[argc-1] + strlen (argv[argc-1]); *arg_end = ' '; } /* Become the leader of a new session and process group, shedding * any controlling tty (which we shouldn't have had anyway - but * you never know what initramfs did). */ setsid (); /* Allow devices to be created with the actual perms * specified. */ initial_umask = umask (0); /* Check if key /dev entries already exist; if they do, * we should assume we don't need to mount /dev. */ if (system_check_file ("/dev/ptmx", S_IFCHR, makedev (5, 2)) < 0 || system_check_file ("/dev/pts", S_IFDIR, 0) < 0) needs_devtmpfs = 1; if (needs_devtmpfs) { if (system_mount ("devtmpfs", "/dev", MS_NOEXEC | MS_NOSUID, NULL) < 0) { NihError *err; err = nih_error_get (); nih_error ("%s: %s", _("Unable to mount /dev filesystem"), err->message); nih_free (err); } /* Required to exist before /dev/pts accessed */ system_mknod ("/dev/ptmx", (S_IFCHR | 0666), makedev (5, 2)); if (mkdir ("/dev/pts", 0755) < 0 && errno != EEXIST) nih_error ("%s: %s", _("Cannot create directory"), "/dev/pts"); } if (system_mount ("devpts", "/dev/pts", MS_NOEXEC | MS_NOSUID, "gid=5,mode=0620") < 0) { NihError *err; err = nih_error_get (); nih_error ("%s: %s", _("Unable to mount /dev/pts filesystem"), err->message); nih_free (err); } /* These devices must exist, but we have to have handled the /dev * check (and possible mount) prior to considering * creating them. And yet, if /dev is not available from * the outset and an error occurs, we are unable to report it, * hence these checks are performed as early as is * feasible. */ system_mknod ("/dev/null", (S_IFCHR | 0666), makedev (1, 3)); system_mknod ("/dev/tty", (S_IFCHR | 0666), makedev (5, 0)); system_mknod ("/dev/console", (S_IFCHR | 0600), makedev (5, 1)); system_mknod ("/dev/kmsg", (S_IFCHR | 0600), makedev (1, 11)); /* Set the standard file descriptors to the ordinary console device, * resetting it to sane defaults unless we're inheriting from another * init process which we know left it in a sane state. */ if (system_setup_console (CONSOLE_OUTPUT, (! restart)) < 0) { NihError *err; err = nih_error_get (); nih_warn ("%s: %s", _("Unable to initialize console, will try /dev/null"), err->message); nih_free (err); if (system_setup_console (CONSOLE_NONE, FALSE) < 0) { err = nih_error_get (); nih_fatal ("%s: %s", _("Unable to initialize console as /dev/null"), err->message); nih_free (err); exit (1); } } /* Set the PATH environment variable */ setenv ("PATH", PATH, TRUE); /* Switch to the root directory in case we were started from some * strange place, or worse, some directory in the initramfs that's * going to go away soon. */ if (chdir ("/")) nih_warn ("%s: %s", _("Unable to set root directory"), strerror (errno)); /* Mount the /proc and /sys filesystems, which are pretty much * essential for any Linux system; not to mention used by * ourselves. Also mount /dev/pts to allow CONSOLE_LOG * to function if booted in an initramfs-less environment. */ if (system_mount ("proc", "/proc", MS_NODEV | MS_NOEXEC | MS_NOSUID, NULL) < 0) { NihError *err; err = nih_error_get (); nih_warn ("%s: %s", _("Unable to mount /proc filesystem"), err->message); nih_free (err); } if (system_mount ("sysfs", "/sys", MS_NODEV | MS_NOEXEC | MS_NOSUID, NULL) < 0) { NihError *err; err = nih_error_get (); nih_warn ("%s: %s", _("Unable to mount /sys filesystem"), err->message); nih_free (err); } } else { nih_debug ("Running with UID %d as PID %d (PPID %d)", (int)getuid (), (int)getpid (), (int)getppid ()); } #else /* DEBUG */ nih_log_set_priority (NIH_LOG_DEBUG); nih_debug ("Running with UID %d as PID %d (PPID %d)", (int)getuid (), (int)getpid (), (int)getppid ()); #endif /* DEBUG */ if (user_mode) { /* Save initial value */ initial_umask = umask (0); (void)umask (initial_umask); } /* Reset the signal state and install the signal handler for those * signals we actually want to catch; this also sets those that * can be sent to us, because we're special */ if (! restart) nih_signal_reset (); #ifndef DEBUG if (use_session_bus == FALSE && user_mode == FALSE) { /* Catch fatal errors immediately rather than waiting for a new * iteration through the main loop. */ nih_signal_set_handler (SIGSEGV, crash_handler); nih_signal_set_handler (SIGABRT, crash_handler); } #endif /* DEBUG */ /* Don't ignore SIGCHLD or SIGALRM, but don't respond to them * directly; it's enough that they interrupt the main loop and * get dealt with during it. */ nih_signal_set_handler (SIGCHLD, nih_signal_handler); nih_signal_set_handler (SIGALRM, nih_signal_handler); #ifndef DEBUG if (use_session_bus == FALSE && user_mode == FALSE) { /* Ask the kernel to send us SIGINT when control-alt-delete is * pressed; generate an event with the same name. */ reboot (RB_DISABLE_CAD); nih_signal_set_handler (SIGINT, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGINT, cad_handler, NULL)); /* Ask the kernel to send us SIGWINCH when alt-uparrow is pressed; * generate a keyboard-request event. */ if (ioctl (0, KDSIGACCEPT, SIGWINCH) == 0) { nih_signal_set_handler (SIGWINCH, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGWINCH, kbd_handler, NULL)); } /* powstatd sends us SIGPWR when it changes /etc/powerstatus */ nih_signal_set_handler (SIGPWR, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGPWR, pwr_handler, NULL)); } /* SIGHUP instructs us to re-load our configuration */ nih_signal_set_handler (SIGHUP, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL)); /* Session Inits only reconnect to D-Bus when notified * via their private socket. */ if (! user_mode) { /* SIGUSR1 instructs us to reconnect to D-Bus */ nih_signal_set_handler (SIGUSR1, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL)); } /* SIGTERM instructs us to re-exec ourselves when running as PID * 1, or to exit when running as a Session Init; this signal should * be the last in the list to ensure that all other signals are * handled before a SIGTERM. */ nih_signal_set_handler (SIGTERM, nih_signal_handler); NIH_MUST (nih_signal_add_handler (NULL, SIGTERM, term_handler, NULL)); #endif /* DEBUG */ /* Watch children for events */ NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, job_process_handler, NULL)); /* Process the event queue each time through the main loop */ NIH_MUST (nih_main_loop_add_func (NULL, (NihMainLoopCb)event_poll, NULL)); /* Adjust our OOM priority to the default, which will be inherited * by all jobs. */ if (JOB_DEFAULT_OOM_SCORE_ADJ) { char filename[PATH_MAX]; int oom_value; FILE *fd; snprintf (filename, sizeof (filename), "/proc/%d/oom_score_adj", getpid ()); oom_value = JOB_DEFAULT_OOM_SCORE_ADJ; fd = fopen (filename, "w"); if ((! fd) && (errno == ENOENT)) { snprintf (filename, sizeof (filename), "/proc/%d/oom_adj", getpid ()); oom_value = (JOB_DEFAULT_OOM_SCORE_ADJ * ((JOB_DEFAULT_OOM_SCORE_ADJ < 0) ? 17 : 15)) / 1000; fd = fopen (filename, "w"); } if (! fd) { nih_warn ("%s: %s", _("Unable to set default oom score"), strerror (errno)); } else { fprintf (fd, "%d\n", oom_value); if (fclose (fd)) nih_warn ("%s: %s", _("Unable to set default oom score"), strerror (errno)); } } if (restart) { if (state_fd == -1) { nih_warn ("%s", _("Stateful re-exec supported but stateless re-exec requested")); } else if (state_read (state_fd) < 0) { /* Stateful re-exec has failed so try once more by * degrading to stateless re-exec, which even in * the case of low-memory scenarios will work. */ /* Inform the child we've given up on stateful * re-exec. */ close (state_fd); nih_error ("%s - %s", _("Failed to read serialisation data"), _("reverting to stateless re-exec")); /* Remove any existing (but now stale) state fd * args which will effectively disable stateful * re-exec. */ clean_args (&args_copy); /* Attempt stateless re-exec */ perform_reexec (); nih_error ("%s", _("Both stateful and stateless re-execs failed")); /* Out of options */ nih_assert_not_reached (); } else { close (state_fd); nih_info ("Stateful re-exec completed"); } } /* Only honour command-line options affecting configuration * directories if not restarting, or if performing a stateless * re-exec. */ if (! restart || (restart && state_fd == -1)) { /* Read configuration */ if (prepend_conf_dirs[0]) { for (char **d = prepend_conf_dirs; d && *d; d++) { nih_debug ("Prepending configuration directory %s", *d); NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR)); } } if (! user_mode) { nih_assert (conf_dirs[0]); NIH_MUST (conf_source_new (NULL, CONFFILE, CONF_FILE)); for (char **d = conf_dirs; d && *d; d++) { nih_debug ("Using configuration directory %s", *d); NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR)); } } else { nih_local char **dirs = NULL; dirs = NIH_MUST (get_user_upstart_dirs ()); for (char **d = conf_dirs[0] ? conf_dirs : dirs; d && *d; d++) { nih_debug ("Using configuration directory %s", *d); NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR)); } } if (append_conf_dirs[0]) { for (char **d = append_conf_dirs; d && *d; d++) { nih_debug ("Adding configuration directory %s", *d); NIH_MUST (conf_source_new (NULL, *d, CONF_JOB_DIR)); } } } nih_free (conf_dirs); nih_free (prepend_conf_dirs); nih_free (append_conf_dirs); job_class_environment_init (); conf_reload (); /* We must have atleast one source of configuration */ nih_assert (! NIH_LIST_EMPTY (conf_sources)); /* Create a listening server for private connections. */ if (use_session_bus == FALSE) { while (control_server_open () < 0) { NihError *err; err = nih_error_get (); if (err->number != ENOMEM) { nih_warn ("%s: %s", _("Unable to listen for private connections"), err->message); nih_free (err); break; } nih_free (err); } } /* Open connection to the appropriate D-Bus bus; we normally expect this to * fail (since dbus-daemon probably isn't running yet) and will try again * later - don't let ENOMEM stop us though. */ if (disable_dbus) { nih_info (_("Not connecting to %s bus"), use_session_bus ? "session" : "system"); } else { while (control_bus_open () < 0) { NihError *err; int number; err = nih_error_get (); number = err->number; nih_free (err); if (number != ENOMEM) break; } } #ifndef DEBUG if (use_session_bus == FALSE && user_mode == FALSE) { /* Now that the startup is complete, send all further logging output * to kmsg instead of to the console. */ if (system_setup_console (CONSOLE_NONE, FALSE) < 0) { NihError *err; err = nih_error_get (); nih_fatal ("%s: %s", _("Unable to setup standard file descriptors"), err->message); nih_free (err); exit (1); } nih_log_set_logger (logger_kmsg); } #endif /* DEBUG */ /* Generate and run the startup event or read the state from the * init daemon that exec'd us */ if (! restart) { if (disable_startup_event) { nih_debug ("Startup event disabled"); } else { NIH_MUST (event_new (NULL, initial_event ? initial_event : STARTUP_EVENT, NULL)); } } else { sigset_t mask; /* We have been re-exec'd. Don't emit an initial event * as only Upstart is restarting - we don't want to restart * the system (another reason being that we don't yet support * upstart-in-initramfs to upstart-in-root-filesystem * state-passing transitions). */ /* We're ok to receive signals again so restore signals * disabled by the term_handler */ sigemptyset (&mask); sigprocmask (SIG_SETMASK, &mask, NULL); /* Emit the Restarted signal so that any listening Instance Init * knows that it needs to restart too. */ control_notify_restarted(); } if (chroot_sessions) nih_debug ("Chroot Sessions enabled"); /* Set us as the child subreaper. * This ensures that even when init doesn't run as PID 1, it'll always be * the ultimate parent of everything it spawns. */ #ifdef HAVE_SYS_PRCTL_H if (getpid () > 1 && prctl (PR_SET_CHILD_SUBREAPER, 1) < 0) { nih_warn ("%s: %s", _("Unable to register as subreaper"), strerror (errno)); NIH_MUST (event_new (NULL, "child-subreaper-failed", NULL)); } #endif /* Run through the loop at least once to deal with signals that were * delivered to the previous process while the mask was set or to * process the startup event we emitted. */ nih_main_loop_interrupt (); ret = nih_main_loop (); /* Cleanup */ conf_destroy (); session_destroy (); control_cleanup (); return ret; } #ifndef DEBUG /** * logger_kmsg: * @priority: priority of message being logged, * @message: message to log. * * Outputs the @message to the kernel log message socket prefixed with an * appropriate tag based on @priority, the program name and terminated with * a new line. * * Returns: zero on success, negative value on error. **/ static int logger_kmsg (NihLogLevel priority, const char *message) { int tag; int fd; ssize_t ret; size_t remaining = -1; nih_local char *buffer = NULL; char *p; nih_assert (message != NULL); switch (priority) { case NIH_LOG_DEBUG: tag = '7'; break; case NIH_LOG_INFO: tag = '6'; break; case NIH_LOG_MESSAGE: tag = '5'; break; case NIH_LOG_WARN: tag = '4'; break; case NIH_LOG_ERROR: tag = '3'; break; case NIH_LOG_FATAL: tag = '2'; break; default: tag = 'd'; } fd = open ("/dev/kmsg", O_WRONLY | O_NOCTTY); if (fd < 0) return -1; buffer = nih_sprintf (NULL, "<%c>%s: %s\n", tag, program_name, message); if (! buffer) goto out; p = buffer; remaining = strlen (p); do { ret = write (fd, p, remaining); if (ret > 0) { p += ret; remaining -= ret; } else if (! ret || (ret < 0 && errno != EINTR)) { close (fd); return -1; } } while (remaining); out: if (close (fd) < 0) return -1; return 0; } /** * crash_handler: * @signum: signal number received. * * Handle receiving the SEGV or ABRT signal, usually caused by one of * our own mistakes. We deal with it by dumping core in a child process * and then killing the parent. * * Sadly there's no real alternative to the ensuing kernel panic. Our * state is likely in tatters, so we can't sigjmp() anywhere "safe" or * re-exec since the system will be suddenly lobotomised. We definitely * don't want to start a root shell or anything like that. Best thing is * to just stop the whole thing and hope that bug report comes quickly. **/ static void crash_handler (int signum) { pid_t pid; nih_assert (args_copy[0] != NULL); pid = fork (); if (pid == 0) { struct sigaction act; struct rlimit limit; sigset_t mask; /* Mask out all signals */ sigfillset (&mask); sigprocmask (SIG_SETMASK, &mask, NULL); /* Set the handler to the default so core is dumped */ act.sa_handler = SIG_DFL; act.sa_flags = 0; sigemptyset (&act.sa_mask); sigaction (signum, &act, NULL); /* Don't limit the core dump size */ limit.rlim_cur = RLIM_INFINITY; limit.rlim_max = RLIM_INFINITY; setrlimit (RLIMIT_CORE, &limit); /* Dump in the root directory */ if (chdir ("/")) nih_warn ("%s: %s", _("Unable to set root directory"), strerror (errno)); /* Raise the signal again */ raise (signum); /* Unmask so that we receive it */ sigdelset (&mask, signum); sigprocmask (SIG_SETMASK, &mask, NULL); /* Wait for death */ pause (); exit (0); } else if (pid > 0) { /* Wait for the core to be generated */ waitpid (pid, NULL, 0); nih_fatal (_("Caught %s, core dumped"), (signum == SIGSEGV ? "segmentation fault" : "abort")); } else { nih_fatal (_("Caught %s, unable to dump core"), (signum == SIGSEGV ? "segmentation fault" : "abort")); } /* Goodbye, cruel world. */ exit (signum); } #endif /** * term_handler: * @data: unused, * @signal: signal caught. * * This is called when we receive the TERM signal, which instructs us * to reexec ourselves when running as PID 1, or to perform a controlled * exit when running as a Session Init. **/ static void term_handler (void *data, NihSignal *signal) { nih_assert (args_copy[0] != NULL); nih_assert (signal != NULL); if (user_mode) { quiesce (QUIESCE_REQUESTER_SYSTEM); return; } nih_warn (_("Re-executing %s"), args_copy[0]); stateful_reexec (); } #ifndef DEBUG /** * cad_handler: * @data: unused, * @signal: signal that called this handler. * * Handle having received the SIGINT signal, sent to us when somebody * presses Ctrl-Alt-Delete on the console. We just generate a * ctrlaltdel event. **/ static void cad_handler (void *data, NihSignal *signal) { NIH_MUST (event_new (NULL, CTRLALTDEL_EVENT, NULL)); } /** * kbd_handler: * @data: unused, * @signal: signal that called this handler. * * Handle having received the SIGWINCH signal, sent to us when somebody * presses Alt-UpArrow on the console. We just generate a * kbdrequest event. **/ static void kbd_handler (void *data, NihSignal *signal) { NIH_MUST (event_new (NULL, KBDREQUEST_EVENT, NULL)); } /** * pwr_handler: * @data: unused, * @signal: signal that called this handler. * * Handle having received the SIGPWR signal, sent to us when powstatd * changes the /etc/powerstatus file. We just generate a * power-status-changed event and jobs read the file. **/ static void pwr_handler (void *data, NihSignal *signal) { NIH_MUST (event_new (NULL, PWRSTATUS_EVENT, NULL)); } /** * hup_handler: * @data: unused, * @signal: signal that called this handler. * * Handle having received the SIGHUP signal, which we use to instruct us to * reload our configuration. **/ static void hup_handler (void *data, NihSignal *signal) { nih_info (_("Reloading configuration")); conf_reload (); } /** * usr1_handler: * @data: unused, * @signal: signal that called this handler. * * Handle having received the SIGUSR signal, which we use to instruct us to * reconnect to D-Bus. **/ static void usr1_handler (void *data, NihSignal *signal) { nih_assert (! user_mode); if (disable_dbus) return; if (! control_bus) { char *dbus_bus_name; dbus_bus_name = dbus_bus_type == DBUS_BUS_SESSION ? "session" : "system"; nih_info (_("Reconnecting to D-Bus %s bus"), dbus_bus_name); if (control_bus_open () < 0) { NihError *err; err = nih_error_get (); nih_warn (_("Unable to connect to the D-Bus %s bus: %s"), dbus_bus_name, err->message); nih_free (err); } } } #endif /* DEBUG */ /** * handle_confdir: * * Determine where system configuration files should be loaded from * if not specified on the command-line. **/ static void handle_confdir (void) { char *dir; nih_assert (conf_dirs); /* user has already specified directory on command-line */ if (conf_dirs[0]) return; if (user_mode) return; dir = getenv (CONFDIR_ENV); NIH_MUST (nih_str_array_add (&conf_dirs, NULL, NULL, dir ? dir : CONFDIR)); } /** * handle_logdir: * * Determine directory where job log files should be written to. **/ static void handle_logdir (void) { char *dir; /* user has already specified directory on command-line */ if (log_dir) goto out; if (user_mode) { log_dir = get_user_log_dir (); return; } log_dir = JOB_LOGDIR; dir = getenv (LOGDIR_ENV); if (! dir) return; log_dir = dir; out: nih_debug ("Using alternate log directory %s", log_dir); } /** * NihOption setter function to handle selection of default console * type. * * Returns: 0 on success, -1 on invalid console type. **/ static int console_type_setter (NihOption *option, const char *arg) { nih_assert (option); default_console = (int)job_class_console_type (arg); if (default_console == -1) { nih_fatal ("%s: %s", _("invalid console type specified"), arg); return -1; } return 0; } /** * NihOption setter function to handle selection of configuration file * directories. * * Returns: 0 on success, -1 on invalid console type. **/ static int conf_dir_setter (NihOption *option, const char *arg) { nih_assert (conf_dirs); nih_assert (option); NIH_MUST (nih_str_array_add (&conf_dirs, NULL, NULL, arg)); return 0; } /** * NihOption setter function to handle selection of configuration file * directories. * * Returns: 0 on success, -1 on invalid console type. **/ static int prepend_conf_dir_setter (NihOption *option, const char *arg) { nih_assert (prepend_conf_dirs); nih_assert (option); NIH_MUST (nih_str_array_add (&prepend_conf_dirs, NULL, NULL, arg)); return 0; } /** * NihOption setter function to handle selection of configuration file * directories. * * Returns: 0 on success, -1 on invalid console type. **/ static int append_conf_dir_setter (NihOption *option, const char *arg) { nih_assert (append_conf_dirs); nih_assert (option); NIH_MUST (nih_str_array_add (&append_conf_dirs, NULL, NULL, arg)); return 0; } upstart-1.13.2/init/event.h0000664000175000017500000000640712373101356012470 00000000000000/* upstart * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_EVENT_H #define INIT_EVENT_H #include #include #include "session.h" #include "state.h" #include /** * EventProgress: * * This is used to record the progress of an event, starting at * being pending, then being handled and finally waiting for the callback * to be called and any cleanup performed. **/ typedef enum event_progress { EVENT_PENDING, EVENT_HANDLING, EVENT_FINISHED } EventProgress; /** * Event: * @entry: list header, * @session: session the event is attached to, * @name: string name of the event, * @env: NULL-terminated array of environment variables, * @fd: open file descriptor associated with a particular * socket-bridge socket (see socket-event(8)), * @progress: progress of event, * @failed: whether this event has failed, * @blockers: number of blockers for finishing, * @blocking: messages and jobs we're blocking. * * Events are one of the core concepts of upstart; they occur whenever * something, somewhere changes state. They are idenitied by a unique * @name string, and can carry further information in the form of @env * which are passed to any jobs whose goal is changed by this event. * * This structure holds all the information on an active event, including * the information contained within the event and the current progress of * that event through the queue. * * Events remain in the handling state while @blockers is non-zero. **/ typedef struct event { NihList entry; Session * session; char *name; char **env; int fd; EventProgress progress; int failed; unsigned int blockers; NihList blocking; } Event; NIH_BEGIN_EXTERN extern int paused; extern NihList *events; void event_init (void); Event *event_new (const void *parent, const char *name, char **env); void event_block (Event *event); void event_unblock (Event *event); void event_poll (void); json_object *event_serialise (const Event *event) __attribute__ ((warn_unused_result)); Event *event_deserialise (json_object *json) __attribute__ ((warn_unused_result)); json_object * event_serialise_all (void) __attribute__ ((warn_unused_result)); int event_deserialise_all (json_object *json) __attribute__ ((warn_unused_result)); int event_to_index (const Event *event) __attribute__ ((warn_unused_result)); Event * event_from_index (int event_index) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_EVENT_H */ upstart-1.13.2/init/tests/0000775000175000017500000000000012402042412012377 500000000000000upstart-1.13.2/init/tests/test_event.c0000664000175000017500000014506312373101356014666 00000000000000/* upstart * * test_event.c - test suite for init/event.c * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "control.h" #include "job.h" #include "event.h" #include "blocked.h" void test_new (void) { Event *event; char **env; /* Check that we can create a new event; the structure should * be allocated with nih_alloc(), placed in a list and all of the * details filled in. */ TEST_FUNCTION ("event_new"); event_init (); nih_main_loop_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { env = nih_str_array_new (NULL); NIH_MUST (nih_str_array_add (&env, NULL, NULL, "FOO=BAR")); NIH_MUST (nih_str_array_add (&env, NULL, NULL, "BAR=FRODO")); } event = event_new (NULL, "test", env); if (test_alloc_failed) { TEST_EQ_P (event, NULL); TEST_ALLOC_PARENT (env, NULL); nih_free (env); continue; } nih_discard (env); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ (event->progress, EVENT_PENDING); TEST_EQ (event->failed, FALSE); TEST_EQ (event->blockers, 0); TEST_LIST_EMPTY (&event->blocking); TEST_EQ_STR (event->name, "test"); TEST_ALLOC_PARENT (event->name, event); TEST_EQ_P (event->env, env); TEST_ALLOC_PARENT (event->env, event); nih_free (event); } } void test_block (void) { Event *event; /* Check that calling event_block increments the number of blockers * that the event has. */ TEST_FUNCTION ("event_block"); event = event_new (NULL, "test", NULL); event->blockers = 4; event_block (event); TEST_EQ (event->blockers, 5); nih_free (event); } void test_unblock (void) { Event *event; /* Check that calling event_unblock increments the number of blockers * that the event has. */ TEST_FUNCTION ("event_unblock"); event = event_new (NULL, "test", NULL); event->blockers = 4; event_unblock (event); TEST_EQ (event->blockers, 3); nih_free (event); } void test_poll (void) { Event *event = NULL; pid_t dbus_pid; DBusError dbus_error; DBusConnection *conn, *client_conn; DBusMessage *message; NihListEntry *entry; TEST_FUNCTION ("event_poll"); nih_error_init (); nih_timer_init (); nih_main_loop_init (); control_init (); job_class_init (); /* Check that when a D-Bus connection is open, the new instance * is registered on that connection as an object and the InstanceAdded * signal is emitted. */ TEST_FEATURE ("with D-Bus connection"); dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); control_init (); entry = nih_list_entry_new (NULL); entry->data = conn; nih_list_add (control_conns, &entry->entry); /* Check that a pending event which does not get blocked goes * straight though and gets freed. */ TEST_FEATURE ("with unblocked pending event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "test", NULL); } TEST_FREE_TAG (event); event_poll (); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "EventEmitted")); dbus_message_unref (message); TEST_FREE (event); } /* Check that a handling event which is not blocked goes * straight though and gets freed. */ TEST_FEATURE ("with unblocked handling event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "test", NULL); event->progress = EVENT_HANDLING; } TEST_FREE_TAG (event); event_poll (); TEST_FREE (event); } /* Check that a handling event which is blocked stays in the queue * in the handling state, but does not prevent the loop from exiting. */ TEST_FEATURE ("with blocked handling event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "test", NULL); event->progress = EVENT_HANDLING; event->blockers = 1; } TEST_FREE_TAG (event); event_poll (); TEST_NOT_FREE (event); TEST_LIST_NOT_EMPTY (&event->entry); nih_free (event); } /* Check that a finished event is freed. */ TEST_FEATURE ("with finished event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "test", NULL); event->progress = EVENT_FINISHED; } TEST_FREE_TAG (event); event_poll (); TEST_FREE (event); } nih_free (entry); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_pending (void) { JobClass *class = NULL; Job *job; Event *event = NULL; /* Check that a pending event in the queue results in jobs being * started and/or stopped and gets moved into the handling state. */ TEST_FUNCTION ("event_pending"); nih_error_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "test", NULL); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; class->process[PROCESS_MAIN] = process_new (class->process); class->process[PROCESS_MAIN]->command = "echo"; class->start_on = event_operator_new ( class, EVENT_MATCH, "test", NULL); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_EQ (event->progress, EVENT_HANDLING); TEST_EQ (event->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_GT (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], NULL, 0); nih_free (class); nih_free (event); } } void test_pending_handle_jobs (void) { FILE *output; JobClass *class = NULL; Job *job = NULL, *ptr; Event *event1 = NULL, *event2 = NULL; Event *event3 = NULL, *event4 = NULL; EventOperator *oper; Blocked *blocked = NULL, *blocked1 = NULL, *blocked2 = NULL; char **env1 = NULL, **env2 = NULL; TEST_FUNCTION ("event_pending_handle_jobs"); program_name = "test"; output = tmpfile (); /* Check that an event that does not match the start operator of * a job does not get blocked and passes straight through the * loop. */ TEST_FEATURE ("with non-matching event for start"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "biscuit", NULL); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; class->start_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_FREE (event1); TEST_HASH_EMPTY (class->instances); oper = class->start_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); nih_free (class); } /* Check that an event that only partially matches an operator * marks the individual node as true, but does not result in the * job being changed yet. The event should now be blocked on the * job. */ TEST_FEATURE ("with partial matching event to start"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; class->start_on = event_operator_new ( class, EVENT_AND, NULL, NULL); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wibble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_LEFT); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wobble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_RIGHT); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_NOT_FREE (event1); TEST_EQ (event1->blockers, 1); TEST_HASH_EMPTY (class->instances); oper = class->start_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); oper = (EventOperator *)class->start_on->node.left; TEST_EQ (oper->value, TRUE); TEST_EQ_P (oper->event, event1); oper = (EventOperator *)class->start_on->node.right; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); nih_free (class); nih_free (event1); } /* Check that multiple events can complete an operator match and * result in the job being started and the start operator in the * class reset. The environment from the class, plus the job-unique * variables should be in the instances's environment, since they * would have been copied out of start_env on starting. */ TEST_FEATURE ("with matching events to start"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); event2 = event_new (NULL, "wobble", NULL); TEST_FREE_TAG (event1); TEST_FREE_TAG (event2); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; assert (nih_str_array_add (&(class->env), class, NULL, "FOO=BAR")); assert (nih_str_array_add (&(class->env), class, NULL, "BAR=BAZ")); class->start_on = event_operator_new ( class, EVENT_AND, NULL, NULL); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wibble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_LEFT); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wobble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_RIGHT); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_NOT_FREE (event1); TEST_NOT_FREE (event2); TEST_EQ (event1->blockers, 1); TEST_EQ (event2->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_NE_P (job->env, NULL); TEST_ALLOC_PARENT (job->env, job); TEST_ALLOC_SIZE (job->env, sizeof (char *) * 6); TEST_ALLOC_PARENT (job->env[0], job->env); TEST_EQ_STRN (job->env[0], "PATH="); TEST_ALLOC_PARENT (job->env[1], job->env); TEST_EQ_STRN (job->env[1], "TERM="); TEST_ALLOC_PARENT (job->env[2], job->env); TEST_EQ_STR (job->env[2], "FOO=BAR"); TEST_ALLOC_PARENT (job->env[3], job->env); TEST_EQ_STR (job->env[3], "BAR=BAZ"); TEST_ALLOC_PARENT (job->env[4], job->env); TEST_EQ_STR (job->env[4], "UPSTART_EVENTS=wibble wobble"); TEST_EQ_P (job->env[5], NULL); TEST_EQ_P (job->start_env, NULL); oper = class->start_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); oper = (EventOperator *)class->start_on->node.left; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); oper = (EventOperator *)class->start_on->node.right; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event1); nih_free (blocked); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event2); nih_free (blocked); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event1); nih_free (event2); } /* Check that the environment variables from the event are also copied * into the job's environment. */ TEST_FEATURE ("with environment in start event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "FRODO=baggins")); assert (nih_str_array_add (&(event1->env), event1, NULL, "BILBO=took")); TEST_FREE_TAG (event1); event2 = event_new (NULL, "wobble", NULL); assert (nih_str_array_add (&(event2->env), event2, NULL, "FRODO=brandybuck")); assert (nih_str_array_add (&(event2->env), event2, NULL, "TEA=MILK")); TEST_FREE_TAG (event2); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; assert (nih_str_array_add (&(class->env), class, NULL, "FOO=BAR")); assert (nih_str_array_add (&(class->env), class, NULL, "BAR=BAZ")); class->start_on = event_operator_new ( class, EVENT_AND, NULL, NULL); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wibble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_LEFT); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wobble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_RIGHT); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_NOT_FREE (event1); TEST_NOT_FREE (event2); TEST_EQ (event1->blockers, 1); TEST_EQ (event2->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_ALLOC_PARENT (job->name, job); TEST_EQ_STR (job->name, ""); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_NE_P (job->env, NULL); TEST_ALLOC_PARENT (job->env, job); TEST_ALLOC_SIZE (job->env, sizeof (char *) * 9); TEST_ALLOC_PARENT (job->env[0], job->env); TEST_EQ_STRN (job->env[0], "PATH="); TEST_ALLOC_PARENT (job->env[1], job->env); TEST_EQ_STRN (job->env[1], "TERM="); TEST_ALLOC_PARENT (job->env[2], job->env); TEST_EQ_STR (job->env[2], "FOO=BAR"); TEST_ALLOC_PARENT (job->env[3], job->env); TEST_EQ_STR (job->env[3], "BAR=BAZ"); TEST_ALLOC_PARENT (job->env[4], job->env); TEST_EQ_STR (job->env[4], "FRODO=brandybuck"); TEST_ALLOC_PARENT (job->env[5], job->env); TEST_EQ_STR (job->env[5], "BILBO=took"); TEST_ALLOC_PARENT (job->env[6], job->env); TEST_EQ_STR (job->env[6], "TEA=MILK"); TEST_ALLOC_PARENT (job->env[7], job->env); TEST_EQ_STR (job->env[7], "UPSTART_EVENTS=wibble wobble"); TEST_EQ_P (job->env[8], NULL); TEST_EQ_P (job->start_env, NULL); oper = class->start_on; TEST_EQ (oper->value, FALSE); oper = (EventOperator *)class->start_on->node.left; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); oper = (EventOperator *)class->start_on->node.right; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event1); nih_free (blocked); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event2); nih_free (blocked); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event1); nih_free (event2); } /* Check that the event can restart an instance that is stopping, * storing the environment in the start_env member since it should * not overwrite the previous environment until it actually restarts. */ TEST_FEATURE ("with restart of stopping job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "FRODO=baggins")); assert (nih_str_array_add (&(event1->env), event1, NULL, "BILBO=took")); TEST_FREE_TAG (event1); event2 = event_new (NULL, "wobble", NULL); assert (nih_str_array_add (&(event2->env), event2, NULL, "FRODO=brandybuck")); assert (nih_str_array_add (&(event2->env), event2, NULL, "TEA=MILK")); TEST_FREE_TAG (event2); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; assert (nih_str_array_add (&(class->env), class, NULL, "FOO=BAR")); assert (nih_str_array_add (&(class->env), class, NULL, "BAR=BAZ")); class->start_on = event_operator_new ( class, EVENT_AND, NULL, NULL); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wibble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_LEFT); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wobble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_RIGHT); nih_hash_add (job_classes, &class->entry); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; assert (nih_str_array_add (&(job->env), job, NULL, "FOO=wibble")); assert (nih_str_array_add (&(job->env), job, NULL, "BAR=wobble")); env1 = job->env; TEST_FREE_TAG (env1); assert (nih_str_array_add (&(job->start_env), job, NULL, "FOO=tea")); assert (nih_str_array_add (&(job->start_env), job, NULL, "BAR=coffee")); env2 = job->start_env; TEST_FREE_TAG (env2); event3 = event_new (NULL, "flibble", NULL); blocked1 = blocked_new (job, BLOCKED_EVENT, event3); event_block (blocked1->event); nih_list_add (&job->blocking, &blocked1->entry); TEST_FREE_TAG (blocked1); TEST_FREE_TAG (event3); event4 = event_new (NULL, "flobble", NULL); blocked2 = blocked_new (job, BLOCKED_EVENT, event4); event_block (blocked2->event); nih_list_add (&job->blocking, &blocked2->entry); TEST_FREE_TAG (blocked2); TEST_FREE_TAG (event4); } event_poll (); TEST_NOT_FREE (event1); TEST_NOT_FREE (event2); TEST_FREE (event3); TEST_FREE (event4); TEST_EQ (event1->blockers, 1); TEST_EQ (event2->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); ptr = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ_P (ptr, job); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_NOT_FREE (env1); TEST_EQ_P (job->env, env1); TEST_FREE (env2); TEST_NE_P (job->start_env, NULL); TEST_ALLOC_PARENT (job->start_env, job); TEST_ALLOC_SIZE (job->start_env, sizeof (char *) * 9); TEST_ALLOC_PARENT (job->start_env[0], job->start_env); TEST_EQ_STRN (job->start_env[0], "PATH="); TEST_ALLOC_PARENT (job->start_env[1], job->start_env); TEST_EQ_STRN (job->start_env[1], "TERM="); TEST_ALLOC_PARENT (job->start_env[2], job->start_env); TEST_EQ_STR (job->start_env[2], "FOO=BAR"); TEST_ALLOC_PARENT (job->start_env[3], job->start_env); TEST_EQ_STR (job->start_env[3], "BAR=BAZ"); TEST_ALLOC_PARENT (job->start_env[4], job->start_env); TEST_EQ_STR (job->start_env[4], "FRODO=brandybuck"); TEST_ALLOC_PARENT (job->start_env[5], job->start_env); TEST_EQ_STR (job->start_env[5], "BILBO=took"); TEST_ALLOC_PARENT (job->start_env[6], job->start_env); TEST_EQ_STR (job->start_env[6], "TEA=MILK"); TEST_ALLOC_PARENT (job->start_env[7], job->start_env); TEST_EQ_STR (job->start_env[7], "UPSTART_EVENTS=wibble wobble"); TEST_EQ_P (job->start_env[8], NULL); oper = class->start_on; TEST_EQ (oper->value, FALSE); oper = (EventOperator *)class->start_on->node.left; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); oper = (EventOperator *)class->start_on->node.right; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_FREE (blocked1); TEST_FREE (blocked2); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event1); nih_free (blocked); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event2); nih_free (blocked); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event1); nih_free (event2); } /* Check that a job that is already running is not affected by the * start events happening again. */ TEST_FEATURE ("with already running job"); event1 = event_new (NULL, "wibble", NULL); event2 = event_new (NULL, "wobble", NULL); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "FRODO=baggins")); assert (nih_str_array_add (&(event1->env), event1, NULL, "BILBO=took")); TEST_FREE_TAG (event1); event2 = event_new (NULL, "wobble", NULL); assert (nih_str_array_add (&(event2->env), event2, NULL, "FRODO=brandybuck")); assert (nih_str_array_add (&(event2->env), event2, NULL, "TEA=MILK")); TEST_FREE_TAG (event2); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; assert (nih_str_array_add (&(class->env), class, NULL, "FOO=BAR")); assert (nih_str_array_add (&(class->env), class, NULL, "BAR=BAZ")); class->start_on = event_operator_new ( class, EVENT_AND, NULL, NULL); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wibble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_LEFT); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wobble", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_RIGHT); nih_hash_add (job_classes, &class->entry); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; assert (nih_str_array_add (&(job->env), job, NULL, "FOO=wibble")); assert (nih_str_array_add (&(job->env), job, NULL, "BAR=wobble")); env1 = job->env; TEST_FREE_TAG (env1); assert (nih_str_array_add (&(job->start_env), job, NULL, "FOO=tea")); assert (nih_str_array_add (&(job->start_env), job, NULL, "BAR=coffee")); env2 = job->start_env; TEST_FREE_TAG (env2); event3 = event_new (NULL, "flibble", NULL); blocked1 = blocked_new (job, BLOCKED_EVENT, event3); event_block (blocked1->event); nih_list_add (&job->blocking, &blocked1->entry); TEST_FREE_TAG (blocked1); TEST_FREE_TAG (event3); event4 = event_new (NULL, "flobble", NULL); blocked2 = blocked_new (job, BLOCKED_EVENT, event4); event_block (blocked2->event); nih_list_add (&job->blocking, &blocked2->entry); TEST_FREE_TAG (blocked2); TEST_FREE_TAG (event4); } event_poll (); TEST_FREE (event1); TEST_FREE (event2); TEST_NOT_FREE (event3); TEST_NOT_FREE (event4); event_poll (); TEST_EQ (event3->blockers, 1); TEST_EQ (event4->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); ptr = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ_P (ptr, job); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_NOT_FREE (env1); TEST_EQ_P (job->env, env1); TEST_NOT_FREE (env2); TEST_EQ_P (job->start_env, env2); oper = class->start_on; TEST_EQ (oper->value, FALSE); oper = (EventOperator *)class->start_on->node.left; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); oper = (EventOperator *)class->start_on->node.right; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked1); TEST_NOT_FREE (blocked2); nih_free (blocked1); nih_free (blocked2); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event3); nih_free (event4); } /* Check that the class's instance name undergoes expansion against * the events, and is used to name the resulting job. */ TEST_FEATURE ("with instance name"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "FRODO=baggins")); assert (nih_str_array_add (&(event1->env), event1, NULL, "BILBO=took")); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->instance = "$FRODO"; class->task = TRUE; class->start_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_NOT_FREE (event1); TEST_EQ (event1->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, "baggins"); TEST_ALLOC_PARENT (job->name, job); TEST_EQ_STR (job->name, "baggins"); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_NE_P (job->env, NULL); TEST_ALLOC_PARENT (job->env, job); TEST_ALLOC_SIZE (job->env, sizeof (char *) * 6); TEST_ALLOC_PARENT (job->env[0], job->env); TEST_EQ_STRN (job->env[0], "PATH="); TEST_ALLOC_PARENT (job->env[1], job->env); TEST_EQ_STRN (job->env[1], "TERM="); TEST_ALLOC_PARENT (job->env[2], job->env); TEST_EQ_STR (job->env[2], "FRODO=baggins"); TEST_ALLOC_PARENT (job->env[3], job->env); TEST_EQ_STR (job->env[3], "BILBO=took"); TEST_ALLOC_PARENT (job->env[4], job->env); TEST_EQ_STR (job->env[4], "UPSTART_EVENTS=wibble"); TEST_EQ_P (job->env[5], NULL); TEST_EQ_P (job->start_env, NULL); oper = class->start_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event1); nih_free (blocked); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event1); } /* Check that if an instance with that name already exists, it is * restarted itself instead of a new one being created. */ TEST_FEATURE ("with restart of existing instance"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "FRODO=brandybuck")); assert (nih_str_array_add (&(event1->env), event1, NULL, "BILBO=took")); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->instance = "$FRODO"; class->task = TRUE; class->start_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); nih_hash_add (job_classes, &class->entry); job = job_new (class, "brandybuck"); job->goal = JOB_STOP; job->state = JOB_STOPPING; event3 = event_new (NULL, "flibble", NULL); blocked1 = blocked_new (job, BLOCKED_EVENT, event3); event_block (blocked1->event); nih_list_add (&job->blocking, &blocked1->entry); TEST_FREE_TAG (blocked1); TEST_FREE_TAG (event3); event4 = event_new (NULL, "flobble", NULL); blocked2 = blocked_new (job, BLOCKED_EVENT, event4); event_block (blocked2->event); nih_list_add (&job->blocking, &blocked2->entry); TEST_FREE_TAG (blocked2); TEST_FREE_TAG (event4); } event_poll (); TEST_NOT_FREE (event1); TEST_EQ (event1->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); ptr = (Job *)nih_hash_lookup (class->instances, "brandybuck"); TEST_EQ_P (ptr, job); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); oper = class->start_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_FREE (event3); TEST_FREE (event4); TEST_FREE (blocked1); TEST_FREE (blocked2); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event1); nih_free (blocked); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event1); } /* Check that errors with the instance name are caught and prevent * the job from being started. */ TEST_FEATURE ("with error in instance name"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "FRODO=baggins")); assert (nih_str_array_add (&(event1->env), event1, NULL, "BILBO=took")); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->instance = "$TIPPLE"; class->task = TRUE; class->start_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); nih_hash_add (job_classes, &class->entry); } TEST_DIVERT_STDERR (output) { event_poll (); } rewind (output); TEST_FREE (event1); TEST_HASH_EMPTY (class->instances); oper = class->start_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_FILE_EQ (output, ("test: Failed to obtain test instance: " "Unknown parameter: TIPPLE\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (class); } /* Check that an event that does not match the stop operator of * a job does not get blocked and passes straight through the * loop. */ TEST_FEATURE ("with non-matching event for stop"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "biscuit", NULL); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; class->stop_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_FREE (event1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); oper = job->stop_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); oper = class->stop_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); nih_free (class); } /* Check that a matching event is recorded against the operator that * matches it, but only affects the job if it completes the * expression. The name of the event should be added to the stop_env * member of the job, used for pre-stop later. */ TEST_FEATURE ("with matching event to stop"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; class->stop_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_NOT_FREE (event1); TEST_EQ (event1->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_STOP); TEST_GT (job->pid[PROCESS_POST_STOP], 0); waitpid (job->pid[PROCESS_POST_STOP], NULL, 0); TEST_NE_P (job->stop_env, NULL); TEST_ALLOC_PARENT (job->stop_env, job); TEST_ALLOC_SIZE (job->stop_env, sizeof (char *) * 2); TEST_ALLOC_PARENT (job->stop_env[0], job->stop_env); TEST_EQ_STR (job->stop_env[0], "UPSTART_STOP_EVENTS=wibble"); TEST_EQ_P (job->stop_env[1], NULL); oper = job->stop_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event1); nih_free (blocked); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event1); } /* Check that the environment variables from the event are also copied * into the job's stop_env member. */ TEST_FEATURE ("with environment in stop event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "FOO=foo")); assert (nih_str_array_add (&(event1->env), event1, NULL, "BAR=bar")); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; class->stop_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_NOT_FREE (event1); TEST_EQ (event1->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_STOP); TEST_GT (job->pid[PROCESS_POST_STOP], 0); waitpid (job->pid[PROCESS_POST_STOP], NULL, 0); TEST_NE_P (job->stop_env, NULL); TEST_ALLOC_PARENT (job->stop_env, job); TEST_ALLOC_SIZE (job->stop_env, sizeof (char *) * 4); TEST_ALLOC_PARENT (job->stop_env[0], job->stop_env); TEST_EQ_STR (job->stop_env[0], "FOO=foo"); TEST_ALLOC_PARENT (job->stop_env[1], job->stop_env); TEST_EQ_STR (job->stop_env[1], "BAR=bar"); TEST_ALLOC_PARENT (job->stop_env[2], job->stop_env); TEST_EQ_STR (job->stop_env[2], "UPSTART_STOP_EVENTS=wibble"); TEST_EQ_P (job->stop_env[3], NULL); oper = job->stop_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event1); nih_free (blocked); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event1); } /* Check that the event can resume stopping a job that's stopping * but previously was marked for restarting. */ TEST_FEATURE ("with stop of restarting job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "FOO=foo")); assert (nih_str_array_add (&(event1->env), event1, NULL, "BAR=bar")); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; class->stop_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; assert (nih_str_array_add (&(job->stop_env), job, NULL, "FOO=biscuit")); assert (nih_str_array_add (&(job->stop_env), job, NULL, "BAR=beer")); env1 = job->stop_env; TEST_FREE_TAG (env1); event3 = event_new (NULL, "flibble", NULL); blocked1 = blocked_new (job, BLOCKED_EVENT, event3); event_block (blocked1->event); nih_list_add (&job->blocking, &blocked1->entry); TEST_FREE_TAG (blocked1); TEST_FREE_TAG (event3); event4 = event_new (NULL, "flobble", NULL); blocked2 = blocked_new (job, BLOCKED_EVENT, event4); event_block (blocked2->event); nih_list_add (&job->blocking, &blocked2->entry); TEST_FREE_TAG (blocked2); TEST_FREE_TAG (event4); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_NOT_FREE (event1); TEST_EQ (event1->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_STOP); TEST_GT (job->pid[PROCESS_POST_STOP], 0); waitpid (job->pid[PROCESS_POST_STOP], NULL, 0); TEST_FREE (env1); TEST_NE_P (job->stop_env, NULL); TEST_ALLOC_PARENT (job->stop_env, job); TEST_ALLOC_SIZE (job->stop_env, sizeof (char *) * 4); TEST_ALLOC_PARENT (job->stop_env[0], job->stop_env); TEST_EQ_STR (job->stop_env[0], "FOO=foo"); TEST_ALLOC_PARENT (job->stop_env[1], job->stop_env); TEST_EQ_STR (job->stop_env[1], "BAR=bar"); TEST_ALLOC_PARENT (job->stop_env[2], job->stop_env); TEST_EQ_STR (job->stop_env[2], "UPSTART_STOP_EVENTS=wibble"); TEST_EQ_P (job->stop_env[3], NULL); oper = job->stop_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_FREE (event3); TEST_FREE (event4); TEST_FREE (blocked1); TEST_FREE (blocked2); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event1); nih_free (blocked); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event1); } /* Check that a job that is already stopping is not affected by the * stop events happening again. */ TEST_FEATURE ("with already stopping job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "FOO=foo")); assert (nih_str_array_add (&(event1->env), event1, NULL, "BAR=bar")); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; class->stop_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; assert (nih_str_array_add (&(job->stop_env), job, NULL, "FOO=biscuit")); assert (nih_str_array_add (&(job->stop_env), job, NULL, "BAR=beer")); env1 = job->stop_env; TEST_FREE_TAG (env1); event3 = event_new (NULL, "flibble", NULL); blocked1 = blocked_new (job, BLOCKED_EVENT, event3); event_block (blocked1->event); nih_list_add (&job->blocking, &blocked1->entry); TEST_FREE_TAG (blocked1); TEST_FREE_TAG (event3); event4 = event_new (NULL, "flobble", NULL); blocked2 = blocked_new (job, BLOCKED_EVENT, event4); event_block (blocked2->event); nih_list_add (&job->blocking, &blocked2->entry); TEST_FREE_TAG (blocked2); TEST_FREE_TAG (event4); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_FREE (event1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_NOT_FREE (env1); TEST_EQ_P (job->stop_env, env1); oper = job->stop_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_NOT_FREE (event3); TEST_NOT_FREE (event4); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked1); TEST_NOT_FREE (blocked2); nih_free (blocked1); nih_free (blocked2); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event3); nih_free (event4); } /* Check that the operator for the stop event can match against * environment variables expanded from the job's env member. */ TEST_FEATURE ("with environment expansion in stop event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event1 = event_new (NULL, "wibble", NULL); assert (nih_str_array_add (&(event1->env), event1, NULL, "SNITCH=GOLD")); assert (nih_str_array_add (&(event1->env), event1, NULL, "SEAKER=WIZARD")); TEST_FREE_TAG (event1); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->task = TRUE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; class->stop_on = event_operator_new ( class, EVENT_MATCH, "wibble", NULL); assert (nih_str_array_add (&(class->stop_on->env), class->stop_on, NULL, "SNITCH=$COLOUR")); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; assert (nih_str_array_add (&(job->env), job, NULL, "COLOUR=GOLD")); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_NOT_FREE (event1); TEST_EQ (event1->blockers, 1); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_STOP); TEST_GT (job->pid[PROCESS_POST_STOP], 0); waitpid (job->pid[PROCESS_POST_STOP], NULL, 0); TEST_NE_P (job->stop_env, NULL); TEST_ALLOC_PARENT (job->stop_env, job); TEST_ALLOC_SIZE (job->stop_env, sizeof (char *) * 4); TEST_ALLOC_PARENT (job->stop_env[0], job->stop_env); TEST_EQ_STR (job->stop_env[0], "SNITCH=GOLD"); TEST_ALLOC_PARENT (job->stop_env[1], job->stop_env); TEST_EQ_STR (job->stop_env[1], "SEAKER=WIZARD"); TEST_ALLOC_PARENT (job->stop_env[2], job->stop_env); TEST_EQ_STR (job->stop_env[2], "UPSTART_STOP_EVENTS=wibble"); TEST_EQ_P (job->stop_env[3], NULL); oper = job->stop_on; TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->event, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event1); nih_free (blocked); TEST_LIST_EMPTY (&job->blocking); nih_free (class); nih_free (event1); } fclose (output); } void test_finished (void) { JobClass *class = NULL; Job *job = NULL; Event *event = NULL, *bevent = NULL; Blocked *blocked = NULL; EventOperator *oper; TEST_FUNCTION ("event_finished"); /* Check that when a non-failed event is finished, a failed event * is not generated. */ TEST_FEATURE ("with non-failed event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "test", NULL); event->progress = EVENT_FINISHED; TEST_FREE_TAG (event); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class->process); class->process[PROCESS_MAIN]->command = "echo"; class->start_on = event_operator_new ( class, EVENT_MATCH, "test/failed", NULL); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_FREE (event); TEST_HASH_EMPTY (class->instances); nih_free (class); } /* Check that a failed event causes another event to be emitted * that has "/failed" appended on the end. We can obtain the * failed event by hooking a job on it, and using the * cause. */ TEST_FEATURE ("with failed event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "test", NULL); event->failed = TRUE; event->progress = EVENT_FINISHED; TEST_FREE_TAG (event); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class->process); class->process[PROCESS_MAIN]->command = "echo"; class->start_on = event_operator_new ( class, EVENT_MATCH, "test/failed", NULL); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_FREE (event); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_GT (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], NULL, 0); nih_free (class); } event_poll (); /* Check that failed events do not, themselves, emit new failed * events (otherwise we could be there all night :p) */ TEST_FEATURE ("with failed failed event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "test/failed", NULL); event->failed = TRUE; event->progress = EVENT_FINISHED; TEST_FREE_TAG (event); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class->process); class->process[PROCESS_MAIN]->command = "echo"; class->start_on = event_operator_new ( class, EVENT_OR, NULL, NULL); oper = event_operator_new (class, EVENT_MATCH, "test/failed", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_LEFT); oper = event_operator_new (class, EVENT_MATCH, "test/failed/failed", NULL); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_RIGHT); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_FREE (event); TEST_HASH_EMPTY (class->instances); nih_free (class); } /* Check that a finishing event has no effect on a stopping job * that is no longer blocked (shouldn't ever happen really, but * pays to check). */ TEST_FEATURE ("with non-blocked stopping job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "biscuit", NULL); TEST_FREE_TAG (event); class = job_class_new (NULL, "foo", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->blocker = NULL; nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ_P (job->blocker, NULL); TEST_FREE (event); nih_free (class); } /* Check that a finishing event has no effect on a starting job * that is no longer blocked (shouldn't ever happen really, but * pays to check). */ TEST_FEATURE ("with non-blocked starting job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "biscuit", NULL); TEST_FREE_TAG (event); class = job_class_new (NULL, "foo", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_STARTING; job->blocker = NULL; nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_EQ_P (job->blocker, NULL); TEST_FREE (event); nih_free (class); } /* Check that the wrong event does not unblock a stopping job. */ TEST_FEATURE ("with stopping job but wrong event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "biscuit", NULL); TEST_FREE_TAG (event); class = job_class_new (NULL, "foo", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; bevent = event_new (job, "wibble", NULL); blocked = blocked_new (bevent, BLOCKED_JOB, job); nih_list_add (&bevent->blocking, &blocked->entry); event_block (bevent); job->blocker = bevent; TEST_FREE_TAG (blocked); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ_P (job->blocker, bevent); TEST_NOT_FREE (blocked); TEST_EQ (bevent->blockers, 1); TEST_FREE (event); nih_free (class); } /* Check that the wrong event does not unblock a starting job. */ TEST_FEATURE ("with starting job but wrong event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "biscuit", NULL); TEST_FREE_TAG (event); class = job_class_new (NULL, "foo", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_STARTING; bevent = event_new (job, "wibble", NULL); blocked = blocked_new (bevent, BLOCKED_JOB, job); nih_list_add (&bevent->blocking, &blocked->entry); event_block (bevent); job->blocker = bevent; TEST_FREE_TAG (blocked); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_EQ_P (job->blocker, bevent); TEST_NOT_FREE (blocked); TEST_EQ (bevent->blockers, 1); TEST_FREE (event); nih_free (class); } /* Check that a matching event unblocks a stopping job and moves * it into the next state. */ TEST_FEATURE ("with stopping job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "wibble", NULL); TEST_FREE_TAG (event); class = job_class_new (NULL, "foo", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->pid[PROCESS_POST_STOP] = 0; job->blocker = event; blocked = blocked_new (event, BLOCKED_JOB, job); nih_list_add (&event->blocking, &blocked->entry); TEST_FREE_TAG (blocked); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_STOP); TEST_GT (job->pid[PROCESS_POST_STOP], 0); TEST_EQ_P (job->blocker, NULL); waitpid (job->pid[PROCESS_POST_STOP], NULL, 0); TEST_FREE (event); TEST_FREE (blocked); nih_free (class); } /* Check that a matching event unblocks a starting job and moves * it into the next state. */ TEST_FEATURE ("with starting job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { event = event_new (NULL, "wibble", NULL); TEST_FREE_TAG (event); class = job_class_new (NULL, "foo", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_PRE_START] = process_new (class); class->process[PROCESS_PRE_START]->command = "echo"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_STARTING; job->pid[PROCESS_PRE_START] = 0; job->blocker = event; blocked = blocked_new (event, BLOCKED_JOB, job); nih_list_add (&event->blocking, &blocked->entry); TEST_FREE_TAG (blocked); nih_hash_add (job_classes, &class->entry); } event_poll (); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_PRE_START); TEST_GT (job->pid[PROCESS_PRE_START], 0); TEST_EQ_P (job->blocker, NULL); waitpid (job->pid[PROCESS_PRE_START], NULL, 0); TEST_FREE (event); TEST_FREE (blocked); nih_free (class); } } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); job_class_environment_init (); test_new (); test_block (); test_unblock (); test_poll (); test_pending (); test_pending_handle_jobs (); test_finished (); return 0; } upstart-1.13.2/init/tests/test_log.c0000664000175000017500000010007412373101356014317 00000000000000/* upstart * * test_log.c - test suite for init/log.c * * Copyright © 2011 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "job.h" #include "test_util_common.h" /* * To help with understanding the TEST_ALLOC_FAIL peculiarities * below... * * log_new() calls __nih_*alloc() *seven* times: * * log_new * log = nih_new * nih_alloc * __nih_alloc # XXX: call 1 * log->path = nih_strndup * nih_alloc * __nih_alloc # XXX: call 2 * log->unflushed = nih_io_buffer_new * nih_new * nih_alloc * __nih_alloc # XXX: call 3 * log->io = nih_io_reopen * io = nih_new * __nih_alloc # XXX: call 4 * io->send_buf = nih_io_buffer_new * nih_new * __nih_alloc # XXX: call 5 * io->recv_buf = nih_io_buffer_new * nih_new * __nih_alloc # XXX: call 6 * io->watch = nih_io_add_watch * nih_new * __nih_alloc # XXX: call 7 * * (There is actually an 8th call to log_unflushed_init(), but we handle * that by calling log_unflushed_init() prior to any tests). * * XXX: Unfortunately, having created a log, we cannot intelligently test the * memory failure handling of the asynchronously called log_io_reader() due to the * underlying complexities of the way NIH re-allocs memory at particular * points. */ #define LOG_NEW_ALLOC_CALLS 7 void test_log_new (void) { Log *log; char path[] = "/foo"; char str[] = "hello, world!"; char str2[] = "The end?"; char filename[1024]; char dirname[1024]; char buffer[1024]; ssize_t ret; ssize_t bytes; struct stat statbuf; FILE *output; mode_t old_perms; off_t old_size; int pty_master; int pty_slave; TEST_FUNCTION ("log_new"); TEST_FILENAME (filename); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); /* XXX: * * It is *essential* we call these functions prior to any * TEST_ALLOC_FAIL blocks since TEST_ALLOC_FAIL tracks calls to * memory allocation routines and expects the function under * test to call said routines *the same number of times* on each * loop. NIH will attempt to initialise internal data * structures lazily so force it to not be lazy to avoid * surprises wrt number of malloc calls. */ nih_io_init (); nih_error_init (); log_unflushed_init (); /************************************************************/ TEST_FEATURE ("object checks with uid 0"); TEST_TRUE (NIH_LIST_EMPTY (log_unflushed_files)); TEST_ALLOC_FAIL { TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, path, pty_master, 0); /* Handle all alloc failures where the alloc calls were * initiated by log_new(). */ if (test_alloc_failed && (test_alloc_failed <= LOG_NEW_ALLOC_CALLS)) { TEST_EQ_P (log, NULL); close (pty_master); close (pty_slave); continue; } TEST_ALLOC_SIZE (log, sizeof(Log)); TEST_ALLOC_PARENT (log->io, log); TEST_ALLOC_SIZE (log->io, sizeof(NihIo)); TEST_ALLOC_PARENT (log->path, log); TEST_EQ_STR (log->path, path); TEST_EQ (log->io->watch->fd, pty_master); TEST_EQ (log->uid, 0); TEST_LT (log->fd, 0); TEST_NE (log_unflushed_files, NULL); TEST_TRUE (NIH_LIST_EMPTY (log_unflushed_files)); close (pty_slave); /* frees pty_master */ nih_free (log); log = NULL; } /************************************************************/ /* XXX: No support for logging of user job output currently */ TEST_FEATURE ("ensure logging disallowed for uid >0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, path, pty_master, 1); TEST_EQ (log, NULL); close (pty_master); close (pty_slave); /************************************************************/ TEST_FEATURE ("parent check"); TEST_ALLOC_FAIL { char *string = NULL; TEST_ALLOC_SAFE { string = NIH_MUST (nih_strdup (NULL, str)); } TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (string, path, pty_master, 0); if (test_alloc_failed && (test_alloc_failed <= LOG_NEW_ALLOC_CALLS)) { TEST_EQ_P (log, NULL); close (pty_master); close (pty_slave); nih_free (string); continue; } TEST_NE_P (log, NULL); TEST_ALLOC_PARENT (log, string); TEST_FREE_TAG (log); close (pty_slave); /* Freeing the parent should free the child */ nih_free (string); TEST_FREE (log); } /************************************************************/ TEST_FEATURE ("writing a new log file with uid 0"); TEST_ALLOC_FAIL { TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); TEST_LT (stat (filename, &statbuf), 0); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, filename, pty_master, 0); /* First time through at this point only log_new() has been called. * But by the end of the first loop, log_io_reader() will have * been called twice. */ if (_test_alloc_call == 0) TEST_EQ (_test_alloc_count, LOG_NEW_ALLOC_CALLS); /* Handle all alloc failures where the alloc calls were * initiated by log_new(). */ if (test_alloc_failed && (test_alloc_failed <= LOG_NEW_ALLOC_CALLS)) { TEST_EQ_P (log, NULL); close (pty_master); close (pty_slave); continue; } TEST_NE_P (log, NULL); ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); TEST_WATCH_UPDATE (); /* Now handle all alloc failures where the alloc calls were * initiated asynchronously by log_io_reader(). */ if (test_alloc_failed == 1+LOG_NEW_ALLOC_CALLS) { TEST_NE_P (log, NULL); close (pty_slave); TEST_TRUE (NIH_LIST_EMPTY (log_unflushed_files)); ret = log_handle_unflushed (NULL, log); TEST_EQ (ret, 1); TEST_TRUE (NIH_LIST_EMPTY (log_unflushed_files)); nih_free (log); TEST_EQ (unlink (filename), 0); continue; } close (pty_slave); TEST_WATCH_UPDATE (); ret = log_handle_unflushed (NULL, log); TEST_EQ (ret, 1); TEST_TRUE (NIH_LIST_EMPTY (log_unflushed_files)); nih_free (log); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); } /************************************************************/ TEST_FEATURE ("same logger appending to file with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); TEST_LT (stat (filename, &statbuf), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); old_size = statbuf.st_size; output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_END (output); fclose (output); ret = write (pty_slave, str2, strlen (str2)); TEST_GT (ret, 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_NE (statbuf.st_size, 0); TEST_EQ (statbuf.st_size, old_size + ret); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_EQ (output, str2); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); close (pty_slave); nih_free (log); /************************************************************/ TEST_FEATURE ("different logger appending to file with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); bytes = 0; ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); bytes += ret; ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); /* XXX: '+1' for '\r' */ bytes += (ret+1); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); old_size = statbuf.st_size; TEST_EQ (old_size, bytes); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_END (output); fclose (output); close (pty_slave); nih_free (log); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_EQ (statbuf.st_size, old_size); bytes = 0; ret = write (pty_slave, str2, strlen (str2)); TEST_GT (ret, 0); bytes += ret; ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); /* '+1' for '\r' */ bytes += (1+ret); TEST_WATCH_UPDATE (); close (pty_slave); nih_free (log); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_EQ (statbuf.st_size, old_size + bytes); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_EQ (output, "The end?\r\n"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("ensure logging resumes when file made accessible with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); /* Save */ old_perms = statbuf.st_mode; old_size = statbuf.st_size; output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_END (output); fclose (output); /* Make file inaccessible */ TEST_EQ (chmod (filename, 0x0), 0); /* Send more data to logger */ ret = write (pty_slave, str2, strlen (str2)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); /* File shouldn't have changed */ TEST_EQ (stat (filename, &statbuf), 0); TEST_EQ (statbuf.st_size, old_size); /* Restore access */ TEST_EQ (chmod (filename, old_perms), 0); /* Further data should cause previous data that could not be * written to be flushed to the file. */ ret = write (pty_slave, "foo\n", 4); TEST_EQ (ret, 4); TEST_WATCH_UPDATE (); close (pty_slave); nih_free (log); TEST_EQ (stat (filename, &statbuf), 0); TEST_GT (statbuf.st_size, old_size); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* Re-check entire file contents */ TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_EQ (output, "The end?\r\n"); TEST_FILE_EQ (output, "foo\r\n"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("ensure logger flushes cached data on request"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); TEST_NE (log_unflushed_files, NULL); TEST_TRUE (NIH_LIST_EMPTY (log_unflushed_files)); TEST_EQ (stat (dirname, &statbuf), 0); /* Save */ old_perms = statbuf.st_mode; /* Make file inaccessible */ TEST_EQ (chmod (dirname, 0x0), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); close (pty_slave); TEST_WATCH_UPDATE (); /* Ensure no log file written */ TEST_LT (stat (filename, &statbuf), 0); TEST_TRUE (NIH_LIST_EMPTY (log_unflushed_files)); TEST_FREE_TAG (log); TEST_EQ (log_handle_unflushed (NULL, log), 0); TEST_FALSE (NIH_LIST_EMPTY (log_unflushed_files)); /* Again, ensure no log file written */ TEST_LT (stat (filename, &statbuf), 0); TEST_EQ (log_clear_unflushed (), -1); /* Restore access */ TEST_EQ (chmod (dirname, old_perms), 0); /* Force flush */ TEST_EQ (log_clear_unflushed (), 0); TEST_TRUE (NIH_LIST_EMPTY (log_unflushed_files)); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); TEST_FREE (log); /************************************************************/ TEST_FEATURE ("ensure logger flushes when destroyed with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); TEST_EQ (rmdir (dirname), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); TEST_WATCH_UPDATE (); old_perms = umask (0); TEST_EQ (mkdir (dirname, 0755), 0); umask (old_perms); /* No more data sent to ensure logger writes it on log destroy */ close (pty_slave); nih_free (log); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("ensure log written when directory created accessible with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); TEST_EQ (rmdir (dirname), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); old_perms = umask (0); TEST_EQ (mkdir (dirname, 0755), 0); umask (old_perms); /* Send more data */ ret = write (pty_slave, str2, strlen (str2)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); close (pty_slave); ret = log_handle_unflushed (NULL, log); TEST_EQ (ret, 1); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_EQ (output, "The end?\r\n"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("ensure remainder of log written when file deleted with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); TEST_WATCH_UPDATE (); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_EQ (fstat (log->fd, &statbuf), 0); TEST_FILE_EQ (output, "hello, world!\r\n"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); TEST_EQ (fstat (log->fd, &statbuf), 0); /* Send more data */ ret = write (pty_slave, str2, strlen (str2)); TEST_GT (ret, 0); ret = write (pty_slave, "\n", 1); TEST_EQ (ret, 1); TEST_WATCH_UPDATE (); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_FILE_EQ (output, "The end?\r\n"); TEST_FILE_END (output); fclose (output); close (pty_slave); nih_free (log); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("writing 1 null with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); TEST_LT (stat (filename, &statbuf), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, "\000", 1); TEST_EQ (ret, 1); TEST_WATCH_UPDATE (); close (pty_slave); nih_free (log); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_EQ (statbuf.st_size, 1); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, ""); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("writing >1 null with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); TEST_LT (stat (filename, &statbuf), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, "\000\000\000", 3); TEST_EQ (ret, 3); TEST_WATCH_UPDATE (); close (pty_slave); nih_free (log); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_EQ (statbuf.st_size, 3); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "\000\000\000"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("writing 1 non-printable only with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); TEST_LT (stat (filename, &statbuf), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, " ", 1); TEST_EQ (ret, 1); TEST_WATCH_UPDATE (); close (pty_slave); nih_free (log); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_EQ (statbuf.st_size, 1); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, " "); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("writing >1 non-printable only with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); TEST_LT (stat (filename, &statbuf), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, "\n \t", 3); TEST_EQ (ret, 3); TEST_WATCH_UPDATE (); close (pty_slave); nih_free (log); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); /* '\r', '\n', ' ', '\t' */ TEST_EQ (statbuf.st_size, 4); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_EQ (fread (buffer, 1, 4, output), 4); TEST_EQ (buffer[0], '\r'); TEST_EQ (buffer[1], '\n'); TEST_EQ (buffer[2], ' '); TEST_EQ (buffer[3], '\t'); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("with very long relative path and uid 0"); { int len = 0; /* Recall that PATH_MAX includes the terminating null * and refers to a _relative path_. */ char long_path[PATH_MAX]; len = sprintf (long_path, "%s", "../tmp/"); TEST_GT (len, 0); long_path[sizeof(long_path)-1] = '\0'; memset (long_path+len, 'J', sizeof(long_path)-len-1); nih_debug("long_path='%s'", long_path); pty_master = -1; pty_slave = -1; TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, long_path, pty_master, 0); TEST_NE_P (log, NULL); close (pty_slave); pty_slave = -1; nih_free (log); } /************************************************************/ TEST_FEATURE ("with overly long relative path and uid 0"); { int len = 0; /* Recall that PATH_MAX includes the terminating null * and refers to a _relative path_. */ char illegal_path[PATH_MAX+1]; len = sprintf (illegal_path, "%s", "../tmp/"); TEST_GT (len, 0); illegal_path[sizeof(illegal_path)-1] = '\0'; memset (illegal_path+len, 'z', sizeof(illegal_path)-len-1); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, illegal_path, pty_master, 0); TEST_EQ_P (log, NULL); close (pty_master); close (pty_slave); } /************************************************************/ TEST_FEATURE ("with very long absolute path and uid 0"); { int len = 0; char long_path[_POSIX_PATH_MAX]; len = sprintf (long_path, "%s", "/tmp/"); TEST_GT (len, 0); long_path[sizeof(long_path)-1] = '\0'; memset (long_path+len, 'J', sizeof(long_path)-len-1); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, long_path, pty_master, 0); TEST_NE_P (log, NULL); close (pty_slave); nih_free (log); } /************************************************************/ TEST_FEATURE ("with overly long absolute path and uid 0"); { int len = 0; char illegal_path[_POSIX_PATH_MAX+1]; len = sprintf (illegal_path, "%s", "/tmp/"); TEST_GT (len, 0); illegal_path[sizeof(illegal_path)-1] = '\0'; memset (illegal_path+len, 'z', sizeof(illegal_path)-len-1); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, illegal_path, pty_master, 0); TEST_EQ_P (log, NULL); close (pty_master); close (pty_slave); } /************************************************************/ /* Tidy up */ TEST_EQ (rmdir (dirname), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); } void test_log_destroy (void) { Log *log; int ret; int flags; char str[] = "hello, world!"; int pty_master; int pty_slave; int found_fd; char filename[1024]; int fd; TEST_FUNCTION ("log_destroy"); /************************************************************/ TEST_FEATURE ("ensure log fd closed with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); flags = fcntl (pty_master, F_GETFL); TEST_NE (flags, -1); log = log_new (NULL, "/foo", pty_master, 0); TEST_NE_P (log, NULL); close (pty_slave); nih_free (log); flags = fcntl (pty_master, F_GETFL); TEST_EQ (flags, -1); TEST_EQ (errno, EBADF); /************************************************************/ TEST_FEATURE ("ensure path and io elements freed with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, "/bar", pty_master, 0); TEST_NE_P (log, NULL); TEST_FREE_TAG (log->path); TEST_FREE_TAG (log->io); close (pty_slave); nih_free (log); TEST_FREE (log->path); TEST_FREE (log->io); /************************************************************/ TEST_FEATURE ("ensure unflushed data freed with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); TEST_FILENAME (filename); /* Make file inaccessible to ensure data cannot be written * and will thus be added to the unflushed buffer. */ fd = open (filename, O_CREAT | O_EXCL, 0); TEST_NE (fd, -1); close (fd); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); TEST_WATCH_UPDATE (); TEST_NE_P (log->unflushed, NULL); TEST_EQ (log->unflushed->len, strlen(str)); TEST_EQ_STR (log->unflushed->buf, str); TEST_FREE_TAG (log->unflushed); close (pty_slave); nih_free (log); TEST_FREE (log->unflushed); /************************************************************/ TEST_FEATURE ("ensure watch freed when log destroyed"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); found_fd = 0; NIH_LIST_FOREACH (nih_io_watches, iter) { NihIoWatch *watch = (NihIoWatch *)iter; if (watch->fd == pty_master) { found_fd = pty_master; break; } } /* fd passed to log_new() should have resulted in a watch being * created. */ TEST_EQ (found_fd, pty_master); ret = write (pty_slave, str, strlen (str)); TEST_GT (ret, 0); TEST_WATCH_UPDATE (); TEST_NE_P (log->unflushed, NULL); TEST_EQ (log->unflushed->len, strlen(str)); TEST_EQ_STR (log->unflushed->buf, str); TEST_FREE_TAG (log->unflushed); close (pty_slave); nih_free (log); found_fd = 0; NIH_LIST_FOREACH (nih_io_watches, iter) { NihIoWatch *watch = (NihIoWatch *)iter; if (watch->fd == pty_master) { found_fd = pty_master; break; } } TEST_EQ (unlink (filename), 0); /* Freeing the log object should have removed the watch */ TEST_EQ (found_fd, 0); TEST_FREE (log->unflushed); } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_log_new (); test_log_destroy (); return 0; } upstart-1.13.2/init/tests/test_conf.c0000664000175000017500000036731012373101356014473 00000000000000/* upstart * * test_conf.c - test suite for init/conf.c * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "job_class.h" #include "job.h" #include "conf.h" #include "event.h" #include "job_process.h" #include "blocked.h" #include "test_util.h" #include "test_util_common.h" /** * JOB_STOP_SECONDS: * * Number of attempts to make to check that job has stopped. **/ #define JOB_STOP_ATTEMPTS 10 void test_source_new (void) { ConfSource *source; conf_init (); /* Check that we can request a new ConfSource structure, it should be * allocated with nih_alloc and placed into the conf_sources list. */ TEST_FUNCTION ("conf_source_new"); TEST_ALLOC_FAIL { source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); if (test_alloc_failed) { TEST_EQ_P (source, NULL); continue; } TEST_ALLOC_SIZE (source, sizeof (ConfSource)); TEST_LIST_NOT_EMPTY (&source->entry); TEST_ALLOC_PARENT (source->path, source); TEST_EQ_STR (source->path, "/tmp"); TEST_EQ (source->type, CONF_JOB_DIR); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, FALSE); TEST_NE_P (source->files, NULL); nih_free (source); } } void test_file_new (void) { ConfSource *source; ConfFile *file; /* Check that we can request a new ConfFile structure, it should be * allocated with nih_alloc and placed into the files hash table of * the source, with the flag copied. */ TEST_FUNCTION ("conf_file_new"); source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); TEST_ALLOC_FAIL { file = conf_file_new (source, "/tmp/foo"); if (test_alloc_failed) { TEST_EQ_P (file, NULL); continue; } TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_LIST_NOT_EMPTY (&file->entry); TEST_EQ_P (file->source, source); TEST_ALLOC_PARENT (file->path, file); TEST_EQ_STR (file->path, "/tmp/foo"); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); TEST_EQ_P ((void *)nih_hash_lookup (source->files, "/tmp/foo"), file); nih_free (file); } nih_free (source); } void test_source_reload_job_dir (void) { ConfSource *source; ConfFile *file, *old_file; JobClass *job, *old_job; Job *instance; FILE *f; int ret, fd, nfds; char dirname[PATH_MAX]; char tmpname[PATH_MAX], filename[PATH_MAX]; fd_set readfds, writefds, exceptfds; NihError *err; TEST_FUNCTION_FEATURE ("conf_source_reload", "with job directory"); program_name = "test"; nih_log_set_priority (NIH_LOG_FATAL); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "exec /sbin/daemon\n"); fprintf (f, "respawn\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/bar.conf"); f = fopen (filename, "w"); fprintf (f, "script\n"); fprintf (f, " echo\n"); fprintf (f, "end script\n"); fclose (f); /* FIXME sub-directories are broken */ strcpy (filename, dirname); strcat (filename, "/frodo"); mkdir (filename, 0755); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); f = fopen (filename, "w"); fprintf (f, "exec /bin/tool\n"); fclose (f); /* Make sure that we have inotify before performing some tests... */ if ((fd = inotify_init ()) < 0) { printf ("SKIP: inotify not available\n"); goto no_inotify; } close (fd); /* Check that we can load a job directory source for the first time. * An inotify watch should be established on the directory, the * descriptor set to be closed-on-exec, and all entries in the * directory parsed. */ TEST_FEATURE ("with new job directory"); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_ALLOC_SIZE (source->watch, sizeof (NihWatch)); TEST_EQ_STR (source->watch->path, dirname); TEST_EQ_P (source->watch->data, source); TEST_TRUE (fcntl (source->watch->fd, F_GETFD) & FD_CLOEXEC); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (file->job, job); TEST_TRUE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/sbin/daemon"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "echo\n"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job , NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/foo"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/bin/tool"); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that if we create a new file in the directory, using the * direct writing technique, it will be automatically parsed and * loaded. */ TEST_FEATURE ("with new file in directory (direct write)"); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); f = fopen (filename, "w"); fprintf (f, "respawn\n"); fprintf (f, "script\n"); fprintf (f, " echo\n"); fprintf (f, "end script\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_EQ_P (file->job, job); TEST_TRUE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "echo\n"); TEST_EQ (job->deleted, FALSE); old_file = file; old_job = job; /* Check that a file in the directory we're watching can be modified * using the direct writing technique; it should be parsed and the * previous job marked for deletion. */ TEST_FEATURE ("with modified job (direct write)"); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); f = fopen (filename, "w"); fprintf (f, "respawn\n"); fprintf (f, "script\n"); fprintf (f, " sleep 5\n"); fprintf (f, "end script\n"); fclose (f); TEST_FREE_TAG (old_file); TEST_FREE_TAG (old_job); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); TEST_FREE (old_job); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_EQ_P (file->job, job); TEST_TRUE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "sleep 5\n"); TEST_EQ (job->deleted, FALSE); old_file = file; old_job = job; /* Check that a file in the directory we're watching can be modified * using the write and then rename technique; it should be parsed and * the previous job marked for deletion. */ TEST_FEATURE ("with modified job (atomic rename)"); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); strcpy (tmpname, dirname); strcat (tmpname, "/frodo/.bar.conf.swp"); f = fopen (tmpname, "w"); fprintf (f, "respawn\n"); fprintf (f, "script\n"); fprintf (f, " sleep 15\n"); fprintf (f, "end script\n"); fclose (f); rename (tmpname, filename); TEST_FREE_TAG (old_file); TEST_FREE_TAG (old_job); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); TEST_FREE (old_job); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_EQ_P (file->job, job); TEST_TRUE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "sleep 15\n"); TEST_EQ (job->deleted, FALSE); old_file = file; old_job = job; /* Check that we can delete a file from the directory, the metadata * for it should be lost and the job should be immediately freed * since it is not running. */ TEST_FEATURE ("with deleted job"); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); unlink (filename); TEST_FREE_TAG (old_file); TEST_FREE_TAG (old_job); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); TEST_FREE (old_job); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_EQ_P (job, NULL); /* Check that if a running job is modified, it is not immediately * replaced, and is instead marked as deleted with the new job in * the sources list ready for action. */ TEST_FEATURE ("with modification to running job"); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); f = fopen (filename, "w"); fprintf (f, "respawn\n"); fprintf (f, "script\n"); fprintf (f, " sleep 5\n"); fprintf (f, "end script\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_NE_P (job, NULL); instance = job_new (job, ""); instance->goal = JOB_START; instance->state = JOB_RUNNING; old_job = job; f = fopen (filename, "w"); fprintf (f, "respawn\n"); fprintf (f, "script\n"); fprintf (f, " sleep 15\n"); fprintf (f, "end script\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_EQ_P (job, old_job); TEST_NE_P (job, file->job); TEST_TRUE (file->job->respawn); TEST_NE_P (file->job->process[PROCESS_MAIN], NULL); TEST_EQ (file->job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (file->job->process[PROCESS_MAIN]->command, "sleep 15\n"); TEST_FALSE (file->job->deleted); TEST_TRUE (job->deleted); TEST_HASH_NOT_EMPTY (job->instances); instance = (Job *)nih_hash_lookup (job->instances, ""); TEST_EQ (instance->goal, JOB_START); TEST_EQ (instance->state, JOB_RUNNING); old_file = file; old_job = file->job; /* Check that if we modify a job that is a replacement for a running * job, the replacement is freed immediately and the new replacement * is kept instead. */ TEST_FEATURE ("with modification to replacement for running job"); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); f = fopen (filename, "w"); fprintf (f, "respawn\n"); fprintf (f, "script\n"); fprintf (f, " sleep 10\n"); fprintf (f, "end script\n"); fclose (f); TEST_FREE_TAG (old_file); TEST_FREE_TAG (old_job); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); TEST_FREE (old_job); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_NE_P (job, file->job); TEST_TRUE (file->job->respawn); TEST_NE_P (file->job->process[PROCESS_MAIN], NULL); TEST_EQ (file->job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (file->job->process[PROCESS_MAIN]->command, "sleep 10\n"); TEST_FALSE (file->job->deleted); TEST_TRUE (job->deleted); TEST_HASH_NOT_EMPTY (job->instances); instance = (Job *)nih_hash_lookup (job->instances, ""); TEST_EQ (instance->goal, JOB_START); TEST_EQ (instance->state, JOB_RUNNING); old_file = file; old_job = file->job; /* Check that if we delete a job that is a replacement for a running * job, the replacement is lost and there is no replacement for the * running job anymore. */ TEST_FEATURE ("with deletion of replacement for running job"); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); unlink (filename); TEST_FREE_TAG (old_file); TEST_FREE_TAG (old_job); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_FREE (old_job); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_NE_P (job, NULL); TEST_TRUE (job->deleted); TEST_HASH_NOT_EMPTY (job->instances); instance = (Job *)nih_hash_lookup (job->instances, ""); TEST_EQ (instance->goal, JOB_START); TEST_EQ (instance->state, JOB_RUNNING); nih_free (job); /* Check that if a running job is deleted, it is not immediately * freed, and instead is marked to be when stopped. */ TEST_FEATURE ("with deletion of running job"); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); f = fopen (filename, "w"); fprintf (f, "respawn\n"); fprintf (f, "script\n"); fprintf (f, " sleep 5\n"); fprintf (f, "end script\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_NE_P (job, NULL); instance = job_new (job, ""); instance->goal = JOB_START; instance->state = JOB_RUNNING; old_job = job; unlink (filename); TEST_FREE_TAG (old_job); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_NOT_FREE (old_job); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_EQ_P (job, old_job); TEST_TRUE (job->deleted); TEST_HASH_NOT_EMPTY (job->instances); instance = (Job *)nih_hash_lookup (job->instances, ""); TEST_EQ (instance->goal, JOB_START); TEST_EQ (instance->state, JOB_RUNNING); nih_free (job); /* Check that a physical error when re-parsing a job is caught * and the file is lost. */ TEST_FEATURE ("with error after modification of job"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0200); f = fopen (filename, "w"); fprintf (f, "exec /bin/tool\n"); fprintf (f, "respawn\n"); fclose (f); old_job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_FREE_TAG (old_job); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_FREE (old_job); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0644); /* Check that a parse error when re-parsing a job is caught * and the file lost. */ TEST_FEATURE ("with parse error after modification of job"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "exec /bin/tool\n"); fprintf (f, "respawn\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); old_file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_FREE_TAG (old_file); old_job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_FREE_TAG (old_job); f = fopen (filename, "w"); fprintf (f, "respin\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->job, NULL); TEST_FREE (old_job); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); strcpy (filename, dirname); strcat (filename, "/foo.conf"); nih_free (source); /* Check that a physical error parsing a file initially is caught, * and doesn't affect later jobs. */ TEST_FEATURE ("with error parsing job"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0000); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_ALLOC_SIZE (source->watch, sizeof (NihWatch)); TEST_EQ_STR (source->watch->path, dirname); TEST_EQ_P (source->watch->data, source); TEST_TRUE (fcntl (source->watch->fd, F_GETFD) & FD_CLOEXEC); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "echo\n"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/foo"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/bin/tool"); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0644); /* Check that a parsing error with a file is ignored and doesn't * affect later jobs. */ TEST_FEATURE ("with job parse error"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "respin\n"); fclose (f); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_ALLOC_SIZE (source->watch, sizeof (NihWatch)); TEST_EQ_STR (source->watch->path, dirname); TEST_EQ_P (source->watch->data, source); TEST_TRUE (fcntl (source->watch->fd, F_GETFD) & FD_CLOEXEC); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->job, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "echo\n"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/foo"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/bin/tool"); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we catch errors attempting to watch and walk a * directory that doesn't exist. */ TEST_FEATURE ("with non-existant directory"); strcpy (filename, dirname); strcat (filename, "/wibble"); source = conf_source_new (NULL, filename, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOENT); nih_free (err); TEST_EQ_P (source->watch, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we can catch the deletion of the top-level directory, * which results in the files and directories themselves being * deleted and the watch being removed from the source structure. */ TEST_FEATURE ("with deletion of top-level directory"); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/frodo"); rmdir (filename); strcpy (filename, dirname); strcat (filename, "/bar.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/foo.conf"); unlink (filename); rmdir (dirname); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_EQ_P (source->watch, NULL); TEST_HASH_EMPTY (source->files); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/foo"); TEST_EQ_P (job, NULL); nih_free (source); /* Check that a file without the ".conf" extension is ignored. */ TEST_FEATURE ("without .conf extension only"); TEST_FILENAME (dirname); mkdir (dirname, 0755); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_HASH_EMPTY (source->files); TEST_HASH_EMPTY (job_classes); strcpy (filename, dirname); strcat (filename, "/munchkin"); f = fopen (filename, "w"); fprintf (f, "exec echo\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_HASH_EMPTY (source->files); TEST_HASH_EMPTY (job_classes); nih_free (source); unlink (filename); rmdir (dirname); /* Check that a file named just ".conf" is ignored. */ TEST_FEATURE ("with literal .conf file"); TEST_FILENAME (dirname); mkdir (dirname, 0755); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_HASH_EMPTY (source->files); TEST_HASH_EMPTY (job_classes); strcpy (filename, dirname); strcat (filename, "/.conf"); f = fopen (filename, "w"); fprintf (f, "exec echo\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_HASH_EMPTY (source->files); TEST_HASH_EMPTY (job_classes); nih_free (source); unlink (filename); rmdir (dirname); no_inotify: /* Disable inotify for the following tests */ assert0 (putenv ("INOTIFY_DISABLE=1")); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "exec /sbin/daemon\n"); fprintf (f, "respawn\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/bar.conf"); f = fopen (filename, "w"); fprintf (f, "script\n"); fprintf (f, " echo\n"); fprintf (f, "end script\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/frodo"); mkdir (filename, 0755); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); f = fopen (filename, "w"); fprintf (f, "exec /bin/tool\n"); fclose (f); /* Check that we can load a job directory source for the first time. * Even though we don't have inotify, all entries in the directory * should still be parsed. */ TEST_FEATURE ("with new job directory but no inotify"); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (file->job, job); TEST_TRUE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/sbin/daemon"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "echo\n"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/foo"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/bin/tool"); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we can perform a mandatory reload of the directory, * having made some changes in between. Entries that were added * should be parsed into the tree, and entries that were deleted * should have been lost. */ TEST_FEATURE ("with reload of job directory"); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "exec /sbin/daemon --foo\n"); fprintf (f, "respawn\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); f = fopen (filename, "w"); fprintf (f, "exec /bin/tool --foo\n"); fclose (f); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, FALSE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (file->job, job); TEST_TRUE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/sbin/daemon --foo"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "echo\n"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/foo"); TEST_EQ_P (job, NULL); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/bin/tool --foo"); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that a physical error parsing a file initially is caught, * and doesn't affect later jobs. */ TEST_FEATURE ("with error parsing job without inotify"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0000); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "echo\n"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/bin/tool --foo"); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0644); /* Check that a parse error is ignored and doesn't affect later jobs. * The file item should remain. */ TEST_FEATURE ("with job parse error without inotify"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "respin\n"); fclose (f); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, TRUE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "echo\n"); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_NE_P (file->job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/bar"); TEST_EQ_P (file->job, job); TEST_FALSE (job->respawn); TEST_NE_P (job->process[PROCESS_MAIN], NULL); TEST_EQ (job->process[PROCESS_MAIN]->script, FALSE); TEST_EQ_STR (job->process[PROCESS_MAIN]->command, "/bin/tool --foo"); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we catch errors attempting to walk a directory that * doesn't exist. */ TEST_FEATURE ("with non-existant directory and no inotify"); strcpy (filename, dirname); strcat (filename, "/wibble"); source = conf_source_new (NULL, filename, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOENT); nih_free (err); TEST_EQ_P (source->watch, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that if we mandatory reload a non-existant directory, all * files, items and jobs are deleted. */ TEST_FEATURE ("with reload of deleted directory"); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/frodo"); rmdir (filename); strcpy (filename, dirname); strcat (filename, "/bar.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/foo.conf"); unlink (filename); rmdir (dirname); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOENT); nih_free (err); TEST_EQ_P (source->watch, NULL); TEST_HASH_EMPTY (source->files); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ (job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ (job, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "frodo/foo"); TEST_EQ (job, NULL); nih_free (source); /* Check that a file without the ".conf" extension is ignored * when it exists at reload time. */ TEST_FEATURE ("without .conf extension only"); TEST_FILENAME (dirname); mkdir (dirname, 0755); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_HASH_EMPTY (source->files); TEST_HASH_EMPTY (job_classes); strcpy (filename, dirname); strcat (filename, "/munchkin"); f = fopen (filename, "w"); fprintf (f, "exec echo\n"); fclose (f); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_HASH_EMPTY (source->files); TEST_HASH_EMPTY (job_classes); nih_free (source); unlink (filename); rmdir (dirname); /* Check that a file named just ".conf" is ignored when it exists * at reload time. */ TEST_FEATURE ("with literal .conf file"); TEST_FILENAME (dirname); mkdir (dirname, 0755); source = conf_source_new (NULL, dirname, CONF_JOB_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_HASH_EMPTY (source->files); TEST_HASH_EMPTY (job_classes); strcpy (filename, dirname); strcat (filename, "/.conf"); f = fopen (filename, "w"); fprintf (f, "exec echo\n"); fclose (f); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_HASH_EMPTY (source->files); TEST_HASH_EMPTY (job_classes); nih_free (source); unlink (filename); rmdir (dirname); nih_log_set_priority (NIH_LOG_MESSAGE); /* Re-enable inotify */ assert0 (unsetenv ("INOTIFY_DISABLE")); } void test_source_reload_conf_dir (void) { ConfSource *source; ConfFile *file, *old_file; FILE *f; int ret, fd, nfds; char dirname[PATH_MAX]; char filename[PATH_MAX]; fd_set readfds, writefds, exceptfds; NihError *err; TEST_FUNCTION_FEATURE ("conf_source_reload", "with config directory"); program_name = "test"; nih_log_set_priority (NIH_LOG_FATAL); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/bar.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/frodo"); mkdir (filename, 0755); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); /* Make sure that we have inotify before performing some tests... */ if ((fd = inotify_init ()) < 0) { printf ("SKIP: inotify not available\n"); goto no_inotify; } close (fd); /* Check that we can load a conf directory source for the first time. * An inotify watch should be established on the directory, the * descriptor set to be closed-on-exec, and all entries in the * directory parsed. */ TEST_FEATURE ("with new conf directory"); source = conf_source_new (NULL, dirname, CONF_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_ALLOC_SIZE (source->watch, sizeof (NihWatch)); TEST_EQ_STR (source->watch->path, dirname); TEST_EQ_P (source->watch->data, source); TEST_TRUE (fcntl (source->watch->fd, F_GETFD) & FD_CLOEXEC); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that if we create a new file in the directory, it will * be automatically parsed and loaded. */ TEST_FEATURE ("with new file in directory"); source = conf_source_new (NULL, dirname, CONF_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); old_file = file; /* Check that a file in the directory we're watching can be modified; * it should be parsed and the previous items marked for deletion. */ TEST_FEATURE ("with modified file in directory"); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); f = fopen (filename, "w"); fprintf (f, "#still nothing to test\n"); fclose (f); TEST_FREE_TAG (old_file); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); old_file = file; /* Check that we can delete a file from the directory, the metadata * for it should be lost and the items should be queued for deletion. */ TEST_FEATURE ("with deleted file"); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); unlink (filename); TEST_FREE_TAG (old_file); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); /* Check that a physical error when re-parsing a file is caught, * and that the file is lost. */ TEST_FEATURE ("with error after modification of file"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); old_file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_FREE_TAG (old_file); chmod (filename, 0200); f = fopen (filename, "w"); fprintf (f, "#still nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); chmod (filename, 0644); /* Check that a parse error when re-parsing a file is caught, * and that the file is lost. */ TEST_FEATURE ("with parse error after modification of file"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); old_file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_FREE_TAG (old_file); f = fopen (filename, "w"); fprintf (f, "oops\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); nih_free (source); /* Check that a physical error parsing a file initially is caught, * and doesn't affect later files. */ TEST_FEATURE ("with error parsing file"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0000); source = conf_source_new (NULL, dirname, CONF_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_ALLOC_SIZE (source->watch, sizeof (NihWatch)); TEST_EQ_STR (source->watch->path, dirname); TEST_EQ_P (source->watch->data, source); TEST_TRUE (fcntl (source->watch->fd, F_GETFD) & FD_CLOEXEC); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0644); /* Check that we catch errors attempting to watch and walk a * directory that doesn't exist. */ TEST_FEATURE ("with non-existant directory"); strcpy (filename, dirname); strcat (filename, "/wibble"); source = conf_source_new (NULL, filename, CONF_DIR); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOENT); nih_free (err); TEST_EQ_P (source->watch, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we can catch the deletion of the top-level directory, * which results in the files and directories themselves being * deleted and the watch being removed from the source structure. */ TEST_FEATURE ("with deletion of top-level directory"); source = conf_source_new (NULL, dirname, CONF_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/frodo"); rmdir (filename); strcpy (filename, dirname); strcat (filename, "/bar.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/foo.conf"); unlink (filename); rmdir (dirname); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_EQ_P (source->watch, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); no_inotify: /* Disable inotify for the following tests */ assert0 (putenv ("INOTIFY_DISABLE=1")); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/bar.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/frodo"); mkdir (filename, 0755); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); /* Check that we can load a conf directory source for the first time. * Even though we don't have inotify, all entries in the directory * should still be parsed. */ TEST_FEATURE ("with new conf directory but no inotify"); source = conf_source_new (NULL, dirname, CONF_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we can perform a mandatory reload of the directory, * having made some changes in between. Entries that were added * should be parsed into the tree, and entries that were deleted * should have been lost. */ TEST_FEATURE ("with reload of conf directory"); source = conf_source_new (NULL, dirname, CONF_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, FALSE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that a physical error parsing a file initially is caught, * and doesn't affect later items. */ TEST_FEATURE ("with error parsing file without inotify"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0000); source = conf_source_new (NULL, dirname, CONF_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0644); /* Check that a parse error is ignored and doesn't affect later items. * The file item should remain. */ TEST_FEATURE ("with parse error without inotify"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "oops\n"); fclose (f); source = conf_source_new (NULL, dirname, CONF_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we catch errors attempting to walk a directory that * doesn't exist. */ TEST_FEATURE ("with non-existant directory and no inotify"); strcpy (filename, dirname); strcat (filename, "/wibble"); source = conf_source_new (NULL, filename, CONF_DIR); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOENT); nih_free (err); TEST_EQ_P (source->watch, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that if we mandatory reload a non-existant directory, all * files, items and jobs are deleted. */ TEST_FEATURE ("with reload of deleted directory"); source = conf_source_new (NULL, dirname, CONF_DIR); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/frodo/bar.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/frodo"); rmdir (filename); strcpy (filename, dirname); strcat (filename, "/bar.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/foo.conf"); unlink (filename); rmdir (dirname); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOENT); nih_free (err); TEST_EQ_P (source->watch, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); nih_log_set_priority (NIH_LOG_MESSAGE); /* Re-enable inotify */ assert0 (unsetenv ("INOTIFY_DISABLE")); } void test_override (void) { ConfSource *source; ConfFile *file; FILE *f; int ret, fd; char dirname[PATH_MAX]; char filename[PATH_MAX], override[PATH_MAX], override2[PATH_MAX]; char *dir; JobClass *job; NihError *err; program_name = "test"; nih_log_set_priority (NIH_LOG_FATAL); TEST_ENSURE_CLEAN_ENV (); TEST_GROUP ("override files"); /* Make sure that we have inotify before performing some tests... */ if ((fd = inotify_init ()) < 0) { printf ("SKIP: inotify not available\n"); goto no_inotify; } close (fd); /* Explicit test of behaviour prior to introduction of override files. * * conf with no override before watch: * create conf * create watch * ensure conf loaded * update conf * ensure conf updated * delete conf * ensure conf deleted */ TEST_FEATURE ("with pre-override environment (conf with no override before watch)"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create conf */ strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "emits hello\n"); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); /* ensure conf loaded */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_NE_P (job->start_on, NULL); /* update conf */ f = fopen (filename, "a"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf updated */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (job->start_on, NULL); /* delete conf */ unlink (filename); TEST_FORCE_WATCH_UPDATE(); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); TEST_HASH_EMPTY (job_classes); TEST_HASH_EMPTY (source->files); TEST_FORCE_WATCH_UPDATE(); /* ensure conf deleted */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); nih_free (source); TEST_EQ (rmdir (dirname), 0); /* Explicit test of behaviour prior to introduction of override files. * * conf with no override after watch: * create watch * create conf * ensure conf loaded * update conf * ensure conf updated * delete conf * ensure conf deleted */ TEST_ENSURE_CLEAN_ENV (); TEST_FEATURE ("with pre-override environment (conf with no override after watch)"); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); /* create conf */ strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "emits hello\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); /* update conf */ f = fopen (filename, "a"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf updated */ job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (job->start_on, NULL); /* delete conf */ unlink (filename); TEST_FORCE_WATCH_UPDATE(); /* ensure conf deleted */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); nih_free (source); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("ensure lone override ignored before watch"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create override */ strcpy (filename, dirname); strcat (filename, "/foo.override"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_FORCE_WATCH_UPDATE(); /* ensure no conf object created */ TEST_HASH_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); /* update override */ f = fopen (filename, "a"); TEST_NE_P (f, NULL); fprintf (f, "author \"me\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure no conf object created */ TEST_HASH_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); /* delete override */ unlink (filename); nih_free (source); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("ensure lone override ignored after watch"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/bar.override"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure no conf object created */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (job, NULL); /* delete override */ unlink (filename); TEST_FORCE_WATCH_UPDATE(); /* ensure override still not present */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_EQ_P (job, NULL); nih_free (source); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("create conf, watch, then create/modify/delete override"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create conf */ strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "emits hello\n"); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); /* ensure conf loaded */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_P ((job->emits)[1], NULL); TEST_NE_P (job->start_on, NULL); /* create override */ strcpy (override, dirname); strcat (override, "/foo.override"); f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fclose (f); TEST_HASH_NOT_EMPTY (source->files); TEST_FORCE_WATCH_UPDATE(); /* ensure conf updated */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (job->start_on, NULL); /* ensure no override in hash */ file = (ConfFile *)nih_hash_lookup (source->files, override); TEST_EQ_P (file, NULL); /* modify override */ f = fopen (override, "a"); TEST_NE_P (f, NULL); fprintf (f, "emits world\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf updated */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_STR ((job->emits)[1], "world"); /* delete override */ unlink (override); TEST_FORCE_WATCH_UPDATE(); /* ensure conf reverted */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_NE_P (job->start_on, NULL); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_P ((job->emits)[1], NULL); nih_free (source); unlink (filename); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("create watch, conf, then create/modify/delete override"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); /* create conf */ strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "emits hello\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_P ((job->emits)[1], NULL); TEST_NE_P (job->start_on, NULL); /* create override */ strcpy (override, dirname); strcat (override, "/foo.override"); f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fclose (f); TEST_HASH_NOT_EMPTY (source->files); TEST_FORCE_WATCH_UPDATE(); /* ensure conf updated */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (job->start_on, NULL); /* ensure no override in hash */ file = (ConfFile *)nih_hash_lookup (source->files, override); TEST_EQ_P (file, NULL); /* modify override */ f = fopen (override, "a"); TEST_NE_P (f, NULL); fprintf (f, "emits world\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf updated */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_STR ((job->emits)[1], "world"); /* delete override */ unlink (override); TEST_FORCE_WATCH_UPDATE(); /* ensure conf reverted */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_NE_P (job->start_on, NULL); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_P ((job->emits)[1], NULL); nih_free (source); unlink (filename); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("create override, watch, then create/modify/delete conf"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); strcpy (filename, dirname); strcat (filename, "/foo.conf"); strcpy (override, dirname); strcat (override, "/foo.override"); /* create override */ f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "author \"bar\"\n"); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_FORCE_WATCH_UPDATE(); /* ensure no conf object created */ TEST_HASH_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); /* create conf */ f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "emits hello\n"); fprintf (f, "author \"foo\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); /* should pick up override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "bar"); /* modify conf */ f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on wibble\n"); fprintf (f, "emits moo\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf reloaded and updated with override */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "moo"); /* should pick up override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "bar"); /* delete conf */ unlink (filename); TEST_FORCE_WATCH_UPDATE(); /* ensure conf object deleted */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); file = (ConfFile *)nih_hash_lookup (source->files, override); TEST_EQ_P (file, NULL); unlink (override); /* ensure no conf object still */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); file = (ConfFile *)nih_hash_lookup (source->files, override); TEST_EQ_P (file, NULL); nih_free (source); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("create watch, override, then create/modify/delete conf"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/foo.conf"); strcpy (override, dirname); strcat (override, "/foo.override"); /* create override */ f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "author \"bar\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure no conf object created */ TEST_HASH_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); /* create conf */ f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "emits hello\n"); fprintf (f, "author \"foo\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); /* should pick up override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "bar"); /* modify conf */ f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on wibble\n"); fprintf (f, "emits moo\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf reloaded and updated with override */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "moo"); /* should pick up override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "bar"); /* delete conf */ unlink (filename); TEST_FORCE_WATCH_UPDATE(); /* ensure conf object deleted */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); file = (ConfFile *)nih_hash_lookup (source->files, override); TEST_EQ_P (file, NULL); unlink (override); /* ensure no conf object still */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); file = (ConfFile *)nih_hash_lookup (source->files, override); TEST_EQ_P (file, NULL); nih_free (source); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("create override, watch, conf, then modify/delete override"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); strcpy (filename, dirname); strcat (filename, "/foo.conf"); strcpy (override, dirname); strcat (override, "/foo.override"); /* create override */ f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "author \"bar\"\n"); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_FORCE_WATCH_UPDATE(); /* ensure no conf object created */ TEST_HASH_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); /* create conf */ f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "emits hello\n"); fprintf (f, "author \"foo\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); /* should pick up override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "bar"); /* modify override */ f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "author \"meh\"\n"); fprintf (f, "env wibble=wobble\n"); fprintf (f, "manual\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf reloaded and updated with override */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); /* should pick up override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "meh"); TEST_EQ_STR ((job->env)[0], "wibble=wobble"); /* delete override */ unlink (override); TEST_FORCE_WATCH_UPDATE(); /* ensure conf object reverted */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_NE_P (job->start_on, NULL); TEST_EQ_STR (job->author, "foo"); TEST_EQ_P (job->env, NULL); TEST_EQ_STR ((job->emits)[0], "hello"); unlink (filename); nih_free (source); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("create watch, override, conf, then modify/delete override"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); strcpy (filename, dirname); strcat (filename, "/foo.conf"); strcpy (override, dirname); strcat (override, "/foo.override"); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_FORCE_WATCH_UPDATE(); /* create override */ f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "author \"bar\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* create conf */ f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "emits hello\n"); fprintf (f, "author \"foo\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); /* should pick up override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "bar"); /* update override */ f = fopen (override, "a"); TEST_NE_P (f, NULL); fprintf (f, "author \"me\"\n"); fprintf (f, "env wibble=wobble\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf reloaded and updated with override */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); /* should pick up override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "me"); TEST_EQ_STR ((job->env)[0], "wibble=wobble"); TEST_FORCE_WATCH_UPDATE(); /* delete override */ unlink (override); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR (job->author, "foo"); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_NE_P (job->start_on, NULL); TEST_EQ_P (job->env, NULL); unlink (filename); nih_free (source); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("create both conf+override files, watch, then modify/delete conf"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create conf */ strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "author \"me\"\n"); fprintf (f, "env foo=bar\n"); fprintf (f, "emits hello\n"); fclose (f); /* create override */ strcpy (override, dirname); strcat (override, "/foo.override"); f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "author \"you\"\n"); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_STR (job->author, "you"); TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR ((job->env)[0], "foo=bar"); TEST_EQ_P (job->export, NULL); /* modify conf */ f = fopen (filename, "a"); TEST_NE_P (f, NULL); fprintf (f, "export foo\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf updated */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_STR ((job->env)[0], "foo=bar"); TEST_NE_P (job->export, NULL); TEST_EQ_STR ((job->export)[0], "foo"); /* delete conf */ unlink (filename); TEST_FORCE_WATCH_UPDATE(); /* ensure conf object deleted */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (job, NULL); file = (ConfFile *)nih_hash_lookup (source->files, override); TEST_EQ_P (file, NULL); unlink (override); nih_free (source); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("create both conf+override files, watch, then modify/delete override"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create conf */ strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "author \"me\"\n"); fprintf (f, "env foo=bar\n"); fprintf (f, "emits hello\n"); fclose (f); /* create override */ strcpy (override, dirname); strcat (override, "/foo.override"); f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "author \"you\"\n"); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_STR (job->author, "you"); TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR ((job->env)[0], "foo=bar"); TEST_EQ_P (job->export, NULL); /* modify override */ f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "description \"hello world\"\n"); fprintf (f, "author \"ubuntu\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf updated */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR (job->author, "ubuntu"); TEST_NE_P (job->description, NULL); TEST_EQ_STR (job->description, "hello world"); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_NE_P (job->start_on, NULL); /* delete override */ unlink (override); TEST_FORCE_WATCH_UPDATE(); /* ensure conf updated */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_NE_P (job->start_on, NULL); TEST_EQ_STR ((job->env)[0], "foo=bar"); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_STR (job->author, "me"); TEST_EQ_P (job->description, NULL); nih_free (source); unlink (filename); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("create two watches, two overrides, conf, then delete override files one by one"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); strcpy (override, dirname); strcat (override, "/peter/foo.override"); strcpy (override2, dirname); strcat (override2, "/paul/foo.override"); strcpy (filename, dirname); strcat (filename, "/paul/foo.conf"); const char *sources[] = {"peter", "paul", NULL}; for (const char **src = sources; *src; src++) { dir = nih_sprintf (NULL, "%s/%s", dirname, *src); TEST_EQ (mkdir (dir, 0755), 0); source = conf_source_new (NULL, dir, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); nih_free (dir); } TEST_FORCE_WATCH_UPDATE(); /* create override */ f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "author \"peter\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* create override */ f = fopen (override2, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "author \"paul\"\n"); fprintf (f, "env wibble=wobble\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* create conf */ f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "emits hello\n"); fprintf (f, "author \"mary\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); /* should pick up the top-priority override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "peter"); /* delete override */ unlink (override); TEST_FORCE_WATCH_UPDATE(); /* ensure conf reloaded and updated with the second override */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); /* should pick up the second override, *NOT* conf */ TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR (job->author, "paul"); TEST_EQ_STR ((job->env)[0], "wibble=wobble"); TEST_FORCE_WATCH_UPDATE(); /* delete override */ unlink (override2); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR (job->author, "mary"); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_NE_P (job->start_on, NULL); TEST_EQ_P (job->env, NULL); unlink (filename); for (const char **src = sources; *src; src++) { dir = nih_sprintf (NULL, "%s/%s", dirname, *src); TEST_EQ (rmdir (dir), 0); nih_free (dir); } TEST_EQ (rmdir (dirname), 0); NIH_LIST_FOREACH_SAFE (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; nih_free (source); } TEST_FEATURE ("create conf, watch, then create invalid override, delete override"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create conf */ strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "author \"wibble\"\n"); fprintf (f, "emits hello\n"); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_FORCE_WATCH_UPDATE(); /* ensure conf loaded */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_NE_P (job->start_on, NULL); /* create (partially) invalid override (which should be * fully ignored) */ strcpy (override, dirname); strcat (override, "/foo.override"); f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "bleaugh!\n"); fprintf (f, "wha...?\n"); fprintf (f, "author \"moo\"\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); unlink (override); TEST_FORCE_WATCH_UPDATE(); /* ensure conf still loaded */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_NE_P (job->start_on, NULL); TEST_EQ_STR (job->author, "wibble"); nih_free (source); unlink (filename); TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("ensure override ignored for CONF_FILE"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create empty conf */ strcpy (filename, dirname); strcat (filename, "/init.conf"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_FILE); TEST_NE_P (source, NULL); ret = conf_source_reload (source); /* We expect conf_source_reload to fail in this situation since * although "init.conf" is a supported config file, it is not * allowed to contain any stanzas, implying that it can only * contain comments. In fact, if the file exists but is zero * size that is currently an error since upstart blindly calls * nih_file_read(), which will fail since there are no bytes to * read. */ TEST_NE (ret, 0); err = nih_error_steal (); TEST_EQ (err->number, EILSEQ); nih_free (err); TEST_FORCE_WATCH_UPDATE(); /* ensure conf NOT loaded */ TEST_HASH_EMPTY (source->files); /* create override */ strcpy (override, dirname); strcat (override, "/init.override"); f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fclose (f); TEST_FORCE_WATCH_UPDATE(); /* ensure conf still NOT loaded */ TEST_HASH_EMPTY (source->files); nih_free (source); unlink (filename); unlink (override); TEST_EQ (rmdir (dirname), 0); no_inotify: /* Disable inotify for the following tests */ assert0 (putenv ("INOTIFY_DISABLE=1")); /* If you don't have inotify, any override file must exist * before the system boots. */ TEST_FEATURE ("both conf+override files with no inotify support"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* create conf */ strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); TEST_NE_P (f, NULL); fprintf (f, "start on started\n"); fprintf (f, "author \"me\"\n"); fprintf (f, "env foo=bar\n"); fprintf (f, "emits hello\n"); fclose (f); /* create override */ strcpy (override, dirname); strcat (override, "/foo.override"); f = fopen (override, "w"); TEST_NE_P (f, NULL); fprintf (f, "manual\n"); fprintf (f, "author \"you\"\n"); fclose (f); /* create watch */ source = conf_source_new (NULL, dirname, CONF_JOB_DIR); TEST_NE_P (source, NULL); ret = conf_source_reload (source); TEST_EQ (ret, 0); /* ensure conf loaded */ TEST_HASH_NOT_EMPTY (source->files); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_NE_P (file, NULL); job = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_NE_P (job, NULL); TEST_EQ_P (file->job, job); TEST_EQ_STR ((job->emits)[0], "hello"); TEST_EQ_STR (job->author, "you"); TEST_EQ_P (job->start_on, NULL); TEST_EQ_STR ((job->env)[0], "foo=bar"); TEST_EQ_P (job->export, NULL); nih_free (source); unlink (filename); unlink (override); TEST_EQ (rmdir (dirname), 0); nih_log_set_priority (NIH_LOG_MESSAGE); /* Re-enable inotify */ assert0 (unsetenv ("INOTIFY_DISABLE")); } void test_source_reload_file (void) { ConfSource *source; ConfFile *file, *old_file; FILE *f; int ret, fd, nfds; char dirname[PATH_MAX]; char tmpname[PATH_MAX], filename[PATH_MAX]; fd_set readfds, writefds, exceptfds; NihError *err; json_object *json; TEST_FUNCTION_FEATURE ("conf_source_reload", "with configuration file"); program_name = "test"; nih_log_set_priority (NIH_LOG_FATAL); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/bar.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); /* Make sure that we have inotify before performing some tests... */ if ((fd = inotify_init ()) < 0) { printf ("SKIP: inotify not available\n"); goto no_inotify; } close (fd); /* Check that we can load a file source for the first time. An * inotify watch should be established on the parent directory, * the descriptor set to be closed-on-exec, but only that single * file parsed. */ TEST_FEATURE ("with new conf file"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_ALLOC_SIZE (source->watch, sizeof (NihWatch)); TEST_EQ_STR (source->watch->path, dirname); TEST_EQ_P (source->watch->data, source); TEST_TRUE (fcntl (source->watch->fd, F_GETFD) & FD_CLOEXEC); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); strcpy (filename, dirname); strcat (filename, "/bar.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that if we create a new file in the directory, alongside * the one we are watching, it is ignored. */ TEST_FEATURE ("with new file alongside conf file"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/baz.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); /* Check that if we modify a file in the directory, alongside * the one we are watching, it is ignored. */ TEST_FEATURE ("with modification to file alongside conf file"); strcpy (filename, dirname); strcat (filename, "/bar.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); /* Check that the configuration file we're watching can be modified * using the direct writing technique. */ TEST_FEATURE ("with modification (direct write)"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); old_file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_FREE_TAG (old_file); f = fopen (filename, "w"); fprintf (f, "#still nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); old_file = file; /* Check that the configuration file we're watching can be modified * using the write and then rename technique; it should be parsed * and the previous file marked for deletion. */ TEST_FEATURE ("with modification (atomic rename)"); strcpy (tmpname, dirname); strcat (tmpname, "/.foo.tmp"); f = fopen (tmpname, "w"); fprintf (f, "#nothing to test\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/foo.conf"); rename (tmpname, filename); TEST_FREE_TAG (old_file); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); old_file = file; /* Check that we can delete the configuration file that we're * watching, the metadata for it should be lost. */ TEST_FEATURE ("with deletion"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); unlink (filename); TEST_FREE_TAG (old_file); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); /* Check that the watch allows us to see if the file we want is * created using the direct writing technique, and thus parsed. */ TEST_FEATURE ("with creation (direct write)"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); /* Check that the watch allows us to see if the file we want is * created using the write and rename, and thus parsed. */ TEST_FEATURE ("with creation (atomic rename)"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); unlink (filename); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); strcpy (tmpname, dirname); strcat (tmpname, "/.foo.tmp"); f = fopen (tmpname, "w"); fprintf (f, "#nothing to test\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/foo.conf"); rename (tmpname, filename); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); old_file = file; /* Check that a physical error when re-parsing a job is caught. */ TEST_FEATURE ("with error after modification"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0200); TEST_FREE_TAG (old_file); f = fopen (filename, "w"); fprintf (f, "#still nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); chmod (filename, 0644); /* Check that a parse error when re-parsing a file is caught. */ TEST_FEATURE ("with parse error after modification"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); old_file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_FREE_TAG (old_file); f = fopen (filename, "w"); fprintf (f, "oops\n"); fclose (f); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_FREE (old_file); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); nih_free (source); /* Check that a physical error parsing a file initially is caught * and returned as an error. */ TEST_FEATURE ("with physical error parsing file"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); chmod (filename, 0000); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, EACCES); nih_free (err); TEST_ALLOC_SIZE (source->watch, sizeof (NihWatch)); TEST_EQ_STR (source->watch->path, dirname); TEST_EQ_P (source->watch->data, source); TEST_TRUE (fcntl (source->watch->fd, F_GETFD) & FD_CLOEXEC); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0644); /* Check that a parsing error with a file doesn't return an error * code, since that's no different to an empty file. */ TEST_FEATURE ("with parse error"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "oops\n"); fclose (f); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_ALLOC_SIZE (source->watch, sizeof (NihWatch)); TEST_EQ_STR (source->watch->path, dirname); TEST_EQ_P (source->watch->data, source); TEST_TRUE (fcntl (source->watch->fd, F_GETFD) & FD_CLOEXEC); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we catch errors attempting to parse a file that * doesn't exist, however we should have a watch on it, so that if * it is created in the future it will be automatically parsed. */ TEST_FEATURE ("with non-existant file"); strcpy (filename, dirname); strcat (filename, "/wibble.conf"); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOENT); nih_free (err); TEST_ALLOC_SIZE (source->watch, sizeof (NihWatch)); TEST_EQ_STR (source->watch->path, dirname); TEST_EQ_P (source->watch->data, source); TEST_TRUE (fcntl (source->watch->fd, F_GETFD) & FD_CLOEXEC); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we can catch the deletion of the parent directory, * which results in the file being deleted and the watch removed. */ TEST_FEATURE ("with deletion of parent directory"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_EQ (ret, 0); strcpy (filename, dirname); strcat (filename, "/baz.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/bar.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/foo.conf"); unlink (filename); rmdir (dirname); nfds = 0; FD_ZERO (&readfds); FD_ZERO (&writefds); FD_ZERO (&exceptfds); nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); nih_io_handle_fds (&readfds, &writefds, &exceptfds); TEST_EQ_P (source->watch, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); no_inotify: /* Disable inotify for the following tests */ assert0 (putenv ("INOTIFY_DISABLE=1")); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/bar.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); /* Check that we can load a conf file source for the first time. * Even though we don't have inotify, the file should still be parsed. */ TEST_FEATURE ("with new conf file but no inotify"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that we can perform a mandatory reload of the file, * having made some changes in between. Items that were added * should be parsed and items that were removed should be deleted. */ TEST_FEATURE ("with reload of conf file"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "#nothing to test\n"); fclose (f); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, FALSE); strcpy (filename, dirname); strcat (filename, "/foo.conf"); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that a physical error parsing a file initially is caught * and returned. */ TEST_FEATURE ("with error parsing file without inotify"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); chmod (filename, 0000); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, EACCES); nih_free (err); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); chmod (filename, 0644); /* Check that a parse error is ignored and doesn't return an error, * being treated equivalent to an empty file. */ TEST_FEATURE ("with parse error without inotify"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "oops\n"); fclose (f); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_EQ (ret, 0); TEST_EQ_P (source->watch, NULL); TEST_EQ (source->flag, TRUE); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_ALLOC_SIZE (file, sizeof (ConfFile)); TEST_ALLOC_PARENT (file, source); TEST_EQ (file->flag, source->flag); TEST_EQ_P (file->data, NULL); nih_free (file); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that trying to parse a file that doesn't exist returns * an error. */ TEST_FEATURE ("with non-existant conf file and no inotify"); strcpy (filename, dirname); strcat (filename, "/wibble.conf"); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOENT); nih_free (err); TEST_EQ_P (source->watch, NULL); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); /* Check that if we mandatory reload a non-existant file, all items * are deleted. */ TEST_FEATURE ("with reload of deleted conf file"); strcpy (filename, dirname); strcat (filename, "/foo.conf"); source = conf_source_new (NULL, filename, CONF_FILE); ret = conf_source_reload (source); TEST_EQ (ret, 0); unlink (filename); ret = conf_source_reload (source); TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOENT); nih_free (err); TEST_EQ_P (source->watch, NULL); file = (ConfFile *)nih_hash_lookup (source->files, filename); TEST_EQ_P (file, NULL); TEST_HASH_EMPTY (source->files); nih_free (source); strcpy (filename, dirname); strcat (filename, "/bar.conf"); unlink (filename); /* Re-enable inotify */ assert0 (unsetenv ("INOTIFY_DISABLE")); TEST_FEATURE ("Invalid .conf file does not stop ConfFile being serialised"); conf_init (); TEST_LIST_EMPTY (conf_sources); f = fopen (filename, "w"); /* Create an invalid job by adding an invalid stanza */ fprintf (f, "invalid\n"); fclose (f); source = conf_source_new (NULL, filename, CONF_FILE); TEST_NE_P (source, NULL); TEST_LIST_NOT_EMPTY (conf_sources); TEST_HASH_EMPTY (source->files); file = conf_file_new (source, "/path/to/file"); TEST_NE_P (file, NULL); TEST_HASH_NOT_EMPTY (source->files); /* Initially, a ConfFile has no associated JobClass */ TEST_EQ_P (file->job, NULL); /* Normally, this would create a JobClass and associate it with * its parent ConfFile, but that doesn't happen when the on-disk * job configuration file is invalid. */ ret = conf_source_reload (source); /* Although the on-disk file is invalid, there is no error here * since it's already been handled by conf_reload_path() (which * displays an error message with details of how the job * configuration file is invalid). */ TEST_EQ (ret, 0); /* We know the job was invalid * by the fact that the ConfFile * still has no associated JobClass. */ TEST_EQ (file->job, NULL); /* See if we can serialise the ConfFile without an associated * JobClass. */ json = conf_file_serialise (file); TEST_NE_P (json, NULL); /* Test there is no JobClass in the JSON */ TEST_EQ (json_object_object_get_ex (json, "job_class", NULL), FALSE); TEST_FEATURE ("ConfFile with no JobClass can be deserialised"); nih_free (source); source = conf_source_new (NULL, filename, CONF_FILE); TEST_NE_P (source, NULL); TEST_LIST_NOT_EMPTY (conf_sources); TEST_HASH_EMPTY (source->files); file = conf_file_deserialise (source, json); TEST_NE_P (file, NULL); nih_free (source); json_object_put (json); unlink (filename); rmdir (dirname); nih_log_set_priority (NIH_LOG_MESSAGE); } void test_source_reload (void) { FILE *f; ConfSource *source1, *source2, *source3; char dirname[PATH_MAX], filename[PATH_MAX], filename2[PATH_MAX]; Event *event1; Event *event2; NihChildWatch *watch; JobClass *class1; JobClass *class2; JobClass *registered; JobClass *best; Job *job; int attempts; int got = 0; int result[3] = {FALSE, FALSE, FALSE}; unsigned int types[3] = {EVENT_MATCH, EVENT_MATCH, EVENT_AND}; int i=0; /* Check that we can reload all sources, and that errors are warned * about and not returned. */ TEST_FUNCTION ("conf_source_reload"); nih_log_set_priority (NIH_LOG_FATAL); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); strcat (filename, "/foo.conf"); source1 = conf_source_new (NULL, filename, CONF_FILE); f = fopen (filename, "w"); fprintf (f, "job foo\n"); fprintf (f, " respawn\n"); fprintf (f, " exec /sbin/daemon\n"); fprintf (f, "end job\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/bar"); mkdir (filename, 0755); source2 = conf_source_new (NULL, filename, CONF_JOB_DIR); strcpy (filename, dirname); strcat (filename, "/bar/bar.conf"); f = fopen (filename, "w"); fprintf (f, "script\n"); fprintf (f, " echo\n"); fprintf (f, "end script\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/baz"); source3 = conf_source_new (NULL, filename, CONF_DIR); conf_reload (); TEST_HASH_NOT_EMPTY (source1->files); TEST_HASH_NOT_EMPTY (source2->files); TEST_HASH_EMPTY (source3->files); nih_free (source1); nih_free (source2); nih_free (source3); strcpy (filename, dirname); strcat (filename, "/foo.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/bar/bar.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/bar"); rmdir (filename); rmdir (dirname); nih_log_set_priority (NIH_LOG_MESSAGE); /************************************************************/ /* - Create 2 jobs. * - Emit an event causing one jobs start on condition to match * such that it runs. * - Ensure that when the job that has runs parent JobClass is destroyed * that does not also result in the destruction of the event needed * by the other job. */ TEST_FUNCTION ("ensure reload does not destroy a blocked event used by another job"); conf_init (); event_init (); job_class_environment_init (); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); source1 = conf_source_new (NULL, filename, CONF_JOB_DIR); strcpy (filename, dirname); strcat (filename, "/rc-sysinit.conf"); f = fopen (filename, "w"); fprintf (f, "start on filesystem and static-network-up\n"); fprintf (f, "exec true\n"); fclose (f); strcpy (filename2, dirname); strcat (filename2, "/foo.conf"); f = fopen (filename2, "w"); fprintf (f, "start on filesystem\n"); fprintf (f, "exec true\n"); fclose (f); watch = NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, job_process_handler, NULL)); /* initial load */ conf_reload (); class1 = job_class_get_registered ("rc-sysinit", NULL); TEST_NE_P (class1, NULL); class2 = job_class_get_registered ("foo", NULL); TEST_NE_P (class2, NULL); TEST_LIST_EMPTY (events); event1 = event_new (NULL, "filesystem", NULL); TEST_NE_P (event1, NULL); TEST_LIST_NOT_EMPTY (events); /* cause foo to run */ event_poll (); /* wait for a reasonable time for the job to stop */ attempts = 0; got = 0; while (TRUE) { nih_child_poll (); NIH_HASH_FOREACH (class2->instances, iter) { Job *job = (Job *)iter; if (job->goal == JOB_STOP) { got = 1; break; } } if (got || attempts == JOB_STOP_ATTEMPTS) break; sleep (1); attempts++; } TEST_EQ (got, 1); TEST_LIST_EMPTY (&event1->blocking); job = (Job *)nih_hash_lookup (class2->instances, ""); TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (events); event_poll (); TEST_LIST_NOT_EMPTY (events); /* actual reload */ conf_reload (); event_poll (); /* XXX: this is the point where older versions of upstart * would fail since the destruction of the 'foo' job would have * incorrectly destroyed the 'filesystem' event. */ TEST_LIST_NOT_EMPTY (events); /* XXX: This will only free the associated *job* * if it is not running. */ nih_free (source1); assert0 (unlink (filename)); assert0 (unlink (filename2)); assert0 (rmdir (dirname)); nih_free (event1); nih_free (watch); TEST_ENSURE_CLEAN_ENV (); /************************************************************/ /* * - Create job with 'start on bar and baz' condition. * - emit bar. * - reload. * - emit baz. * - expect job to run. */ TEST_FUNCTION ("ensure .conf reload causes waiting job to run when 'start on' matches"); TEST_ENSURE_CLEAN_ENV (); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); source1 = conf_source_new (NULL, filename, CONF_JOB_DIR); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = fopen (filename, "w"); fprintf (f, "start on bar and baz\n"); fprintf (f, "exec true\n"); fclose (f); watch = NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, job_process_handler, NULL)); /* initial load */ conf_reload (); registered = job_class_get_registered ("foo", NULL); TEST_NE_P (registered, NULL); best = conf_select_job (registered->name, registered->session); TEST_NE_P (best, NULL); /* give job a chance to run - we don't expect it to though */ event_poll (); /* there should only be a single JobClass */ TEST_EQ_P (registered, best); TEST_LIST_EMPTY (events); NIH_TREE_FOREACH_POST (&best->start_on->node, iter) { EventOperator *oper = (EventOperator *)iter; TEST_EQ(oper->value, result[i]); TEST_EQ(oper->type, types[i]); i++; } i = 0; event1 = event_new (NULL, "bar", NULL); TEST_NE_P (event1, NULL); TEST_LIST_NOT_EMPTY (events); event_poll (); result[0] = TRUE; NIH_TREE_FOREACH_POST (&best->start_on->node, iter) { EventOperator *oper = (EventOperator *)iter; TEST_EQ(oper->value, result[i]); TEST_EQ(oper->type, types[i]); i++; } i = 0; /* actual reload */ conf_reload (); event_poll (); TEST_EQ (event1->blockers, 1); /* JobClass should have been destroyed and recreated */ class1 = job_class_get_registered ("foo", NULL); TEST_NE_P (class1, registered); registered = class1; best = conf_select_job (registered->name, registered->session); TEST_NE_P (best, NULL); TEST_EQ_P (registered, best); NIH_TREE_FOREACH_POST (&best->start_on->node, iter) { EventOperator *oper = (EventOperator *)iter; TEST_EQ(oper->value, result[i]); TEST_EQ(oper->type, types[i]); i++; } result[0] = FALSE; i = 0; f = fopen (filename, "w"); fprintf (f, "start on baz and bar\n"); fprintf (f, "exec true\n"); fclose (f); /* reload again */ conf_reload (); event_poll (); TEST_EQ (event1->blockers, 1); /* JobClass should have been destroyed and recreated */ class1 = job_class_get_registered ("foo", NULL); TEST_NE_P (class1, registered); registered = class1; best = conf_select_job (registered->name, registered->session); TEST_NE_P (best, NULL); TEST_EQ_P (registered, best); result[1] = TRUE; NIH_TREE_FOREACH_POST (&best->start_on->node, iter) { EventOperator *oper = (EventOperator *)iter; TEST_EQ(oper->value, result[i]); TEST_EQ(oper->type, types[i]); i++; } event2 = event_new (NULL, "baz", NULL); TEST_NE_P (event2, NULL); TEST_LIST_NOT_EMPTY (events); /* cause foo to run */ event_poll (); /* wait for a reasonable time for the job to stop */ attempts = 0; got = 0; while (TRUE) { nih_child_poll (); NIH_HASH_FOREACH (class1->instances, iter) { Job *job = (Job *)iter; if (job->goal == JOB_STOP) { got = 1; break; } } if (got || attempts == JOB_STOP_ATTEMPTS) break; sleep (1); attempts++; } TEST_EQ (got, 1); /* force the events to be freed via event_finished() */ event_poll (); TEST_LIST_EMPTY (events); nih_free (source1); nih_free (watch); TEST_ENSURE_CLEAN_ENV (); /************************************************************/ } void test_file_destroy (void) { ConfSource *source; ConfFile *file; JobClass *job, *other, *ptr; Job *instance; TEST_FUNCTION ("conf_file_destroy"); source = conf_source_new (NULL, "/path", CONF_JOB_DIR); /* Check that when a ConfFile for a job is freed, the attached * job is also freed if it is not the current job. */ TEST_FEATURE ("with not-current job"); file = conf_file_new (source, "/path/to/file"); job = file->job = job_class_new (NULL, "foo", NULL); other = job_class_new (NULL, "foo", NULL); nih_hash_add (job_classes, &other->entry); TEST_FREE_TAG (job); nih_free (file); TEST_FREE (job); ptr = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (ptr, other); nih_free (other); /* Check that when a ConfFile for a job is freed, the attached * job is also freed if it is the current job but is not running. */ TEST_FEATURE ("with stopped job"); file = conf_file_new (source, "/path/to/file"); job = file->job = job_class_new (NULL, "foo", NULL); nih_hash_add (job_classes, &job->entry); TEST_FREE_TAG (job); nih_free (file); TEST_FREE (job); ptr = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (ptr, NULL); /* Check that when a ConfFile for a job is freed, the attached job * is not freed if it is the current job and has active instances; * instead it is marked as deleted so job_change_state() can free it. */ TEST_FEATURE ("with running job"); file = conf_file_new (source, "/path/to/file"); job = file->job = job_class_new (NULL, "foo", NULL); nih_hash_add (job_classes, &job->entry); TEST_FREE_TAG (job); instance = job_new (job, ""); instance->goal = JOB_START; instance->state = JOB_RUNNING; nih_free (file); TEST_NOT_FREE (job); TEST_TRUE (job->deleted); TEST_EQ (instance->goal, JOB_START); TEST_EQ (instance->state, JOB_RUNNING); ptr = (JobClass *)nih_hash_lookup (job_classes, "foo"); TEST_EQ_P (ptr, job); nih_free (job); nih_free (source); } void test_select_job (void) { ConfSource *source1, *source2, *source3; ConfFile *file1, *file3, *file4, *file5; JobClass *class1, *class2, *class4, *ptr; /* keep gcc 4.6 happy */ ConfFile *file2 __attribute__((__unused__)); JobClass *class3 __attribute__((__unused__)); TEST_FUNCTION ("conf_select_job"); source1 = conf_source_new (NULL, "/tmp/foo", CONF_DIR); source2 = conf_source_new (NULL, "/tmp/bar", CONF_JOB_DIR); file1 = conf_file_new (source2, "/tmp/bar/frodo"); class1 = file1->job = job_class_new (NULL, "frodo", NULL); file2 = conf_file_new (source2, "/tmp/bar/bilbo"); file3 = conf_file_new (source2, "/tmp/bar/drogo"); class2 = file3->job = job_class_new (NULL, "drogo", NULL); source3 = conf_source_new (NULL, "/tmp/baz", CONF_JOB_DIR); file4 = conf_file_new (source3, "/tmp/baz/frodo"); class3 = file4->job = job_class_new (NULL, "frodo", NULL); file5 = conf_file_new (source2, "/tmp/bar/bilbo"); class4 = file5->job = job_class_new (NULL, "bilbo", NULL); /* Check that a job with only one file is returned. */ TEST_FEATURE ("with one file"); ptr = conf_select_job ("drogo", NULL); TEST_EQ_P (ptr, class2); /* Check that the first job of multiple available files is * returned. */ TEST_FEATURE ("with multiple files"); ptr = conf_select_job ("frodo", NULL); TEST_EQ_P (ptr, class1); /* Check that files with no attached job are ignored. */ TEST_FEATURE ("with file but no attached job"); ptr = conf_select_job ("bilbo", NULL); TEST_EQ_P (ptr, class4); /* Check that when there is no match, NULL is returned. */ TEST_FEATURE ("with no match"); ptr = conf_select_job ("meep", NULL); TEST_EQ_P (ptr, NULL); nih_free (source3); nih_free (source2); nih_free (source1); } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_source_new (); test_file_new (); test_source_reload_job_dir (); test_source_reload_conf_dir (); test_source_reload_file (); test_source_reload (); test_override (); test_file_destroy (); test_select_job (); return 0; } upstart-1.13.2/init/tests/test_util.c0000664000175000017500000000564612373101356014524 00000000000000#include "test_util_common.h" #undef PACKAGE_COPYRIGHT #include "test_util.h" #include #include /** * event_operator_diff: * @a: first Blocked, * @b: second Blocked, * @seen: object type that has already been seen. * * Compare two Blocked objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int event_operator_diff (EventOperator *a, EventOperator *b) { if (! a && ! b) return 0; if ((! a && b) || (a && ! b)) return 1; TEST_TWO_TREES_FOREACH (&a->node, &b->node, iter_a, iter_b) { EventOperator *opera = (EventOperator *)iter_a; EventOperator *operb = (EventOperator *)iter_b; nih_local char *env_a = NULL; nih_local char *env_b = NULL; if ((! opera && operb) || (! operb && opera)) return 1; TEST_NE_P (opera, NULL); TEST_NE_P (operb, NULL); if (opera->type != operb->type) return 1; if (opera->value != operb->value) return 1; if (opera->type == EVENT_MATCH && opera->env) { env_a = state_collapse_env ((const char **)opera->env); if (! env_a) return 1; } if (operb->type == EVENT_MATCH && operb->env) { env_b = state_collapse_env ((const char **)operb->env); if (! env_b) return 1; } if (string_check (env_a, env_b)) return 1; if (opera->event != operb->event) return 1; } return 0; } /** * session_from_chroot: * @chroot: full path to chroot. * * Obtain the session relating to the specified chroot. * * Returns: Session, or NULL if no session found. **/ Session * session_from_chroot (const char *chroot) { nih_assert (chroot); session_init (); NIH_LIST_FOREACH (sessions, iter) { Session *session = (Session *)iter; if (! strcmp (session->chroot, chroot)) return session; } return NULL; } /** * ensure_env_clean: * * Ensure most common data structures are empty. * * Note: Control connections are not handled as the init routine * does more than just initialise the structure. **/ void ensure_env_clean (void) { TEST_NE_P (sessions, NULL); TEST_NE_P (events, NULL); TEST_NE_P (conf_sources, NULL); TEST_NE_P (job_classes, NULL); TEST_NE_P (log_unflushed_files, NULL); /* Ensure environment is clean before test is run */ TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (log_unflushed_files); } /** * clean_env: * * Re-initialise all common data structures. * * Note: Like ensure_env_clean(), control connections are not handled. **/ void clean_env (void) { session_init (); event_init (); job_class_init (); conf_init (); log_unflushed_init (); nih_free (sessions); nih_free (events); nih_free (job_classes); nih_free (conf_sources); nih_free (log_unflushed_files); sessions = NULL; events = NULL; job_classes = NULL; conf_sources = NULL; log_unflushed_files = NULL; session_init (); event_init (); job_class_init (); conf_init (); log_unflushed_init (); } upstart-1.13.2/init/tests/test_cgroup.c0000664000175000017500000002220412373101356015033 00000000000000/* upstart * * test_cgroup.c - test suite for init/cgroup.c * * Copyright © 2013-2014 Canonical Ltd. * Author: James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include "cgroup.h" #include "test_util_common.h" extern NihHash *cgroup_paths; void test_cgroup_new (void) { nih_local char *parent = NULL; CGroup *cgroup; TEST_FUNCTION ("cgroup_new"); parent = nih_strdup (NULL, "a parent object"); TEST_NE_P (parent, NULL); TEST_FEATURE ("no parent, controller"); TEST_ALLOC_FAIL { cgroup = cgroup_new (NULL, "cpuset"); if (test_alloc_failed) { TEST_EQ_P (cgroup, NULL); continue; } TEST_NE_P (cgroup, NULL); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_ALLOC_PARENT (cgroup, NULL); TEST_EQ_STR (cgroup->controller, "cpuset"); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("cpuset")); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_LIST_EMPTY (&cgroup->names); nih_free (cgroup); } TEST_FEATURE ("parent, controller"); TEST_ALLOC_FAIL { cgroup = cgroup_new (parent, "perf_event"); if (test_alloc_failed) { TEST_EQ_P (cgroup, NULL); continue; } TEST_NE_P (cgroup, NULL); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_ALLOC_PARENT (cgroup, parent); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_LIST_EMPTY (&cgroup->names); nih_free (cgroup); } } void test_cgroup_name_new (void) { CGroupName *cgname; nih_local char *parent = NULL; TEST_FUNCTION ("cgroup_name_new"); parent = nih_strdup (NULL, "a parent object"); TEST_NE_P (parent, NULL); TEST_FEATURE ("no parent, name"); TEST_ALLOC_FAIL { cgname = cgroup_name_new (NULL, "foo."); if (test_alloc_failed) { TEST_EQ_P (cgname, NULL); continue; } TEST_NE_P (cgname, NULL); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_ALLOC_PARENT (cgname, NULL); TEST_EQ_STR (cgname->name, "foo."); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo.")); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_LIST_EMPTY (&cgname->settings); } TEST_FEATURE ("parent, name"); TEST_ALLOC_FAIL { cgname = cgroup_name_new (parent, "bar"); if (test_alloc_failed) { TEST_EQ_P (cgname, NULL); continue; } TEST_NE_P (cgname, NULL); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_ALLOC_PARENT (cgname, parent); TEST_EQ_STR (cgname->name, "bar"); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("bar")); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_LIST_EMPTY (&cgname->settings); } } void test_cgroup_setting_new (void) { CGroupSetting *setting; nih_local char *parent= NULL; parent = nih_strdup (NULL, "a parent object"); TEST_NE_P (parent, NULL); TEST_FUNCTION ("cgroup_setting_new"); TEST_FEATURE ("no parent, key, no value"); TEST_ALLOC_FAIL { setting = cgroup_setting_new (NULL, "foo", NULL); if (test_alloc_failed) { TEST_EQ_P (setting, NULL); continue; } TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_ALLOC_PARENT (setting, NULL); TEST_EQ_STR (setting->key, "foo"); TEST_ALLOC_SIZE (setting->key, 1+strlen ("foo")); TEST_ALLOC_PARENT (setting->key, setting); nih_free (setting); } TEST_FEATURE ("parent, key, no value"); TEST_ALLOC_FAIL { setting = cgroup_setting_new (parent, "hello world", NULL); if (test_alloc_failed) { TEST_EQ_P (setting, NULL); continue; } TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_ALLOC_PARENT (setting, parent); TEST_EQ_STR (setting->key, "hello world"); TEST_ALLOC_SIZE (setting->key, 1+strlen ("hello world")); TEST_ALLOC_PARENT (setting->key, setting); nih_free (setting); } TEST_FEATURE ("no parent, key, value"); TEST_ALLOC_FAIL { setting = cgroup_setting_new (NULL, "hello world", "a value"); if (test_alloc_failed) { TEST_EQ_P (setting, NULL); continue; } TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_ALLOC_PARENT (setting, NULL); TEST_EQ_STR (setting->key, "hello world"); TEST_ALLOC_SIZE (setting->key, 1+strlen ("hello world")); TEST_ALLOC_PARENT (setting->key, setting); TEST_EQ_STR (setting->value, "a value"); TEST_ALLOC_SIZE (setting->value, 1+strlen ("a value")); TEST_ALLOC_PARENT (setting->value, setting); nih_free (setting); } TEST_FEATURE ("parent, key, value"); TEST_ALLOC_FAIL { setting = cgroup_setting_new (parent, "hello world", "a value"); if (test_alloc_failed) { TEST_EQ_P (setting, NULL); continue; } TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_ALLOC_PARENT (setting, parent); TEST_EQ_STR (setting->key, "hello world"); TEST_ALLOC_SIZE (setting->key, 1+strlen ("hello world")); TEST_ALLOC_PARENT (setting->key, setting); TEST_EQ_STR (setting->value, "a value"); TEST_ALLOC_SIZE (setting->value, 1+strlen ("a value")); TEST_ALLOC_PARENT (setting->value, setting); nih_free (setting); } } void test_cgroup_job_start (void) { char confdir[PATH_MAX]; char logdir[PATH_MAX]; char flagfile[PATH_MAX]; nih_local char *cmd = NULL; pid_t dbus_pid = 0; pid_t upstart_pid = 0; char **output; size_t lines; size_t len; nih_local char *logfile = NULL; nih_local char *logfile_name = NULL; nih_local char *contents = NULL; if (geteuid ()) { printf ("INFO: skipping %s tests as not running as root\n", __func__); fflush (NULL); return; } TEST_GROUP ("cgroup manager handling"); TEST_FILENAME (confdir); TEST_EQ (mkdir (confdir, 0755), 0); TEST_FILENAME (logdir); TEST_EQ (mkdir (logdir, 0755), 0); TEST_FILENAME (flagfile); /* Use the "secret" interface */ TEST_EQ (setenv ("UPSTART_CONFDIR", confdir, 1), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", logdir, 1), 0); TEST_DBUS (dbus_pid); /*******************************************************************/ TEST_FEATURE ("Ensure startup job does not start until cgmanager available"); contents = nih_sprintf (NULL, "start on startup\n" "\n" "cgroup memory mem-%s\n" "\n" "exec echo hello\n", __func__); TEST_NE_P (contents, NULL); CREATE_FILE (confdir, "cgroup.conf", contents); logfile_name = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "cgroup.log")); start_upstart_common (&upstart_pid, FALSE, FALSE, confdir, logdir, NULL); cmd = nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), "cgroup"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); /* job should *NOT* start on startup */ TEST_EQ_STR (output[0], "cgroup stop/waiting"); nih_free (output); TEST_FALSE (file_exists (logfile_name)); cmd = nih_sprintf (NULL, "%s notify-cgroup-manager-address %s 2>&1", get_initctl (), CGMANAGER_DBUS_SOCK); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 0); WAIT_FOR_FILE (logfile_name); logfile = nih_file_read (NULL, logfile_name, &len); TEST_NE_P (logfile, NULL); TEST_EQ_STR (logfile, "hello\r\n"); DELETE_FILE (confdir, "cgroup.conf"); assert0 (unlink (logfile_name)); /*******************************************************************/ TEST_FEATURE ("Ensure bogus cgroups don't crash init"); contents = nih_sprintf (NULL, "cgroup name\n" "\n" "exec echo hello\n"); TEST_NE_P (contents, NULL); CREATE_FILE (confdir, "cgroup-name.conf", contents); logfile_name = NIH_MUST (nih_sprintf (NULL, "%s/%s", logdir, "cgroup-name.log")); cmd = nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), "cgroup-name"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); /* job is not running yet */ TEST_EQ_STR (output[0], "cgroup-name stop/waiting"); nih_free (output); TEST_FALSE (file_exists (logfile_name)); cmd = nih_sprintf (NULL, "%s start %s 2>&1", get_initctl (), "cgroup-name"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 1); TEST_EQ_STR (output[0], "initctl: Job failed to start"); DELETE_FILE (confdir, "cgroup-name.conf"); /*******************************************************************/ STOP_UPSTART (upstart_pid); TEST_DBUS_END (dbus_pid); TEST_EQ (rmdir (confdir), 0); TEST_EQ (rmdir (logdir), 0); /*******************************************************************/ } int main (int argc, char *argv[]) { test_cgroup_new (); test_cgroup_name_new (); test_cgroup_setting_new (); test_cgroup_job_start (); return 0; } upstart-1.13.2/init/tests/test_job_process.c0000664000175000017500000075606412373101356016066 00000000000000/* upstart * * test_job_process.c - test suite for init/job_process.c * * Copyright © 2011-2014 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #if HAVE_VALGRIND_VALGRIND_H #include #endif /* HAVE_VALGRIND_VALGRIND_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "job_process.h" #include "job.h" #include "event.h" #include "blocked.h" #include "conf.h" #include "errors.h" #include "test_util_common.h" #define EXPECTED_JOB_LOGDIR "/var/log/upstart" #define TEST_SHELL "/bin/sh" #define TEST_SHELL_ARG "-e" /* Used to generate single- and multi-line output. */ #define TEST_CMD_ECHO "/bin/echo" /* Used to generate multi-line output out stdout without using shell * meta-characters. */ #define TEST_CMD_YES "/usr/bin/yes" /* Used to generate multi-line output on stderr without using shell * meta-characters. */ #define TEST_CMD_DD "/bin/dd" /* number of iterations to perform to check file contents */ #define MAX_ITERATIONS 5 /** * SHELL_CHARS: * * This is the list of characters that, if encountered in a process, cause * it to always be run with a shell. **/ #define SHELL_CHARS "~`!$^&*()=|\\{}[];\"'<>?" /** * CHECK_FILE_EQ: * * @_file: FILE to read from, * @_line: line to expect. * * Check that the next line in the file @_file is @_line, which should * include the terminating newline if one is expected. * * This differs from TEST_FILE_EQ() in that the test is performed * MAX_ITERATIONS times with a 1 second sleep between iterations. **/ #define CHECK_FILE_EQ(_file, _line, _select) \ do { \ int ok = FALSE; \ char filebuf[1024]; \ for (int i = 0; i < MAX_ITERATIONS; i++) { \ TEST_NE_P (fgets (filebuf, sizeof (filebuf), _file), NULL); \ if (! strcmp (filebuf, _line)) { \ ok = TRUE; \ break; \ } \ if (_select) { \ TEST_WATCH_UPDATE_TIMEOUT_SECS (1); \ } else { \ sleep (1); \ } \ rewind (_file); \ } \ TEST_EQ (ok, TRUE); \ } while (0) /* * Register regular child handler. * Register another handler to be called after the primary * Upstart handler to allow the test to exit the main loop * quickly on success. * Process the event queue each time through the main loop */ #define TEST_INSTALL_CHILD_HANDLERS() \ NIH_MUST (nih_child_add_watch (NULL, \ -1, \ NIH_CHILD_ALL, \ test_job_process_handler,\ NULL)); \ NIH_MUST (nih_child_add_watch (NULL, \ -1, \ NIH_CHILD_ALL, \ job_process_handler, \ NULL)); \ NIH_MUST (nih_main_loop_add_func (NULL, (NihMainLoopCb)event_poll, \ NULL)) #define TEST_CLEAR_CHILD_STATUS() \ do { \ TEST_EQ (waitid (P_ALL, 0, &siginfo, WEXITED | WNOWAIT), -1); \ TEST_EQ (errno, ECHILD); \ errno = 0; \ child_exit_after = 1; \ for (int _i = 0; _i < PROCESS_LAST; _i++) { \ child_exit_status[_i] = -1; \ } \ } while (0) /* Modified version of NIH's TEST_CHILD() that is resilient * to temporary errors. */ #define RESILIENT_TEST_CHILD(_pid) \ do { \ int _test_fds[2]; \ fflush (stdout); \ fflush (stderr); \ assert0 (pipe (_test_fds)); \ _pid = fork (); \ if (_pid > 0) { \ ssize_t ret; \ char _test_buf[1]; \ close (_test_fds[1]); \ while (TRUE) { \ ret = read (_test_fds[0], _test_buf, 1); \ if (ret > 0) { \ assert (ret == 1); \ break; \ } else if (ret < 0 && errno != EINTR) { \ nih_assert_not_reached (); \ } else { \ nih_assert_not_reached (); \ } \ } \ close (_test_fds[0]); \ } else if (_pid == 0) { \ close (_test_fds[0]); \ assert (write (_test_fds[1], "\n", 1) == 1); \ close (_test_fds[1]); \ } \ } while (0); \ if (_pid == 0) \ for (int _test_child = 0; _test_child < 2; _test_child++) \ if (_test_child) { \ abort (); \ } else /* Sadly we can't test everything that job_process_spawn() does simply because * a lot of it can only be done by root, or in the case of the console stuff, * kills whatever had /dev/console (usually X). * * This set of tests at least ensures some level of code coverage. */ enum child_tests { TEST_SIMPLE, TEST_PIDS, TEST_CONSOLE, TEST_PWD, TEST_ENVIRONMENT, TEST_OUTPUT, TEST_OUTPUT_WITH_STOP, TEST_FDS }; pid_t pty_child_pid; static char *argv0; static int get_available_pty_count (void) __attribute__((unused)); static void close_all_files (void); static int child_exit_status[PROCESS_LAST]; static int child_exit_after; /** * test_job_process_handler: * * @data: existing NihList that this function will add entries to, * @pid: process that changed, * @event: event that occurred on the child, * @status: exit status, signal raised or ptrace event. * * Handler that just sets some globals and requests the main loop to * exit to allow the test that installs it to check the values passed to * this function as appropriate. **/ void test_job_process_handler (void *data, pid_t pid, NihChildEvents event, int status) { if (event != NIH_CHILD_EXITED) return; child_exit_after--; child_exit_status[child_exit_after] = status; if (child_exit_after < 1) nih_main_loop_exit (0); } static void child (enum child_tests test, const char *filename) { FILE *out; char tmpname[PATH_MAX], path[PATH_MAX]; int i; int ret = EXIT_SUCCESS; strcpy (tmpname, filename); strcat (tmpname, ".tmp"); out = fopen (tmpname, "w"); switch (test) { case TEST_SIMPLE: break; case TEST_PIDS: fprintf (out, "pid: %d\n", getpid ()); fprintf (out, "ppid: %d\n", getppid ()); fprintf (out, "pgrp: %d\n", getpgrp ()); fprintf (out, "sid: %d\n", getsid (0)); break; case TEST_CONSOLE: for (i = 0; i < 3; i++) { struct stat buf; fstat (i, &buf); fprintf (out, "%d: %d %d\n", i, major (buf.st_rdev), minor (buf.st_rdev)); } break; case TEST_PWD: assert (getcwd (path, sizeof (path))); fprintf (out, "wd: %s\n", path); break; case TEST_ENVIRONMENT: /* guarantee output ordering */ for (i = 0; environ[i]; i++); qsort (environ, i, sizeof (environ[0]), strcmp_compar); for (char **env = environ; *env; env++) fprintf (out, "%s\n", *env); break; case TEST_OUTPUT: /* Write to stdout and stderr. * * Of course, daemon's usually make a point of not writing to * stdout/stderr... */ fprintf(stdout, "stdout\n"); fprintf(stderr, "stderr\n"); /* write out pid to the output file to make it easier * for the caller to track us if we've already forked */ fprintf (out, "%d\n", getpid ()); fflush (NULL); break; case TEST_OUTPUT_WITH_STOP: fprintf (stdout, "started\n"); fflush (NULL); /* wait for signal */ raise (SIGSTOP); fprintf(stdout, "ended\n"); fflush (NULL); break; case TEST_FDS: /* Establish list of open (valid) and closed (invalid) * file descriptors. * * XXX: Note that if you attempt to run this program * through gdb, the TEST_FDS tests will probably fail. * This seems to be due to gdb creating/leaking atleast 1 fd. * * To work around this issue, either comment out all * TEST_FDS tests to allow you to debug the _actual_ failing * test(s), or if it is one of the TEST_FDS tests which is * failing either use an alternative technique to debug the * failing test(s) (such as strace(1)), or force the TEST_FDS * tests to pass in gdb by setting the appropriate flag * variable to indicate the test(s) passed. */ { DIR *dir; struct dirent *ent; struct stat statbuf; char *prefix_path = "/proc/self/fd"; char path[PATH_MAX]; char link[PATH_MAX]; int saved_errno; ssize_t len; int valid; dir = opendir(prefix_path); if (!dir) { saved_errno = errno; fprintf (out, "failed to open '%s'" " (errno=%d [%s])", prefix_path, saved_errno, strerror(saved_errno)); ret = EXIT_FAILURE; goto out; } while ((ent=readdir(dir)) != NULL) { int fd; valid = 0; if ( !strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..") ) continue; sprintf (path, "%s/%s", prefix_path, ent->d_name); fd = atoi (ent->d_name); len = readlink (path, link, sizeof (link)); TEST_GT (len, 0); link[len] = '\0'; if (fd == fileno (out)) { /* we (have to) pretend the log file that * we write is invisible. */ valid = 0; } else if (link[0] == '/') { sprintf (path, "/proc/%d/fd", getpid ()); if (stat (link, &statbuf) < 0) valid = 0; else if (S_ISDIR (statbuf.st_mode) && ! strcmp (path, link)) { /* Ignore the last entry which is a link to the * /proc/self/fd/ directory. */ valid = 0; } else { valid = 1; } } else { valid = fd_valid (fd); } fprintf (out, "fd %d: %svalid (link=%s)\n", fd, valid ? "" : "in", link); } closedir(dir); } break; } out: fsync (fileno (out)); fclose (out); rename (tmpname, filename); exit (ret); } /* FIXME: * * This is not currently reliable due to a kernel bug that does * not bound 'nr' to the range: * * 0 <= nr <= 'max' */ /** * get_available_pty_count: * * Return count of available ptys. * **/ static int get_available_pty_count (void) { FILE *f; int nr, max; int ret; f = fopen ("/proc/sys/kernel/pty/max", "r"); TEST_NE_P (f, NULL); ret = fscanf (f, "%d", &max); TEST_EQ (ret, 1); TEST_GT (max, 0); fclose (f); f = fopen ("/proc/sys/kernel/pty/nr", "r"); TEST_NE_P (f, NULL); ret = fscanf (f, "%d", &nr); TEST_EQ (ret, 1); TEST_GE (nr, 0); fclose (f); return max - nr; } /* Helper function to close all fds above 2, in case any have been leaked * to us from the environment (and thence to the child process) */ static void close_all_files (void) { unsigned long i; struct rlimit rlim; if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) return; for (i = 3; i < rlim.rlim_cur; i++) close(i); } /* XXX: Note that none of these tests attempts to test with a Session * passed to job_class_new() since to do so would modify the home * directory of the user running these tests (BAD!!). * * (Such tests are handled in the bundled test_user_sessions.sh script). */ void test_start (void) { char dirname[PATH_MAX]; JobClass *class = NULL; Job *job = NULL; FILE *output; struct stat statbuf; char filename[PATH_MAX], buf[80]; char function[PATH_MAX]; int status; siginfo_t info; char filebuf[1024]; struct passwd *pwd; struct group *grp; char *p; int ok; char buffer[1024]; pid_t pid; int i; siginfo_t siginfo; log_unflushed_init (); job_class_init (); TEST_FUNCTION ("job_process_start"); TEST_FILENAME (filename); program_name = "test"; TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* Override default location to ensure job output goes to a * writeable location */ TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); /* Check that we can run a simple command, and have the process id * and state filled in. We should be able to wait for the pid to * finish and see that it has been run as expected. */ TEST_FEATURE ("with simple command"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "touch %s", filename); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; } job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], NULL, 0); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); nih_free (class); } /* Check that we can run a command that requires a shell to be * intepreted correctly, a shell should automatically be used to * make this work. Check the contents of a file we'll create to * check that a shell really was used. */ TEST_FEATURE ("with shell command"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "echo $$ > %s\n", filename); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; } job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], NULL, 0); TEST_EQ (stat (filename, &statbuf), 0); TEST_EQ (job->class->process[PROCESS_MAIN]->script, FALSE); /* Filename should contain the pid */ output = fopen (filename, "r"); sprintf (buf, "%d\n", job->pid[PROCESS_MAIN]); TEST_FILE_EQ (output, buf); TEST_FILE_END (output); fclose (output); unlink (filename); nih_free (class); } /* Check that we can run a small shell script, and that it's run * by using the shell directly and passing the script in on the * command-line. */ TEST_FEATURE ("with small script"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = TRUE; class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "echo $0 $@ > %s\n", filename); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; } job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); output = fopen (filename, "r"); TEST_FILE_EQ (output, "/bin/sh\n"); TEST_FILE_END (output); fclose (output); unlink (filename); nih_free (class); } /* Check that we can run a small shell script that has many newlines * to be stripped from the end before passing it on the command-line. */ TEST_FEATURE ("with small script and trailing newlines"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = TRUE; class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "echo $0 $@ > %s\n\n\n", filename); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; } job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); output = fopen (filename, "r"); TEST_FILE_EQ (output, "/bin/sh\n"); TEST_FILE_END (output); fclose (output); unlink (filename); nih_free (class); } /* Check that shell scripts are run with the -e option set, so that * any failing command causes the entire script to fail. */ TEST_FEATURE ("with script that will fail"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = TRUE; class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "test -d %s > %s\n", filename, filename); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; } job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 1); output = fopen (filename, "r"); TEST_FILE_END (output); fclose (output); unlink (filename); nih_free (class); } /* Check that a job is run with the environment from its env member, * with the job name appended to it. */ TEST_FEATURE ("with environment of unnamed instance"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s %d %s", argv0, TEST_ENVIRONMENT, filename); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; assert (nih_str_array_add (&job->env, job, NULL, "FOO=BAR")); assert (nih_str_array_add (&job->env, job, NULL, "BAR=BAZ")); assert (nih_str_array_add (&job->stop_env, job, NULL, "FOO=SMACK")); assert (nih_str_array_add (&job->stop_env, job, NULL, "CRACKLE=FIZZ")); } job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], NULL, 0); TEST_EQ (stat (filename, &statbuf), 0); /* Read back the environment to make sure it matched that from * the job. */ output = fopen (filename, "r"); TEST_FILE_EQ (output, "BAR=BAZ\n"); TEST_FILE_EQ (output, "FOO=BAR\n"); if (job->class->process[PROCESS_MAIN]->script || strpbrk (job->class->process[PROCESS_MAIN]->command, SHELL_CHARS)) TEST_FILE_EQ (output, "PWD=/\n"); TEST_FILE_EQ (output, "UPSTART_INSTANCE=\n"); TEST_FILE_EQ (output, "UPSTART_JOB=test\n"); TEST_FILE_EQ (output, "UPSTART_NO_SESSIONS=1\n"); TEST_FILE_END (output); fclose (output); unlink (filename); nih_free (class); } /* Check that a job is run with the environment from its env member, * with the job name and instance name appended to it. */ TEST_FEATURE ("with environment of named instance"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s %d %s", argv0, TEST_ENVIRONMENT, filename); job = job_new (class, "foo"); job->goal = JOB_START; job->state = JOB_SPAWNED; assert (nih_str_array_add (&job->env, job, NULL, "FOO=BAR")); assert (nih_str_array_add (&job->env, job, NULL, "BAR=BAZ")); assert (nih_str_array_add (&job->stop_env, job, NULL, "FOO=SMACK")); assert (nih_str_array_add (&job->stop_env, job, NULL, "CRACKLE=FIZZ")); } job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], NULL, 0); TEST_EQ (stat (filename, &statbuf), 0); /* Read back the environment to make sure it matched that from * the job. */ output = fopen (filename, "r"); TEST_FILE_EQ (output, "BAR=BAZ\n"); TEST_FILE_EQ (output, "FOO=BAR\n"); if (job->class->process[PROCESS_MAIN]->script || strpbrk (job->class->process[PROCESS_MAIN]->command, SHELL_CHARS)) TEST_FILE_EQ (output, "PWD=/\n"); TEST_FILE_EQ (output, "UPSTART_INSTANCE=foo\n"); TEST_FILE_EQ (output, "UPSTART_JOB=test\n"); TEST_FILE_EQ (output, "UPSTART_NO_SESSIONS=1\n"); TEST_FILE_END (output); fclose (output); unlink (filename); nih_free (class); } /* Check that the pre-stop job is run with the environment from the * stop_env member as well as from the env member, overriding where * necessary, and the job name and id appended. */ TEST_FEATURE ("with environment for pre-stop"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_PRE_STOP] = process_new (class); class->process[PROCESS_PRE_STOP]->script = FALSE; class->process[PROCESS_PRE_STOP]->command = nih_sprintf ( class->process[PROCESS_PRE_STOP], "%s %d %s", argv0, TEST_ENVIRONMENT, filename); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_PRE_STOP; assert (nih_str_array_add (&job->env, job, NULL, "FOO=BAR")); assert (nih_str_array_add (&job->env, job, NULL, "BAR=BAZ")); assert (nih_str_array_add (&job->stop_env, job, NULL, "FOO=SMACK")); assert (nih_str_array_add (&job->stop_env, job, NULL, "CRACKLE=FIZZ")); } job_process_start (job, PROCESS_PRE_STOP); TEST_NE (job->pid[PROCESS_PRE_STOP], 0); waitpid (job->pid[PROCESS_PRE_STOP], NULL, 0); TEST_EQ (stat (filename, &statbuf), 0); /* Read back the environment to make sure it matched that from * the job. */ output = fopen (filename, "r"); TEST_FILE_EQ (output, "BAR=BAZ\n"); TEST_FILE_EQ (output, "CRACKLE=FIZZ\n"); TEST_FILE_EQ (output, "FOO=SMACK\n"); if (job->class->process[PROCESS_PRE_STOP]->script || strpbrk (job->class->process[PROCESS_PRE_STOP]->command, SHELL_CHARS)) TEST_FILE_EQ (output, "PWD=/\n"); TEST_FILE_EQ (output, "UPSTART_INSTANCE=\n"); TEST_FILE_EQ (output, "UPSTART_JOB=test\n"); TEST_FILE_EQ (output, "UPSTART_NO_SESSIONS=1\n"); TEST_FILE_END (output); fclose (output); unlink (filename); nih_free (class); } /* Check that the post-stop job is run with the environment from the * stop_env member as well as from the env member, overriding where * necessary, and the job name and id appended. */ TEST_FEATURE ("with environment for post-stop"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->script = FALSE; class->process[PROCESS_POST_STOP]->command = nih_sprintf ( class->process[PROCESS_POST_STOP], "%s %d %s", argv0, TEST_ENVIRONMENT, filename); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_POST_STOP; assert (nih_str_array_add (&job->env, job, NULL, "FOO=BAR")); assert (nih_str_array_add (&job->env, job, NULL, "BAR=BAZ")); assert (nih_str_array_add (&job->stop_env, job, NULL, "FOO=SMACK")); assert (nih_str_array_add (&job->stop_env, job, NULL, "CRACKLE=FIZZ")); } job_process_start (job, PROCESS_POST_STOP); TEST_NE (job->pid[PROCESS_POST_STOP], 0); waitpid (job->pid[PROCESS_POST_STOP], NULL, 0); TEST_EQ (stat (filename, &statbuf), 0); /* Read back the environment to make sure it matched that from * the job. */ output = fopen (filename, "r"); TEST_FILE_EQ (output, "BAR=BAZ\n"); TEST_FILE_EQ (output, "CRACKLE=FIZZ\n"); TEST_FILE_EQ (output, "FOO=SMACK\n"); if (job->class->process[PROCESS_POST_STOP]->script || strpbrk (job->class->process[PROCESS_POST_STOP]->command, SHELL_CHARS)) TEST_FILE_EQ (output, "PWD=/\n"); TEST_FILE_EQ (output, "UPSTART_INSTANCE=\n"); TEST_FILE_EQ (output, "UPSTART_JOB=test\n"); TEST_FILE_EQ (output, "UPSTART_NO_SESSIONS=1\n"); TEST_FILE_END (output); fclose (output); unlink (filename); nih_free (class); } /* Check that a particularly long script is instead invoked by * using the /proc/self/fd feature, with the shell script fed to the * child process by an NihIo structure. */ TEST_FEATURE ("with long script"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = TRUE; class->process[PROCESS_MAIN]->command = nih_alloc ( class->process[PROCESS_MAIN], 4096); sprintf (class->process[PROCESS_MAIN]->command, "exec > %s\necho $0\necho $@\n", filename); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; } job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); TEST_WATCH_LOOP (); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); output = fopen (filename, "r"); TEST_FILE_EQ_N (output, "/proc/self/fd/"); TEST_FILE_EQ (output, "\n"); TEST_FILE_END (output); fclose (output); unlink (filename); nih_free (class); } /* Check that if we're running a non-daemon job, the trace state * is reset and no process trace is established. */ TEST_FEATURE ("with non-daemon job"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_MAIN]->command = "true"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job->trace_forks = 2; job->trace_state = TRACE_NORMAL; } job_process_start (job, PROCESS_MAIN); TEST_EQ (job->trace_forks, 0); TEST_EQ (job->trace_state, TRACE_NONE); TEST_NE (job->pid[PROCESS_MAIN], 0); assert0 (waitid (P_PID, job->pid[PROCESS_MAIN], &info, WEXITED | WSTOPPED)); TEST_EQ (info.si_pid, job->pid[PROCESS_MAIN]); TEST_EQ (info.si_code, CLD_EXITED); TEST_EQ (info.si_status, 0); nih_free (class); } /* Check that if we're running a script for a daemon job, the * trace state is reset and no process trace is established. */ TEST_FEATURE ("with script for daemon job"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_PRE_START] = process_new (class); class->process[PROCESS_PRE_START]->script = FALSE; class->process[PROCESS_PRE_START]->command = "true"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_PRE_START; job->trace_forks = 2; job->trace_state = TRACE_NORMAL; } job_process_start (job, PROCESS_PRE_START); TEST_EQ (job->trace_forks, 0); TEST_EQ (job->trace_state, TRACE_NONE); TEST_NE (job->pid[PROCESS_PRE_START], 0); assert0 (waitid (P_PID, job->pid[PROCESS_PRE_START], &info, WEXITED | WSTOPPED)); TEST_EQ (info.si_pid, job->pid[PROCESS_PRE_START]); TEST_EQ (info.si_code, CLD_EXITED); TEST_EQ (info.si_status, 0); nih_free (class); } /* Check that if we're running a daemon job, the trace state * is reset and a process trace is established so that we can * follow the forks. */ TEST_FEATURE ("with daemon job"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->expect = EXPECT_DAEMON; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_MAIN]->command = "true"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job->trace_forks = 2; job->trace_state = TRACE_NORMAL; } job_process_start (job, PROCESS_MAIN); TEST_EQ (job->trace_forks, 0); TEST_EQ (job->trace_state, TRACE_NEW); TEST_NE (job->pid[PROCESS_MAIN], 0); assert0 (waitid (P_PID, job->pid[PROCESS_MAIN], &info, WEXITED | WSTOPPED)); TEST_EQ (info.si_pid, job->pid[PROCESS_MAIN]); TEST_EQ (info.si_code, CLD_TRAPPED); TEST_EQ (info.si_status, SIGTRAP); assert0 (ptrace (PTRACE_DETACH, job->pid[PROCESS_MAIN], NULL, 0)); assert0 (waitid (P_PID, job->pid[PROCESS_MAIN], &info, WEXITED | WSTOPPED)); TEST_EQ (info.si_pid, job->pid[PROCESS_MAIN]); TEST_EQ (info.si_code, CLD_EXITED); TEST_EQ (info.si_status, 0); nih_free (class); } /* Check that if we're running a forking job, the trace state * is reset and a process trace is established so that we can * follow the fork. */ TEST_FEATURE ("with forking job"); TEST_HASH_EMPTY (job_classes); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->expect = EXPECT_FORK; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_MAIN]->command = "true"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job->trace_forks = 2; job->trace_state = TRACE_NORMAL; } job_process_start (job, PROCESS_MAIN); TEST_EQ (job->trace_forks, 0); TEST_EQ (job->trace_state, TRACE_NEW); TEST_NE (job->pid[PROCESS_MAIN], 0); assert0 (waitid (P_PID, job->pid[PROCESS_MAIN], &info, WEXITED | WSTOPPED)); TEST_EQ (info.si_pid, job->pid[PROCESS_MAIN]); TEST_EQ (info.si_code, CLD_TRAPPED); TEST_EQ (info.si_status, SIGTRAP); assert0 (ptrace (PTRACE_DETACH, job->pid[PROCESS_MAIN], NULL, 0)); assert0 (waitid (P_PID, job->pid[PROCESS_MAIN], &info, WEXITED | WSTOPPED)); TEST_EQ (info.si_pid, job->pid[PROCESS_MAIN]); TEST_EQ (info.si_code, CLD_EXITED); TEST_EQ (info.si_status, 0); nih_free (class); } /* Check that if we try and run a command that doesn't exist, * job_process_start() raises a ProcessError and the command doesn't * have any stored process id for it. */ TEST_FEATURE ("with no such file"); TEST_HASH_EMPTY (job_classes); TEST_RESET_MAIN_LOOP (); TEST_INSTALL_CHILD_HANDLERS (); output = tmpfile (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_MAIN]->command = filename; job = job_new (class, "foo"); job->goal = JOB_START; job->state = JOB_SPAWNED; nih_hash_add (job_classes, &class->entry); TEST_CLEAR_CHILD_STATUS (); } TEST_DIVERT_STDERR (output) { job_process_start (job, PROCESS_MAIN); pid = job->pid[PROCESS_MAIN]; TEST_GT (pid, 0); TEST_EQ (nih_main_loop (), 0); TEST_EQ (child_exit_status[PROCESS_MAIN], 255); } rewind (output); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_GT (sprintf (buffer, "test: test (foo) main process (%i) terminated with status 255\n", pid), 0); TEST_GT (fgets (filebuf, sizeof (filebuf), output), 0); TEST_TRUE (strcmp (filebuf, ("test: Failed to spawn test (foo) main " "process: unable to execute: " "No such file or directory\n")) == 0 || strcmp (filebuf, buffer) == 0); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (class); } TEST_EQ (rmdir (dirname), 0); TEST_RESET_MAIN_LOOP (); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* Override default location to ensure job output goes to a * writeable location */ TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); /************************************************************/ TEST_FEATURE ("ensure sane fds with no console, no script"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "prism", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/prism.log", dirname), 0); sprintf (function, "%d", TEST_FDS); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s %s %s", argv0, function, filename); class->process[PROCESS_MAIN]->script = FALSE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (stat (filename, &statbuf), 0); output = fopen (filename, "r"); { char state[32]; int fd; int ret; int valid; while (fgets (filebuf, sizeof(filebuf), output) != NULL) { ret = sscanf (filebuf, "fd %d: %s ", &fd, state); TEST_EQ (ret, 2); if (! strcmp ("invalid", state)) valid = 0; else valid = 1; /* 0, 1, 2 */ if (fd < 3) { if (! valid) TEST_FAILED ("fd %d is unexpectedly invalid", fd); } else { if (valid) TEST_FAILED ("fd %d is unexpectedly valid", fd); } } } fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("ensure sane fds with no console, and script"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "prism", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/prism.log", dirname), 0); sprintf (function, "%d", TEST_FDS); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s %s %s", argv0, function, filename); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (stat (filename, &statbuf), 0); output = fopen (filename, "r"); { char state[32]; int fd; int ret; int valid; while (fgets (filebuf, sizeof(filebuf), output) != NULL) { ret = sscanf (filebuf, "fd %d: %s ", &fd, state); TEST_EQ (ret, 2); if (! strcmp ("invalid", state)) valid = 0; else valid = 1; /* 0, 1, 2 */ if (fd < 3) { if (! valid) TEST_FAILED ("fd %d is unexpectedly invalid", fd); } else { if (valid) TEST_FAILED ("fd %d is unexpectedly valid", fd); } } } fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("ensure sane fds with console log, no script"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "prism", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/prism.log", dirname), 0); sprintf (function, "%d", TEST_FDS); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s %s %s", argv0, function, filename); class->process[PROCESS_MAIN]->script = FALSE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (stat (filename, &statbuf), 0); output = fopen (filename, "r"); { char state[32]; int fd; int ret; int valid; while (fgets (filebuf, sizeof(filebuf), output) != NULL) { ret = sscanf (filebuf, "fd %d: %s ", &fd, state); TEST_EQ (ret, 2); if (! strcmp ("invalid", state)) valid = 0; else valid = 1; /* 0, 1, 2 */ if (fd < 3) { if (! valid) TEST_FAILED ("fd %d is unexpectedly invalid", fd); } else { if (valid) TEST_FAILED ("fd %d is unexpectedly valid", fd); } } } fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("ensure sane fds with console log, and script"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "prism", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/prism.log", dirname), 0); sprintf (function, "%d", TEST_FDS); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s %s %s", argv0, function, filename); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (stat (filename, &statbuf), 0); output = fopen (filename, "r"); { char state[32]; int fd; int ret; int valid; while (fgets (filebuf, sizeof(filebuf), output) != NULL) { ret = sscanf (filebuf, "fd %d: %s ", &fd, state); TEST_EQ (ret, 2); if (! strcmp ("invalid", state)) valid = 0; else valid = 1; /* 0, 1, 2 */ if (fd < 3) { if (! valid) TEST_FAILED ("fd %d is unexpectedly invalid", fd); } else { if (valid) TEST_FAILED ("fd %d is unexpectedly valid", fd); } } } fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("ensure that no log file written for single-line no-output script"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "/bin/true"); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); ENSURE_DIRECTORY_EMPTY (dirname); /* Paranoia */ TEST_TRUE (stat (filename, &statbuf) < 0 && errno == ENOENT); nih_free (class); /************************************************************/ TEST_FEATURE ("ensure that no log file written for single-line no-output command"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "/bin/true"); class->process[PROCESS_MAIN]->script = FALSE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); ENSURE_DIRECTORY_EMPTY (dirname); /* Paranoia */ TEST_TRUE (stat (filename, &statbuf) < 0 && errno == ENOENT); nih_free (class); /************************************************************/ TEST_FEATURE ("ensure that no log file written for CONSOLE_NONE"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello world", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); /* If a log is written, select(2) will inform us, but we don't * expect this, hence specify a timeout. */ { struct timeval t; /* be generous */ t.tv_sec = 2; t.tv_usec = 0; TEST_WATCH_UPDATE_TIMEOUT (&t); } ENSURE_DIRECTORY_EMPTY (dirname); /* Paranoia */ TEST_TRUE (stat (filename, &statbuf) < 0 && errno == ENOENT); nih_free (class); /************************************************************/ TEST_FEATURE ("ensure that no log file written for multi-line no-output script"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "/bin/true\n/bin/false"); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); /* XXX: call 0: async process setup */ TEST_WATCH_UPDATE (); /* XXX: call 1: wait for script write to child shell */ TEST_WATCH_UPDATE (); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); /* we've just run /bin/false remember? :) */ TEST_EQ (WEXITSTATUS (status), 1); /* XXX: call 2: wait for read from pty allowing logger to write to log file */ TEST_WATCH_UPDATE (); ENSURE_DIRECTORY_EMPTY (dirname); /* Paranoia */ TEST_TRUE (stat (filename, &statbuf) < 0 && errno == ENOENT); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line script that writes 1 line to stdout"); TEST_HASH_EMPTY (job_classes); /* Note we can't use TEST_ALLOC_FAIL() for this test since on * the ENOMEM loop all we could do is discard the error and * continue since job_process_start() calls job_process_spawn() * repeatedly until it works, but the alloc fails in log_new() * invoked by job_process_spawn() such that when we've left * job_process_start(), it's too late. * * However, we test this scenario in test_spawn() so all is not * lost. */ class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello world", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line script that is killed"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello world;sleep 999", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); /* wait for process to setup */ TEST_WATCH_UPDATE (); /* wait for read from pty allowing logger to write to log file */ TEST_WATCH_UPDATE (); TEST_EQ (kill (-job->pid[PROCESS_MAIN], SIGKILL), 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGKILL); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* This is very icky... * * Since we're not running an nih_main_loop, select(2) is * not being called for us. We have already called * select(2) once via TEST_WATCH_UPDATE() (since we expect * the job to have produced output) but we have absolutely * no way of knowing if it should be called again unless we have * a custom loop which calls select(2) and then checks for the * expected result. However, that would either mean * TEST_WATCH_UPDATE() could not be called "in isolation" or * that it would need to accept a block that could check some * condition to know whether to call select(2) again. * * For now, we cheat by re-reading the log file a number of * times. If we don't see the expected result within a * "reasonable" period, we fail. * * This loop is necessary since although the amount of data * being transferred is tiny, the kernel occasionally splits it * into multiple chunks using one of the line end characters as * a "delimiter". */ CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line command that is killed"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s", TEST_CMD_YES); class->process[PROCESS_MAIN]->script = FALSE; job = job_new (class, ""); TEST_NE_P (job, NULL); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); /* wait for process to setup */ TEST_WATCH_UPDATE (); /* wait for read from pty allowing logger to write to log file */ TEST_WATCH_UPDATE (); TEST_EQ (kill (job->pid[PROCESS_MAIN], SIGKILL), 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGKILL); /* allow destructor to write any lingering unflushed data */ nih_free (class); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* Timed repeated read until we get the result we expect. */ ok = FALSE; while (fgets (filebuf, sizeof(filebuf), output) != NULL) { if (! strcmp (filebuf, "y\r\n")) ok = TRUE; else ok = FALSE; if (! ok) break; } if (! ok) { /* The last entry has been truncated, probably due to * the kernel breaking the data on one of the newline * characters. Attempt a few times to re-read all the * expected data. */ for (int i = 0; i < MAX_ITERATIONS; i++) { /* rewind until 3 bytes ('y', '\r' and '\n') * before EOF. */ fseek (output, 3, SEEK_END); TEST_NE_P (fgets (filebuf, sizeof (filebuf), output), NULL); if (! strcmp (filebuf, "y\r\n")) { ok = TRUE; break; } sleep (1); rewind (output); } } TEST_EQ (ok, TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("with multi-line script that is killed"); TEST_HASH_EMPTY (job_classes); /* Note we can't use TEST_ALLOC_FAIL() for this test since on * the ENOMEM loop all we could do is discard the error and * continue since job_process_start() calls job_process_spawn() * repeatedly until it works, but the alloc fails in log_new() * invoked by job_process_spawn() such that when we've left * job_process_start(), it's too late. * * However, we test this scenario in test_spawn() so all is not * lost. */ class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello world\nsleep 999", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); /* wait for process to setup */ TEST_WATCH_UPDATE (); /* XXX: call 1: wait for script write to child shell */ TEST_WATCH_UPDATE (); /* XXX: call 2: wait for read from pty allowing logger to write to log file */ TEST_WATCH_UPDATE (); TEST_EQ (kill (-job->pid[PROCESS_MAIN], SIGKILL), 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGKILL); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line script that writes 1 byte and is killed"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s -ne X;sleep 999", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); /* wait for process to setup */ TEST_WATCH_UPDATE (); /* wait for read from pty allowing logger to write to log file */ TEST_WATCH_UPDATE (); TEST_EQ (kill (-job->pid[PROCESS_MAIN], SIGKILL), 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGKILL); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "X"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ /* Can't think of a command that would echo 1 byte and then * either sleep or read a file forever to allow us time to kill * it *after* it had written the single byte. Answers on a * postcard please. * * TEST_FEATURE ("with single-line command that writes 1 byte and is killed"); */ /************************************************************/ TEST_FEATURE ("with multi-line script that writes 1 byte and is killed"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "multiline", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/multiline.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "/bin/true\n%s -ne F", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); /* wait for process to setup */ TEST_WATCH_UPDATE (); /* XXX: call 1: wait for script write to child shell */ TEST_WATCH_UPDATE (); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); /* XXX: call 2: wait for read from pty allowing logger to write to log file */ TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_FILE_EQ (output, "F"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line command that writes 1 line to stdout"); TEST_HASH_EMPTY (job_classes); /* Note we can't use TEST_ALLOC_FAIL() for this test since on * the ENOMEM loop all we could do is discard the error and * continue since job_process_start() calls job_process_spawn() * repeatedly until it works, but the alloc fails in log_new() * invoked by job_process_spawn() such that when we've left * job_process_start(), it's too late. * * However, we test this scenario in test_spawn() so all is not * lost. */ class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello world", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = FALSE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with multi-line script that writes 1 line to stdout"); TEST_HASH_EMPTY (job_classes); /* XXX: Note that all tests which use multi-line scripts (but * XXX: *NOT* commands!) and produce output must call * XXX: TEST_WATCH_UPDATE() *TWICE* to ensure select(2) is * XXX: called twice. * * This is required since job_process_start() uses an NihIo object * to squirt the script to the shell sub-process and this * triggers select to return when the data is written to the shell. * However, we don't care about that directly - we care more about * a subsequent fd becoming ready to read data from - the fd * associated with the pty which will trigger the log file to be * written. * * Note that the 2nd call to TEST_WATCH_UPDATE would not be * required should job_process_start() simple invoke write(2) to * send the data. */ class = job_class_new (NULL, "multiline", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/multiline.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "/bin/true\n%s hello world\n\n\n\n\n\n\n\n\n\n", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); /* wait for process to setup */ TEST_WATCH_UPDATE (); /* XXX: call 1: wait for script write to child shell */ TEST_WATCH_UPDATE (); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); /* XXX: call 2: wait for read from pty allowing logger to write to log file */ TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with instance job and single-line script that writes 1 line to stdout"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test-instance.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello world", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, "instance"); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line script that writes >1 lines to stdout"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/foo.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], /* XXX: note the required quoting */ "%s -ne \"hello world\\n\\n\\n\"", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* Yup, pseudo-terminals record *everything*, * even the carriage returns. */ CHECK_FILE_EQ (output, "hello world\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line command that writes >1 lines to stdout"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/foo.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], /* XXX: note the required quoting */ "%s -ne \"hello world\\n\\n\\n\"", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = FALSE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with multi-line script that writes >1 lines to stdout"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "elf", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/elf.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], /* XXX: note the required quoting */ "\n/bin/true\n%s -ne \"hello world\\n\\n\\n\"\n\n", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); TEST_WATCH_UPDATE (); TEST_WATCH_UPDATE (); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line script that writes 1 line to stderr"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello world >&2", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line command that writes 1 line to stderr"); TEST_HASH_EMPTY (job_classes); /* Run a command that generates output to stderr without having * to use script redirection. * * dd(1) is a good choice as it always writes to stderr. */ class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s if=/dev/zero of=/dev/null bs=1 count=0", TEST_CMD_DD); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "0+0 records in\r\n", TRUE); CHECK_FILE_EQ (output, "0+0 records out\r\n", TRUE); TEST_FILE_MATCH (output, "0 bytes (0 B) copied,*\r\n"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with multi-line script that writes 1 line to stderr"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "/bin/true\n%s hello world >&2\n\n\n", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); TEST_WATCH_UPDATE (); TEST_WATCH_UPDATE (); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line script that writes >1 lines to stderr"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/foo.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], /* XXX: note the required quoting */ "%s -ne \"hello\\nworld\\n\\n\\n\" >&2", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* Yup, pseudo-terminals record *everything*, * even the carriage returns. */ CHECK_FILE_EQ (output, "hello\r\n", TRUE); CHECK_FILE_EQ (output, "world\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line command that writes >1 lines to stderr"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/foo.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], /* XXX: note the required quoting */ "%s -ne \"hello world\\n\\n\\n\"", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = FALSE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with multi-line script that writes >1 lines to stderr"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "elf", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/elf.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], /* XXX: note the required quoting */ "/bin/true\n%s -ne \"hello world\\n\\n\" 1>&2\n\n\n", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); TEST_WATCH_UPDATE (); TEST_WATCH_UPDATE (); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); CHECK_FILE_EQ (output, "\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line script that writes 1 line to stdout then 1 line to stderr"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "blah", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/blah.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], /* XXX: note the required quoting */ "%s stdout;%s stderr >&2", TEST_CMD_ECHO, TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "stdout\r\n", TRUE); CHECK_FILE_EQ (output, "stderr\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line script that writes 1 line to stderr then 1 line to stdout"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "blah", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/blah.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], /* XXX: note the required quoting */ "%s stderr >&2;%s stdout", TEST_CMD_ECHO, TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "stderr\r\n", TRUE); CHECK_FILE_EQ (output, "stdout\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line command that writes to stdout and stderr"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "blah", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/blah.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s if=/dev/zero bs=1 count=7", TEST_CMD_DD); class->process[PROCESS_MAIN]->script = FALSE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_NE_P (fgets (filebuf, sizeof(filebuf), output), NULL); TEST_EQ (memcmp (filebuf, "\000\000\000\000\000\000", 7), 0); p = filebuf + 7; TEST_EQ_STR (p, "7+0 records in\r\n"); CHECK_FILE_EQ (output, "7+0 records out\r\n", TRUE); TEST_FILE_MATCH (output, "7 bytes (7 B) copied,*\r\n"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line script running an invalid command"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "blah", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/blah.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "/this/command/does/not/exist"); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_NE (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_TRUE (fgets (buffer, sizeof(buffer), output)); TEST_STR_MATCH (buffer, "*sh:*/this/command/does/not/exist:*"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************ * Superficially, there seems little point in running a test for * this scenario since if Upstart attempts to exec(2) directly a * command that does not exist, the exec simply fails (since * there is no shell to report the error). * * And yet -- ironically -- bug 912558 would have been prevented * had we originally tested this scenario! ************************************************************/ TEST_FEATURE ("with single-line command running an invalid command"); TEST_HASH_EMPTY (job_classes); TEST_RESET_MAIN_LOOP (); TEST_INSTALL_CHILD_HANDLERS (); class = job_class_new (NULL, "buzz", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/buzz.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "/this/command/does/not/exist"); class->process[PROCESS_MAIN]->script = FALSE; /* Stranger things have happened at sea */ TEST_EQ (stat (class->process[PROCESS_MAIN]->command, &statbuf), -1); TEST_EQ (errno, ENOENT); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; /* XXX: Manually add the class so job_process_find() works */ nih_hash_add (job_classes, &class->entry); output = tmpfile (); TEST_NE_P (output, NULL); TEST_CLEAR_CHILD_STATUS (); TEST_DIVERT_STDERR (output) { job_process_start (job, PROCESS_MAIN); TEST_GT (job->pid[PROCESS_MAIN], 0); TEST_EQ (nih_main_loop (), 0); TEST_EQ (child_exit_status[PROCESS_MAIN], 255); } TEST_FILE_END (output); fclose (output); /* We don't expect a logfile to be written since there is no * accompanying shell to write the error. */ TEST_EQ (stat (filename, &statbuf), -1); TEST_EQ (errno, ENOENT); nih_free (class); TEST_RESET_MAIN_LOOP (); #if 0 /************************************************************/ TEST_FEATURE ("with single-line command running an invalid command, then a 1-line post-stop script"); TEST_HASH_EMPTY (job_classes); TEST_INSTALL_CHILD_HANDLERS (); class = job_class_new (NULL, "asterix", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/asterix.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "/this/command/does/not/exist"); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = nih_sprintf ( class->process[PROCESS_POST_STOP], "echo hello"); class->process[PROCESS_POST_STOP]->script = TRUE; /* Stranger things have happened at sea */ TEST_EQ (stat (class->process[PROCESS_MAIN]->command, &statbuf), -1); TEST_EQ (errno, ENOENT); job = job_new (class, ""); /* XXX: Manually add the class so job_process_find() works */ nih_hash_add (job_classes, &class->entry); output = tmpfile (); TEST_NE_P (output, NULL); TEST_DIVERT_STDERR (output) { job->goal = JOB_START; job->state = JOB_SPAWNED; TEST_CLEAR_CHILD_STATUS (); child_exit_after = 2; job_process_start (job, PROCESS_MAIN); TEST_GT (job->pid[PROCESS_MAIN], 0); TEST_EQ (nih_main_loop (), 0); /* Check exit status in reverse order */ /* Main */ TEST_EQ (child_exit_status[1], 255); /* Post-stop */ TEST_EQ (child_exit_status[0], 0); /* And the post stop should have written data */ TEST_EQ (stat (filename, &statbuf), 0); } fclose (output); /* check file contents */ output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with single-line command running an invalid command, then a 2-line post-stop script"); TEST_HASH_EMPTY (job_classes); TEST_RESET_MAIN_LOOP (); TEST_INSTALL_CHILD_HANDLERS (); class = job_class_new (NULL, "asterix", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/asterix.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "/this/command/does/not/exist"); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = nih_sprintf ( class->process[PROCESS_POST_STOP], "echo hello\necho world"); class->process[PROCESS_POST_STOP]->script = TRUE; /* Stranger things have happened at sea */ TEST_EQ (stat (class->process[PROCESS_MAIN]->command, &statbuf), -1); TEST_EQ (errno, ENOENT); job = job_new (class, ""); /* XXX: Manually add the class so job_process_find() works */ nih_hash_add (job_classes, &class->entry); output = tmpfile (); TEST_NE_P (output, NULL); TEST_DIVERT_STDERR (output) { job->goal = JOB_START; job->state = JOB_SPAWNED; TEST_CLEAR_CHILD_STATUS (); child_exit_after = 2; job_process_start (job, PROCESS_MAIN); TEST_NE (job->pid[PROCESS_MAIN], 0); TEST_EQ (nih_main_loop (), 0); TEST_EQ (child_exit_status[1], 255); TEST_EQ (child_exit_status[0], 0); /* And the post stop should have written data */ TEST_EQ (stat (filename, &statbuf), 0); } fclose (output); /* check file contents */ output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello\r\n", TRUE); CHECK_FILE_EQ (output, "world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); TEST_RESET_MAIN_LOOP (); /************************************************************/ TEST_FEATURE ("with single-line command running an invalid command, then a post-stop command"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "asterix", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/asterix.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "/this/command/does/not/exist"); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = nih_sprintf ( class->process[PROCESS_POST_STOP], "echo hello"); class->process[PROCESS_POST_STOP]->script = FALSE; /* Stranger things have happened at sea */ TEST_EQ (stat (class->process[PROCESS_MAIN]->command, &statbuf), -1); TEST_EQ (errno, ENOENT); job = job_new (class, ""); TEST_RESET_MAIN_LOOP (); TEST_INSTALL_CHILD_HANDLERS (); output = tmpfile (); TEST_NE_P (output, NULL); TEST_DIVERT_STDERR (output) { job->goal = JOB_START; job->state = JOB_SPAWNED; TEST_CLEAR_CHILD_STATUS (); child_exit_after = 2; job_process_start (job, PROCESS_MAIN); TEST_GT (job->pid[PROCESS_MAIN], 0); TEST_EQ (nih_main_loop (), 0); TEST_GT (job->pid[PROCESS_POST_STOP], 0); TEST_EQ (child_exit_status[1], 255); TEST_EQ (child_exit_status[0], 0); /* The post stop should have written data */ TEST_EQ (stat (filename, &statbuf), 0); } fclose (output); /* check file contents */ output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); TEST_RESET_MAIN_LOOP (); #endif /************************************************************/ TEST_FEATURE ("with single-line command running an invalid command, then an invalid post-stop command"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "asterix", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/asterix.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "/this/command/does/not/exist"); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = nih_sprintf ( class->process[PROCESS_POST_STOP], "/this/command/does/not/exist"); class->process[PROCESS_POST_STOP]->script = FALSE; /* Stranger things have happened at sea */ TEST_EQ (stat (class->process[PROCESS_MAIN]->command, &statbuf), -1); TEST_EQ (errno, ENOENT); job = job_new (class, ""); TEST_RESET_MAIN_LOOP (); TEST_INSTALL_CHILD_HANDLERS (); output = tmpfile (); TEST_NE_P (output, NULL); TEST_DIVERT_STDERR (output) { job->goal = JOB_START; job->state = JOB_SPAWNED; TEST_CLEAR_CHILD_STATUS (); child_exit_after = 2; job_process_start (job, PROCESS_MAIN); TEST_GT (job->pid[PROCESS_MAIN], 0); TEST_EQ (nih_main_loop (), 0); TEST_EQ (child_exit_status[1], 255); TEST_EQ (child_exit_status[0], 255); /* Again, no file expected */ TEST_EQ (stat (filename, &statbuf), -1); TEST_EQ (errno, ENOENT); } fclose (output); nih_free (class); TEST_RESET_MAIN_LOOP (); /************************************************************/ TEST_FEATURE ("with single-line command running a valid command, then a 1-line invalid post-stop command"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "obelix", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/obelix.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello world", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = FALSE; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = nih_strdup ( class->process[PROCESS_POST_STOP], "/this/command/does/not/exist"); class->process[PROCESS_POST_STOP]->script = FALSE; /* Stranger things have happened at sea */ TEST_EQ (stat (class->process[PROCESS_POST_STOP]->command, &statbuf), -1); TEST_EQ (errno, ENOENT); job = job_new (class, ""); TEST_RESET_MAIN_LOOP (); TEST_INSTALL_CHILD_HANDLERS (); output = tmpfile (); TEST_NE_P (output, NULL); TEST_DIVERT_STDERR (output) { job->goal = JOB_START; job->state = JOB_SPAWNED; TEST_CLEAR_CHILD_STATUS (); job_process_start (job, PROCESS_MAIN); TEST_GT (job->pid[PROCESS_MAIN], 0); TEST_EQ (nih_main_loop (), 0); TEST_EQ (child_exit_status[0], 0); TEST_EQ (child_exit_status[1], -1); /* Expect a log file */ TEST_EQ (stat (filename, &statbuf), 0); job->goal = JOB_STOP; job->state = JOB_POST_STOP; TEST_CLEAR_CHILD_STATUS (); job_process_start (job, PROCESS_POST_STOP); TEST_GT (job->pid[PROCESS_POST_STOP], 0); TEST_EQ (nih_main_loop (), 0); TEST_EQ (child_exit_status[0], 255); } fclose (output); /* check file contents */ output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); TEST_RESET_MAIN_LOOP (); /************************************************************/ TEST_FEATURE ("with multi-line script running an invalid command"); TEST_HASH_EMPTY (job_classes); TEST_RESET_MAIN_LOOP (); TEST_INSTALL_CHILD_HANDLERS (); class = job_class_new (NULL, "blah", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/blah.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "true\n/this/command/does/not/exist"); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; nih_hash_add (job_classes, &class->entry); TEST_CLEAR_CHILD_STATUS (); job_process_start (job, PROCESS_MAIN); TEST_GT (job->pid[PROCESS_MAIN], 0); TEST_EQ (nih_main_loop (), 0); TEST_EQ (child_exit_status[0], 127); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_TRUE (fgets (buffer, sizeof(buffer), output)); TEST_STR_MATCH (buffer, "/proc/self/fd/9*/this/command/does/not/exist:*"); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); TEST_RESET_MAIN_LOOP (); /************************************************************/ TEST_FEATURE ("with multi-line script that writes 1 line to stdout then 1 line to stderr"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "blah", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/blah.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s stdout\n%s stderr >&2\n", TEST_CMD_ECHO, TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_WATCH_UPDATE (); TEST_NE (job->pid[PROCESS_MAIN], 0); TEST_WATCH_UPDATE (); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "stdout\r\n", TRUE); CHECK_FILE_EQ (output, "stderr\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with multi-line script that writes 1 line to stderr then 1 line to stdout"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "blah", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/blah.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s stderr >&2\n%s stdout\n", TEST_CMD_ECHO, TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = TRUE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_WATCH_UPDATE (); TEST_NE (job->pid[PROCESS_MAIN], 0); TEST_WATCH_UPDATE (); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "stderr\r\n", TRUE); CHECK_FILE_EQ (output, "stdout\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); nih_free (class); /************************************************************/ /* XXX: Note that we don't force a watch update here to simulate * a job that writes data _after_ Upstart has run nih_io_handle_fds() * in the main loop and just _before_ it exits _in the same main * loop iteration_. */ TEST_FEATURE ("with single line command writing fast and exiting"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "budapest", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/budapest.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); /* program to run "fast", so directly exec a program with * no shell intervention. */ class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello\n", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = FALSE; /* XXX: Manually add the class so job_process_find() works */ nih_hash_add (job_classes, &class->entry); NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, job_process_handler, NULL)); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); /* Wait for process to avoid any possibility of EAGAIN in * log_read_watch(). */ pid = job->pid[PROCESS_MAIN]; TEST_EQ (waitpid (pid, NULL, 0), pid); /* allow destructor to write any lingering unflushed data */ nih_free (class); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello\r\n", TRUE); TEST_FILE_END (output); fclose (output); TEST_EQ (unlink (filename), 0); /************************************************************/ TEST_FEATURE ("with single line command writing lots of data fast and exiting"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/foo.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); /* program must run "fast", so directly exec with * no shell intervention. * * Writes large number of nulls (3MB). */ #define EXPECTED_1K_BLOCKS (1024*3) #define TEST_BLOCKSIZE 1024 class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s if=/dev/zero bs=%d count=%d", TEST_CMD_DD, TEST_BLOCKSIZE, EXPECTED_1K_BLOCKS); class->process[PROCESS_MAIN]->script = FALSE; NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, job_process_handler, NULL)); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; job_process_start (job, PROCESS_MAIN); TEST_WATCH_UPDATE (); TEST_WATCH_UPDATE (); pid = job->pid[PROCESS_MAIN]; /* job will block until something reads the other end of the pty */ TEST_EQ (kill (pid, 0), 0); { size_t bytes = 0; size_t expected_bytes = TEST_BLOCKSIZE * EXPECTED_1K_BLOCKS; off_t filesize = (off_t)-1; /* Check repeatedly for job log output jobs until * we've either read the expected number of nulls, or we * timed out. */ while ( 1 ) { size_t length; size_t i; struct timeval t; nih_local char *file = NULL; t.tv_sec = 1; t.tv_usec = 0; TEST_WATCH_UPDATE_TIMEOUT (&t); TEST_EQ (stat (filename, &statbuf), 0); /* We expect the file size to change */ if (statbuf.st_size == filesize) { break; } filesize = statbuf.st_size; file = nih_file_read (NULL, filename, &length); TEST_NE_P (file, NULL); bytes = 0; for (i=0; i < length; ++i) { if (file[i] == '\0') bytes++; } if (bytes == expected_bytes) { break; } } TEST_EQ (bytes, expected_bytes); } TEST_EQ (kill (pid, 0), 0); /* Wait until the process is in a known state. This ensures that * when job_process_terminated() calls log_handle_unflushed(), * the log object will _not_ get added to the unflushed list, * meaning it will get destroyed immediately. */ waitid (P_PID, pid, &siginfo, WEXITED | WNOWAIT); nih_child_poll (); /* The process should now be dead */ TEST_EQ (kill (pid, 0), -1); TEST_EQ (errno, ESRCH); nih_free (class); TEST_EQ (stat (filename, &statbuf), 0); TEST_TRUE (S_ISREG (statbuf.st_mode)); TEST_TRUE (statbuf.st_mode & S_IRUSR); TEST_TRUE (statbuf.st_mode & S_IWUSR); TEST_FALSE (statbuf.st_mode & S_IXUSR); TEST_TRUE (statbuf.st_mode & S_IRGRP); TEST_FALSE (statbuf.st_mode & S_IWGRP); TEST_FALSE (statbuf.st_mode & S_IXGRP); TEST_FALSE (statbuf.st_mode & S_IROTH); TEST_FALSE (statbuf.st_mode & S_IWOTH); TEST_FALSE (statbuf.st_mode & S_IXOTH); TEST_EQ (unlink (filename), 0); #undef EXPECTED_1K_BLOCKS #undef TEST_BLOCKSIZE /************************************************************/ /* Applies to respawn jobs too */ TEST_FEATURE ("with log object freed on process exit"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "acorn", NULL); TEST_NE_P (class, NULL); TEST_FILENAME (filename); TEST_GT (sprintf (filename, "%s/acorn.log", dirname), 0); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s hello", TEST_CMD_ECHO); class->process[PROCESS_MAIN]->script = FALSE; /* XXX: Manually add the class so job_process_find() works */ nih_hash_add (job_classes, &class->entry); NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, job_process_handler, NULL)); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; TEST_NE_P (job->log, NULL); TEST_ALLOC_PARENT (job->log, job); for (i = 0; i < PROCESS_LAST; i++) { TEST_EQ_P (job->log[i], NULL); } job_process_start (job, PROCESS_MAIN); TEST_WATCH_UPDATE (); pid = job->pid[PROCESS_MAIN]; job->goal = JOB_STOP; job->state = JOB_KILLED; TEST_NE (job->pid[PROCESS_MAIN], 0); TEST_NE_P (job->log, NULL); for (i = 0; i < PROCESS_LAST; i++) { if (i == PROCESS_MAIN) { TEST_NE_P (job->log[i], NULL); TEST_ALLOC_PARENT (job->log[i], job->log); } else { TEST_EQ_P (job->log[i], NULL); } } TEST_FREE_TAG (job); TEST_FREE_TAG (job->log); /* Wait until the process is in a known state. This ensures that * when job_process_terminated() calls log_handle_unflushed(), * the log object will _not_ get added to the unflushed list, * meaning it will get destroyed immediately. */ waitid (P_PID, pid, &siginfo, WEXITED | WNOWAIT); nih_child_poll (); /* Should have been destroyed now */ TEST_FREE (job); TEST_FREE (job->log); nih_free (class); unlink (filename); /************************************************************/ /* Check that we can succesfully setuid and setgid to * ourselves. This should always work, privileged or * otherwise. */ TEST_FEATURE ("with setuid me"); TEST_HASH_EMPTY (job_classes); TEST_NE_P (output, NULL); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "touch %s", filename); pwd = getpwuid (getuid ()); TEST_NE (pwd, NULL); class->setuid = nih_strdup (class, pwd->pw_name); grp = getgrgid (getgid ()); TEST_NE (grp, NULL); class->setgid = nih_strdup (class, grp->gr_name); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; output = tmpfile (); } TEST_DIVERT_STDERR (output) { job_process_start (job, PROCESS_MAIN); } fclose (output); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], NULL, 0); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); nih_free (class); } /************************************************************/ /* Check that initgroups gets called. * The test will run a job as nobody/nogroup (setuid/setgid) target. * * When run from an unprivileged user, the check will ensure that upstart * fails to start the job (returning -1) as initgroups() is a privileged * call (similar to setuid and setgid). * * When run from a privileged user (root), the check will ensure that * upstart succeeds in dropping privileges, which includes calling * initgroup, setuid and setgid. * * If the test is started by user nobody/nogroup, then it'll succeed as * there's no privilege changes to be done in such case (same uid/gid). */ TEST_FEATURE ("with setuid"); TEST_HASH_EMPTY (job_classes); TEST_RESET_MAIN_LOOP (); TEST_INSTALL_CHILD_HANDLERS (); TEST_NE_P (output, NULL); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "touch %s", filename); pwd = getpwnam ("nobody"); TEST_NE (pwd, NULL); class->setuid = nih_strdup (class, pwd->pw_name); grp = getgrnam ("nogroup"); TEST_NE (grp, NULL); class->setgid = nih_strdup (class, grp->gr_name); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; nih_hash_add (job_classes, &class->entry); TEST_CLEAR_CHILD_STATUS (); output = tmpfile (); } TEST_DIVERT_STDERR (output) { job_process_start (job, PROCESS_MAIN); TEST_GT (job->pid[PROCESS_MAIN], 0); TEST_EQ (nih_main_loop (), 0); } if (geteuid() == 0 || getuid() == pwd->pw_uid) { TEST_EQ (stat (filename, &statbuf), 0); } else { TEST_EQ (stat (filename, &statbuf), -1); } unlink (filename); nih_free (class); } TEST_RESET_MAIN_LOOP (); /************************************************************/ TEST_FEATURE ("with multiple processes and log"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "aero", NULL); TEST_NE_P (class, NULL); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); TEST_GT (sprintf (filename, "%s/aero.log", dirname), 0); sprintf (function, "%d", TEST_OUTPUT_WITH_STOP); /* Create a temporary filename for child() output. We don't care * about this file as we're interested in childs() stdout/stderr * output only. */ TEST_FILENAME (filebuf); class->console = CONSOLE_LOG; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "%s %s %s", argv0, function, filebuf); class->process[PROCESS_MAIN]->script = FALSE; sprintf (function, "%d", TEST_OUTPUT); class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = nih_sprintf ( class->process[PROCESS_POST_START], "%s %s %s", argv0, function, filebuf); class->process[PROCESS_POST_START]->script = FALSE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNING; job_process_start (job, PROCESS_MAIN); while (stat (filename, &statbuf) != 0 || statbuf.st_size < 9) { TEST_WATCH_UPDATE (); } pid = job->pid[PROCESS_MAIN]; TEST_GT (pid, 0); TEST_EQ (stat (filename, &statbuf), 0); output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* initial output from main process */ TEST_FILE_EQ (output, "started\r\n"); TEST_EQ (fclose (output), 0); job_process_start (job, PROCESS_POST_START); TEST_WATCH_UPDATE (); pid = job->pid[PROCESS_POST_START]; TEST_GT (pid, 0); /* wait for post-start to finish */ waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); while (stat (filename, &statbuf) != 0 || statbuf.st_size < 25) { TEST_WATCH_UPDATE (); } output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* initial output from main process, followed by all output from * post-start process. */ CHECK_FILE_EQ (output, "started\r\n", TRUE); CHECK_FILE_EQ (output, "stdout\r\n", TRUE); CHECK_FILE_EQ (output, "stderr\r\n", TRUE); TEST_FILE_END (output); TEST_EQ (fclose (output), 0); pid = job->pid[PROCESS_MAIN]; TEST_EQ (kill (pid, SIGCONT), 0); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); /* wait for post-start to finish */ waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_WATCH_UPDATE (); output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* initial output from main process, followed by all output from * post-start process, followed by final data from main process. */ CHECK_FILE_EQ (output, "started\r\n", TRUE); CHECK_FILE_EQ (output, "stdout\r\n", TRUE); CHECK_FILE_EQ (output, "stderr\r\n", TRUE); CHECK_FILE_EQ (output, "ended\r\n", TRUE); TEST_FILE_END (output); TEST_EQ (fclose (output), 0); TEST_EQ (unlink (filebuf), 0); TEST_EQ (unlink (filename), 0); /************************************************************/ /* Final clean-up */ TEST_EQ (rmdir (dirname), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); TEST_HASH_EMPTY (job_classes); } /* * XXX: Note that none of these tests attempts to test with a Session * passed to job_class_new() since to do so would modify the home * directory of the user running these tests (BAD!!). * * (Such tests are handled in the bundled test_user_sessions.sh script). */ void test_spawn (void) { FILE *output, *input; char function[PATH_MAX], filename[PATH_MAX]; char dirname[PATH_MAX]; char script[PATH_MAX]; char buf[80]; char filebuf[1024]; char *args[6]; char *env[3]; nih_local char **args_array = NULL; size_t argc; JobClass *class; Job *job; pid_t pid; siginfo_t info; NihError *err; //JobProcessError *perr; int status; struct stat statbuf; int ret; int job_process_fd = -1; nih_local NihIoBuffer *buffer = NULL; log_unflushed_init (); /* reset */ (void) umask (0); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); /* Override default location to ensure job output goes to a * writeable location */ TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); TEST_FUNCTION ("job_process_spawn_with_fd"); TEST_FILENAME (filename); args[0] = argv0; args[1] = function; args[2] = filename; args[3] = NULL; /* Check that we can spawn a simple job, waiting for the child * process to complete and reading from the file written to check * that the process tree is what we expect it to look like. */ TEST_FEATURE ("with simple job"); TEST_HASH_EMPTY (job_classes); sprintf (function, "%d", TEST_PIDS); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); waitpid (pid, NULL, 0); output = fopen (filename, "r"); TEST_GT (pid, 0); TEST_NE (pid, getpid ()); sprintf (buf, "pid: %d\n", pid); TEST_FILE_EQ (output, buf); sprintf (buf, "ppid: %d\n", getpid ()); TEST_FILE_EQ (output, buf); sprintf (buf, "pgrp: %d\n", pid); TEST_FILE_EQ (output, buf); sprintf (buf, "sid: %d\n", pid); TEST_FILE_EQ (output, buf); TEST_FILE_END (output); fclose (output); assert0 (unlink (filename)); nih_free (class); /* Check that a job spawned with no console has the file descriptors * bound to the /dev/null device. */ TEST_FEATURE ("with no console"); TEST_HASH_EMPTY (job_classes); sprintf (function, "%d", TEST_CONSOLE); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); waitpid (pid, NULL, 0); output = fopen (filename, "r"); TEST_FILE_EQ (output, "0: 1 3\n"); TEST_FILE_EQ (output, "1: 1 3\n"); TEST_FILE_EQ (output, "2: 1 3\n"); TEST_FILE_END (output); fclose (output); assert0 (unlink (filename)); nih_free (class); /* Check that a job spawned with a log console has file descriptors: * * 0 bound to the /dev/null device. * 1 bound to the pseudo-tty device. * 2 bound to the pseudo-tty device. * */ TEST_FEATURE ("with console logging"); TEST_HASH_EMPTY (job_classes); sprintf (function, "%d", TEST_CONSOLE); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_LOG; job = job_new (class, ""); pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); waitpid (pid, NULL, 0); output = fopen (filename, "r"); /* /dev/null */ TEST_FILE_EQ (output, "0: 1 3\n"); /* stdout and stderr should be bound to the same Unix98 PTY slave * device (one of the char devices in range 136-143). * We ignore the minor as it could be any value. */ { unsigned int major, saved_major; unsigned int unused; TEST_EQ (fscanf (output, "1: %u %u\n", &major, &unused), 2); TEST_TRUE (major >= 136 && major <= 143); saved_major = major; TEST_EQ (fscanf (output, "2: %u %u\n", &major, &unused), 2); TEST_TRUE (major == saved_major); } TEST_FILE_END (output); fclose (output); assert0 (unlink (filename)); nih_free (class); /* Check that a job with an alternate working directory is run from * that directory. */ TEST_FEATURE ("with working directory"); TEST_HASH_EMPTY (job_classes); sprintf (function, "%d", TEST_PWD); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->chdir = "/tmp"; job = job_new (class, ""); pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); waitpid (pid, NULL, 0); output = fopen (filename, "r"); TEST_FILE_EQ (output, "wd: /tmp\n"); TEST_FILE_END (output); fclose (output); assert0 (unlink (filename)); nih_free (class); /* Check that a job is run with only the environment variables * specifiec in the function call. */ TEST_FEATURE ("with environment"); TEST_HASH_EMPTY (job_classes); sprintf (function, "%d", TEST_ENVIRONMENT); setenv ("BAR", "baz", TRUE); env[0] = "PATH=/bin"; env[1] = "FOO=bar"; env[2] = NULL; class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); pid = job_process_spawn_with_fd (job, args, env, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); waitpid (pid, NULL, 0); output = fopen (filename, "r"); TEST_FILE_EQ (output, "FOO=bar\n"); TEST_FILE_EQ (output, "PATH=/bin\n"); TEST_FILE_EQ (output, "UPSTART_NO_SESSIONS=1\n"); TEST_FILE_END (output); fclose (output); assert0 (unlink (filename)); nih_free (class); /* Check that when we spawn an ordinary job, it isn't usually ptraced * since that's a special honour reserved for daemons that we expect * to fork. */ TEST_FEATURE ("with non-daemon job"); TEST_HASH_EMPTY (job_classes); sprintf (function, "%d", TEST_SIMPLE); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); assert0 (waitid (P_PID, pid, &info, WEXITED | WSTOPPED | WCONTINUED)); TEST_EQ (info.si_code, CLD_EXITED); TEST_EQ (info.si_status, 0); assert0 (unlink (filename)); nih_free (class); /* Check that when we spawn a daemon job, we can request that the * parent be traced. */ TEST_FEATURE ("with daemon job"); TEST_HASH_EMPTY (job_classes); sprintf (function, "%d", TEST_SIMPLE); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); class->console = CONSOLE_NONE; pid = job_process_spawn_with_fd (job, args, NULL, TRUE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); assert0 (waitid (P_PID, pid, &info, WEXITED | WSTOPPED | WCONTINUED)); TEST_EQ (info.si_code, CLD_TRAPPED); TEST_EQ (info.si_status, SIGTRAP); assert0 (ptrace (PTRACE_DETACH, pid, NULL, 0)); assert0 (waitid (P_PID, pid, &info, WEXITED | WSTOPPED | WCONTINUED)); TEST_EQ (info.si_code, CLD_EXITED); TEST_EQ (info.si_status, 0); assert0 (unlink (filename)); nih_free (class); #if 0 /* Check that attempting to spawn a binary that doesn't exist returns * an error immediately with all of the expected information in the * error structure. */ TEST_FEATURE ("with no such file"); TEST_HASH_EMPTY (job_classes); args[0] = filename; args[1] = filename; args[2] = NULL; class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_NE (pid, 0); buffer = read_from_fd (NULL, job_process_fd); TEST_NE_P (buffer, NULL); job_process_error_handler (buffer->buf, buffer->len); err = nih_error_get (); TEST_EQ (err->number, JOB_PROCESS_ERROR); TEST_ALLOC_SIZE (err, sizeof (JobProcessError)); perr = (JobProcessError *)err; TEST_EQ (perr->type, JOB_PROCESS_ERROR_EXEC); TEST_EQ (perr->arg, 0); TEST_EQ (perr->errnum, ENOENT); nih_free (perr); nih_free (buffer); #endif /************************************************************/ TEST_FEATURE ("with no such file, no shell and console log"); TEST_HASH_EMPTY (job_classes); args[0] = "does-not-exist"; args[1] = NULL; class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_LOG; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_SPAWNED; TEST_NE_P (job->log, NULL); TEST_EQ_P (job->log[PROCESS_MAIN], NULL); pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); job->process_data[PROCESS_MAIN] = NIH_MUST ( job_process_data_new (job->process_data, job, PROCESS_MAIN, job_process_fd)); TEST_WATCH_UPDATE (); TEST_NE (pid, 0); TEST_GT (waitpid (-1, NULL, 0), 0); NihIo *io = nih_io_reopen (job, job_process_fd, NIH_IO_STREAM, NULL, NULL, NULL, NULL); TEST_NE_P (io, NULL); buffer = read_from_fd (NULL, job_process_fd); TEST_NE_P (buffer, NULL); TEST_NE_P (job->process_data[PROCESS_MAIN], NULL); TEST_TRUE (job->process_data[PROCESS_MAIN]->valid); TEST_NE_P (job->log[PROCESS_MAIN], NULL); job_process_child_reader (job->process_data[PROCESS_MAIN], io, buffer->buf, buffer->len); /* The log should have been allocated in job_process_spawn, * but then freed on error. */ TEST_EQ_P (job->log[PROCESS_MAIN], NULL); /* Check that we can spawn a job and pause it */ TEST_FEATURE ("with debug enabled"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->debug = TRUE; job = job_new (class, ""); sprintf (function, "%s", "/bin/true"); args[0] = function; args[1] = function; args[2] = NULL; pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); /* Ensure process is still running after some period of time. * * If it hasn't stopped as we expect it will certainly have finished by now, * thanks to the sleep. */ sleep (1); assert0 (kill(pid, 0)); TEST_GE (waitid (P_PID, pid, &info, WNOHANG | WUNTRACED), 0); TEST_EQ (info.si_code, CLD_STOPPED); TEST_EQ (info.si_status, SIGSTOP); assert0 (kill(pid, SIGCONT)); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (class); /********************************************************************/ TEST_FEATURE ("ensure sane fds with no console"); TEST_HASH_EMPTY (job_classes); sprintf (function, "%d", TEST_FDS); args[0] = argv0; args[1] = function; args[2] = filename; args[3] = NULL; class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); waitpid (pid, NULL, 0); TEST_EQ (stat (filename, &statbuf), 0); output = fopen (filename, "r"); TEST_NE_P (output, NULL); { char state[32]; int fd; int ret; int valid; while (fgets (filebuf, sizeof(filebuf), output) != NULL) { ret = sscanf (filebuf, "fd %d: %s ", &fd, state); TEST_EQ (ret, 2); if (! strcmp ("invalid", state)) valid = 0; else valid = 1; /* 0, 1, 2 */ if (fd < 3) { if (! valid) TEST_FAILED ("fd %d is unexpectedly invalid", fd); } else { if (valid) TEST_FAILED ("fd %d is unexpectedly valid", fd); } } } fclose (output); assert0 (unlink (filename)); nih_free (class); /********************************************************************/ TEST_FEATURE ("ensure sane fds with console log"); TEST_HASH_EMPTY (job_classes); sprintf (function, "%d", TEST_FDS); args[0] = argv0; args[1] = function; args[2] = filename; args[3] = NULL; class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_LOG; job = job_new (class, ""); pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); waitpid (pid, NULL, 0); TEST_EQ (stat (filename, &statbuf), 0); output = fopen (filename, "r"); TEST_NE_P (output, NULL); { char state[32]; int fd; int ret; int valid; while (fgets (filebuf, sizeof(filebuf), output) != NULL) { ret = sscanf (filebuf, "fd %d: %s ", &fd, state); TEST_EQ (ret, 2); if (! strcmp ("invalid", state)) valid = 0; else valid = 1; /* 0, 1, 2 */ if (fd < 3) { if (! valid) TEST_FAILED ("fd %d is unexpectedly invalid", fd); } else { if (valid) TEST_FAILED ("fd %d is unexpectedly valid", fd); } } } fclose (output); assert0 (unlink (filename)); TEST_EQ (rmdir (dirname), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("ensure multi process output logged"); TEST_LIST_EMPTY (nih_io_watches); TEST_HASH_EMPTY (job_classes); TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); class = job_class_new (NULL, "multiproc", NULL); TEST_NE_P (class, NULL); class->console = CONSOLE_LOG; TEST_GT (sprintf (filename, "%s/multiproc.log", dirname), 0); job = job_new (class, ""); TEST_NE_P (job, NULL); sprintf (function, "%d", TEST_OUTPUT_WITH_STOP); /* Create a temporary filename for child() output. We don't care * about this file as we're interested in childs() stdout/stderr * output only. */ TEST_FILENAME (filebuf); args[0] = argv0; args[1] = function; args[2] = filebuf; args[3] = NULL; job->pid[PROCESS_MAIN] = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); pid = job->pid[PROCESS_MAIN]; TEST_GT (pid, 0); /* The main process is now running, but paused. It should have * produced some output so check that now. */ TEST_WATCH_UPDATE (); TEST_EQ (stat (filename, &statbuf), 0); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "started\r\n", TRUE); TEST_FILE_END (output); TEST_EQ (fclose (output), 0); sprintf (function, "%d", TEST_OUTPUT); args[0] = argv0; args[1] = function; args[2] = filebuf; args[3] = NULL; job->pid[PROCESS_POST_START] = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_POST_START, &job_process_fd); pid = job->pid[PROCESS_POST_START]; TEST_GT (pid, 0); /* wait for post-start process to end */ waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); /* ensure log written */ nih_free (job->log[PROCESS_POST_START]); job->log[PROCESS_POST_START] = NULL; output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* from main process */ CHECK_FILE_EQ (output, "started\r\n", TRUE); /* from post-start process */ CHECK_FILE_EQ (output, "stdout\r\n", TRUE); /* from post-start process */ CHECK_FILE_EQ (output, "stderr\r\n", TRUE); TEST_FILE_END (output); fclose (output); pid = job->pid[PROCESS_MAIN]; TEST_EQ (kill (pid, SIGCONT), 0); /* wait for main process to end */ waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); /* ensure log written */ nih_free (job->log[PROCESS_MAIN]); job->log[PROCESS_MAIN] = NULL; output = fopen (filename, "r"); TEST_NE_P (output, NULL); /* from main process */ CHECK_FILE_EQ (output, "started\r\n", TRUE); /* from post-start process */ CHECK_FILE_EQ (output, "stdout\r\n", TRUE); /* from post-start process */ CHECK_FILE_EQ (output, "stderr\r\n", TRUE); /* from main process */ CHECK_FILE_EQ (output, "ended\r\n", TRUE); TEST_FILE_END (output); fclose (output); assert0 (unlink (filebuf)); assert0 (unlink (filename)); TEST_EQ (rmdir (dirname), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("simple test"); TEST_HASH_EMPTY (job_classes); TEST_FILENAME (dirname); umask(0); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "simple-test", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); argc = 0; args_array = NIH_MUST (nih_str_array_new (NULL)); TEST_FILENAME (script); input = fopen (script, "w"); TEST_NE_P (input, NULL); TEST_GT (fprintf (input, "%s hello world\n", TEST_CMD_ECHO), 0); fclose (input); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, TEST_SHELL)); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, TEST_SHELL_ARG)); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, script)); } pid = job_process_spawn_with_fd (job, args_array, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); if (test_alloc_failed) { TEST_LT (pid, 0); err = nih_error_get (); TEST_NE_P (err, NULL); TEST_EQ (err->number, ENOMEM); nih_free (err); assert0 (unlink (script)); } else { TEST_GT (pid, 0); TEST_EQ (waitpid (pid, &status, 0), pid); } TEST_ALLOC_SAFE { /* May alloc space if there is log data */ nih_free (class); TEST_GT (sprintf (filename, "%s/simple-test.log", dirname), 0); if (!test_alloc_failed) { output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); TEST_EQ (fclose (output), 0); } unlink (filename); } } assert0 (rmdir (dirname)); /************************************************************/ TEST_FEATURE ("with single-line script and 'console log'"); TEST_HASH_EMPTY (job_classes); /* Check that we can spawn a job and retrieve its output. */ TEST_FILENAME (dirname); umask(0); TEST_EQ (mkdir (dirname, 0755), 0); /* Override default location to ensure job output goes to a * writeable location */ TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); class = job_class_new (NULL, "with-single-line-script-and-console-log", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/with-single-line-script-and-console-log.log", dirname), 0); job = job_new (class, ""); TEST_NE_P (job, NULL); argc = 0; args_array = NIH_MUST (nih_str_array_new (NULL)); TEST_FILENAME (script); input = fopen (script, "w"); TEST_NE_P (input, NULL); TEST_GT (fprintf (input, "%s hello world\n", TEST_CMD_ECHO), 0); fclose (input); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, TEST_SHELL)); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, TEST_SHELL_ARG)); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, script)); pid = job_process_spawn_with_fd (job, args_array, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); TEST_EQ (waitpid (pid, &status, 0), pid); TEST_TRUE (WIFEXITED (status)); TEST_WATCH_UPDATE (); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); TEST_EQ (fclose (output), 0); assert0 (unlink (filename)); assert0 (unlink (script)); TEST_EQ (rmdir (dirname), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); nih_free (class); /************************************************************/ TEST_FEATURE ("with multi-line script and 'console log'"); TEST_HASH_EMPTY (job_classes); /* Check that we can spawn a job and retrieve its output. */ TEST_FILENAME (dirname); umask(0); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); class = job_class_new (NULL, "with-multi-line-script-and-console-log", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/with-multi-line-script-and-console-log.log", dirname), 0); job = job_new (class, ""); TEST_NE_P (job, NULL); argc = 0; args_array = NIH_MUST (nih_str_array_new (NULL)); TEST_FILENAME (script); input = fopen (script, "w"); TEST_NE_P (input, NULL); TEST_GT (fprintf (input, "/bin/true\n%s hello world\n", TEST_CMD_ECHO), 0); fclose (input); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, TEST_SHELL)); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, TEST_SHELL_ARG)); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, script)); pid = job_process_spawn_with_fd (job, args_array, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); TEST_EQ (waitpid (pid, &status, 0), pid); TEST_TRUE (WIFEXITED (status)); TEST_WATCH_UPDATE (); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "hello world\r\n", TRUE); TEST_FILE_END (output); TEST_EQ (fclose (output), 0); assert0 (unlink (filename)); assert0 (unlink (script)); TEST_EQ (rmdir (dirname), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); nih_free (job); /************************************************************/ TEST_FEATURE ("read single null byte with 'console log'"); TEST_HASH_EMPTY (job_classes); /* Check that we can spawn a job and read a single byte written * to stdout. */ TEST_FILENAME (dirname); umask(0); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); class = job_class_new (NULL, "read-single-null-bytes-with-console-log", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/read-single-null-bytes-with-console-log.log", dirname), 0); job = job_new (class, ""); TEST_NE_P (job, NULL); argc = 0; args_array = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, TEST_CMD_ECHO)); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, "-en")); NIH_MUST (nih_str_array_add (&args_array, NULL, &argc, "\\000")); pid = job_process_spawn_with_fd (job, args_array, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); TEST_EQ (waitpid (pid, &status, 0), pid); TEST_TRUE (WIFEXITED (status)); ret = log_handle_unflushed (job->log, job->log[PROCESS_MAIN]); TEST_EQ (ret, 1); output = fopen (filename, "r"); TEST_NE_P (output, NULL); TEST_NE_P (fgets (filebuf, sizeof(filebuf), output), NULL); TEST_EQ (memcmp (filebuf, "\000", 1), 0); TEST_FILE_END (output); TEST_EQ (fclose (output), 0); assert0 (unlink (filename)); TEST_EQ (rmdir (dirname), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); nih_free (job); nih_free (class); /************************************************************/ TEST_FEATURE ("read data from forked process"); TEST_HASH_EMPTY (job_classes); TEST_FILENAME (dirname); umask(0); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); class = job_class_new (NULL, "read-data-from-forked-process", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/read-data-from-forked-process.log", dirname), 0); job = job_new (class, ""); TEST_NE_P (job, NULL); sprintf (function, "%d", TEST_OUTPUT); /* fork */ sprintf (filebuf, "%d", 1); TEST_FILENAME (script); args[0] = argv0; args[1] = function; args[2] = script; args[3] = filebuf; args[4] = NULL; pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); TEST_NE (waitpid (pid, &status, 0), -1); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); ret = log_handle_unflushed (job->log, job->log[PROCESS_MAIN]); TEST_EQ (ret, 1); TEST_WATCH_UPDATE (); /* This will eventually call the log destructor */ nih_free (class); TEST_LIST_EMPTY (nih_io_watches); TEST_EQ (stat (filename, &statbuf), 0); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "stdout\r\n", FALSE); CHECK_FILE_EQ (output, "stderr\r\n", FALSE); TEST_FILE_END (output); TEST_EQ (fclose (output), 0); assert0 (unlink (filename)); TEST_EQ (rmdir (dirname), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); /************************************************************/ TEST_FEATURE ("read data from daemon process"); TEST_HASH_EMPTY (job_classes); TEST_FILENAME (dirname); umask(0); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); job = job_new (class, ""); TEST_NE_P (job, NULL); sprintf (function, "%d", TEST_OUTPUT); /* daemonize */ sprintf (filebuf, "%d", 2); TEST_FILENAME (script); args[0] = argv0; args[1] = function; args[2] = script; args[3] = filebuf; args[4] = NULL; pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_GT (pid, 0); TEST_WATCH_UPDATE (); TEST_EQ (waitpid (pid, &status, 0), pid); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); /* This will eventually call the log destructor */ nih_free (class); output = fopen (filename, "r"); TEST_NE_P (output, NULL); CHECK_FILE_EQ (output, "stdout\r\n", FALSE); CHECK_FILE_EQ (output, "stderr\r\n", FALSE); TEST_FILE_END (output); TEST_EQ (fclose (output), 0); assert0 (unlink (filename)); TEST_EQ (rmdir (dirname), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); /* FIXME */ #if 0 /************************************************************/ TEST_FEATURE ("when no free ptys"); TEST_HASH_EMPTY (job_classes); { int available_ptys; int ret; struct rlimit rlimit; TEST_FILENAME (dirname); umask(0); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); class = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); TEST_EQ (class->console, CONSOLE_LOG); TEST_GT (sprintf (filename, "%s/test.log", dirname), 0); job = job_new (class, ""); TEST_NE_P (job, NULL); available_ptys = get_available_pty_count (); TEST_GT (available_ptys, 1); TEST_EQ (getrlimit (RLIMIT_NOFILE, &rlimit), 0); if ((unsigned int)rlimit.rlim_cur <= (unsigned int)available_ptys) { /* Since we do not run as root, we are unable to * raise our limit to allow us to consume all * remaining ptys. */ printf ("WARNING:\n"); printf ("WARNING: Test not run as insufficient files available\n"); printf ("WARNING: (%u available files for uid %d, need atleast %u)\n", (unsigned int)rlimit.rlim_cur, (int)getuid (), (unsigned int)available_ptys); printf ("WARNING:\n"); printf ("WARNING: See limits(5).\n"); printf ("WARNING:\n"); } else { /* Consume all free ptys */ { int pty; for (pty = 0; pty < available_ptys; ++pty) { ret = posix_openpt (O_RDWR | O_NOCTTY); if (ret < 0) break; } } pid = job_process_spawn_with_fd (job, args, NULL, FALSE, -1, PROCESS_MAIN, &job_process_fd); TEST_WATCH_UPDATE (); TEST_NE (pid, 0); buffer = read_from_fd (NULL, job_process_fd); TEST_NE_P (buffer, NULL); job_process_error_handler (buffer->buf, buffer->len); /* Ensure logging disabled in failure scenarios */ TEST_EQ (class->console, CONSOLE_NONE); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); } nih_free (class); } assert0 (rmdir (dirname)); #else /* FIXME */ TEST_FEATURE ("WARNING: FIXME: test 'when no free ptys' disabled due to kernel bug"); #endif TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); } void test_log_path (void) { JobClass *class = NULL; Job *job = NULL; nih_local char *log_path = NULL; nih_local char *expected = NULL; nih_local char *home = NULL; char dirname[PATH_MAX]; TEST_FILENAME (dirname); TEST_FUNCTION ("job_process_log_path"); /************************************************************/ TEST_FEATURE ("with system job with simple name"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "system", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); log_path = job_process_log_path (job, FALSE); TEST_NE_P (log_path, NULL); expected = NIH_MUST (nih_sprintf (NULL, "%s/%s.log", EXPECTED_JOB_LOGDIR, "system")); TEST_EQ_STR (log_path, expected); nih_free (class); /************************************************************/ TEST_FEATURE ("with system job containing illegal path characters"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "//hello_foo bar.z/", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); log_path = job_process_log_path (job, FALSE); TEST_NE_P (log_path, NULL); expected = NIH_MUST (nih_sprintf (NULL, "%s/%s.log", EXPECTED_JOB_LOGDIR, "__hello_foo bar.z_")); TEST_EQ_STR (log_path, expected); nih_free (class); /************************************************************/ TEST_FEATURE ("with system job with named instance"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "foo bar", NULL); TEST_NE_P (class, NULL); job = job_new (class, "bar foo"); TEST_NE_P (job, NULL); log_path = job_process_log_path (job, FALSE); TEST_NE_P (log_path, NULL); expected = NIH_MUST (nih_sprintf (NULL, "%s/%s.log", EXPECTED_JOB_LOGDIR, "foo bar-bar foo")); TEST_EQ_STR (log_path, expected); nih_free (class); /************************************************************/ TEST_FEATURE ("with system job with named instance and illegal path characters"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "a/b", NULL); TEST_NE_P (class, NULL); job = job_new (class, "c/d_?/"); TEST_NE_P (job, NULL); log_path = job_process_log_path (job, FALSE); TEST_NE_P (log_path, NULL); expected = NIH_MUST (nih_sprintf (NULL, "%s/%s.log", EXPECTED_JOB_LOGDIR, "a_b-c_d_?_")); TEST_EQ_STR (log_path, expected); nih_free (class); /************************************************************/ TEST_FEATURE ("with subverted logdir and system job with named instance and illegal path characters"); TEST_HASH_EMPTY (job_classes); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); class = job_class_new (NULL, "a/b", NULL); TEST_NE_P (class, NULL); job = job_new (class, "c/d_?/"); TEST_NE_P (job, NULL); log_path = job_process_log_path (job, FALSE); TEST_NE_P (log_path, NULL); expected = NIH_MUST (nih_sprintf (NULL, "%s/%s.log", dirname, "a_b-c_d_?_")); TEST_EQ_STR (log_path, expected); nih_free (class); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); TEST_HASH_EMPTY (job_classes); } void test_kill (void) { JobClass * class; Job * job = NULL; NihTimer * timer; struct timespec now; pid_t pid; int status; TEST_FUNCTION ("job_process_kill"); nih_timer_init (); event_init (); class = job_class_new (NULL, "test", NULL); class->kill_timeout = 1000; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_strdup ( class->process[PROCESS_MAIN], "echo"); /* Check that an easily killed process goes away with just a single * call to job_process_kill, having received the TERM signal. * A kill timer should be set to handle the case where the child * doesn't get reaped. */ TEST_FEATURE ("with easily killed process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); } job->goal = JOB_STOP; job->state = JOB_KILLED; TEST_CHILD (job->pid[PROCESS_MAIN]) { pause (); } pid = job->pid[PROCESS_MAIN]; setpgid (pid, pid); job_process_kill (job, PROCESS_MAIN); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_KILLED); TEST_EQ (job->pid[PROCESS_MAIN], pid); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGTERM); assert0 (clock_gettime (CLOCK_MONOTONIC, &now)); TEST_NE_P (job->kill_timer, NULL); TEST_ALLOC_SIZE (job->kill_timer, sizeof (NihTimer)); TEST_ALLOC_PARENT (job->kill_timer, job); TEST_GE (job->kill_timer->due, now.tv_sec + 950); TEST_LE (job->kill_timer->due, now.tv_sec + 1000); TEST_EQ (job->kill_process, PROCESS_MAIN); nih_free (job->kill_timer); job->kill_timer = NULL; job->kill_process = PROCESS_INVALID; nih_free (job); event_poll (); } /* Check that a process that's hard to kill doesn't go away, but * that the kill timer sends the KILL signal which should finally * get rid of it. */ TEST_FEATURE ("with hard to kill process"); TEST_ALLOC_FAIL { int wait_fd = 0; TEST_ALLOC_SAFE { job = job_new (class, ""); } job->goal = JOB_STOP; job->state = JOB_KILLED; TEST_CHILD_WAIT (job->pid[PROCESS_MAIN], wait_fd) { struct sigaction act; act.sa_handler = SIG_IGN; act.sa_flags = 0; sigemptyset (&act.sa_mask); sigaction (SIGTERM, &act, NULL); TEST_CHILD_RELEASE (wait_fd); for (;;) pause (); } pid = job->pid[PROCESS_MAIN]; setpgid (pid, pid); job_process_kill (job, PROCESS_MAIN); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_KILLED); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (kill (job->pid[PROCESS_MAIN], 0), 0); assert0 (clock_gettime (CLOCK_MONOTONIC, &now)); TEST_NE_P (job->kill_timer, NULL); TEST_ALLOC_SIZE (job->kill_timer, sizeof (NihTimer)); TEST_ALLOC_PARENT (job->kill_timer, job); TEST_GE (job->kill_timer->due, now.tv_sec + 950); TEST_LE (job->kill_timer->due, now.tv_sec + 1000); TEST_EQ (job->kill_process, PROCESS_MAIN); /* Run the kill timer */ timer = job->kill_timer; timer->callback (timer->data, timer); nih_free (timer); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_KILLED); TEST_EQ (job->pid[PROCESS_MAIN], pid); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGKILL); TEST_EQ_P (job->kill_timer, NULL); TEST_EQ (job->kill_process, PROCESS_INVALID); nih_free (job); event_poll (); } nih_free (class); } void test_handler (void) { ConfSource * source; ConfFile * file; JobClass * class; Job * job = NULL; Blocked * blocked = NULL; Event * event; Event * bevent = NULL; FILE * output; int exitcodes[2] = { 100, SIGINT << 8 }; int status; pid_t pid; siginfo_t info; unsigned long data; struct timespec now; char dirname[PATH_MAX]; nih_local char *logfile = NULL; int fds[2] = { -1, -1}; NihIo *io = NULL; nih_local NihIoBuffer *buffer= NULL; TEST_FILENAME (dirname); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (setenv ("UPSTART_LOGDIR", dirname, 1), 0); logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s.log", dirname, "test")); TEST_FUNCTION ("job_process_handler"); program_name = "test"; output = tmpfile (); source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); file = conf_file_new (source, "/tmp/test"); file->job = class = job_class_new (NULL, "test", NULL); TEST_NE_P (file->job, NULL); class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = "echo"; class->start_on = event_operator_new (class, EVENT_MATCH, "foo", NULL); class->stop_on = event_operator_new (class, EVENT_MATCH, "foo", NULL); nih_hash_add (job_classes, &class->entry); event = event_new (NULL, "foo", NULL); /* Check that the child handler can be called with a pid that doesn't * match the job, and that the job state doesn't change. */ TEST_FEATURE ("with unknown pid"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 999, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_EQ_P (job->blocker, NULL); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that we can handle the running task of the job terminating, * which should set the goal to stop and transition a state change * into the stopping state. This should not be considered a failure. */ TEST_FEATURE ("with running process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that we can handle a running task of the job after it's been * sent the TERM signal and a kill timer set. The kill timer should * be cancelled and freed, and since we killed it, the job should * still not be considered failed. */ TEST_FEATURE ("with kill timer"); TEST_ALLOC_FAIL { NihTimer *timer = NULL; TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_KILLED; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_ALLOC_SAFE { timer = (void *) nih_strdup (job, "test"); } TEST_FREE_TAG (timer); job->kill_timer = timer; job->kill_process = PROCESS_MAIN; TEST_FREE_TAG (job); job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_FREE (timer); TEST_FREE (job); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, FALSE); TEST_FREE (blocked); } /* Check that if the process is restarting, and died when we killed * it, the goal remains as start and a state change is still * transitioned. This should also not be considered a failure. */ TEST_FEATURE ("with restarting process"); TEST_ALLOC_FAIL { NihTimer *timer = NULL; TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_KILLED; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_ALLOC_SAFE { timer = (void *) nih_strdup (job, "test"); } TEST_FREE_TAG (timer); job->kill_timer = timer; job->kill_process = PROCESS_MAIN; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_FREE (timer); TEST_EQ_P (job->kill_timer, NULL); TEST_EQ (job->kill_process, PROCESS_INVALID); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that we can handle the pre-start process of the job exiting, * and if it terminates with a good error code, end up in the running * state. */ TEST_FEATURE ("with pre-start process"); class->process[PROCESS_PRE_START] = process_new (class); class->process[PROCESS_PRE_START]->command = "echo"; assert0 (pipe (fds)); close (fds[1]); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); job->process_data[PROCESS_PRE_START] = NIH_MUST ( job_process_data_new (job->process_data, job, PROCESS_PRE_START, fds[0])); } job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_MAIN] = 0; job->pid[PROCESS_PRE_START] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_EQ (job->state, JOB_SPAWNED); job_change_state (job, job_next_state(job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_PRE_START], 0); TEST_GT (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], NULL, 0); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } close (fds[0]); nih_free (class->process[PROCESS_PRE_START]); class->process[PROCESS_PRE_START] = NULL; unlink (logfile); /* Check that we can handle a failing pre-start process of the job, * which changes the goal to stop and transitions a state change in * that direction to the stopping state. An error should be emitted * and the job and event should be marked as failed. */ TEST_FEATURE ("with failed pre-start process"); class->process[PROCESS_PRE_START] = process_new (class); class->process[PROCESS_PRE_START]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_PRE_START] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 1); } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_PRE_START], 0); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, TRUE); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_PRE_START); TEST_EQ (job->exit_status, 1); TEST_FILE_EQ (output, ("test: test pre-start process (1) " "terminated with status 1\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } nih_free (class->process[PROCESS_PRE_START]); class->process[PROCESS_PRE_START] = NULL; unlink (logfile); /* Check that we can handle a killed starting task, which should * act as if it failed. A different error should be output and * the failed exit status should contain the signal and the high bit. */ TEST_FEATURE ("with killed pre-start process"); class->process[PROCESS_PRE_START] = process_new (class); class->process[PROCESS_PRE_START]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_PRE_START] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_KILLED, SIGTERM); } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_PRE_START], 0); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, TRUE); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_PRE_START); TEST_EQ (job->exit_status, SIGTERM << 8); TEST_FILE_EQ (output, ("test: test pre-start process (1) " "killed by TERM signal\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } nih_free (class->process[PROCESS_PRE_START]); class->process[PROCESS_PRE_START] = NULL; unlink (logfile); /* Check that we can catch the running task of a service stopping * with an error, and if the job is to be respawned, go into * the stopping state but don't change the goal to stop. * * This should also emit a warning, but should not set the failed * state since we're dealing with it. */ TEST_FEATURE ("with respawn of running service process"); class->respawn = TRUE; class->respawn_limit = 5; class->respawn_interval = 10; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 1); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); assert0 (clock_gettime (CLOCK_MONOTONIC, &now)); TEST_EQ (job->respawn_count, 1); TEST_LE (job->respawn_time, now.tv_sec); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ (job->class->process[PROCESS_MAIN]->script, FALSE); TEST_FILE_EQ (output, ("test: test main process (1) " "terminated with status 1\n")); TEST_FILE_EQ (output, ("test: test main process ended, " "respawning\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->respawn = FALSE; /* Check that we can catch the running task of a service stopping * with an error, and if the job is to be respawned, go into * the stopping state but don't change the goal to stop. * * This should also emit a warning, but should not set the failed * state since we're dealing with it. */ TEST_FEATURE ("with respawn of running task process"); class->task = TRUE; class->respawn = TRUE; class->respawn_limit = 5; class->respawn_interval = 10; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 1); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); assert0 (clock_gettime (CLOCK_MONOTONIC, &now)); TEST_EQ (job->respawn_count, 1); TEST_LE (job->respawn_time, now.tv_sec); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ (job->class->process[PROCESS_MAIN]->script, FALSE); TEST_FILE_EQ (output, ("test: test main process (1) " "terminated with status 1\n")); TEST_FILE_EQ (output, ("test: test main process ended, " "respawning\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->respawn = FALSE; class->task = FALSE; /* Check that if the process has been respawned too many times * recently, the goal is changed to stop and the process moved into * the stopping state. */ TEST_FEATURE ("with too many respawns of running process"); class->respawn = TRUE; class->respawn_limit = 5; class->respawn_interval = 10; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); assert0 (clock_gettime (CLOCK_MONOTONIC, &now)); job->respawn_count = 5; job->respawn_time = now.tv_sec - 5; } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->respawn_count, 6); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, TRUE); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ (job->class->process[PROCESS_MAIN]->script, FALSE); TEST_FILE_EQ (output, ("test: test respawning too fast, " "stopped\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->respawn = FALSE; /* Check that we can catch a running task exiting with a "normal" * exit code, and even if it's marked respawn, set the goal to * stop and transition into the stopping state. */ TEST_FEATURE ("with normal exit of running respawn process"); class->respawn = TRUE; class->normalexit = exitcodes; class->normalexit_len = 1; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 100); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ (job->class->process[PROCESS_MAIN]->script, FALSE); nih_free (job); } class->respawn = FALSE; class->normalexit = NULL; class->normalexit_len = 0; /* Check that a zero exit is not considered normal for a service * by default. */ TEST_FEATURE ("with respawn of service process and zero exit code"); class->respawn = TRUE; class->respawn_limit = 5; class->respawn_interval = 10; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); assert0 (clock_gettime (CLOCK_MONOTONIC, &now)); TEST_EQ (job->respawn_count, 1); TEST_LE (job->respawn_time, now.tv_sec); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ (job->class->process[PROCESS_MAIN]->script, FALSE); TEST_FILE_EQ (output, ("test: test main process ended, " "respawning\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->respawn = FALSE; /* Check that zero is considered a normal exit code for a task. */ TEST_FEATURE ("with respawn of task process and zero exit code"); class->task = TRUE; class->respawn = TRUE; class->respawn_limit = 5; class->respawn_interval = 10; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ (job->class->process[PROCESS_MAIN]->script, FALSE); nih_free (job); } class->respawn = FALSE; class->task = FALSE; /* Check that a running task that fails with an exit status not * listed in normalexit causes the job to be marked as failed. */ TEST_FEATURE ("with abnormal exit of running process"); class->normalexit = exitcodes; class->normalexit_len = 2; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 99); } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, TRUE); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, 99); TEST_FILE_EQ (output, ("test: test main process (1) " "terminated with status 99\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->normalexit = NULL; class->normalexit_len = 0; /* Check that a running task that fails doesn't mark the job or * event as failed if the goal was already to stop the job (since * it's probably failed because of the TERM or KILL signal). */ TEST_FEATURE ("with killed running process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_KILLED; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_FREE_TAG (job); TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_KILLED, SIGTERM); } rewind (output); TEST_FREE (job); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, FALSE); TEST_FREE (blocked); TEST_FILE_EQ (output, ("test: test main process (1) " "killed by TERM signal\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); } /* Check that a running task that fails with an exit status * listed in normalexit does not cause the job to be marked as * failed, but instead just stops it normally. */ TEST_FEATURE ("with normal exit of running process"); class->normalexit = exitcodes; class->normalexit_len = 2; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 100); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } class->normalexit = NULL; class->normalexit_len = 0; /* Check that a running task that fails with an signal * listed in normalexit does not cause the job to be marked as * failed, but instead just stops it normally. */ TEST_FEATURE ("with normal signal killed running process"); class->normalexit = exitcodes; class->normalexit_len = 2; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_KILLED, SIGINT); } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_FILE_EQ (output, ("test: test main process (1) " "killed by INT signal\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->normalexit = NULL; class->normalexit_len = 0; /* A running task exiting with the zero exit code is considered * a normal termination if not marked respawn. */ TEST_FEATURE ("with running task and zero exit"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that we can handle the post-stop process of the job exiting, * and end up in the waiting state. */ TEST_FEATURE ("with post-stop process"); class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->pid[PROCESS_POST_STOP] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_FREE_TAG (job); job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_FREE (job); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, FALSE); TEST_FREE (blocked); } nih_free (class->process[PROCESS_POST_STOP]); class->process[PROCESS_POST_STOP] = NULL; /* Check that we can handle a failing post-stop process of the job, * which should get marked as failed if the job hasn't been already. */ TEST_FEATURE ("with failed post-stop process"); class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->pid[PROCESS_POST_STOP] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_FREE_TAG (job); TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 1); } rewind (output); TEST_FREE (job); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, TRUE); TEST_FREE (blocked); TEST_FILE_EQ (output, ("test: test post-stop process (1) " "terminated with status 1\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); } nih_free (class->process[PROCESS_POST_STOP]); class->process[PROCESS_POST_STOP] = NULL; /* Check that a failing stopping task doesn't overwrite the record * of a failing earlier task. */ TEST_FEATURE ("with stopping task failure after failure"); class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->pid[PROCESS_POST_STOP] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = TRUE; job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = SIGSEGV << 8; TEST_FREE_TAG (job); TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 1); } rewind (output); TEST_FREE (job); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, TRUE); TEST_FREE (blocked); TEST_FILE_EQ (output, ("test: test post-stop process (1) " "terminated with status 1\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); } nih_free (class->process[PROCESS_POST_STOP]); class->process[PROCESS_POST_STOP] = NULL; /* Check that we can handle the post-start task of the job exiting, * the exit status should be ignored and the job transitioned into * the running state. The pid of the job shouldn't be cleared, * but the aux pid should be. */ TEST_FEATURE ("with post-start process"); class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_POST_START] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 2, NIH_CHILD_EXITED, 1); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (job->pid[PROCESS_POST_START], 0); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_FILE_EQ (output, ("test: test post-start process (2) " "terminated with status 1\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } nih_free (class->process[PROCESS_POST_START]); class->process[PROCESS_POST_START] = NULL; /* Check that we can handle the running task of the job exiting, even * if it dies during the post-start state, which should set the goal to * stop and transition a state change into the stopping state. */ TEST_FEATURE ("with running process in post-start state"); class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->process[PROCESS_POST_START]); class->process[PROCESS_POST_START] = NULL; /* Check that we can handle the running task of the job exiting while * there is a post-start script running; this should only set the goal * to stop since we also have to wait for the post-start script to * stop. */ TEST_FEATURE ("with running process while post-start running"); class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_POST_START] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_START); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_POST_START], 2); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->process[PROCESS_POST_START]); class->process[PROCESS_POST_START] = NULL; /* Check that we can handle the running process exiting before the * post-start process finishes. This should mark the job to be * stopped, but not change the state, handling the post-start process * exiting afterwards should change the state. */ TEST_FEATURE ("with running then post-start process"); class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_POST_START] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_START); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_POST_START], 2); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); job_process_handler (NULL, 2, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_POST_START], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->process[PROCESS_POST_START]); class->process[PROCESS_POST_START] = NULL; /* Check that we can handle a failed running process before the * post-start process finishes. This should mark the job to be * stopped, but not change the state, then handling the post-start * process exiting afterwards should change the state. */ TEST_FEATURE ("with failed running then post-start process"); class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_POST_START] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_KILLED, SIGSEGV); } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_START); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_POST_START], 2); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, TRUE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, SIGSEGV << 8); TEST_FILE_EQ (output, ("test: test main process (1) " "killed by SEGV signal\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); job_process_handler (NULL, 2, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_POST_START], 0); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, TRUE); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, SIGSEGV << 8); nih_free (job); } nih_free (class->process[PROCESS_POST_START]); class->process[PROCESS_POST_START] = NULL; /* Check that we can handle the running process of a respawn job * exiting before the post-start process finishes. This should * mark the job to be respawned when the post-start script finishes * instead of making any state change. */ TEST_FEATURE ("with respawn of running while post-start process"); class->respawn = TRUE; class->respawn_limit = 5; class->respawn_interval = 10; class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_POST_START] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); } rewind (output); TEST_EQ (job->goal, JOB_RESPAWN); TEST_EQ (job->state, JOB_POST_START); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_POST_START], 2); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); job_process_handler (NULL, 2, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_POST_START], 0); assert0 (clock_gettime (CLOCK_MONOTONIC, &now)); TEST_EQ (job->respawn_count, 1); TEST_LE (job->respawn_time, now.tv_sec); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ (job->class->process[PROCESS_MAIN]->script, FALSE); TEST_FILE_EQ (output, ("test: test main process ended, " "respawning\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } nih_free (class->process[PROCESS_POST_START]); class->process[PROCESS_POST_START] = NULL; class->respawn = FALSE; /* Check that we can handle the pre-stop task of the job exiting, the * exit status should be ignored and the job transitioned into * the stopping state. The pid of the job shouldn't be cleared, * but the aux pid should be. */ TEST_FEATURE ("with pre-stop process"); class->process[PROCESS_PRE_STOP] = process_new (class); class->process[PROCESS_PRE_STOP]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_PRE_STOP; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_PRE_STOP] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 2, NIH_CHILD_EXITED, 1); } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (job->pid[PROCESS_PRE_STOP], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_FILE_EQ (output, ("test: test pre-stop process (2) " "terminated with status 1\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } nih_free (class->process[PROCESS_PRE_STOP]); class->process[PROCESS_PRE_STOP] = NULL; /* Check that we can handle the running task of the job exiting, even * if it dies during the pre-stop state, which transition a state * change into the stopping state. */ TEST_FEATURE ("with running process in pre-stop state"); class->process[PROCESS_PRE_STOP] = process_new (class); class->process[PROCESS_PRE_STOP]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_PRE_STOP; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->process[PROCESS_PRE_STOP]); class->process[PROCESS_PRE_STOP] = NULL; /* Check that we can handle the running task of the job exiting while * there is a pre-stop script running; this should have no other effect * since we also have to wait for the pre-stop script to stop. */ TEST_FEATURE ("with running process while pre-stop running"); class->process[PROCESS_PRE_STOP] = process_new (class); class->process[PROCESS_PRE_STOP]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_PRE_STOP; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_PRE_STOP] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_PRE_STOP); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_PRE_STOP], 2); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->process[PROCESS_PRE_STOP]); class->process[PROCESS_PRE_STOP] = NULL; /* Check that we can handle the running process of a respawn job * exiting before the pre-stop process finishes. This should * mark the job to be respawned when the pre-stop script finishes * instead of making any state change. */ TEST_FEATURE ("with respawn of running while pre-stop process"); class->respawn = TRUE; class->respawn_limit = 5; class->respawn_interval = 10; class->process[PROCESS_PRE_STOP] = process_new (class); class->process[PROCESS_PRE_STOP]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_PRE_STOP; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_PRE_STOP] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); } rewind (output); TEST_EQ (job->goal, JOB_RESPAWN); TEST_EQ (job->state, JOB_PRE_STOP); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_PRE_STOP], 2); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); job_process_handler (NULL, 2, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_PRE_STOP], 0); assert0 (clock_gettime (CLOCK_MONOTONIC, &now)); TEST_EQ (job->respawn_count, 1); TEST_LE (job->respawn_time, now.tv_sec); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ (job->class->process[PROCESS_MAIN]->script, FALSE); TEST_FILE_EQ (output, ("test: test main process ended, " "respawning\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } nih_free (class->process[PROCESS_PRE_STOP]); class->process[PROCESS_PRE_STOP] = NULL; class->respawn = FALSE; /* Check that we don't respawn the job if the running process exits * before the pre-stop process finishes if we were going to stop the * running proecss anyway. */ TEST_FEATURE ("with respawn of to be stopped while pre-stop process"); class->respawn = TRUE; class->respawn_limit = 5; class->respawn_interval = 10; class->process[PROCESS_PRE_STOP] = process_new (class); class->process[PROCESS_PRE_STOP]->command = "echo"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_PRE_STOP; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_PRE_STOP] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = -1; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_PRE_STOP); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_PRE_STOP], 2); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, (ProcessType)-1); TEST_EQ (job->exit_status, 0); job_process_handler (NULL, 2, NIH_CHILD_EXITED, 0); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (job->pid[PROCESS_PRE_STOP], 0); TEST_EQ (job->respawn_count, 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, (ProcessType)-1); TEST_EQ (job->exit_status, 0); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } nih_free (class->process[PROCESS_PRE_STOP]); class->process[PROCESS_PRE_STOP] = NULL; class->respawn = FALSE; /* Check that a running task that exits while we're waiting for * the stopping event to finish does not change the state or * record the exit information since we were stopping anyway and * this just makes our job easier. */ TEST_FEATURE ("with running process while stopping"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); bevent = event_new (job, "stopping", NULL); } job->goal = JOB_STOP; job->state = JOB_STOPPING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = bevent; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, 1, NIH_CHILD_KILLED, SIGTERM); } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_EQ_P (job->blocker, bevent); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); TEST_FILE_EQ (output, ("test: test main process (1) " "killed by TERM signal\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); } #if HAVE_VALGRIND_VALGRIND_H /* These tests fail when running under valgrind. */ if (! RUNNING_ON_VALGRIND) { #endif /* Check that we ignore a process stopping on a signal if it isn't * the main process of the job. */ TEST_FEATURE ("with stopped non-main process"); class->expect = EXPECT_STOP; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } TEST_CHILD (pid) { raise (SIGSTOP); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_POST_START] = pid; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_STOPPED, SIGSTOP); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (job->pid[PROCESS_POST_START], pid); TEST_EQ (kill (pid, SIGCONT), 0); waitpid (job->pid[PROCESS_POST_START], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that we ignore the main process stopping on a signal if the * job isn't in the spawned state. */ TEST_FEATURE ("with stopped main process outside of spawned"); class->expect = EXPECT_STOP; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } TEST_CHILD (pid) { raise (SIGSTOP); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_MAIN] = pid; job->pid[PROCESS_POST_START] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_STOPPED, SIGSTOP); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_POST_START); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->pid[PROCESS_POST_START], 1); TEST_EQ (kill (pid, SIGCONT), 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that we ignore the main process stopping on a signal in * the spawned state if we're not waiting for it to do so. */ TEST_FEATURE ("with stopped main process for non-wait job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } TEST_CHILD (pid) { raise (SIGSTOP); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_STOPPED, SIGSTOP); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (kill (pid, SIGCONT), 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that we ignore the main process stopping on the wrong * signal. */ TEST_FEATURE ("with stopped main process but wrong signal"); class->expect = EXPECT_STOP; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } TEST_CHILD (pid) { raise (SIGTSTP); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_STOPPED, SIGTSTP); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (kill (pid, SIGCONT), 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (event->blockers, 1); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked); TEST_EQ_P (blocked->event, event); event_unblock (event); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that if we're waiting in spawned for the main process to * stop, and it does so, the process is continued and the job state * changed to running. */ TEST_FEATURE ("with stopped main process waiting in spawned"); class->expect = EXPECT_STOP; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } TEST_CHILD (pid) { raise (SIGSTOP); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_STOPPED, SIGSTOP); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], pid); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_EQ (event->blockers, 0); TEST_EQ (event->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that a traced process has a signal delivered to it * unchanged. */ TEST_FEATURE ("with signal delivered to traced process"); class->expect = EXPECT_DAEMON; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job->trace_state = TRACE_NORMAL; } TEST_CHILD (pid) { assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); signal (SIGTERM, SIG_IGN); raise (SIGTERM); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_TRAPPED, SIGTERM); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->trace_forks, 0); TEST_EQ (job->trace_state, TRACE_NORMAL); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that a new traced process which receives SIGTRAP doesn't * have it delivered, and instead has its options set. */ TEST_FEATURE ("with trapped new traced process"); class->expect = EXPECT_DAEMON; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job->trace_state = TRACE_NEW; } TEST_CHILD (pid) { assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); raise (SIGTRAP); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_TRAPPED, SIGTRAP); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->trace_forks, 0); TEST_EQ (job->trace_state, TRACE_NORMAL); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that a new traced process child which receives SIGSTOP * doesn't have it delivered, and instead has its fork count * incremented and its options set. */ TEST_FEATURE ("with trapped new traced process"); class->expect = EXPECT_DAEMON; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job->trace_state = TRACE_NEW_CHILD; } TEST_CHILD (pid) { assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); raise (SIGSTOP); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_TRAPPED, SIGSTOP); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->trace_forks, 1); TEST_EQ (job->trace_state, TRACE_NORMAL); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that the second child of a daemon process is detached * and ends the trace, moving the job into the running state. */ TEST_FEATURE ("with second child of daemon process"); class->expect = EXPECT_DAEMON; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job->trace_forks = 1; job->trace_state = TRACE_NEW_CHILD; } TEST_CHILD (pid) { assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); raise (SIGSTOP); pause (); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_TRAPPED, SIGSTOP); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->trace_forks, 2); TEST_EQ (job->trace_state, TRACE_NONE); kill (job->pid[PROCESS_MAIN], SIGTERM); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGTERM); nih_free (job); } class->expect = EXPECT_NONE; /* Check that the first child of a forking process is detached * and ends the trace, moving the job into the running state. */ TEST_FEATURE ("with first child of forking process"); class->expect = EXPECT_FORK; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job->trace_forks = 0; job->trace_state = TRACE_NEW_CHILD; } TEST_CHILD (pid) { assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); raise (SIGSTOP); pause (); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_TRAPPED, SIGSTOP); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->trace_forks, 1); TEST_EQ (job->trace_state, TRACE_NONE); kill (job->pid[PROCESS_MAIN], SIGTERM); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGTERM); nih_free (job); } class->expect = EXPECT_NONE; /* Check that when a process forks and we receive the event for * the parent before the child (faked by killing the child), the * trace state is to expect a new child - with the state updated * to have the new pid, and the parent detached. */ TEST_FEATURE ("with fork notification before child"); class->expect = EXPECT_DAEMON; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job->trace_state = TRACE_NORMAL; } TEST_CHILD (pid) { assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); raise (SIGSTOP); fork (); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); assert0 (ptrace (PTRACE_SETOPTIONS, pid, NULL, PTRACE_O_TRACEFORK | PTRACE_O_TRACEEXEC)); assert0 (ptrace (PTRACE_CONT, pid, NULL, 0)); assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); /* Get the child process id now; it'll be stopped at a * trapped SIGSTOP, so continue and let it die - thus * simulating the event not having been received yet. */ assert0 (ptrace (PTRACE_GETEVENTMSG, pid, NULL, &data)); assert0 (waitid (P_PID, (pid_t)data, &info, WSTOPPED | WNOWAIT)); TEST_EQ (info.si_pid, (pid_t)data); TEST_EQ (info.si_code, CLD_TRAPPED); TEST_EQ (info.si_status, SIGSTOP); assert0 (ptrace (PTRACE_CONT, (pid_t)data, NULL, 0)); waitpid ((pid_t)data, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); /* Now carry on with the test */ job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_PTRACE, PTRACE_EVENT_FORK); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_NE (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->trace_forks, 0); TEST_EQ (job->trace_state, TRACE_NEW_CHILD); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that when a process forks and we receive the event for * the child before the parent (forced by deliberately waiting * for the child and reaping its event first), the existing * child is handled anyway and the trace state updated with the * new pid, the parent detached and the new child being traced * with a normal state. */ TEST_FEATURE ("with child notification before parent"); class->expect = EXPECT_DAEMON; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job->trace_state = TRACE_NORMAL; } TEST_CHILD (pid) { assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); raise (SIGSTOP); fork (); exit (0); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); assert0 (ptrace (PTRACE_SETOPTIONS, pid, NULL, PTRACE_O_TRACEFORK | PTRACE_O_TRACEEXEC)); assert0 (ptrace (PTRACE_CONT, pid, NULL, 0)); assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); /* Wait for the child process to reach SIGSTOP as well, * taking it off the wait queue. */ assert0 (ptrace (PTRACE_GETEVENTMSG, pid, NULL, &data)); assert0 (waitid (P_PID, (pid_t)data, &info, WSTOPPED | WNOWAIT)); TEST_EQ (info.si_pid, (pid_t)data); TEST_EQ (info.si_code, CLD_TRAPPED); TEST_EQ (info.si_status, SIGSTOP); /* Now carry on with the test */ job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_PTRACE, PTRACE_EVENT_FORK); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_NE (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->trace_forks, 1); TEST_EQ (job->trace_state, TRACE_NORMAL); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); waitpid ((pid_t)data, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that should the process call exec() before the first fork() * it's allowed since it's likely a shell script calling the real * thing that we want to follow. */ TEST_FEATURE ("with exec call by initial process"); class->expect = EXPECT_DAEMON; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job->trace_forks = 0; job->trace_state = TRACE_NORMAL; } TEST_CHILD (pid) { assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); raise (SIGSTOP); execl ("/bin/true", "true", NULL); exit (15); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); assert0 (ptrace (PTRACE_SETOPTIONS, pid, NULL, PTRACE_O_TRACEFORK | PTRACE_O_TRACEEXEC)); assert0 (ptrace (PTRACE_CONT, pid, NULL, 0)); assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_PTRACE, PTRACE_EVENT_EXEC); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->trace_forks, 0); TEST_EQ (job->trace_state, TRACE_NORMAL); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that should the process call exec() after fork() it ends * the tracing even if we haven't had enough forks yet and moves * the job into the running state. */ TEST_FEATURE ("with exec call by process after fork"); class->expect = EXPECT_DAEMON; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job->trace_forks = 1; job->trace_state = TRACE_NORMAL; } TEST_CHILD (pid) { assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); raise (SIGSTOP); execl ("/bin/true", "true", NULL); exit (15); } assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); assert0 (ptrace (PTRACE_SETOPTIONS, pid, NULL, PTRACE_O_TRACEFORK | PTRACE_O_TRACEEXEC)); assert0 (ptrace (PTRACE_CONT, pid, NULL, 0)); assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; TEST_DIVERT_STDERR (output) { job_process_handler (NULL, pid, NIH_CHILD_PTRACE, PTRACE_EVENT_EXEC); } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], pid); TEST_EQ (job->trace_forks, 1); TEST_EQ (job->trace_state, TRACE_NONE); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); nih_free (job); } class->expect = EXPECT_NONE; #if HAVE_VALGRIND_VALGRIND_H } #endif fclose (output); nih_free (event); event_poll (); TEST_RESET_MAIN_LOOP (); TEST_NE_P (class->process[PROCESS_MAIN], NULL); TEST_EQ_P (class->process[PROCESS_PRE_START], NULL); TEST_EQ_P (class->process[PROCESS_POST_START], NULL); TEST_EQ_P (class->process[PROCESS_PRE_STOP], NULL); TEST_EQ_P (class->process[PROCESS_POST_STOP], NULL); TEST_EQ_P (class->process[PROCESS_SECURITY], NULL); /************************************************************/ /* Ensure that if a child is setup successfully and then exits * before the main loop detects the child fd has closed (due to * the child calling execvp()), that the state is correct. */ TEST_FEATURE ("with child exit notification before child setup success notification"); job = job_new (class, ""); TEST_NE_P (job, NULL); job->goal = JOB_START; job->state = JOB_SPAWNING; assert0 (pipe (fds)); job->process_data[PROCESS_MAIN] = job_process_data_new (job->process_data, job, PROCESS_MAIN, fds[0]); TEST_NE_P (job->process_data[PROCESS_MAIN], NULL); TEST_NE_P (class->process[PROCESS_MAIN], NULL); TEST_EQ_P (class->process[PROCESS_PRE_START], NULL); TEST_EQ_P (class->process[PROCESS_POST_START], NULL); TEST_EQ_P (class->process[PROCESS_PRE_STOP], NULL); TEST_EQ_P (class->process[PROCESS_POST_STOP], NULL); TEST_EQ_P (class->process[PROCESS_SECURITY], NULL); /* used to check if job_process_terminated() called */ job->process_data[PROCESS_MAIN]->status = -1; TEST_CHILD (job->pid[PROCESS_MAIN]) { close (fds[0]); nih_io_set_cloexec (fds[1]); execl ("/bin/true", "/bin/true", NULL); } close (fds[1]); TEST_FREE_TAG (job); job_process_handler (NULL, job->pid[PROCESS_MAIN], NIH_CHILD_EXITED, 0); TEST_NOT_FREE (job); TEST_TRUE (job->process_data[PROCESS_MAIN]->valid); TEST_EQ (job->process_data[PROCESS_MAIN]->job_process_fd, fds[0]); TEST_EQ (job->process_data[PROCESS_MAIN]->shell_fd, -1); TEST_EQ_P (job->process_data[PROCESS_MAIN]->script, NULL); /* job_process_terminated() should have been called now and the * status recorded. */ TEST_EQ (job->process_data[PROCESS_MAIN]->status, 0); /* goal should not change until the IO handlers have had a * chance to run. */ TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_NE_P (job->process_data[PROCESS_MAIN], NULL); close (fds[0]); pid = job->pid[PROCESS_MAIN]; TEST_EQ (timed_waitpid (pid, 5), pid); nih_free (job); TEST_RESET_MAIN_LOOP (); /************************************************************/ /* Ensure that if a child failed to be setup and then exits * before the main loop detects the child fd has data to read * that the state is correct. */ TEST_FEATURE ("with child exit notification before child setup failure notification"); job = job_new (class, ""); TEST_NE_P (job, NULL); job->goal = JOB_START; job->state = JOB_SPAWNING; assert0 (pipe (fds)); job->process_data[PROCESS_MAIN] = job_process_data_new (job->process_data, job, PROCESS_MAIN, fds[0]); TEST_NE_P (job->process_data[PROCESS_MAIN], NULL); TEST_EQ (job->process_data[PROCESS_MAIN]->job_process_fd, fds[0]); TEST_EQ (job->process_data[PROCESS_MAIN]->process, PROCESS_MAIN); TEST_CHILD (job->pid[PROCESS_MAIN]) { close (fds[0]); nih_error_raise_no_memory (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CGROUP_SETUP, 0); } close (fds[1]); TEST_FREE_TAG (job); job_process_handler (NULL, job->pid[PROCESS_MAIN], NIH_CHILD_DUMPED, 255); TEST_NOT_FREE (job); /* goal should not change until the IO handlers have had a * chance to run. */ TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_NE_P (job->process_data[PROCESS_MAIN], NULL); /* Still valid because the IO handlers haven't fired yet */ TEST_TRUE (job->process_data[PROCESS_MAIN]->valid); TEST_EQ (job->process_data[PROCESS_MAIN]->job_process_fd, fds[0]); TEST_EQ (job->process_data[PROCESS_MAIN]->shell_fd, -1); TEST_EQ_P (job->process_data[PROCESS_MAIN]->script, NULL); /* job_process_terminated() will have been called now */ status = job->process_data[PROCESS_MAIN]->status; TEST_GT (status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 255); /* slurp - don't care about content */ buffer = read_from_fd (NULL, fds[0]); close (fds[0]); pid = job->pid[PROCESS_MAIN]; TEST_EQ (timed_waitpid (pid, 5), pid); nih_free (job); TEST_RESET_MAIN_LOOP (); /************************************************************/ TEST_FEATURE ("with child setup success notification before child exit notification"); job = job_new (class, ""); TEST_NE_P (job, NULL); job->goal = JOB_START; job->state = JOB_SPAWNING; assert0 (pipe (fds)); job->process_data[PROCESS_MAIN] = job_process_data_new (job->process_data, job, PROCESS_MAIN, fds[0]); TEST_NE_P (job->process_data[PROCESS_MAIN], NULL); TEST_EQ (job->process_data[PROCESS_MAIN]->job_process_fd, fds[0]); TEST_EQ (job->process_data[PROCESS_MAIN]->process, PROCESS_MAIN); io = nih_io_reopen (job->process_data[PROCESS_MAIN], fds[0], NIH_IO_STREAM, (NihIoReader)job_process_child_reader, (NihIoCloseHandler)job_process_close_handler, NULL, job->process_data[PROCESS_MAIN]); TEST_NE_P (io, NULL); TEST_CHILD (job->pid[PROCESS_MAIN]) { close (fds[0]); nih_io_set_cloexec (fds[1]); execl ("/bin/true", "/bin/true", NULL); } close (fds[1]); job_process_close_handler (job->process_data[PROCESS_MAIN], io); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_NE_P (job->process_data[PROCESS_MAIN], NULL); /* Invalid because the IO handlers have now run */ TEST_FALSE (job->process_data[PROCESS_MAIN]->valid); TEST_EQ (job->process_data[PROCESS_MAIN]->job_process_fd, -1); TEST_EQ (job->process_data[PROCESS_MAIN]->shell_fd, -1); TEST_EQ_P (job->process_data[PROCESS_MAIN]->script, NULL); TEST_EQ (job->process_data[PROCESS_MAIN]->status, 0); close (fds[0]); pid = job->pid[PROCESS_MAIN]; TEST_EQ (timed_waitpid (pid, 5), pid); nih_free (job); TEST_RESET_MAIN_LOOP (); /************************************************************/ TEST_FEATURE ("with child setup failure notification before child exit notification"); job = job_new (class, ""); TEST_NE_P (job, NULL); job->goal = JOB_START; job->state = JOB_SPAWNED; assert0 (pipe (fds)); job->process_data[PROCESS_MAIN] = job_process_data_new (job->process_data, job, PROCESS_MAIN, fds[0]); TEST_NE_P (job->process_data[PROCESS_MAIN], NULL); TEST_EQ (job->process_data[PROCESS_MAIN]->job_process_fd, fds[0]); TEST_EQ (job->process_data[PROCESS_MAIN]->process, PROCESS_MAIN); /* Can't use job_register_child_handler() as we want the return * value. */ io = nih_io_reopen (job->process_data[PROCESS_MAIN], fds[0], NIH_IO_STREAM, (NihIoReader)job_process_child_reader, (NihIoCloseHandler)job_process_close_handler, NULL, job->process_data[PROCESS_MAIN]); TEST_NE_P (io, NULL); RESILIENT_TEST_CHILD (job->pid[PROCESS_MAIN]) { close (fds[0]); nih_error_raise_no_memory (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CGROUP_SETUP, 0); } close (fds[1]); pid = job->pid[PROCESS_MAIN]; buffer = read_from_fd (NULL, fds[0]); job_process_child_reader (job->process_data[PROCESS_MAIN], io, buffer->buf, buffer->len); /* Setup failed, so goal should have changed to stop */ TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_NE_P (job->process_data[PROCESS_MAIN], NULL); /* Invalid because the IO handlers have now run */ TEST_FALSE (job->process_data[PROCESS_MAIN]->valid); TEST_EQ (job->process_data[PROCESS_MAIN]->job_process_fd, -1); TEST_EQ (job->process_data[PROCESS_MAIN]->shell_fd, -1); TEST_EQ_P (job->process_data[PROCESS_MAIN]->script, NULL); TEST_EQ (job->process_data[PROCESS_MAIN]->shell_fd, -1); /* Still zero because the process handler hasn't run yet */ TEST_EQ (job->process_data[PROCESS_MAIN]->status, 0); close (fds[0]); TEST_EQ (timed_waitpid (pid, 5), pid); nih_free (job); TEST_RESET_MAIN_LOOP (); /************************************************************/ nih_free (class); file->job = NULL; nih_free (source); TEST_EQ (rmdir (dirname), 0); TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0); } void test_find (void) { JobClass *class1, *class2, *class3; Job *job1, *job2, *job3, *job4, *job5, *ptr; ProcessType process; TEST_FUNCTION ("job_process_find"); class1 = job_class_new (NULL, "foo", NULL); class1->process[PROCESS_MAIN] = process_new (class1); class1->process[PROCESS_POST_START] = process_new (class1); class1->instance = "$FOO"; nih_hash_add (job_classes, &class1->entry); class2 = job_class_new (NULL, "bar", NULL); class2->process[PROCESS_PRE_START] = process_new (class2); class2->process[PROCESS_MAIN] = process_new (class2); class2->process[PROCESS_PRE_STOP] = process_new (class2); class2->instance = "$FOO"; nih_hash_add (job_classes, &class2->entry); class3 = job_class_new (NULL, "baz", NULL); class3->process[PROCESS_POST_STOP] = process_new (class3); nih_hash_add (job_classes, &class3->entry); job1 = job_new (class1, "foo"); job1->pid[PROCESS_MAIN] = 10; job1->pid[PROCESS_POST_START] = 15; job2 = job_new (class1, "bar"); job3 = job_new (class2, "foo"); job3->pid[PROCESS_PRE_START] = 20; job4 = job_new (class2, "bar"); job4->pid[PROCESS_MAIN] = 25; job4->pid[PROCESS_PRE_STOP] = 30; job5 = job_new (class3, ""); job5->pid[PROCESS_POST_STOP] = 35; /* Check that we can find a job that exists by the pid of its * primary process. */ TEST_FEATURE ("with pid we expect to find"); ptr = job_process_find (10, &process); TEST_EQ_P (ptr, job1); TEST_EQ (process, PROCESS_MAIN); /* Check that we can find a job that exists by the pid of its * pre-start process. */ TEST_FEATURE ("with pre-start pid we expect to find"); ptr = job_process_find (20, &process); TEST_EQ_P (ptr, job3); TEST_EQ (process, PROCESS_PRE_START); /* Check that we can find a job that exists by the pid of its * post-start process. */ TEST_FEATURE ("with post-start pid we expect to find"); ptr = job_process_find (15, &process); TEST_EQ_P (ptr, job1); TEST_EQ (process, PROCESS_POST_START); /* Check that we can find a job that exists by the pid of its * pre-stop process. */ TEST_FEATURE ("with pre-stop pid we expect to find"); ptr = job_process_find (30, &process); TEST_EQ_P (ptr, job4); TEST_EQ (process, PROCESS_PRE_STOP); /* Check that we can find a job that exists by the pid of its * pre-stop process. */ TEST_FEATURE ("with post-stop pid we expect to find"); ptr = job_process_find (35, &process); TEST_EQ_P (ptr, job5); TEST_EQ (process, PROCESS_POST_STOP); /* Check that we get NULL if no job has a process with that pid. */ TEST_FEATURE ("with pid we do not expect to find"); ptr = job_process_find (100, NULL); TEST_EQ_P (ptr, NULL); /* Check that we get NULL if there are jobs in the hash, but none * have pids. */ TEST_FEATURE ("with no pids in job table"); nih_free (job5); nih_free (job4); nih_free (job3); nih_free (job1); ptr = job_process_find (20, NULL); TEST_EQ_P (ptr, NULL); /* Check that we get NULL if there are no instances running. */ TEST_FEATURE ("with no instances"); nih_free (job2); ptr = job_process_find (20, NULL); TEST_EQ_P (ptr, NULL); /* Check that we get NULL if there are no jobs in the hash. */ TEST_FEATURE ("with empty job table"); nih_free (class1); nih_free (class2); nih_free (class3); ptr = job_process_find (20, NULL); TEST_EQ_P (ptr, NULL); } void test_utmp (void) { JobClass * class; Job * job = NULL; Blocked * blocked = NULL; Event * event; FILE * output; char utmpname[PATH_MAX]; struct utmpx utmp, *utmptr; struct timeval tv; TEST_FUNCTION ("job_process_handler"); program_name = "test"; class = job_class_new (NULL, "test", NULL); class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = "echo"; class->start_on = event_operator_new (class, EVENT_MATCH, "foo", NULL); class->stop_on = event_operator_new (class, EVENT_MATCH, "foo", NULL); nih_hash_add (job_classes, &class->entry); event = event_new (NULL, "foo", NULL); TEST_FILENAME(utmpname); /* Check that utmp record for the running task of the job terminating * is properly changed to DEAD_PROCESS */ TEST_FEATURE ("with LOGIN_PROCESS utmp entry"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; output = fopen (utmpname, "w"); fclose (output); /* set utmp file */ utmpxname(utmpname); /* set up utmp entries */ memset (&utmp, 0, sizeof utmp); strcpy(utmp.ut_id, "2"); utmp.ut_type = LOGIN_PROCESS; utmp.ut_pid = 2; gettimeofday(&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; setutxent(); pututxline(&utmp); strcpy(utmp.ut_id, "1"); utmp.ut_pid = 1; pututxline(&utmp); endutxent(); job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); setutxent(); utmptr = getutxent(); TEST_NE_P(utmptr, NULL); TEST_EQ(utmptr->ut_pid, 2); TEST_EQ(utmptr->ut_type, LOGIN_PROCESS); utmptr = getutxent(); TEST_NE_P(utmptr, NULL); TEST_EQ(utmptr->ut_pid, 1); TEST_EQ(utmptr->ut_type, DEAD_PROCESS); nih_free (job); } TEST_FEATURE ("with USER_PROCESS utmp entry"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; output = fopen (utmpname, "w"); fclose (output); /* set utmp file */ utmpxname(utmpname); /* set up utmp entries */ memset (&utmp, 0, sizeof utmp); strcpy(utmp.ut_id, "2"); utmp.ut_type = USER_PROCESS; utmp.ut_pid = 2; gettimeofday(&tv, NULL); utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; setutxent(); pututxline(&utmp); strcpy(utmp.ut_id, "1"); utmp.ut_pid = 1; pututxline(&utmp); endutxent(); job_process_handler (NULL, 1, NIH_CHILD_EXITED, 0); setutxent(); utmptr = getutxent(); TEST_NE_P(utmptr, NULL); TEST_EQ(utmptr->ut_pid, 2); TEST_EQ(utmptr->ut_type, USER_PROCESS); utmptr = getutxent(); TEST_NE_P(utmptr, NULL); TEST_EQ(utmptr->ut_pid, 1); TEST_EQ(utmptr->ut_type, DEAD_PROCESS); nih_free (job); } /* new mingetty doesn't use entries with DEAD_PROCESS until it's last entry so * we need to check if upstart sets DEAD_PROCESS for correct entry */ TEST_FEATURE ("with multiple entries with same ut_id"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, event); event_block (event); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 2; TEST_FREE_TAG (blocked); job->blocker = NULL; event->failed = FALSE; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; output = fopen (utmpname, "w"); fclose (output); /* set utmp file */ utmpxname(utmpname); /* set up utmp entries */ memset (&utmp, 0, sizeof utmp); strcpy(utmp.ut_id, "2"); utmp.ut_type = DEAD_PROCESS; utmp.ut_pid = 1; gettimeofday(&tv, NULL); utmp.ut_time = 0; setutxent(); pututxline(&utmp); strcpy(utmp.ut_id, "2"); utmp.ut_type = USER_PROCESS; utmp.ut_pid = 2; utmp.ut_tv.tv_sec = tv.tv_sec; utmp.ut_tv.tv_usec = tv.tv_usec; pututxline(&utmp); endutxent(); job_process_handler (NULL, 2, NIH_CHILD_EXITED, 0); setutxent(); utmptr = getutxent(); TEST_NE_P(utmptr, NULL); TEST_EQ(utmptr->ut_pid, 1); TEST_EQ(utmptr->ut_type, DEAD_PROCESS); utmptr = getutxent(); TEST_NE_P(utmptr, NULL); TEST_EQ(utmptr->ut_pid, 2); TEST_EQ(utmptr->ut_type, DEAD_PROCESS); TEST_EQ(utmptr->ut_time, 0); nih_free (job); } unlink (utmpname); } void run_tests (void) { test_start (); test_spawn (); test_log_path (); test_kill (); test_handler (); test_utmp (); test_find (); } /** * io_reader: * * Write data received from child end of pty to stdout and * update the NihIo to reflect the consumed data. * * We could detect and replace the "\r\n" line-end combo added by the * pty line-discipline with a simple '\n', but for now lets leave the * data verbatim so it's clear from the log when pty usage kicks in. **/ static void io_reader (void *data, NihIo *io, const char *str, size_t len) { ssize_t bytes; nih_assert (io); nih_assert (str); nih_assert (len); bytes = write (STDOUT_FILENO, str, len); TEST_NE (bytes, -1); /* consume */ nih_io_buffer_shrink (io->recv_buf, bytes); } /** * io_error_handler: * * Deal with errors from child end of pty. **/ static void io_error_handler (void *data, NihIo *io) { NihError *err; nih_assert (io); /* Consume */ err = nih_error_get (); /* error that's returned when child closes their end of a pty */ nih_assert (err->number == EIO); nih_free (err); nih_free (io); } /* Grab child exit status and ask main loop to exit */ void process_handler (void *data, pid_t pid, NihChildEvents event, int status) { nih_assert (pid == pty_child_pid); nih_main_loop_exit (status); } /** * run_tests_in_pty: * * Create a pty and run tests in child process. Parent echoes childs * output. * * This shouldn't be required but for the fact that Upstart needs to * be able to run its test suite even in environments which * don't provide a controlling terminal (such as modern versions of * sbuild). * * See the following for the gory details: * * - LP: #888910 * - Debian Bug:607844 **/ void run_tests_in_pty (void) { int pty_master; int pty_slave; nih_local NihIo *io = NULL; int ret; ret = openpty (&pty_master, &pty_slave, NULL, NULL, NULL); TEST_NE (ret, -1); pty_child_pid = fork (); TEST_NE (pty_child_pid, (pid_t)-1); if (! pty_child_pid) { int i; pid_t self; /* child */ close (pty_master); self = getpid (); /* Ensure that the child is the process group leader * such that is responds correctly to SIGTSTP. */ TEST_EQ (setpgid (self, self), 0); /* connect standard streams to the child end of the pty */ for (i = 0; i < 3; i++) while (dup2 (pty_slave, i) == -1 && errno == EBUSY) ; /* clean up */ close (pty_slave); /* run tests within the pty */ run_tests (); exit (EXIT_SUCCESS); } /* parent */ close (pty_slave); io = nih_io_reopen (NULL, pty_master, NIH_IO_STREAM, io_reader, NULL, io_error_handler, NULL); TEST_NE_P (io, NULL); /* Watch child for events */ NIH_MUST (nih_child_add_watch (NULL, pty_child_pid, (NIH_CHILD_EXITED|NIH_CHILD_KILLED|NIH_CHILD_DUMPED), process_handler, NULL)); ret = nih_main_loop (); exit (ret ? EXIT_FAILURE : EXIT_SUCCESS); } /** * have_ctty: * * Returns: TRUE if we have a controlling terminal, * else FALSE. **/ int have_ctty (void) { int fd; fd = open ("/dev/tty", O_RDONLY | O_NOCTTY); if (fd < 0) return FALSE; close (fd); return TRUE; } int main (int argc, char *argv[]) { /* Note we do not set the UPSTART_NO_SESSIONS variable since this * would cause these tests to fail (as they scrutinize the job * environment). */ /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); /* We re-exec this binary to test various children features. To * do that, we need to know the full path to the program. */ argv0 = argv[0]; if (argv0[0] != '/') { #ifdef TEST_PLAN TEST_PLAN(153); #endif char *path = nih_alloc (NULL, PATH_MAX); assert (getcwd (path, PATH_MAX)); strcat (path, "/"); strcat (path, argv0); argv0 = path; } /* If three arguments are given, the first is the child enum, * second is a filename to write the result to and the third is * the number of times to fork. */ if (argc == 4) { int forks; int status; pid_t pid; forks = atol (argv[3]); nih_assert (forks > 0); do { pid = fork (); if (pid < 0) exit (1); else if (pid) { nih_assert (waitpid (pid, &status, 0) == pid); exit (0); } } while (forks--); child (atoi (argv[1]), argv[2]); nih_assert_not_reached (); } /* If two arguments are given, the first is the child enum and the * second is a filename to write the result to. */ if (argc == 3) { child (atoi (argv[1]), argv[2]); exit (1); } close_all_files (); job_class_init (); nih_error_init (); nih_io_init (); if (! have_ctty ()) { fprintf (stderr, "\n\n" "INFO: Running tests in pty since environment " "does not provide needed controlling terminal\n" "\n\n"); run_tests_in_pty (); } else { run_tests (); } return 0; } upstart-1.13.2/init/tests/test_job.c0000664000175000017500000060465512401640554014326 00000000000000/* upstart * * test_job.c - test suite for init/job.c * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "process.h" #include "job_process.h" #include "job_class.h" #include "job.h" #include "event.h" #include "event_operator.h" #include "blocked.h" #include "conf.h" #include "control.h" #include "state.h" #include "test_util_common.h" void job_quit_with_state (void *data, NihMainLoopFunc *loop) { Job *job; job = (Job *)data; nih_main_loop_exit (job->state); } char *argv0; static int state_fd = -1; static int continue_deserialise_ptrace = FALSE; static int child_wait_fd; void test_new (void) { JobClass *class; Job *job; EventOperator *oper; pid_t dbus_pid; DBusError dbus_error; DBusConnection *conn, *client_conn; DBusMessage *message; NihListEntry *entry; NihDBusObject *object; char *path; int i; TEST_FUNCTION ("job_new"); nih_error_init (); nih_timer_init (); nih_main_loop_init (); control_init (); conf_init (); /* Check that we can create a new job structure; the structure * should be allocated with nih_alloc, placed in the instances * list of the class and have sensible defaults. */ TEST_FEATURE ("with no name"); class = job_class_new (NULL, "test", NULL); class->stop_on = event_operator_new (class, EVENT_MATCH, "baz", NULL); TEST_ALLOC_FAIL { job = job_new (class, ""); if (test_alloc_failed) { TEST_EQ_P (job, NULL); continue; } TEST_ALLOC_PARENT (job, class); TEST_ALLOC_SIZE (job, sizeof (Job)); TEST_LIST_NOT_EMPTY (&job->entry); TEST_EQ_P (job->class, class); TEST_ALLOC_PARENT (job->name, job); TEST_EQ_STR (job->name, ""); TEST_ALLOC_PARENT (job->path, job); TEST_EQ_STR (job->path, DBUS_PATH_UPSTART "/jobs/test/_"); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_WAITING); TEST_EQ_P (job->env, NULL); TEST_EQ_P (job->start_env, NULL); TEST_EQ_P (job->stop_env, NULL); oper = (EventOperator *)job->stop_on; TEST_ALLOC_PARENT (oper, job); TEST_ALLOC_SIZE (oper, sizeof (EventOperator)); TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "baz"); TEST_EQ_P (oper->env, NULL); TEST_EQ (oper->value, FALSE); TEST_NE_P (job->pid, NULL); TEST_ALLOC_PARENT (job->pid, job); TEST_ALLOC_SIZE (job->pid, sizeof (pid_t) * PROCESS_LAST); for (i = 0; i < PROCESS_LAST; i++) TEST_EQ (job->pid[i], 0); TEST_EQ_P (job->blocker, NULL); TEST_LIST_EMPTY (&job->blocking); TEST_EQ_P (job->kill_timer, NULL); TEST_EQ (job->kill_process, PROCESS_INVALID); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ (job->respawn_count, 0); TEST_EQ (job->respawn_time, 0); TEST_EQ (job->trace_forks, 0); TEST_EQ (job->trace_state, TRACE_NONE); TEST_NE_P (job->log, NULL); TEST_ALLOC_SIZE (job->log, sizeof (Log *) * PROCESS_LAST); for (i = 0; i < PROCESS_LAST; i++) { TEST_EQ_P (job->log[i], NULL); } TEST_NE_P (job->process_data, NULL); TEST_ALLOC_SIZE (job->log, sizeof (JobProcessData *) * PROCESS_LAST); for (i = 0; i < PROCESS_LAST; i++) { TEST_EQ_P (job->process_data[i], NULL); } event_operator_reset (job->stop_on); nih_free (job); } /* Check that if a name is passed, it is stored in the job. */ TEST_FEATURE ("with name given"); TEST_ALLOC_FAIL { job = job_new (class, "fred"); if (test_alloc_failed) { TEST_EQ_P (job, NULL); continue; } TEST_ALLOC_PARENT (job, class); TEST_ALLOC_SIZE (job, sizeof (Job)); TEST_LIST_NOT_EMPTY (&job->entry); TEST_ALLOC_PARENT (job->name, job); TEST_EQ_STR (job->name, "fred"); TEST_ALLOC_PARENT (job->path, job); TEST_EQ_STR (job->path, DBUS_PATH_UPSTART "/jobs/test/fred"); event_operator_reset (job->stop_on); nih_free (job); } /* Check that when a D-Bus connection is open, the new instance * is registered on that connection as an object and the InstanceAdded * signal is emitted. */ TEST_FEATURE ("with D-Bus connection"); dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); control_init (); entry = nih_list_entry_new (NULL); entry->data = conn; nih_list_add (control_conns, &entry->entry); job = job_new (class, "fred"); TEST_ALLOC_PARENT (job, class); TEST_ALLOC_SIZE (job, sizeof (Job)); TEST_LIST_NOT_EMPTY (&job->entry); TEST_ALLOC_PARENT (job->name, job); TEST_EQ_STR (job->name, "fred"); TEST_ALLOC_PARENT (job->path, job); TEST_EQ_STR (job->path, DBUS_PATH_UPSTART "/jobs/test/fred"); TEST_TRUE (dbus_connection_get_object_path_data (conn, job->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, job->path); TEST_EQ_P (object->data, job); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_JOB, "InstanceAdded")); TEST_EQ_STR (dbus_message_get_path (message), class->path); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job->path); dbus_message_unref (message); event_operator_reset (job->stop_on); nih_free (job); nih_free (entry); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); event_operator_reset (class->stop_on); nih_free (class); } void test_register (void) { pid_t dbus_pid; DBusError dbus_error; DBusConnection *conn, *client_conn; DBusMessage *message; JobClass *class; Job *job; NihDBusObject *object; char *path; TEST_FUNCTION ("job_register"); dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); /* Check that we can register an existing job instance on the bus * using its path, and have a InstanceAdded signal emitted. */ TEST_FEATURE ("with signal emission"); class = job_class_new (NULL, "test", NULL); job = job_new (class, "fred"); assert (dbus_connection_get_object_path_data (conn, job->path, (void **)&object)); assert (object == NULL); job_register (job, conn, TRUE); TEST_TRUE (dbus_connection_get_object_path_data (conn, job->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, job->path); TEST_EQ_P (object->data, job); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_JOB, "InstanceAdded")); TEST_EQ_STR (dbus_message_get_path (message), class->path); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job->path); dbus_message_unref (message); nih_free (class); /* Check that we can suppress signal emission, but that the instance * is still registered. */ TEST_FEATURE ("without signal emission"); class = job_class_new (NULL, "test", NULL); job = job_new (class, "fred"); assert (dbus_connection_get_object_path_data (conn, job->path, (void **)&object)); assert (object == NULL); job_register (job, conn, FALSE); TEST_TRUE (dbus_connection_get_object_path_data (conn, job->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, job->path); TEST_EQ_P (object->data, job); message = dbus_message_new_signal ("/", "com.ubuntu.Upstart.Test", "TestPassed"); assert (message != NULL); dbus_connection_send (conn, message, NULL); dbus_message_unref (message); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, "com.ubuntu.Upstart.Test", "TestPassed")); dbus_message_unref (message); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_change_goal (void) { JobClass *class; Job *job = NULL; Blocked *blocked; DBusError dbus_error; pid_t dbus_pid; DBusConnection *conn, *client_conn; NihListEntry *entry = NULL; DBusMessage *message; char *job_path = NULL, *goal, *state; TEST_FUNCTION ("job_change_goal"); event_init (); program_name = "test"; class = job_class_new (NULL, "test", NULL); class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = "echo"; class->process[PROCESS_PRE_START] = process_new (class); class->process[PROCESS_PRE_START]->command = "echo"; class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); control_init (); entry = nih_list_entry_new (NULL); entry->data = conn; nih_list_add (control_conns, &entry->entry); /* Check that an attempt to start a waiting job results in the * goal being changed to start, and the state transitioned to * starting. */ TEST_FEATURE ("with waiting job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job_path = nih_strdup (NULL, job->path); } job->goal = JOB_STOP; job->state = JOB_WAITING; job_change_goal (job, JOB_START); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_JOB, "InstanceAdded")); dbus_message_unref (message); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_INSTANCE, "GoalChanged")); TEST_EQ_STR (dbus_message_get_path (message), job_path); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &goal, DBUS_TYPE_INVALID)); TEST_EQ_STR (goal, "start"); dbus_message_unref (message); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_INSTANCE, "StateChanged")); TEST_EQ_STR (dbus_message_get_path (message), job_path); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &state, DBUS_TYPE_INVALID)); TEST_EQ_STR (state, "starting"); dbus_message_unref (message); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); nih_free (job); } nih_free (entry); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); /* Check that an attempt to start a job that's in the process of * stopping changes only the goal, and leaves the rest of the * state transition up to the normal process. */ TEST_FEATURE ("with stopping job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); } job->goal = JOB_STOP; job->state = JOB_KILLED; job->pid[PROCESS_MAIN] = 1; job_change_goal (job, JOB_START); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_KILLED); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ_P (job->blocker, NULL); nih_free (job); } /* Check that an attempt to start a job that's running and still * with a start goal does nothing. */ TEST_FEATURE ("with running job and start"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; job_change_goal (job, JOB_START); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ_P (job->blocker, NULL); nih_free (job); } /* Check that an attempt to stop a running job results in the goal * and the state being changed. */ TEST_FEATURE ("with running job and stop"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); } job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; job_change_goal (job, JOB_STOP); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); nih_free (job); } /* Check that an attempt to stop a running job without any process * also results in the state being changed. */ TEST_FEATURE ("with running job and no process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); } job->goal = JOB_START; job->state = JOB_RUNNING; job_change_goal (job, JOB_STOP); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_NE_P (job->blocker, NULL); TEST_LIST_NOT_EMPTY (&job->blocker->blocking); blocked = (Blocked *)job->blocker->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job->blocker); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&job->blocker->blocking); nih_free (job); } /* Check that an attempt to stop a starting job only results in the * goal being changed, the state should not be changed. */ TEST_FEATURE ("with starting job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); } job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_PRE_START] = 1; job_change_goal (job, JOB_STOP); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_PRE_START); TEST_EQ (job->pid[PROCESS_PRE_START], 1); TEST_EQ_P (job->blocker, NULL); nih_free (job); } /* Check that an attempt to stop a waiting job does nothing. */ TEST_FEATURE ("with waiting job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); } job->goal = JOB_STOP; job->state = JOB_WAITING; job_change_goal (job, JOB_STOP); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_WAITING); TEST_EQ_P (job->blocker, NULL); nih_free (job); } nih_free (class); event_poll (); } void test_change_state (void) { FILE *output; ConfSource *source = NULL; ConfFile *file = NULL; JobClass *class, *replacement = NULL, *ptr; Job *job = NULL, *instance = NULL; Blocked *blocked = NULL; NihListEntry *entry = NULL; Event *cause, *event; struct stat statbuf; char dirname[PATH_MAX], filename[PATH_MAX]; char **env1, **env2, **env3; Process *tmp, *fail; pid_t pid, dbus_pid; DBusError dbus_error; DBusConnection *conn, *client_conn; DBusMessage *message; char *path, *job_path = NULL, *state; int status; nih_error_init (); nih_main_loop_init (); event_init (); TEST_FUNCTION ("job_change_state"); program_name = "test"; output = tmpfile (); TEST_FILENAME (dirname); mkdir (dirname, 0700); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "touch %s/run", dirname); class->process[PROCESS_PRE_START] = process_new (class); class->process[PROCESS_PRE_START]->command = nih_sprintf ( class->process[PROCESS_PRE_START], "touch %s/start", dirname); class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = nih_sprintf ( class->process[PROCESS_POST_STOP], "touch %s/stop", dirname); class->start_on = event_operator_new (class, EVENT_MATCH, "wibble", NULL); class->stop_on = event_operator_new (class, EVENT_MATCH, "wibble", NULL); fail = process_new (class); fail->command = nih_sprintf (fail, "%s/no/such/file", dirname); cause = event_new (NULL, "wibble", NULL); nih_list_remove (&cause->entry); /* Check that a job can move from waiting to starting. This * should emit the starting event and block on it and copy the * environment from start_env. */ TEST_FEATURE ("waiting to starting"); dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); control_init (); entry = nih_list_entry_new (NULL); entry->data = conn; nih_list_add (control_conns, &entry->entry); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job_path = nih_strdup (NULL, job->path); assert (nih_str_array_add (&(job->start_env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->start_env), job, NULL, "BAZ=BAZ")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_JOB, "InstanceAdded")); dbus_message_unref (message); job->goal = JOB_START; job->state = JOB_WAITING; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); env1 = job->start_env; job->failed = TRUE; job->failed_process = PROCESS_POST_STOP; job->exit_status = 1; job_change_state (job, JOB_STARTING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_INSTANCE, "StateChanged")); TEST_EQ_STR (dbus_message_get_path (message), job_path); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &state, DBUS_TYPE_INVALID)); TEST_EQ_STR (state, "starting"); dbus_message_unref (message); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->env, env1); TEST_EQ_P (job->start_env, NULL); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "starting"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (entry); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); /* Check that a named instance of a job can move from waiting to * starting, and that the instance name is included in the event * environment. */ TEST_FEATURE ("waiting to starting for named instance"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); assert (nih_str_array_add (&(job->start_env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->start_env), job, NULL, "BAZ=BAZ")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_WAITING; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); env1 = job->start_env; job->failed = TRUE; job->failed_process = PROCESS_POST_STOP; job->exit_status = 1; job_change_state (job, JOB_STARTING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->env, env1); TEST_EQ_P (job->start_env, NULL); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "starting"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_P (event->env[2], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that any exported variable is added to the starting event * from the job environment; it should not be possible to overwrite * built-in variables, and any unknown variables should be ignored. */ TEST_FEATURE ("waiting to starting with export"); assert (nih_str_array_add (&(class->export), class, NULL, "FOO")); assert (nih_str_array_add (&(class->export), class, NULL, "JOB")); assert (nih_str_array_add (&(class->export), class, NULL, "BEEP")); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); assert (nih_str_array_add (&(job->start_env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->start_env), job, NULL, "BAZ=BAZ")); assert (nih_str_array_add (&(job->start_env), job, NULL, "JOB=wibble")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_WAITING; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); env1 = job->start_env; job->failed = TRUE; job->failed_process = PROCESS_POST_STOP; job->exit_status = 1; job_change_state (job, JOB_STARTING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->env, env1); TEST_EQ_P (job->start_env, NULL); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "starting"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "FOO=BAR"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->export); class->export = NULL; /* Check that a job with a start process can move from starting * to pre-start, and have the process run. */ TEST_FEATURE ("starting to pre-start"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_SECURITY; job->pid[PROCESS_PRE_START] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_PRE_STARTING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_PRE_START); TEST_NE (job->pid[PROCESS_PRE_START], 0); waitpid (job->pid[PROCESS_PRE_START], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/start"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that a job without a start process can move from starting * to pre-start, skipping over that state, and instead going all * the way through to the running state. Because we get there, * we should get a started event emitted. */ TEST_FEATURE ("starting to pre-start without process"); tmp = class->process[PROCESS_PRE_START]; class->process[PROCESS_PRE_START] = NULL; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); TEST_NE_P (nih_main_loop_add_func (job, job_quit_with_state, job), NULL); } job->goal = JOB_START; job->state = JOB_SECURITY; job->pid[PROCESS_MAIN] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_PRE_STARTING); while (nih_main_loop () < JOB_RUNNING) {} TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/run"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "started"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } class->process[PROCESS_PRE_START] = tmp; /* Check that a job with a start process that fails to run moves * from starting to pre-start, the goal gets changed to stop, the * status to stopping and the failed information set correctly. */ TEST_FEATURE ("starting to pre-start for failed process"); tmp = class->process[PROCESS_PRE_START]; class->process[PROCESS_PRE_START] = fail; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); TEST_NE_P (nih_main_loop_add_func (job, job_quit_with_state, job), NULL); } job->goal = JOB_START; job->state = JOB_SECURITY; job->pid[PROCESS_PRE_START] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_change_state (job, JOB_PRE_STARTING); while (nih_main_loop() < JOB_STOPPING) {} } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_FALSE (job->process_data[PROCESS_PRE_START]->valid); TEST_EQ (job->pid[PROCESS_PRE_START], 0); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, TRUE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=pre-start"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_PRE_START); TEST_EQ (job->exit_status, -1); TEST_FILE_EQ (output, ("test: Failed to spawn test " "pre-start process: unable to execute: " "No such file or directory\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->process[PROCESS_PRE_START] = tmp; /* Check that a job with a main process can move from pre-start to * spawned and have the process run, and as it's not going to wait, * the state will be skipped forwards to running and the started * event emitted. */ TEST_FEATURE ("pre-start to spawned"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); TEST_NE_P (nih_main_loop_add_func (job, job_quit_with_state, job), NULL); } job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_MAIN] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_SPAWNING); while (nih_main_loop() < JOB_RUNNING) {} TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/run"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "started"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that a job with a named instance includes the instance * name in the started event. */ TEST_FEATURE ("pre-start to spawned for named instance"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); TEST_NE_P (nih_main_loop_add_func (job, job_quit_with_state, job), NULL); } job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_MAIN] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_SPAWNING); while (nih_main_loop() < JOB_RUNNING) {} TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/run"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "started"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that any exported variable is added to the started event * from the job environment; it should not be possible to overwrite * built-in variables, and any unknown variables should be ignored. */ TEST_FEATURE ("pre-start to spawned with export"); assert (nih_str_array_add (&(class->export), class, NULL, "FOO")); assert (nih_str_array_add (&(class->export), class, NULL, "JOB")); assert (nih_str_array_add (&(class->export), class, NULL, "BEEP")); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); assert (nih_str_array_add (&(job->env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->env), job, NULL, "BAZ=BAZ")); assert (nih_str_array_add (&(job->env), job, NULL, "JOB=wibble")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); TEST_NE_P (nih_main_loop_add_func (job, job_quit_with_state, job), NULL); } job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_MAIN] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_SPAWNING); while (nih_main_loop() < JOB_RUNNING) {} TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/run"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "started"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "FOO=BAR"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->export); class->export = NULL; /* Check that a job without a main process can move from pre-start * straight to running skipping the interim steps, and has the * started event emitted. */ TEST_FEATURE ("pre-start to spawned without process"); tmp = class->process[PROCESS_MAIN]; class->process[PROCESS_MAIN] = NULL; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_PRE_START; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_SPAWNING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "started"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } class->process[PROCESS_MAIN] = tmp; /* Check that a job with a main process that fails has its goal * changed to stop, the state changed to stopping and failed * information filled in. */ TEST_FEATURE ("pre-start to spawned for failed process"); tmp = class->process[PROCESS_MAIN]; class->process[PROCESS_MAIN] = fail; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); TEST_NE_P (nih_main_loop_add_func (job, job_quit_with_state, job), NULL); } job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_MAIN] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_change_state (job, JOB_SPAWNING); while (nih_main_loop() < JOB_STOPPING) {} } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_FALSE (job->process_data[PROCESS_MAIN]->valid); TEST_EQ (job->pid[PROCESS_MAIN], 0); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, TRUE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, -1); TEST_FILE_EQ (output, ("test: Failed to spawn test " "main process: unable to execute: " "No such file or directory\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->process[PROCESS_MAIN] = tmp; /* Check that a job which has a main process that needs to wait for * an event can move from pre-start to spawned and have the process * run. The state will remain in spawned until whatever we're * waiting for happens. */ TEST_FEATURE ("pre-start to spawned for waiting job"); class->expect = EXPECT_STOP; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_MAIN] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_SPAWNING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_SPAWNED); TEST_NE (job->pid[PROCESS_MAIN], 0); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/run"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } class->expect = EXPECT_NONE; /* Check that a job with a post-start process can move from spawned * to post-start, and have the process run. */ TEST_FEATURE ("spawned to post-start"); class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = nih_sprintf ( class->process[PROCESS_POST_START], "touch %s/post-start", dirname); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_POST_START] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_POST_STARTING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_POST_START); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_NE (job->pid[PROCESS_POST_START], 0); waitpid (job->pid[PROCESS_POST_START], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/post-start"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->process[PROCESS_POST_START]); class->process[PROCESS_POST_START] = NULL; /* Check that a job without a post-start process can move from * spawned to post-start, skipping over that state, and instead * going to the running state. Because we get there, we should * get a started event emitted. */ TEST_FEATURE ("spawned to post-start without process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = 1; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_POST_STARTING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "started"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that a job with a post-start process ignores the failure * of that process and can move from spawned to post-start, skipping * over that state, and instead going to the running state. Because * we get there, we should get a started event emitted. */ TEST_FEATURE ("spawned to post-start for failed process"); class->process[PROCESS_POST_START] = fail; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); TEST_NE_P (nih_main_loop_add_func (job, job_quit_with_state, job), NULL); } job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = 1; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_change_state (job, JOB_POST_STARTING); while (nih_main_loop () < JOB_RUNNING) { } } rewind (output); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "started"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_FILE_EQ (output, ("test: Failed to spawn test " "post-start process: unable to execute: " "No such file or directory\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->process[PROCESS_POST_START] = NULL; /* Check that a service can move from post-start to running, which * will emit the started event and unblock the events that caused * us to start since the job has reached the desired state. */ TEST_FEATURE ("post-start to running for service"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_MAIN] = 1; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_RUNNING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "started"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that a task can move from post-start to running, which will * emit the started event but leave events blocked and referenced. */ TEST_FEATURE ("post-start to running for task"); class->task = TRUE; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_MAIN] = 1; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_RUNNING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "started"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } class->task = FALSE; /* Check that a job with a pre-stop process can move from running * to pre-stop, and have the process run. */ TEST_FEATURE ("running to pre-stop"); class->process[PROCESS_PRE_STOP] = process_new (class); class->process[PROCESS_PRE_STOP]->command = nih_sprintf ( class->process[PROCESS_PRE_STOP], "touch %s/pre-stop", dirname); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; job->pid[PROCESS_PRE_STOP] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_PRE_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_PRE_STOP); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_NE (job->pid[PROCESS_PRE_STOP], 0); waitpid (job->pid[PROCESS_PRE_STOP], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/pre-stop"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->process[PROCESS_PRE_STOP]); class->process[PROCESS_PRE_STOP] = NULL; /* Check that a job without a pre-stop process can move from * running to pre-stop, skipping over that state, and instead * going to the stopping state. Because we get there, we should * get a stopping event emitted. */ TEST_FEATURE ("running to pre-stop without process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_PRE_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=ok"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that a job with a named instance and without a pre-stop * process includes the instance name in the stopping event. */ TEST_FEATURE ("running to pre-stop for named instance"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_PRE_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=ok"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that any exported variable is added to the stopping event * from the job environment; it should not be possible to overwrite * built-in variables, and any unknown variables should be ignored. */ TEST_FEATURE ("running to pre-stop with export"); assert (nih_str_array_add (&(class->export), class, NULL, "FOO")); assert (nih_str_array_add (&(class->export), class, NULL, "JOB")); assert (nih_str_array_add (&(class->export), class, NULL, "BEEP")); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); assert (nih_str_array_add (&(job->env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->env), job, NULL, "BAZ=BAZ")); assert (nih_str_array_add (&(job->env), job, NULL, "JOB=wibble")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_PRE_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=ok"); TEST_EQ_STR (event->env[3], "FOO=BAR"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } nih_free (class->export); class->export = NULL; /* Check that a job with a pre-stop process ignores any failure and * moves from running to pre-stop, and then straight into the stopping * state, emitting that event. */ TEST_FEATURE ("running to pre-stop for failed process"); class->process[PROCESS_PRE_STOP] = fail; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); TEST_NE_P (nih_main_loop_add_func (job, job_quit_with_state, job), NULL); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_DIVERT_STDERR (output) { job_change_state (job, JOB_PRE_STOPPING); while (nih_main_loop () < JOB_STOPPING) {} } rewind (output); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (job->pid[PROCESS_MAIN], 1); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=ok"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_FILE_EQ (output, ("test: Failed to spawn test " "pre-stop process: unable to execute: " "No such file or directory\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); nih_free (job); } class->process[PROCESS_PRE_STOP] = NULL; /* Check that a job can move from running to stopping, by-passing * pre-stop. This should emit the stopping event, containing the * failed information including the exit status, and block on it. */ TEST_FEATURE ("running to stopping"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; job_change_state (job, JOB_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, 1); nih_free (job); } /* Check that a job with a named instance that fails includes the * instance name in the stopping event after the failed information. */ TEST_FEATURE ("running to stopping for named instance"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; job_change_state (job, JOB_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, 1); nih_free (job); } /* Check that any exported variable is added to the stopping event * from the job environment after any failed information; it should * not be possible to overwrite built-in variables, and any unknown * variables should be ignored. */ TEST_FEATURE ("running to stopping with export"); assert (nih_str_array_add (&(class->export), class, NULL, "FOO")); assert (nih_str_array_add (&(class->export), class, NULL, "JOB")); assert (nih_str_array_add (&(class->export), class, NULL, "BEEP")); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); assert (nih_str_array_add (&(job->env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->env), job, NULL, "BAZ=BAZ")); assert (nih_str_array_add (&(job->env), job, NULL, "JOB=wibble")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; job_change_state (job, JOB_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_STR (event->env[5], "FOO=BAR"); TEST_EQ_P (event->env[6], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, 1); nih_free (job); } nih_free (class->export); class->export = NULL; /* Check that a job killed by a signal can move from running to * stopping, by-passing pre-stop. This should emit the stopping * event, containing the failed information including the exit * signal, and block on it. */ TEST_FEATURE ("running to stopping for killed process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = SIGSEGV << 8; job_change_state (job, JOB_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=SEGV"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, SIGSEGV << 8); nih_free (job); } /* Check that a job killed by an unknown signal can move from * running to stopping, by-passing pre-stop. This should emit * the stopping event, containing the failed information * including the exit signal number, and block on it. */ TEST_FEATURE ("running to stopping for unknown signal"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_RUNNING; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 33 << 8; job_change_state (job, JOB_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=33"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, TRUE); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, 33 << 8); nih_free (job); } /* Check that a job can move from pre-stop back to running again; * clearing the block and reference on the events that stopped it * including their environment. */ TEST_FEATURE ("pre-stop to running"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); assert (nih_str_array_add (&(job->stop_env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->stop_env), job, NULL, "BAZ=BAZ")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_PRE_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); env1 = job->stop_env; TEST_FREE_TAG (env1); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_goal (job, JOB_START); job_change_state (job, JOB_RUNNING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_FREE (env1); TEST_EQ_P (job->stop_env, NULL); TEST_FREE (blocked); TEST_LIST_EMPTY (&job->blocking); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that a job can move from pre-stop to stopping. This * should emit the stopping event, containing the failed information, * and block on it. */ TEST_FEATURE ("pre-stop to stopping"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_PRE_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopping"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=ok"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that a job with an active process can move from stopping * to killed, the process should be sent the TERM signal and a * kill timer put in place to check up on it. */ TEST_FEATURE ("stopping to killed"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_STOPPING; TEST_CHILD (job->pid[PROCESS_MAIN]) { pause (); } pid = job->pid[PROCESS_MAIN]; setpgid (pid, pid); job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_KILLED); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_KILLED); TEST_EQ (job->pid[PROCESS_MAIN], pid); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGTERM); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_NE_P (job->kill_timer, NULL); TEST_EQ (job->kill_process, PROCESS_MAIN); nih_free (job->kill_timer); job->kill_timer = NULL; job->kill_process = PROCESS_INVALID; nih_free (job); } /* Check that a job with no running process can move from stopping * to killed, skipping over that state and ending up in post-stop * instead. */ TEST_FEATURE ("stopping to killed without process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_STOPPING; job->pid[PROCESS_POST_STOP] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_KILLED); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_STOP); TEST_NE (job->pid[PROCESS_POST_STOP], 0); waitpid (job->pid[PROCESS_POST_STOP], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/stop"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); TEST_EQ_P (job->kill_timer, NULL); TEST_EQ (job->kill_process, PROCESS_INVALID); nih_free (job); } /* Check that a job with a stop process can move from killed * to post-stop, and have the process run. */ TEST_FEATURE ("killed to post-stop"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_KILLED; job->pid[PROCESS_POST_STOP] = 0; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job_change_state (job, JOB_POST_STOPPING); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_POST_STOP); TEST_NE (job->pid[PROCESS_POST_STOP], 0); waitpid (job->pid[PROCESS_POST_STOP], &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); strcpy (filename, dirname); strcat (filename, "/stop"); TEST_EQ (stat (filename, &statbuf), 0); unlink (filename); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_EQ_P (job->blocker, NULL); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that a job without a stop process can move from killed * to post-stop, skipping over that state, and instead going all * the way through to being deleted. Because we get there, * we should get a stopped event emitted, and both the events * that started and stopped the job forgotten. */ TEST_FEATURE ("killed to post-stop without process"); tmp = class->process[PROCESS_POST_STOP]; class->process[PROCESS_POST_STOP] = NULL; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_KILLED; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_FREE_TAG (job); job_change_state (job, JOB_POST_STOPPING); TEST_FREE (job); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_FREE (blocked); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopped"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); } class->process[PROCESS_POST_STOP] = tmp; /* Check that a job with a stop process that fails to run moves * from killed to post-start, the goal gets changed to stop, the * status to stopped (and thus through to being deleted) and the * failed information set correctly. */ TEST_FEATURE ("killed to post-stop for failed process"); tmp = class->process[PROCESS_POST_STOP]; class->process[PROCESS_POST_STOP] = fail; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_KILLED; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; TEST_FREE_TAG (job); TEST_DIVERT_STDERR (output) { job_change_state (job, JOB_POST_STOPPING); TEST_WATCH_LOOP (); } rewind (output); TEST_FREE (job); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, TRUE); TEST_FREE (blocked); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopped"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=post-stop"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_FILE_EQ (output, ("test: Failed to spawn test " "post-stop process: unable to execute: " "No such file or directory\n")); TEST_FILE_END (output); TEST_FILE_RESET (output); } class->process[PROCESS_POST_STOP] = tmp; /* Check that a job can move from post-stop to being deleted. This * should emit the stopped event and clear the cause. */ TEST_FEATURE ("post-stop to waiting"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_FREE_TAG (job); job_change_state (job, JOB_WAITING); TEST_FREE (job); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_FREE (blocked); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopped"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); } /* Check that a job with a named instance includes the instance * name in the stopped event. */ TEST_FEATURE ("post-stop to waiting for named instance"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_FREE_TAG (job); job_change_state (job, JOB_WAITING); TEST_FREE (job); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_FREE (blocked); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopped"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); } /* Check that any exported variable is added to the stopped event * from the job environment; it should not be possible to overwrite * built-in variables, and any unknown variables should be ignored. */ TEST_FEATURE ("post-stop to waiting with export"); assert (nih_str_array_add (&(class->export), class, NULL, "FOO")); assert (nih_str_array_add (&(class->export), class, NULL, "JOB")); assert (nih_str_array_add (&(class->export), class, NULL, "BEEP")); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, "foo"); assert (nih_str_array_add (&(job->env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->env), job, NULL, "BAZ=BAZ")); assert (nih_str_array_add (&(job->env), job, NULL, "JOB=wibble")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_FREE_TAG (job); job_change_state (job, JOB_WAITING); TEST_FREE (job); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_FREE (blocked); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopped"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_STR (event->env[5], "FOO=BAR"); TEST_EQ_P (event->env[6], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); } nih_free (class->export); class->export = NULL; /* Check that when a job is deleted, the InstanceRemoved signal * is also emitted on any D-Bus connections. */ TEST_FEATURE ("post-stop to waiting with d-bus connection"); dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); control_init (); entry = nih_list_entry_new (NULL); entry->data = conn; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); job_path = nih_strdup (NULL, job->path); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); nih_list_add (control_conns, &entry->entry); } job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job_failed (job, PROCESS_MAIN, 1); TEST_FREE_TAG (job); job_change_state (job, JOB_WAITING); TEST_FREE (job); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, TRUE); TEST_FREE (blocked); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopped"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_INSTANCE, "Failed")); TEST_EQ_STR (dbus_message_get_path (message), job_path); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_INT32, &status, DBUS_TYPE_INVALID)); TEST_EQ (status, 1); dbus_message_unref (message); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_INSTANCE, "StateChanged")); TEST_EQ_STR (dbus_message_get_path (message), job_path); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &state, DBUS_TYPE_INVALID)); TEST_EQ_STR (state, "waiting"); dbus_message_unref (message); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART_JOB, "InstanceRemoved")); TEST_EQ_STR (dbus_message_get_path (message), class->path); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job_path); dbus_message_unref (message); nih_free (job_path); nih_list_remove (&entry->entry); } nih_free (entry); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); /* Check that a job can move from post-stop to starting. This * should emit the starting event and block on it, as well as clear * any failed state information; but only unblock and unreference the * stop events, the start events should remain referenced while the * environment should be replaced with the new one. */ TEST_FEATURE ("post-stop to starting"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); assert (nih_str_array_add (&(job->env), job, NULL, "FOO=TEA")); assert (nih_str_array_add (&(job->env), job, NULL, "BAZ=COFFEE")); assert (nih_str_array_add (&(job->start_env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->start_env), job, NULL, "BAZ=BAZ")); assert (nih_str_array_add (&(job->stop_env), job, NULL, "FOO=BAR")); assert (nih_str_array_add (&(job->stop_env), job, NULL, "BAZ=BAZ")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); env1 = job->env; env2 = job->start_env; env3 = job->stop_env; TEST_FREE_TAG (env1); TEST_FREE_TAG (env2); TEST_FREE_TAG (env3); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; job_change_state (job, JOB_STARTING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_FREE (env1); TEST_NOT_FREE (env2); TEST_EQ_P (job->env, env2); TEST_EQ_P (job->start_env, NULL); TEST_FREE (env3); TEST_EQ_P (job->stop_env, NULL); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "starting"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that when there is no new environment, the old one is left * intact when the job moves from post-stop to starting. */ TEST_FEATURE ("post-stop to starting without new environment"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { job = job_new (class, ""); assert (nih_str_array_add (&(job->env), job, NULL, "FOO=TEA")); assert (nih_str_array_add (&(job->env), job, NULL, "BAZ=COFFEE")); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } job->goal = JOB_START; job->state = JOB_POST_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); env1 = job->env; TEST_FREE_TAG (env1); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; job_change_state (job, JOB_STARTING); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_EQ (cause->blockers, 1); TEST_EQ (cause->failed, FALSE); TEST_NOT_FREE (env1); TEST_EQ_P (job->env, env1); TEST_EQ_P (job->start_env, NULL); TEST_EQ_P (job->blocker, (Event *)events->next); TEST_NOT_FREE (blocked); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_EQ_P (blocked->event, cause); event_unblock (cause); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "starting"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); TEST_EQ (job->failed, FALSE); TEST_EQ (job->failed_process, PROCESS_INVALID); TEST_EQ (job->exit_status, 0); nih_free (job); } /* Check that a job which has a better replacement can move from * post-stop to waiting, and be removed from the jobs hash table * and replaced by the better one. */ TEST_FEATURE ("post-stop to waiting for replaced job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); file = conf_file_new (source, "/tmp/test"); file->job = job_class_new (NULL, "test", NULL); replacement = file->job; job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); } nih_hash_add (job_classes, &class->entry); job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_FREE_TAG (job); job_change_state (job, JOB_WAITING); TEST_FREE (job); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_FREE (blocked); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopped"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); ptr = (JobClass *)nih_hash_lookup (job_classes, "test"); TEST_EQ (ptr, replacement); file->job = NULL; nih_free (replacement); nih_free (source); } /* Check that a job with a remaining running instance is not deleted, * and is not replaced even if there is another waiting - only the * instance should be deleted. */ TEST_FEATURE ("post-stop to waiting for still active job"); class->deleted = TRUE; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); file = conf_file_new (source, "/tmp/test"); file->job = job_class_new (NULL, "test", NULL); replacement = file->job; job = job_new (class, ""); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); instance = job_new (class, ""); instance->goal = JOB_START; instance->state = JOB_RUNNING; } nih_hash_add (job_classes, &class->entry); job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_FREE_TAG (class); TEST_FREE_TAG (job); TEST_FREE_TAG (instance); job_change_state (job, JOB_WAITING); TEST_NOT_FREE (class); TEST_FREE (job); TEST_NOT_FREE (instance); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_FREE (blocked); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopped"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); ptr = (JobClass *)nih_hash_lookup (job_classes, "test"); TEST_EQ_P (ptr, class); file->job = NULL; nih_free (replacement); nih_free (source); nih_free (instance); } class->deleted = FALSE; /* Check that a job with a deleted source can move from post-stop * to waiting, be removed from the jobs hash table, replaced by * a better one, then freed. */ TEST_FEATURE ("post-stop to waiting for deleted job"); source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); file = conf_file_new (source, "/tmp/test"); file->job = job_class_new (NULL, "test", NULL); replacement = file->job; class->deleted = TRUE; job = job_new (class, ""); nih_hash_add (job_classes, &class->entry); blocked = blocked_new (job, BLOCKED_EVENT, cause); event_block (cause); nih_list_add (&job->blocking, &blocked->entry); job->goal = JOB_STOP; job->state = JOB_POST_STOP; job->blocker = NULL; cause->failed = FALSE; TEST_FREE_TAG (blocked); job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_FREE_TAG (class); TEST_FREE_TAG (job); job_change_state (job, JOB_WAITING); TEST_FREE (class); TEST_FREE (job); TEST_EQ (cause->blockers, 0); TEST_EQ (cause->failed, FALSE); TEST_FREE (blocked); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "stopped"); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); TEST_LIST_EMPTY (events); ptr = (JobClass *)nih_hash_lookup (job_classes, "test"); TEST_EQ (ptr, replacement); file->job = NULL; nih_free (replacement); nih_free (source); fclose (output); rmdir (dirname); nih_free (cause); event_poll (); } void test_next_state (void) { JobClass *class; Job *job; TEST_FUNCTION ("job_next_state"); class = job_class_new (NULL, "test", NULL); class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = "echo"; job = job_new (class, ""); /* Check that the next state if we're starting a waiting job is * starting. */ TEST_FEATURE ("with waiting job and a goal of start"); job->goal = JOB_START; job->state = JOB_WAITING; TEST_EQ (job_next_state (job), JOB_STARTING); /* Check that the next state if we're stopping a starting job is * stpoping. */ TEST_FEATURE ("with starting job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_STARTING; TEST_EQ (job_next_state (job), JOB_STOPPING); /* Check that the next state if we're starting a starting job is * sec-spawning. */ TEST_FEATURE ("with starting job and a goal of start"); job->goal = JOB_START; job->state = JOB_STARTING; TEST_EQ (job_next_state (job), JOB_SECURITY_SPAWNING); /* Check that the next state if we're starting a sec-spawning job is * security. */ TEST_FEATURE ("with starting job and a goal of start"); job->goal = JOB_START; job->state = JOB_SECURITY_SPAWNING; TEST_EQ (job_next_state (job), JOB_SECURITY); /* Check that the next state if we're starting a security job is * pre-starting. */ TEST_FEATURE ("with security job and a goal of start"); job->goal = JOB_START; job->state = JOB_SECURITY; TEST_EQ (job_next_state (job), JOB_PRE_STARTING); /* Check that the next state if we're stopping an security job is * stopping. */ TEST_FEATURE ("with security job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_SECURITY; TEST_EQ (job_next_state (job), JOB_STOPPING); /* Check that the next state if we're starting a pre-starting job is * pre-start. */ TEST_FEATURE ("with pre-stating job and a goal of start"); job->goal = JOB_START; job->state = JOB_PRE_STARTING; TEST_EQ (job_next_state (job), JOB_PRE_START); /* Check that the next state if we're stopping a pre-starting job is * stopping. */ TEST_FEATURE ("with pre-starting job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_PRE_STARTING; TEST_EQ (job_next_state (job), JOB_STOPPING); /* Check that the next state if we're stopping a pre-start job is * stopping. */ TEST_FEATURE ("with pre-start job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_PRE_START; TEST_EQ (job_next_state (job), JOB_STOPPING); /* Check that the next state if we're starting a pre-start job is * spawned. */ TEST_FEATURE ("with pre-start job and a goal of start"); job->goal = JOB_START; job->state = JOB_PRE_START; TEST_EQ (job_next_state (job), JOB_SPAWNING); /* Check that the next state if we're starting a spawning job is * spawned. */ TEST_FEATURE ("with pre-start job and a goal of start"); job->goal = JOB_START; job->state = JOB_SPAWNING; TEST_EQ (job_next_state (job), JOB_SPAWNED); /* Check that the next state if we're stopping a spawned job is * stopping. */ TEST_FEATURE ("with spawned job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_SPAWNED; TEST_EQ (job_next_state (job), JOB_STOPPING); /* Check that the next state if we're starting a spawned job is * post-starting. */ TEST_FEATURE ("with spawned job and a goal of start"); job->goal = JOB_START; job->state = JOB_SPAWNED; TEST_EQ (job_next_state (job), JOB_POST_STARTING); /* Check that the next state if we're starting a post-staring job is * post-start. */ TEST_FEATURE ("with post-starting job and a goal of start"); job->goal = JOB_START; job->state = JOB_POST_STARTING; TEST_EQ (job_next_state (job), JOB_POST_START); /* Check that the next state if we're stopping a post-start job is * stopping. */ TEST_FEATURE ("with post-start job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_POST_START; TEST_EQ (job_next_state (job), JOB_STOPPING); /* Check that the next state if we're starting a post-start job is * running. */ TEST_FEATURE ("with post-start job and a goal of start"); job->goal = JOB_START; job->state = JOB_POST_START; TEST_EQ (job_next_state (job), JOB_RUNNING); /* Check that the next state if we're respawning after a post-start * job is stopping with the goal changed. */ TEST_FEATURE ("with post-start job and a goal of respawn"); job->goal = JOB_RESPAWN; job->state = JOB_POST_START; TEST_EQ (job_next_state (job), JOB_STOPPING); TEST_EQ (job->goal, JOB_START); /* Check that the next state if we're stopping a running job is * pre-stop. This is the "normal" stop process, as called from the * goal change event. */ TEST_FEATURE ("with running job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 1; TEST_EQ (job_next_state (job), JOB_PRE_STOPPING); /* Check that the next state if we're stopping a job with pre-stop is * pre-stop. This is the "normal" stop process, as called from the * goal change event. */ TEST_FEATURE ("with pre-stopping job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_PRE_STOPPING; job->pid[PROCESS_MAIN] = 1; TEST_EQ (job_next_state (job), JOB_PRE_STOP); /* Check that the next state if we're stopping a running job that * has no process is stopping. This is the stop process if the * process goes away on its own, as called from the child reaper. */ TEST_FEATURE ("with dead running job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 0; TEST_EQ (job_next_state (job), JOB_STOPPING); /* Check that the next state if we're starting a running job is * stopping. This assumes that the job has exited, but we didn't * change the goal, so it should be respawned. */ TEST_FEATURE ("with running job and a goal of start"); job->goal = JOB_START; job->state = JOB_RUNNING; TEST_EQ (job_next_state (job), JOB_STOPPING); /* Check that the next state if we're starting a pre-stop job is * running. This assumes that the pre-stop job decided that the * job should not stop. */ TEST_FEATURE ("with pre-stop job and a goal of start"); job->goal = JOB_START; job->state = JOB_PRE_STOP; TEST_EQ (job_next_state (job), JOB_RUNNING); /* Check that the next state if we're stopping a pre-stop job is * stopping. */ TEST_FEATURE ("with pre-stop job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_PRE_STOP; TEST_EQ (job_next_state (job), JOB_STOPPING); /* Check that the next state if we're respawning after a pre-stop * job is stopping with the goal changed. */ TEST_FEATURE ("with post-start job and a goal of respawn"); job->goal = JOB_RESPAWN; job->state = JOB_PRE_STOP; TEST_EQ (job_next_state (job), JOB_STOPPING); TEST_EQ (job->goal, JOB_START); /* Check that the next state if we're starting a stopping job is * killed. This is because we need to clean up before we can start * again. */ TEST_FEATURE ("with stopping job and a goal of start"); job->goal = JOB_START; job->state = JOB_STOPPING; TEST_EQ (job_next_state (job), JOB_KILLED); /* Check that the next state if we're stopping a stopping job is * killed. */ TEST_FEATURE ("with stopping job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_STOPPING; TEST_EQ (job_next_state (job), JOB_KILLED); /* Check that the next state if we're starting a killed job is * post-stop. This is because we need to clean up before we can * start again. */ TEST_FEATURE ("with killed job and a goal of start"); job->goal = JOB_START; job->state = JOB_KILLED; TEST_EQ (job_next_state (job), JOB_POST_STOPPING); /* Check that the next state if we're starting a post-stopping * job is post-stop. */ TEST_FEATURE ("with post-stopping job and a goal of start"); job->goal = JOB_START; job->state = JOB_POST_STOPPING; TEST_EQ (job_next_state (job), JOB_POST_STOP); /* Check that the next state if we're stopping a killed job is * post-stop. */ TEST_FEATURE ("with killed job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_KILLED; TEST_EQ (job_next_state (job), JOB_POST_STOPPING); /* Check that the next state if we're stopping a post-stopping * job is post-stop. */ TEST_FEATURE ("with post-stopping job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_POST_STOPPING; TEST_EQ (job_next_state (job), JOB_POST_STOP); /* Check that the next state if we're starting a post-stop job is * starting. */ TEST_FEATURE ("with post-stop job and a goal of start"); job->goal = JOB_START; job->state = JOB_POST_STOP; TEST_EQ (job_next_state (job), JOB_STARTING); /* Check that the next state if we're stopping a post-stop job is * waiting. */ TEST_FEATURE ("with post-stop job and a goal of stop"); job->goal = JOB_STOP; job->state = JOB_POST_STOP; TEST_EQ (job_next_state (job), JOB_WAITING); nih_free (class); } void test_failed (void) { JobClass *class; Job *job; Blocked *blocked1, *blocked2; Event *event1, *event2; TEST_FUNCTION ("job_failed"); /* Check that when the job has failed, the process and status are * stored in the job and any events are unblocked and also marked * as failed before freeing the blocking list. */ TEST_FEATURE ("with no current failure"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); event1 = event_new (NULL, "foo", NULL); blocked1 = blocked_new (job, BLOCKED_EVENT, event1); event_block (event1); nih_list_add (&job->blocking, &blocked1->entry); TEST_FREE_TAG (blocked1); event2 = event_new (NULL, "bar", NULL); blocked2 = blocked_new (job, BLOCKED_EVENT, event2); event_block (event2); nih_list_add (&job->blocking, &blocked2->entry); TEST_FREE_TAG (blocked2); job_failed (job, PROCESS_MAIN, 1); TEST_TRUE (job->failed); TEST_EQ (job->failed_process, PROCESS_MAIN); TEST_EQ (job->exit_status, 1); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked1); TEST_FREE (blocked2); TEST_EQ (event1->blockers, 0); TEST_TRUE (event1->failed); TEST_EQ (event2->blockers, 0); TEST_TRUE (event2->failed); nih_free (class); /* Check that if the job has already failed, the new failure * information does not override it and thus the events remain blocked * since these were added after the first failure. */ TEST_FEATURE ("with previous failure"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->failed = TRUE; job->failed_process = PROCESS_PRE_START; job->exit_status = 1; event1 = event_new (NULL, "foo", NULL); blocked1 = blocked_new (job, BLOCKED_EVENT, event1); event_block (event1); nih_list_add (&job->blocking, &blocked1->entry); TEST_FREE_TAG (blocked1); event2 = event_new (NULL, "bar", NULL); blocked2 = blocked_new (job, BLOCKED_EVENT, event2); event_block (event2); nih_list_add (&job->blocking, &blocked2->entry); TEST_FREE_TAG (blocked2); job_failed (job, PROCESS_POST_STOP, 10); TEST_TRUE (job->failed); TEST_EQ (job->failed_process, PROCESS_PRE_START); TEST_EQ (job->exit_status, 1); TEST_LIST_NOT_EMPTY (&job->blocking); TEST_NOT_FREE (blocked1); TEST_NOT_FREE (blocked2); TEST_EQ (event1->blockers, 1); TEST_FALSE (event1->failed); TEST_EQ (event2->blockers, 1); TEST_FALSE (event2->failed); nih_free (class); event_poll (); } void test_finished (void) { JobClass *class; Job *job; Blocked *blocked1, *blocked2; Event *event1, *event2; TEST_FUNCTION ("job_finished"); /* Check that when the job has a list of blocked events, each event * is unblocked and the list itself is then freed. */ TEST_FEATURE ("with blocked events"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); event1 = event_new (NULL, "foo", NULL); blocked1 = blocked_new (job, BLOCKED_EVENT, event1); event_block (event1); nih_list_add (&job->blocking, &blocked1->entry); TEST_FREE_TAG (blocked1); event2 = event_new (NULL, "bar", NULL); blocked2 = blocked_new (job, BLOCKED_EVENT, event2); event_block (event2); nih_list_add (&job->blocking, &blocked2->entry); TEST_FREE_TAG (blocked2); job_finished (job, FALSE); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked1); TEST_FREE (blocked2); TEST_EQ (event1->blockers, 0); TEST_FALSE (event1->failed); TEST_EQ (event2->blockers, 0); TEST_FALSE (event2->failed); nih_free (class); /* Check that when the job failed, each event in the list is * unblocked and marked as failed. */ TEST_FEATURE ("with blocked events and failure"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); event1 = event_new (NULL, "foo", NULL); blocked1 = blocked_new (job, BLOCKED_EVENT, event1); event_block (event1); nih_list_add (&job->blocking, &blocked1->entry); TEST_FREE_TAG (blocked1); event2 = event_new (NULL, "bar", NULL); blocked2 = blocked_new (job, BLOCKED_EVENT, event2); event_block (event2); nih_list_add (&job->blocking, &blocked2->entry); TEST_FREE_TAG (blocked2); job_finished (job, TRUE); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked1); TEST_FREE (blocked2); TEST_EQ (event1->blockers, 0); TEST_TRUE (event1->failed); TEST_EQ (event2->blockers, 0); TEST_TRUE (event2->failed); nih_free (class); /* Check that when the job has no blocked events, the function * still works (and just does nothing). */ TEST_FEATURE ("without blocked events"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job_finished (job, TRUE); TEST_LIST_EMPTY (&job->blocking); nih_free (class); event_poll (); } void test_emit_event (void) { JobClass *class; Job *job; Event *event; Blocked *blocked; TEST_FUNCTION ("job_emit_event"); /* Check that a nameless job in the starting state has the starting * event event emitted with the job name set. */ TEST_FEATURE ("with singleton in starting state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_STARTING; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "starting"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 3); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that an instance job in the starting state also has the * instance name set. */ TEST_FEATURE ("with instance in starting state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_START; job->state = JOB_STARTING; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "starting"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 3); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_P (event->env[2], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the running state has the started * event emitted with the job name set. */ TEST_FEATURE ("with singleton in running state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "started"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 3); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that an instance job in the running state also has the * instance name set. */ TEST_FEATURE ("with instance in running state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_START; job->state = JOB_RUNNING; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "started"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 3); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_P (event->env[2], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the stopping state, with no failure, * has the stopping event emitted with the job name set and the * result as "ok" */ TEST_FEATURE ("with non-failed singleton in stopping state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 4); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=ok"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the stopping state, with no failure, * also has the instance name set before the result information. */ TEST_FEATURE ("with non-failed instance in stopping state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_STOPPING; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 4); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=ok"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the stopping state, with a process * terminated by an abnormal exit code, has the stopping event emitted * with the job name set, the result as failed, and the process and * exit status members set. */ TEST_FEATURE ("with failed singleton in stopping state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the stopping state, with a process * terminated by an abnormal exit code, also has the instance name * set before the result information. */ TEST_FEATURE ("with failed instance in stopping state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the stopping state, with a process * killed by a signal, has the stopping event emitted with the job * name set, the result as failed, and the process and exit signal * members set. */ TEST_FEATURE ("with killed singleton in stopping state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_PRE_START; job->exit_status = SIGSEGV << 8; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=pre-start"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=SEGV"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the stopping state, with a process * killed by a signal, also has the instance name set before the * result information. */ TEST_FEATURE ("with killed instance in stopping state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_PRE_START; job->exit_status = SIGSEGV << 8; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=pre-start"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=SEGV"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the stopping state, with a process * killed by an unknown signal, has the stopping event emitted with * the job name set, the result as failed, and the process and exit * signal members set. */ TEST_FEATURE ("with unknown killed singleton in stopping state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_PRE_START; job->exit_status = 47 << 8; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=pre-start"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=47"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the stopping state, with a process * killed by an unknown signal, also has the instance name set before * the result information. */ TEST_FEATURE ("with unknown killed instance in stopping state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_PRE_START; job->exit_status = 47 << 8; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=pre-start"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=47"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the stopping state, with a process * that failed to start at all,has the stopping event emitted with * the job name set, the result as failed, and just the process set. */ TEST_FEATURE ("with unstarted singleton in stopping state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = -1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 5); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the stopping state, with a process * that failed to start at all, also has the instance name set before * the result information. */ TEST_FEATURE ("with unstarted instance in stopping state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = -1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 5); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the stopping state that failed to * respawn has the stopping event emitted with the job name set, * the result as failed and the process set to respawn. */ TEST_FEATURE ("with failed respawn singleton in stopping state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_INVALID; job->exit_status = -1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 5); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=respawn"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the stopping state that failed to * respawn also has the instance name set before the result * information. */ TEST_FEATURE ("with failed respawn instance in stopping state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_STOPPING; job->failed = TRUE; job->failed_process = PROCESS_INVALID; job->exit_status = -1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopping"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 5); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=respawn"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the stopped state, with no failure, * has the stopped event emitted with the job name set and the * result as "ok" */ TEST_FEATURE ("with non-failed singleton in stopped state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_WAITING; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 4); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=ok"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the waiting state, with no failure, * also has the instance name set before the result information. */ TEST_FEATURE ("with non-failed instance in waiting state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_WAITING; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 4); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=ok"); TEST_EQ_P (event->env[3], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the waiting state, with a process * terminated by an abnormal exit code, has the waiting event emitted * with the job name set, the result as failed, and the process and * exit status members set. */ TEST_FEATURE ("with failed singleton in waiting state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the waiting state, with a process * terminated by an abnormal exit code, also has the instance name * set before the result information. */ TEST_FEATURE ("with failed instance in waiting state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = 1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_STR (event->env[4], "EXIT_STATUS=1"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the waiting state, with a process * killed by a signal, has the waiting event emitted with the job * name set, the result as failed, and the process and exit signal * members set. */ TEST_FEATURE ("with killed singleton in waiting state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_PRE_START; job->exit_status = SIGSEGV << 8; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=pre-start"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=SEGV"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the waiting state, with a process * killed by a signal, also has the instance name set before the * result information. */ TEST_FEATURE ("with killed instance in waiting state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_PRE_START; job->exit_status = SIGSEGV << 8; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=pre-start"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=SEGV"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the waiting state, with a process * killed by an unknown signal, has the waiting event emitted with * the job name set, the result as failed, and the process and exit * signal members set. */ TEST_FEATURE ("with unknown killed singleton in waiting state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_PRE_START; job->exit_status = 47 << 8; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=pre-start"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=47"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the waiting state, with a process * killed by an unknown signal, also has the instance name set before * the result information. */ TEST_FEATURE ("with unknown killed instance in waiting state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_PRE_START; job->exit_status = 47 << 8; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 6); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=pre-start"); TEST_EQ_STR (event->env[4], "EXIT_SIGNAL=47"); TEST_EQ_P (event->env[5], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the waiting state, with a process * that failed to start at all,has the waiting event emitted with * the job name set, the result as failed, and just the process set. */ TEST_FEATURE ("with unstarted singleton in waiting state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = -1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 5); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the waiting state, with a process * that failed to start at all, also has the instance name set before * the result information. */ TEST_FEATURE ("with unstarted instance in waiting state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_MAIN; job->exit_status = -1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 5); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=main"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a nameless job in the waiting state that failed to * respawn has the waiting event emitted with the job name set, * the result as failed and the process set to respawn. */ TEST_FEATURE ("with failed respawn singleton in waiting state"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_INVALID; job->exit_status = -1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 5); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE="); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=respawn"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); /* Check that a instance job in the waiting state that failed to * respawn also has the instance name set before the result * information. */ TEST_FEATURE ("with failed respawn instance in waiting state"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); job->goal = JOB_STOP; job->state = JOB_WAITING; job->failed = TRUE; job->failed_process = PROCESS_INVALID; job->exit_status = -1; TEST_ALLOC_FAIL { event = job_emit_event (job); TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_LIST_NOT_EMPTY (&event->entry); TEST_EQ_STR (event->name, "stopped"); TEST_ALLOC_SIZE (event->env, sizeof (char *) * 5); TEST_EQ_STR (event->env[0], "JOB=test"); TEST_EQ_STR (event->env[1], "INSTANCE=foo"); TEST_EQ_STR (event->env[2], "RESULT=failed"); TEST_EQ_STR (event->env[3], "PROCESS=respawn"); TEST_EQ_P (event->env[4], NULL); TEST_LIST_EMPTY (&event->blocking); nih_free (event); } nih_free (class); } void test_name (void) { JobClass *class; Job *job; const char *ret; char *name; TEST_FUNCTION ("job_name"); /* Check that the name of a non-instance job is returned. */ TEST_FEATURE ("with non-instance job"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); TEST_ALLOC_FAIL { ret = job_name (job); TEST_EQ_STR (ret, "test"); } nih_free (class); /* Check that the name of an instance job is returned. */ TEST_FEATURE ("with instance job"); class = job_class_new (NULL, "test", NULL); class->instance = "$FOO"; job = job_new (class, "foo"); TEST_ALLOC_FAIL { ret = job_name (job); TEST_EQ_STR (ret, "test (foo)"); } nih_free (class); /* Check that a second call to the function frees the first returned * value. */ TEST_FEATURE ("with multiple calls"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); ret = job_name (job); name = (char *)ret; TEST_FREE_TAG (name); job_name (job); TEST_FREE (name); nih_free (class); } void test_goal_name (void) { const char *name; TEST_FUNCTION ("job_goal_name"); /* Check that the JOB_STOP goal returns the right string. */ TEST_FEATURE ("with stop goal"); name = job_goal_name (JOB_STOP); TEST_EQ_STR (name, "stop"); /* Check that the JOB_START goal returns the right string. */ TEST_FEATURE ("with start goal"); name = job_goal_name (JOB_START); TEST_EQ_STR (name, "start"); /* Check that the JOB_RESPAWN goal returns the right string. */ TEST_FEATURE ("with respawn goal"); name = job_goal_name (JOB_RESPAWN); TEST_EQ_STR (name, "respawn"); /* Check that an invalid goal returns NULL. */ TEST_FEATURE ("with invalid goal"); name = job_goal_name (1234); TEST_EQ_P (name, NULL); } void test_goal_from_name (void) { JobGoal goal; TEST_FUNCTION ("job_goal_from_name"); /* Check that the JOB_STOP goal is returned for the right string. */ TEST_FEATURE ("with stop goal"); goal = job_goal_from_name ("stop"); TEST_EQ (goal, JOB_STOP); /* Check that the JOB_START goal is returned for the right string. */ TEST_FEATURE ("with start goal"); goal = job_goal_from_name ("start"); TEST_EQ (goal, JOB_START); /* Check that the JOB_RESPAWN goal is returned for the right string. */ TEST_FEATURE ("with respawn goal"); goal = job_goal_from_name ("respawn"); TEST_EQ (goal, JOB_RESPAWN); /* Check that -1 is returned for an invalid string. */ TEST_FEATURE ("with invalid goal"); goal = job_goal_from_name ("wibble"); TEST_EQ (goal, (JobGoal)-1); } void test_state_name (void) { const char *name; TEST_FUNCTION ("job_state_name"); /* Check that the JOB_WAITING state returns the right string. */ TEST_FEATURE ("with waiting state"); name = job_state_name (JOB_WAITING); TEST_EQ_STR (name, "waiting"); /* Check that the JOB_STARTING state returns the right string. */ TEST_FEATURE ("with starting state"); name = job_state_name (JOB_STARTING); TEST_EQ_STR (name, "starting"); /* Check that the JOB_SECURITY state returns the right string. */ TEST_FEATURE ("with security state"); name = job_state_name (JOB_SECURITY); TEST_EQ_STR (name, "security"); /* Check that the JOB_PRE_START state returns the right string. */ TEST_FEATURE ("with pre-start state"); name = job_state_name (JOB_PRE_START); TEST_EQ_STR (name, "pre-start"); /* Check that the JOB_SPAWNED state returns the right string. */ TEST_FEATURE ("with spawned state"); name = job_state_name (JOB_SPAWNED); TEST_EQ_STR (name, "spawned"); /* Check that the JOB_POST_START state returns the right string. */ TEST_FEATURE ("with post-start state"); name = job_state_name (JOB_POST_START); TEST_EQ_STR (name, "post-start"); /* Check that the JOB_RUNNING state returns the right string. */ TEST_FEATURE ("with running state"); name = job_state_name (JOB_RUNNING); TEST_EQ_STR (name, "running"); /* Check that the JOB_PRE_STOP state returns the right string. */ TEST_FEATURE ("with pre-stop state"); name = job_state_name (JOB_PRE_STOP); TEST_EQ_STR (name, "pre-stop"); /* Check that the JOB_STOPPING state returns the right string. */ TEST_FEATURE ("with stopping state"); name = job_state_name (JOB_STOPPING); TEST_EQ_STR (name, "stopping"); /* Check that the JOB_KILLED state returns the right string. */ TEST_FEATURE ("with killed state"); name = job_state_name (JOB_KILLED); TEST_EQ_STR (name, "killed"); /* Check that the JOB_POST_STOP state returns the right string. */ TEST_FEATURE ("with post-stop state"); name = job_state_name (JOB_POST_STOP); TEST_EQ_STR (name, "post-stop"); /* Check that an invalid state returns NULL. */ TEST_FEATURE ("with invalid state"); name = job_state_name (1234); TEST_EQ_P (name, NULL); } void test_state_from_name (void) { JobState state; TEST_FUNCTION ("job_state_from_name"); /* Check that JOB_WAITING is returned for the right string. */ TEST_FEATURE ("with waiting state"); state = job_state_from_name ("waiting"); TEST_EQ (state, JOB_WAITING); /* Check that JOB_STARTING is returned for the right string. */ TEST_FEATURE ("with starting state"); state = job_state_from_name ("starting"); TEST_EQ (state, JOB_STARTING); /* Check that JOB_SECURITY is returned for the right string. */ TEST_FEATURE ("with security state"); state = job_state_from_name ("security"); TEST_EQ (state, JOB_SECURITY); /* Check that JOB_PRE_START is returned for the right string. */ TEST_FEATURE ("with pre-start state"); state = job_state_from_name ("pre-start"); TEST_EQ (state, JOB_PRE_START); /* Check that JOB_SPAWNED is returned for the right string. */ TEST_FEATURE ("with spawned state"); state = job_state_from_name ("spawned"); TEST_EQ (state, JOB_SPAWNED); /* Check that JOB_POST_START is returned for the right string. */ TEST_FEATURE ("with post-start state"); state = job_state_from_name ("post-start"); TEST_EQ (state, JOB_POST_START); /* Check that JOB_RUNNING is returned for the right string. */ TEST_FEATURE ("with running state"); state = job_state_from_name ("running"); TEST_EQ (state, JOB_RUNNING); /* Check that JOB_PRE_STOP is returned for the right string. */ TEST_FEATURE ("with pre-stop state"); state = job_state_from_name ("pre-stop"); TEST_EQ (state, JOB_PRE_STOP); /* Check that JOB_STOPPING is returned for the right string. */ TEST_FEATURE ("with stopping state"); state = job_state_from_name ("stopping"); TEST_EQ (state, JOB_STOPPING); /* Check that JOB_KILLED is returned for the right string. */ TEST_FEATURE ("with killed state"); state = job_state_from_name ("killed"); TEST_EQ (state, JOB_KILLED); /* Check that JOB_POST_STOP is returned for the right string. */ TEST_FEATURE ("with post-stop state"); state = job_state_from_name ("post-stop"); TEST_EQ (state, JOB_POST_STOP); /* Check that -1 is returned for an invalid string. */ TEST_FEATURE ("with invalid state"); state = job_state_from_name ("wibble"); TEST_EQ (state, (JobState)-1); } void test_start (void) { DBusConnection *conn, *client_conn; pid_t dbus_pid; DBusMessage *method, *reply; NihDBusMessage *message; dbus_uint32_t serial; JobClass *class; Job *job; Blocked * blocked; int ret; NihError *error; NihDBusError *dbus_error; TEST_FUNCTION ("job_start"); nih_error_init (); nih_main_loop_init (); event_init (); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); /* Check that if we start a job instance that is stopping, the goal * is changed to start. If we then hurry it through to running, * the reply will be sent to the sender. */ TEST_FEATURE ("with stopping job"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); job->goal = JOB_STOP; job->state = JOB_STOPPING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Start"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_start (job, message, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_INSTANCE_START_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); nih_free (job->blocker); job->blocker = NULL; TEST_NOT_FREE (blocked); job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); nih_free (class); /* Check that we can start a stopping job instance without waiting * for the command to complete, the reply should be sent immediately * and no blocking entry created. */ TEST_FEATURE ("with no wait"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Start"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_start (job, message, FALSE); TEST_EQ (ret, 0); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); TEST_LIST_EMPTY (&job->blocking); job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); nih_free (class); /* Check that if we attempt to start a job that's already started, * a D-Bus error is raised immediately. */ TEST_FEATURE ("with starting job"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_STARTING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Start"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_start (job, message, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.AlreadyStarted"); nih_free (dbus_error); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); event_poll (); } void test_stop (void) { DBusConnection *conn, *client_conn; pid_t dbus_pid; DBusMessage *method, *reply; NihDBusMessage *message; dbus_uint32_t serial; JobClass *class; Job *job; Blocked * blocked; int ret; NihError *error; NihDBusError *dbus_error; TEST_FUNCTION ("job_stop"); nih_error_init (); nih_main_loop_init (); event_init (); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); /* Check that if we stop a job instance that is running, the goal * is changed to stop. If we then hurry it through to waiting, * the reply will be sent to the sender and the instance deleted. */ TEST_FEATURE ("with running job"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; TEST_FREE_TAG (job); method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Stop"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_stop (job, message, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_INSTANCE_STOP_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_FREE (job); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); nih_free (class); /* Check that we can stop a running job instance without waiting * for it to complete, the reply should be sent immediately and * no blocking entry created. */ TEST_FEATURE ("with no wait"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; TEST_FREE_TAG (job); method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Stop"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_stop (job, message, FALSE); TEST_EQ (ret, 0); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); TEST_LIST_EMPTY (&job->blocking); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_FREE (job); nih_free (class); /* Check that if we attempt to stop a job that's already been stopped, * a D-Bus error is raised immediately. */ TEST_FEATURE ("with stopping job"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Stop"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_stop (job, message, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.AlreadyStopped"); nih_free (dbus_error); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); event_poll (); } void test_reload (void) { DBusConnection *conn, *client_conn; pid_t dbus_pid; DBusMessage *method, *reply; NihDBusMessage *message; dbus_uint32_t serial; JobClass *class; Job *job; int ret, status; nih_error_init (); nih_main_loop_init (); event_init (); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); TEST_FUNCTION ("job_reload"); TEST_FEATURE ("with default reload signal"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "sleep 10"); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; TEST_CHILD (job->pid[PROCESS_MAIN]) { pause (); } method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Reload"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_reload (job, message); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGHUP); TEST_EQ (ret, 0); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); nih_free (class); TEST_FEATURE ("with SIGUSR1 reload signal"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = nih_sprintf ( class->process[PROCESS_MAIN], "sleep 10"); class->reload_signal = SIGUSR1; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; TEST_CHILD (job->pid[PROCESS_MAIN]) { pause (); } method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Reload"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_reload (job, message); waitpid (job->pid[PROCESS_MAIN], &status, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGUSR1); TEST_EQ (ret, 0); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_restart (void) { DBusConnection *conn, *client_conn; pid_t dbus_pid; DBusMessage *method, *reply; NihDBusMessage *message; dbus_uint32_t serial; JobClass *class; Job *job; Blocked * blocked; int ret; NihError *error; NihDBusError *dbus_error; TEST_FUNCTION ("job_restart"); nih_error_init (); nih_main_loop_init (); event_init (); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); /* Check that if we restart a job instance that is running, the goal * remains at start but a state change is forced. If we then hurry * it back through to running, the reply will be sent to the sender. */ TEST_FEATURE ("with running job"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Restart"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_restart (job, message, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_INSTANCE_RESTART_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); nih_free (job->blocker); job->blocker = NULL; TEST_NOT_FREE (blocked); job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); nih_free (class); /* Check that we can restart a running job instance without waiting * for the command to complete, the reply should be sent immediately * and no blocking entry created. */ TEST_FEATURE ("with no wait"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Restart"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_restart (job, message, FALSE); TEST_EQ (ret, 0); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); TEST_LIST_EMPTY (&job->blocking); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); nih_free (class); /* Check that if we attempt to restart a job that's already stopping, * a D-Bus error is raised immediately. */ TEST_FEATURE ("with stopping job"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), job->path, DBUS_INTERFACE_UPSTART_INSTANCE, "Restart"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); ret = job_restart (job, message, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.AlreadyStopped"); nih_free (dbus_error); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); event_poll (); } void test_get_name (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; Job *job = NULL; NihError *error; char *name; int ret; TEST_FUNCTION ("job_get_name"); nih_error_init (); job_class_init (); /* Check that the name of the instance is returned from the * property, as a child of the message. */ TEST_FEATURE ("with instance name"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); job = job_new (class, "instance name"); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } name = NULL; ret = job_get_name (job, message, &name); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (name, message); TEST_EQ_STR (name, "instance name"); nih_free (message); nih_free (class); } /* Check that an instance with an empty string as the name has * the empty string returned. */ TEST_FEATURE ("with no instance name"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } name = NULL; ret = job_get_name (job, message, &name); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (name, message); TEST_EQ_STR (name, ""); nih_free (message); nih_free (class); } } void test_get_goal (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; Job *job = NULL; NihError *error; char *goal; int ret; /* Check that the goal of the instance is returned a newly allocated * string, as a child of the message. */ TEST_FUNCTION ("job_get_goal"); nih_error_init (); job_class_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } goal = NULL; ret = job_get_goal (job, message, &goal); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (goal, message); TEST_EQ_STR (goal, "start"); nih_free (message); nih_free (class); } } void test_get_state (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; Job *job = NULL; NihError *error; char *state; int ret; /* Check that the state of the instance is returned a newly allocated * string, as a child of the message. */ TEST_FUNCTION ("job_get_state"); nih_error_init (); job_class_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } state = NULL; ret = job_get_state (job, message, &state); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (state, message); TEST_EQ_STR (state, "running"); nih_free (message); nih_free (class); } } void test_get_processes (void) { NihDBusMessage * message = NULL; JobClass * class = NULL; Job * job = NULL; JobProcessesElement **processes; NihError * error; int ret; TEST_FUNCTION ("job_get_processes"); nih_error_init (); job_class_init (); /* Check that a job with no active processes has an empty array * returned. */ TEST_FEATURE ("with no processes"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_STARTING; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } processes = NULL; ret = job_get_processes (job, message, &processes); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (processes, message); TEST_ALLOC_SIZE (processes, sizeof (JobProcessesElement *) * 1); TEST_EQ_P (processes[0], NULL); nih_free (message); nih_free (class); } /* Check that a job with an active pre-start process has a single * array entry for that process with its pid returned. */ TEST_FEATURE ("with pre-start process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->process[PROCESS_PRE_START] = process_new (class); class->process[PROCESS_PRE_START]->command = "echo"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_PRE_START; job->pid[PROCESS_PRE_START] = 1014; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } processes = NULL; ret = job_get_processes (job, message, &processes); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (processes, message); TEST_ALLOC_SIZE (processes, sizeof (JobProcessesElement *) * 2); TEST_ALLOC_PARENT (processes[0], processes); TEST_ALLOC_SIZE (processes[0], sizeof (JobProcessesElement)); TEST_EQ_STR (processes[0]->item0, "pre-start"); TEST_ALLOC_PARENT (processes[0]->item0, processes[0]); TEST_EQ (processes[0]->item1, 1014); TEST_EQ_P (processes[1], NULL); nih_free (message); nih_free (class); } /* Check that a job with an active post-start process, and no main * process, has a single array entry for that process with its pid * returned. */ TEST_FEATURE ("with post-start process and no main process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = "echo"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_POST_START] = 2137; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } processes = NULL; ret = job_get_processes (job, message, &processes); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (processes, message); TEST_ALLOC_SIZE (processes, sizeof (JobProcessesElement *) * 2); TEST_ALLOC_PARENT (processes[0], processes); TEST_ALLOC_SIZE (processes[0], sizeof (JobProcessesElement)); TEST_EQ_STR (processes[0]->item0, "post-start"); TEST_ALLOC_PARENT (processes[0]->item0, processes[0]); TEST_EQ (processes[0]->item1, 2137); TEST_EQ_P (processes[1], NULL); nih_free (message); nih_free (class); } /* Check that a job with an active main process has a single array * entry for that process with its pid returned. */ TEST_FEATURE ("with main process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = "echo"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; job->pid[PROCESS_MAIN] = 3648; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } processes = NULL; ret = job_get_processes (job, message, &processes); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (processes, message); TEST_ALLOC_SIZE (processes, sizeof (JobProcessesElement *) * 2); TEST_ALLOC_PARENT (processes[0], processes); TEST_ALLOC_SIZE (processes[0], sizeof (JobProcessesElement)); TEST_EQ_STR (processes[0]->item0, "main"); TEST_ALLOC_PARENT (processes[0]->item0, processes[0]); TEST_EQ (processes[0]->item1, 3648); TEST_EQ_P (processes[1], NULL); nih_free (message); nih_free (class); } /* Check that a job with an active main process, and a simultaneous * post-start process, has two array entries returned: one for each * process with its pid. The main process should be listed first. */ TEST_FEATURE ("with main process and post-start process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->process[PROCESS_POST_START] = process_new (class); class->process[PROCESS_POST_START]->command = "echo"; class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = "echo"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_POST_START; job->pid[PROCESS_POST_START] = 2137; job->pid[PROCESS_MAIN] = 3648; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } processes = NULL; ret = job_get_processes (job, message, &processes); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (processes, message); TEST_ALLOC_SIZE (processes, sizeof (JobProcessesElement *) * 3); TEST_ALLOC_PARENT (processes[0], processes); TEST_ALLOC_SIZE (processes[0], sizeof (JobProcessesElement)); TEST_EQ_STR (processes[0]->item0, "main"); TEST_ALLOC_PARENT (processes[0]->item0, processes[0]); TEST_EQ (processes[0]->item1, 3648); TEST_ALLOC_PARENT (processes[1], processes); TEST_ALLOC_SIZE (processes[1], sizeof (JobProcessesElement)); TEST_EQ_STR (processes[1]->item0, "post-start"); TEST_ALLOC_PARENT (processes[1]->item0, processes[1]); TEST_EQ (processes[1]->item1, 2137); TEST_EQ_P (processes[2], NULL); nih_free (message); nih_free (class); } /* Check that a job with an active main process, and a simultaneous * pre-stop process, has two array entries returned: one for each * process with its pid. The main process should be listed first. */ TEST_FEATURE ("with main process and pre-stop process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->process[PROCESS_MAIN] = process_new (class); class->process[PROCESS_MAIN]->command = "echo"; class->process[PROCESS_PRE_STOP] = process_new (class); class->process[PROCESS_PRE_STOP]->command = "echo"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_PRE_STOP; job->pid[PROCESS_MAIN] = 3648; job->pid[PROCESS_PRE_STOP] = 7864; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } processes = NULL; ret = job_get_processes (job, message, &processes); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (processes, message); TEST_ALLOC_SIZE (processes, sizeof (JobProcessesElement *) * 3); TEST_ALLOC_PARENT (processes[0], processes); TEST_ALLOC_SIZE (processes[0], sizeof (JobProcessesElement)); TEST_EQ_STR (processes[0]->item0, "main"); TEST_ALLOC_PARENT (processes[0]->item0, processes[0]); TEST_EQ (processes[0]->item1, 3648); TEST_ALLOC_PARENT (processes[1], processes); TEST_ALLOC_SIZE (processes[1], sizeof (JobProcessesElement)); TEST_EQ_STR (processes[1]->item0, "pre-stop"); TEST_ALLOC_PARENT (processes[1]->item0, processes[1]); TEST_EQ (processes[1]->item1, 7864); TEST_EQ_P (processes[2], NULL); nih_free (message); nih_free (class); } /* Check that a job with an active pre-stop process, and no main * process, has a single array entry for that process with its pid * returned. */ TEST_FEATURE ("with pre-stop process and no main process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->process[PROCESS_PRE_STOP] = process_new (class); class->process[PROCESS_PRE_STOP]->command = "echo"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_PRE_STOP; job->pid[PROCESS_PRE_STOP] = 7864; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } processes = NULL; ret = job_get_processes (job, message, &processes); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (processes, message); TEST_ALLOC_SIZE (processes, sizeof (JobProcessesElement *) * 2); TEST_ALLOC_PARENT (processes[0], processes); TEST_ALLOC_SIZE (processes[0], sizeof (JobProcessesElement)); TEST_EQ_STR (processes[0]->item0, "pre-stop"); TEST_ALLOC_PARENT (processes[0]->item0, processes[0]); TEST_EQ (processes[0]->item1, 7864); TEST_EQ_P (processes[1], NULL); nih_free (message); nih_free (class); } /* Check that a job with an active post-stop process has a single * array entry for that process with its pid returned. */ TEST_FEATURE ("with post-stop process"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->process[PROCESS_POST_STOP] = process_new (class); class->process[PROCESS_POST_STOP]->command = "echo"; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_POST_STOP; job->pid[PROCESS_POST_STOP] = 9764; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } processes = NULL; ret = job_get_processes (job, message, &processes); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (processes, message); TEST_ALLOC_SIZE (processes, sizeof (JobProcessesElement *) * 2); TEST_ALLOC_PARENT (processes[0], processes); TEST_ALLOC_SIZE (processes[0], sizeof (JobProcessesElement)); TEST_EQ_STR (processes[0]->item0, "post-stop"); TEST_ALLOC_PARENT (processes[0]->item0, processes[0]); TEST_EQ (processes[0]->item1, 9764); TEST_EQ_P (processes[1], NULL); nih_free (message); nih_free (class); } } void test_deserialise_ptrace (void) { ConfSource *source = NULL; ConfFile *file = NULL; JobClass *class = NULL; Job *job = NULL; pid_t parent_pid, pid; siginfo_t info; char *child_wait_fd_str; TEST_FUNCTION_FEATURE ("job_deserialise", "ptrace handling"); nih_error_init (); job_class_init (); TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (conf_sources); TEST_CHILD_WAIT (parent_pid, child_wait_fd) { /* Manually construct a job and all required associated * objects. */ /* First, create ConfSource, ConfFile and JobClass */ source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); TEST_NE_P (source, NULL); file = conf_file_new (source, "/tmp/test.conf"); class = file->job = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); class->console = CONSOLE_OUTPUT; class->expect = EXPECT_FORK; class->chdir = NIH_MUST (nih_strdup (class, ".")); class->process[PROCESS_MAIN] = process_new (class); TEST_NE_P (class->process[PROCESS_MAIN], NULL); job_class_consider (class); /* Fork a process then immediately stop it */ TEST_CHILD (pid) { pid_t pid2; assert0 (ptrace (PTRACE_TRACEME, 0, NULL, 0)); raise (SIGSTOP); pid2 = fork (); if (pid2) waitpid (pid2, NULL, 0); exit (0); } /* Wait for child to be stopped */ assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); /* Set up a fork+exec trace on the child in the parent. */ assert0 (ptrace (PTRACE_SETOPTIONS, pid, NULL, PTRACE_O_TRACEFORK | PTRACE_O_TRACEEXEC)); /* Allow the child to continue */ assert0 (ptrace (PTRACE_CONT, pid, NULL, 0)); job = job_new (class, ""); TEST_NE_P (job, NULL); job->goal = JOB_START; job->state = JOB_SPAWNED; job->pid[PROCESS_MAIN] = pid; job->trace_forks = 0; job->trace_state = TRACE_NORMAL; args_copy = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (nih_str_array_add (&args_copy, NULL, NULL, argv0)); NIH_MUST (nih_str_array_add (&args_copy, NULL, NULL, "--child-wait-fd")); child_wait_fd_str = NIH_MUST (nih_sprintf (class, "%d", child_wait_fd)); NIH_MUST (nih_str_array_add (&args_copy, NULL, NULL, child_wait_fd_str)); NIH_MUST (nih_str_array_add (&args_copy, NULL, NULL, "--deserialise-ptrace")); stateful_reexec (); /* Continue in deserialise_ptrace_next */ } } void test_job_find (void) { ConfFile *file; ConfSource *source; Job *job, *ret; JobClass *class; Session *session; TEST_FUNCTION ("job_find"); nih_error_init (); conf_init (); job_class_init (); TEST_HASH_EMPTY (job_classes); source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); TEST_NE_P (source, NULL); file = conf_file_new (source, "/tmp/test"); TEST_NE_P (file, NULL); class = file->job = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); /***********************************************************/ TEST_FEATURE ("JobClass, no job name or Session"); ret = job_find (NULL, class, NULL, NULL); TEST_EQ_P (ret, NULL); /***********************************************************/ TEST_FEATURE ("job class name, no job name or Session"); ret = job_find (NULL, NULL, "test", NULL); TEST_EQ_P (ret, NULL); /***********************************************************/ TEST_FEATURE ("JobClass+job name, no Session"); ret = job_find (NULL, class, NULL, ""); TEST_EQ (ret, job); /***********************************************************/ TEST_FEATURE ("job class name+job name, no Session"); ret = job_find (NULL, NULL, "test", ""); TEST_EQ (ret, job); /***********************************************************/ /* recreate env */ nih_free (conf_sources); nih_free (job_classes); conf_sources = NULL; job_classes = NULL; conf_init (); job_class_init (); TEST_HASH_EMPTY (job_classes); source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); TEST_NE_P (source, NULL); session = session_new (NULL, "/abc"); TEST_NE_P (session, NULL); session->conf_path = NIH_MUST (nih_strdup (session, "/def/ghi")); source->session = session; file = conf_file_new (source, "/tmp/test"); TEST_NE_P (file, NULL); class = file->job = job_class_new (NULL, "test", session); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); /***********************************************************/ TEST_FEATURE ("JobClass+Session, no job name"); ret = job_find (session, class, NULL, NULL); TEST_EQ_P (ret, NULL); /***********************************************************/ TEST_FEATURE ("job class name+Session, no job name"); ret = job_find (session, NULL, "test", NULL); TEST_EQ_P (ret, NULL); /***********************************************************/ /* clean up */ nih_free (conf_sources); nih_free (job_classes); nih_free (session); conf_sources = NULL; job_classes = NULL; conf_init (); job_class_init (); } void deserialise_ptrace_next (void) { /* Continued from test_deserialise_ptrace */ JobClass *class; Job *job; int pid; siginfo_t info; int ret; nih_error_init (); job_class_init (); NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, job_process_handler, NULL)); TEST_NE (state_fd, -1); TEST_HASH_EMPTY (job_classes); ret = state_read (state_fd); TEST_GE (ret, 0); close (state_fd); class = job_class_get ("test", NULL); TEST_NE_P (class, NULL); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_NE_P (job, NULL); TEST_EQ (job->goal, JOB_START); pid = job->pid[PROCESS_MAIN]; TEST_GT (pid, 0); TEST_EQ (job->trace_forks, 0); assert0 (waitid (P_PID, pid, &info, WSTOPPED | WNOWAIT)); /* wait for grand-child */ nih_child_poll (); TEST_NE (job->pid[PROCESS_MAIN], 0); TEST_NE (job->pid[PROCESS_MAIN], pid); TEST_CHILD_RELEASE (child_wait_fd); } static NihOption options[] = { { 0, "state-fd", "specify file descriptor to read serialisation data from", NULL, "FD", &state_fd, nih_option_int }, { 0, "child-wait-fd", "specify file descriptor that test parent is waiting for", NULL, "FD", &child_wait_fd, nih_option_int }, { 0, "deserialise-ptrace", "continue test_deserialise_ptrace", NULL, NULL, &continue_deserialise_ptrace, NULL }, /* Ignore invalid options */ { '-', "--", NULL, NULL, NULL, NULL, NULL }, NIH_OPTION_LAST }; void test_job_last_process (void) { ConfFile *file; ConfSource *source; JobClass *class; Job *job; int i; int ret; TEST_FUNCTION ("job_last_process"); nih_error_init (); conf_init (); job_class_init (); TEST_HASH_EMPTY (job_classes); source = conf_source_new (NULL, "/tmp", CONF_JOB_DIR); TEST_NE_P (source, NULL); file = conf_file_new (source, "/tmp/test"); TEST_NE_P (file, NULL); class = file->job = job_class_new (NULL, "test", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); /*******************************************************************/ TEST_FEATURE ("no job processes"); for (i = 0; i < PROCESS_LAST; i++) { ret = job_last_process (job, i); TEST_FALSE (ret); } /*******************************************************************/ TEST_FEATURE ("first job process"); class->process[PROCESS_MAIN] = process_new (class); TEST_NE_P (class->process[PROCESS_MAIN], NULL); for (i = 0; i < PROCESS_LAST; i++) { ret = job_last_process (job, i); if (i == PROCESS_MAIN) { TEST_TRUE (ret); } else { TEST_FALSE (ret); } } nih_free (class->process[PROCESS_MAIN]); class->process[PROCESS_MAIN] = NULL; /*******************************************************************/ TEST_FEATURE ("last job process"); class->process[PROCESS_SECURITY] = process_new (class); TEST_NE_P (class->process[PROCESS_SECURITY], NULL); for (i = 0; i < PROCESS_LAST; i++) { ret = job_last_process (job, i); if (i == PROCESS_SECURITY) { TEST_TRUE (ret); } else { TEST_FALSE (ret); } } nih_free (class->process[PROCESS_SECURITY]); class->process[PROCESS_SECURITY] = NULL; /*******************************************************************/ TEST_FEATURE ("PROCESS_PRE_STOP job process"); class->process[PROCESS_PRE_STOP] = process_new (class); TEST_NE_P (class->process[PROCESS_PRE_STOP], NULL); for (i = 0; i < PROCESS_LAST; i++) { ret = job_last_process (job, i); if (i == PROCESS_PRE_STOP) { TEST_TRUE (ret); } else { TEST_FALSE (ret); } } nih_free (class->process[PROCESS_PRE_STOP]); class->process[PROCESS_PRE_STOP] = NULL; /*******************************************************************/ TEST_FEATURE ("all job processes set"); for (i = 0; i < PROCESS_LAST; i++) { class->process[i] = process_new (class); TEST_NE_P (class->process[i], NULL); } for (i = 0; i < PROCESS_LAST; i++) { ret = job_last_process (job, i); if (i == PROCESS_SECURITY) { TEST_TRUE (ret); } else { TEST_FALSE (ret); } } for (i = 0; i < PROCESS_LAST; i++) { nih_free (class->process[i]); class->process[i] = NULL; } /*******************************************************************/ TEST_FEATURE ("all job processes set except PROCESS_SECURITY"); for (i = 0; i < PROCESS_SECURITY; i++) { class->process[i] = process_new (class); TEST_NE_P (class->process[i], NULL); } for (i = 0; i < PROCESS_LAST; i++) { ret = job_last_process (job, i); if (i == PROCESS_POST_STOP) { TEST_TRUE (ret); } else { TEST_FALSE (ret); } } for (i = 0; i < PROCESS_SECURITY; i++) { nih_free (class->process[i]); class->process[i] = NULL; } /***********************************************************/ /* clean up */ nih_free (conf_sources); nih_free (job_classes); conf_sources = NULL; job_classes = NULL; conf_init (); job_class_init (); } int main (int argc, char *argv[]) { char **args = NULL; /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); argv0 = argv[0]; nih_main_init (argv[0]); args = nih_option_parser (NULL, argc,argv, options, FALSE); if (! args) exit (1); if (continue_deserialise_ptrace) { deserialise_ptrace_next (); exit (0); } test_new (); test_register (); test_change_goal (); test_change_state (); test_next_state (); test_failed (); test_finished (); test_emit_event (); test_name (); test_goal_name (); test_goal_from_name (); test_state_name (); test_state_from_name (); test_start (); test_stop (); test_restart (); test_reload (); test_get_name (); test_get_goal (); test_get_state (); test_get_processes (); test_deserialise_ptrace (); test_job_find (); test_job_last_process (); return 0; } upstart-1.13.2/init/tests/test_environ.c0000664000175000017500000012563212373101356015225 00000000000000/* upstart * * test_environ.c - test suite for init/environ.c * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include "environ.h" #include "errors.h" void test_add (void) { char **env = NULL, **ret; size_t len = 0; TEST_FUNCTION ("environ_add"); /* Check that we can add a variable to a new environment table * and that it is appended to the array. */ TEST_FEATURE ("with empty table"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); } ret = environ_add (&env, NULL, &len, TRUE, "FOO=BAR"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 0); TEST_EQ_P (env[0], NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_P (env[1], NULL); nih_free (env); } /* Check that we can add a variable to an environment table with * existing different entries and that it is appended to the array. */ TEST_FEATURE ("with new variable"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); } ret = environ_add (&env, NULL, &len, TRUE, "FRODO=BAGGINS"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 2); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_P (env[2], NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 3); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_ALLOC_PARENT (env[2], env); TEST_ALLOC_SIZE (env[2], 14); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_P (env[3], NULL); nih_free (env); } /* Check that we can add a variable from the environment to the table * and that it is appended to the array. */ TEST_FEATURE ("with new variable from environment"); putenv ("FRODO=BAGGINS"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); } ret = environ_add (&env, NULL, &len, TRUE, "FRODO"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 2); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_P (env[2], NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 3); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_ALLOC_PARENT (env[2], env); TEST_ALLOC_SIZE (env[2], 14); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_P (env[3], NULL); nih_free (env); } unsetenv ("FRODO"); /* Check that when we attempt to add a variable that's not in the * environment, the table is not extended. */ TEST_FEATURE ("with new variable unset in environment"); unsetenv ("FRODO"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); } ret = environ_add (&env, NULL, &len, TRUE, "FRODO"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 2); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_P (env[2], NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 2); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_P (env[2], NULL); nih_free (env); } /* Check that we can replace a variable in the environment table * when one already exists with the same or different value. */ TEST_FEATURE ("with replacement variable"); TEST_ALLOC_FAIL { char *old_env; TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); assert (nih_str_array_add (&env, NULL, &len, "FRODO=BAGGINS")); } old_env = env[1]; TEST_FREE_TAG (old_env); ret = environ_add (&env, NULL, &len, TRUE, "BAR=WIBBLE"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_NOT_FREE (old_env); TEST_EQ (len, 3); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_P (env[3], NULL); nih_free (env); continue; } TEST_FREE (old_env); TEST_NE_P (ret, NULL); TEST_EQ (len, 3); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_ALLOC_PARENT (env[1], env); TEST_ALLOC_SIZE (env[1], 11); TEST_EQ_STR (env[1], "BAR=WIBBLE"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_P (env[3], NULL); nih_free (env); } /* Check that we can replace a variable from the environment in the * environment table when one already exists with the same or * different value. */ TEST_FEATURE ("with replacement variable from environment"); putenv ("BAR=WIBBLE"); TEST_ALLOC_FAIL { char *old_env; TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); assert (nih_str_array_add (&env, NULL, &len, "FRODO=BAGGINS")); assert (nih_str_array_add (&env, NULL, &len, "BILBO=TOOK")); } old_env = env[1]; TEST_FREE_TAG (old_env); ret = environ_add (&env, NULL, &len, TRUE, "BAR"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_NOT_FREE (old_env); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_STR (env[3], "BILBO=TOOK"); TEST_EQ_P (env[4], NULL); nih_free (env); continue; } TEST_FREE (old_env); TEST_NE_P (ret, NULL); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_ALLOC_PARENT (env[1], env); TEST_ALLOC_SIZE (env[1], 11); TEST_EQ_STR (env[1], "BAR=WIBBLE"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_STR (env[3], "BILBO=TOOK"); TEST_EQ_P (env[4], NULL); nih_free (env); } unsetenv ("BAR"); /* Check that when we attempt to replace a variable that's unset * in the environment, the existing variable is removed from the * table. */ TEST_FEATURE ("with replacement variable unset in environment"); unsetenv ("BAR"); TEST_ALLOC_FAIL { char *old_env; TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); assert (nih_str_array_add (&env, NULL, &len, "FRODO=BAGGINS")); assert (nih_str_array_add (&env, NULL, &len, "BILBO=TOOK")); } old_env = env[1]; TEST_FREE_TAG (old_env); ret = environ_add (&env, NULL, &len, TRUE, "BAR"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_NOT_FREE (old_env); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_STR (env[3], "BILBO=TOOK"); TEST_EQ_P (env[4], NULL); nih_free (env); continue; } TEST_FREE (old_env); TEST_NE_P (ret, NULL); TEST_EQ (len, 3); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "FRODO=BAGGINS"); TEST_EQ_STR (env[2], "BILBO=TOOK"); TEST_EQ_P (env[3], NULL); nih_free (env); } unsetenv ("BAR"); /* Check that we can add a variable to an environment table with * existing different entries and that it is appended to the array, * even if replace is FALSE. */ TEST_FEATURE ("with new variable but no replace"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); } ret = environ_add (&env, NULL, &len, FALSE, "FRODO=BAGGINS"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 2); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_P (env[2], NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 3); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_ALLOC_PARENT (env[2], env); TEST_ALLOC_SIZE (env[2], 14); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_P (env[3], NULL); nih_free (env); } /* Check that when a variable already exists in the environment * table, and we're not replacing, the original value is left * untouched. */ TEST_FEATURE ("with existing variable"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); assert (nih_str_array_add (&env, NULL, &len, "FRODO=BAGGINS")); } ret = environ_add (&env, NULL, &len, FALSE, "BAR=WIBBLE"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 3); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_P (env[3], NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 3); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_P (env[3], NULL); nih_free (env); } /* Check that when a variable from the environment already exists in * the environment table, and we're not replacing, the original value * is left untouched. */ TEST_FEATURE ("with existing variable from environment"); putenv ("BAR=WIBBLE"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); assert (nih_str_array_add (&env, NULL, &len, "FRODO=BAGGINS")); assert (nih_str_array_add (&env, NULL, &len, "BILBO=TOOK")); } ret = environ_add (&env, NULL, &len, FALSE, "BAR"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_STR (env[3], "BILBO=TOOK"); TEST_EQ_P (env[4], NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_STR (env[3], "BILBO=TOOK"); TEST_EQ_P (env[4], NULL); nih_free (env); } unsetenv ("BAR"); /* Check that when a variable from the environment is unset it * does not remove an existing variable in the environment table * if we're not replacing. */ TEST_FEATURE ("with existing variable unset in environment"); unsetenv ("BAR"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); assert (nih_str_array_add (&env, NULL, &len, "FRODO=BAGGINS")); assert (nih_str_array_add (&env, NULL, &len, "BILBO=TOOK")); } ret = environ_add (&env, NULL, &len, FALSE, "BAR"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_STR (env[3], "BILBO=TOOK"); TEST_EQ_P (env[4], NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "FRODO=BAGGINS"); TEST_EQ_STR (env[3], "BILBO=TOOK"); TEST_EQ_P (env[4], NULL); nih_free (env); } unsetenv ("BAR"); /* Check that attempting to add a variable by name fails if * there is no corresponding environment variable set. */ TEST_FEATURE ("using bare word with no corresponding variable set in environment"); /* Ensure variable not set initially */ TEST_EQ_P (getenv ("UPSTART_TEST_VARIABLE"), NULL); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, &len, "FOO=BAR")); } ret = environ_add (&env, NULL, &len, FALSE, "UPSTART_TEST_VARIABLE"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 1); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_P (env[1], NULL); nih_free (env); continue; } /* XXX: Attempting to add an unset variable results in * no change to the table (it is not an error!) */ TEST_EQ_P (ret, env); TEST_EQ (len, 1); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_P (env[1], NULL); nih_free (env); } } void test_remove (void) { char **env = NULL; char *removed = NULL; char **ret = NULL; size_t len = 0; TEST_FUNCTION ("environ_remove"); TEST_FEATURE ("remove name=value pair with empty table"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); } ret = environ_remove (&env, NULL, &len, "FOO=BAR"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 0); TEST_EQ_P (env[0], NULL); nih_free (env); continue; } TEST_EQ_P (ret, NULL); TEST_EQ (len, 0); TEST_EQ_P (env[0], NULL); nih_free (env); } TEST_FEATURE ("remove bare name with empty table"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); } ret = environ_remove (&env, NULL, &len, "FOO"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 0); TEST_EQ_P (env[0], NULL); nih_free (env); continue; } TEST_EQ_P (ret, NULL); TEST_EQ (len, 0); TEST_EQ_P (env[0], NULL); nih_free (env); } TEST_FEATURE ("remove name=value from table of size 1"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); ret = environ_add (&env, NULL, &len, TRUE, "FOO=BAR"); TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); removed = env[0]; TEST_FREE_TAG (removed); TEST_EQ_P (env[1], NULL); } ret = environ_remove (&env, NULL, &len, "FOO=BAR"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 0); TEST_EQ_P (env[0], NULL); TEST_FREE (removed); nih_free (env); } TEST_FEATURE ("remove bare name from table of size 1"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); ret = environ_add (&env, NULL, &len, TRUE, "FOO=BAR"); TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); removed = env[0]; TEST_FREE_TAG (removed); TEST_EQ_P (env[1], NULL); } ret = environ_remove (&env, NULL, &len, "FOO"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 0); TEST_EQ_P (env[0], NULL); TEST_FREE (removed); nih_free (env); } TEST_FEATURE ("remove first name=value entry from table of size 2"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); ret = environ_add (&env, NULL, &len, TRUE, "FOO=BAR"); TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_P (env[1], NULL); ret = environ_add (&env, NULL, &len, TRUE, "BAZ=QUX"); TEST_NE_P (ret, NULL); TEST_EQ (len, 2); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); removed = env[0]; TEST_FREE_TAG (removed); TEST_ALLOC_PARENT (env[1], env); TEST_ALLOC_SIZE (env[1], 8); TEST_EQ_STR (env[1], "BAZ=QUX"); TEST_EQ_P (env[2], NULL); } /* Remove first entry added */ ret = environ_remove (&env, NULL, &len, "FOO=BAR"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "BAZ=QUX"); TEST_FREE (removed); TEST_EQ_P (env[1], NULL); nih_free (env); } TEST_FEATURE ("remove first bare name entry from table of size 2"); /* Set a variable to allow the bare name to be expanded */ assert0 (setenv ("UPSTART_TEST_VARIABLE", "foo", 1)); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); ret = environ_add (&env, NULL, &len, TRUE, "UPSTART_TEST_VARIABLE"); TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); /* Should have been expanded */ TEST_EQ_STR (env[0], "UPSTART_TEST_VARIABLE=foo"); TEST_EQ_P (env[1], NULL); ret = environ_add (&env, NULL, &len, TRUE, "BAZ=QUX"); TEST_NE_P (ret, NULL); TEST_EQ (len, 2); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "UPSTART_TEST_VARIABLE=foo"); removed = env[0]; TEST_FREE_TAG (removed); TEST_ALLOC_PARENT (env[1], env); TEST_ALLOC_SIZE (env[1], 8); TEST_EQ_STR (env[1], "BAZ=QUX"); TEST_EQ_P (env[2], NULL); } /* Remove first entry added */ ret = environ_remove (&env, NULL, &len, "UPSTART_TEST_VARIABLE"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "BAZ=QUX"); TEST_FREE (removed); TEST_EQ_P (env[1], NULL); nih_free (env); } assert0 (unsetenv ("UPSTART_TEST_VARIABLE")); TEST_FEATURE ("remove last name=value entry from table of size 2"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); ret = environ_add (&env, NULL, &len, TRUE, "FOO=BAR"); TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_P (env[1], NULL); ret = environ_add (&env, NULL, &len, TRUE, "BAZ=QUX"); TEST_NE_P (ret, NULL); TEST_EQ (len, 2); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_ALLOC_PARENT (env[1], env); TEST_ALLOC_SIZE (env[1], 8); TEST_EQ_STR (env[1], "BAZ=QUX"); removed = env[1]; TEST_FREE_TAG (removed); TEST_EQ_P (env[2], NULL); } /* Remove last entry added */ ret = environ_remove (&env, NULL, &len, "BAZ=QUX"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_P (env[1], NULL); TEST_FREE (removed); nih_free (env); } TEST_FEATURE ("remove last bare name entry from table of size 2"); /* Set a variable to allow the bare name to be expanded */ assert0 (setenv ("UPSTART_TEST_VARIABLE", "foo", 1)); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); ret = environ_add (&env, NULL, &len, TRUE, "FOO=BAR"); TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_P (env[1], NULL); ret = environ_add (&env, NULL, &len, TRUE, "UPSTART_TEST_VARIABLE"); TEST_NE_P (ret, NULL); TEST_EQ (len, 2); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_ALLOC_PARENT (env[1], env); TEST_ALLOC_SIZE (env[1], 8); /* Should have been expanded */ TEST_EQ_STR (env[1], "UPSTART_TEST_VARIABLE=foo"); removed = env[1]; TEST_FREE_TAG (removed); TEST_EQ_P (env[2], NULL); } /* Remove last entry added */ ret = environ_remove (&env, NULL, &len, "UPSTART_TEST_VARIABLE"); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 8); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_P (env[1], NULL); TEST_FREE (removed); nih_free (env); } assert0 (unsetenv ("UPSTART_TEST_VARIABLE")); } void test_append (void) { char **env = NULL, **new_env, **ret; size_t len = 0; TEST_FUNCTION ("environ_append"); /* Check that we can append all new entries onto the end of an * existing environment table, without modifying the entries passed. */ TEST_FEATURE ("with new entries"); new_env = nih_str_array_new (NULL); assert (environ_add (&new_env, NULL, NULL, TRUE, "MILK=white")); assert (environ_add (&new_env, NULL, NULL, TRUE, "TEA=green")); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (environ_add (&env, NULL, &len, TRUE, "FOO=BAR")); assert (environ_add (&env, NULL, &len, TRUE, "BAR=BAZ")); } ret = environ_append (&env, NULL, &len, TRUE, new_env); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); nih_free (env); continue; } TEST_EQ_P (ret, env); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "MILK=white"); TEST_EQ_STR (env[3], "TEA=green"); TEST_EQ_P (env[4], NULL); nih_free (env); } nih_free (new_env); /* Check that if entries are being replaced, those values from the * new table replace the values in the old table. */ TEST_FEATURE ("with replacement entries"); new_env = nih_str_array_new (NULL); assert (environ_add (&new_env, NULL, NULL, TRUE, "MILK=white")); assert (environ_add (&new_env, NULL, NULL, TRUE, "TEA=green")); assert (environ_add (&new_env, NULL, NULL, TRUE, "FOO=apricot")); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (environ_add (&env, NULL, &len, TRUE, "FOO=BAR")); assert (environ_add (&env, NULL, &len, TRUE, "BAR=BAZ")); } ret = environ_append (&env, NULL, &len, TRUE, new_env); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); nih_free (env); continue; } TEST_EQ_P (ret, env); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=apricot"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "MILK=white"); TEST_EQ_STR (env[3], "TEA=green"); TEST_EQ_P (env[4], NULL); nih_free (env); } nih_free (new_env); /* Check that if entries are being preserved, those values from the * new table are ignored. */ TEST_FEATURE ("with preserve existing entries"); new_env = nih_str_array_new (NULL); assert (environ_add (&new_env, NULL, NULL, TRUE, "MILK=white")); assert (environ_add (&new_env, NULL, NULL, TRUE, "TEA=green")); assert (environ_add (&new_env, NULL, NULL, TRUE, "FOO=apricot")); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); assert (environ_add (&env, NULL, &len, TRUE, "FOO=BAR")); assert (environ_add (&env, NULL, &len, TRUE, "BAR=BAZ")); } ret = environ_append (&env, NULL, &len, FALSE, new_env); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); nih_free (env); continue; } TEST_EQ_P (ret, env); TEST_EQ (len, 4); TEST_EQ_STR (env[0], "FOO=BAR"); TEST_EQ_STR (env[1], "BAR=BAZ"); TEST_EQ_STR (env[2], "MILK=white"); TEST_EQ_STR (env[3], "TEA=green"); TEST_EQ_P (env[4], NULL); nih_free (env); } nih_free (new_env); } void test_set (void) { char **env = NULL, **ret; size_t len = 0; TEST_FUNCTION ("environ_set"); /* Check that an environment variable can be set from a format * string. */ TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { len = 0; env = nih_str_array_new (NULL); } ret = environ_set (&env, NULL, &len, TRUE, "FOO=%d", 1234); if (test_alloc_failed) { TEST_EQ_P (ret, NULL); TEST_EQ (len, 0); TEST_EQ_P (env[0], NULL); nih_free (env); continue; } TEST_NE_P (ret, NULL); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_ALLOC_SIZE (env[0], 9); TEST_EQ_STR (env[0], "FOO=1234"); TEST_EQ_P (env[1], NULL); nih_free (env); } } void test_lookup (void) { char **env = NULL; size_t len = 0; char * const *ret; TEST_FUNCTION ("environ_lookup"); len = 0; env = nih_str_array_new (NULL); /* Check that an empty table always returns NULL. */ TEST_FEATURE ("with empty table"); ret = environ_lookup (env, "FOO", 3); TEST_EQ_P (ret, NULL); assert (nih_str_array_add (&env, NULL, &len, "FOOLISH=no")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); /* Check that a key that is present is returned. */ TEST_FEATURE ("with key to be found"); ret = environ_lookup (env, "BAR", 3); TEST_EQ_P (ret, &env[1]); /* Check that a key that doesn't exist returns NULL. */ TEST_FEATURE ("with key not found"); ret = environ_lookup (env, "MEEP", 4); TEST_EQ_P (ret, NULL); /* Check that the key is not prefix-matched. */ TEST_FEATURE ("with key that is prefix of another"); ret = environ_lookup (env, "FOO", 3); TEST_EQ_P (ret, NULL); /* Check that the length is honoured. */ TEST_FEATURE ("with longer key"); ret = environ_lookup (env, "FOOLISH", 3); TEST_EQ_P (ret, NULL); nih_free (env); } void test_get (void) { char **env = NULL; size_t len = 0; const char *ret; TEST_FUNCTION ("environ_get"); len = 0; env = nih_str_array_new (NULL); /* Check that an empty table always returns NULL. */ TEST_FEATURE ("with empty table"); ret = environ_get (env, "FOO"); TEST_EQ_P (ret, NULL); assert (nih_str_array_add (&env, NULL, &len, "FOOLISH=no")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); /* Check that a key that is present is returned. */ TEST_FEATURE ("with key to be found"); ret = environ_get (env, "BAR"); TEST_EQ_STR (ret, "BAZ"); /* Check that a key that doesn't exist returns NULL. */ TEST_FEATURE ("with key not found"); ret = environ_get (env, "MEEP"); TEST_EQ_P (ret, NULL); /* Check that the key is not prefix-matched. */ TEST_FEATURE ("with key that is prefix of another"); ret = environ_get (env, "FOO"); TEST_EQ_P (ret, NULL); nih_free (env); } void test_getn (void) { char **env = NULL; size_t len = 0; const char *ret; TEST_FUNCTION ("environ_getn"); len = 0; env = nih_str_array_new (NULL); /* Check that an empty table always returns NULL. */ TEST_FEATURE ("with empty table"); ret = environ_getn (env, "FOO", 3); TEST_EQ_P (ret, NULL); assert (nih_str_array_add (&env, NULL, &len, "FOOLISH=no")); assert (nih_str_array_add (&env, NULL, &len, "BAR=BAZ")); /* Check that a key that is present is returned. */ TEST_FEATURE ("with key to be found"); ret = environ_getn (env, "BAR", 3); TEST_EQ_STR (ret, "BAZ"); /* Check that a key that doesn't exist returns NULL. */ TEST_FEATURE ("with key not found"); ret = environ_getn (env, "MEEP", 4); TEST_EQ_P (ret, NULL); /* Check that the key is not prefix-matched. */ TEST_FEATURE ("with key that is prefix of another"); ret = environ_getn (env, "FOO", 3); TEST_EQ_P (ret, NULL); /* Check that the length is honoured. */ TEST_FEATURE ("with longer key"); ret = environ_getn (env, "FOOLISH", 3); TEST_EQ_P (ret, NULL); nih_free (env); } void test_all_valid (void) { char **env; int valid; TEST_FUNCTION ("environ_all_valid"); /* Check that a valid environment table returns TRUE. */ TEST_FEATURE ("with valid table"); env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, NULL, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, NULL, "BAR=BAZ")); valid = environ_all_valid (env); TEST_TRUE (valid); nih_free (env); /* Check that an empty environment table is valid. */ TEST_FEATURE ("with empty table"); env = nih_str_array_new (NULL); valid = environ_all_valid (env); TEST_TRUE (valid); nih_free (env); /* Check that an entry without an equals means the table is not * valid. */ TEST_FEATURE ("with missing equals"); env = nih_str_array_new (NULL); assert (nih_str_array_add (&env, NULL, NULL, "FOO=BAR")); assert (nih_str_array_add (&env, NULL, NULL, "BAR")); assert (nih_str_array_add (&env, NULL, NULL, "WIBBLE=woo")); valid = environ_all_valid (env); TEST_FALSE (valid); nih_free (env); } void test_expand (void) { NihError *error; char *env[7], *str; TEST_FUNCTION ("environ_expand"); env[0] = "FOO=frodo"; env[1] = "BAR=bilbo"; env[2] = "BAZ=xx"; env[3] = "HOBBIT=FOO"; env[4] = "NULL="; env[5] = "DOH=oops"; env[6] = NULL; nih_error_push_context(); nih_error_pop_context (); /* Check that we can expand a string containing no expansion. */ TEST_FEATURE ("with no expansion"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "this is a test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "this is a test"); nih_free (str); } /* Check that we can expand a simple string containing a reference * from the environment, with the reference replaced by the environment * variable value. */ TEST_FEATURE ("with simple expansion"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "this is a $FOO test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "this is a frodo test"); nih_free (str); } /* Check that we can expand a simple string containing a reference * from the environment that is smaller than the reference, with the * reference replaced by the environment variable value. */ TEST_FEATURE ("with simple expansion of smaller value"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "this is a $BAZ test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "this is a xx test"); nih_free (str); } /* Check that we can expand a simple string containing a reference * from the environment that is exactly the same size as the * reference, with the reference replaced by the environment variable * value. */ TEST_FEATURE ("with simple expansion of same size value"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "this is a $DOH test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "this is a oops test"); nih_free (str); } /* Check that we can expand a string containing multiple simple * references, with each replaced by the variable value. */ TEST_FEATURE ("with multiple simple expansions"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "test $FOO $BAR$BAZ", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "test frodo bilboxx"); nih_free (str); } /* Check that we can expand a string containing a bracketed * reference, allowing it to nestle against other alphanumerics. */ TEST_FEATURE ("with simple bracketed expression"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${BAR}test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "bilbotest"); nih_free (str); } /* Check that we can expand a string containing multiple bracketed * references, allowing it to nestle against other alphanumerics. */ TEST_FEATURE ("with multiple simple bracketed expression"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${BAR}${FOO}test${BAZ}", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "bilbofrodotestxx"); nih_free (str); } /* Check that simple expressions may appear within bracketed * expressions, causing them to be evaluted and the evalution * serving as the reference. */ TEST_FEATURE ("with simple expression inside bracketed expression"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${$HOBBIT} baggins", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "frodo baggins"); nih_free (str); } /* Check that bracketed expressions may appear within bracketed * expressions. */ TEST_FEATURE ("with bracketed expression inside bracketed expression"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${${HOBBIT}} baggins", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "frodo baggins"); nih_free (str); } /* Check that we can substitute a default value if the variable * we were after was unset. */ TEST_FEATURE ("with bracketed default expression"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${MEEP-a }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "a test"); nih_free (str); } /* Check that a default expression uses the environment value if * it is actually set. */ TEST_FEATURE ("with bracketed default expression for set variable"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${BAZ-a }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "xxtest"); nih_free (str); } /* Check that a default expression uses the environment value if * it is actually set, even if it is NULL. */ TEST_FEATURE ("with bracketed default expression for null variable"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${NULL-a }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "test"); nih_free (str); } /* Check that we can substitute a default value if the variable * we were after was unset (or null). */ TEST_FEATURE ("with bracketed default or null expression"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${MEEP:-a }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "a test"); nih_free (str); } /* Check that a default or null expression uses the environment value * if it is actually set and not null. */ TEST_FEATURE ("with bracketed default or null expression for set variable"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${BAZ:-a }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "xxtest"); nih_free (str); } /* Check that we can substitute a default value if the variable * we were after was null. */ TEST_FEATURE ("with bracketed default or null expression for null variable"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${NULL:-a }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "a test"); nih_free (str); } /* Check that we don't substitute an alternate value if the * variable we were after was unset. */ TEST_FEATURE ("with bracketed alternate expression"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${MEEP+good }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "test"); nih_free (str); } /* Check that we use the alternate value if the environment variable * is actually set. */ TEST_FEATURE ("with bracketed alternate expression for set variable"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${BAZ+good }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "good test"); nih_free (str); } /* Check that we use the alternate value if the environment variable * is set, even if it is NULL. */ TEST_FEATURE ("with bracketed alternate expression for null variable"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${NULL+good }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "good test"); nih_free (str); } /* Check that we don't substitute an alternate value if the * variable we were after was unset (or null). */ TEST_FEATURE ("with bracketed alternate or null expression"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${MEEP:+good }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "test"); nih_free (str); } /* Check that we use the alternate value if the environment variable * is actually set and not null. */ TEST_FEATURE ("with bracketed alternate or null expression for set variable"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${BAZ:+good }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "good test"); nih_free (str); } /* Check that we don't substitute an alternate value if the * variable we were after was set, but was null. */ TEST_FEATURE ("with bracketed alternate or null expression for null variable"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${NULL:+good }test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "test"); nih_free (str); } /* Check that references on either side of an expression are * expanded before evaluation. */ TEST_FEATURE ("with references in bracketed expression argument"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${$BAZ:-${$HOBBIT}}test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "frodotest"); nih_free (str); } /* Check that a literal dollar sign with no following text is * treated just as a dollar sign. */ TEST_FEATURE ("with dollar sign in whitespace"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "this is a $ test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "this is a $ test"); nih_free (str); } /* Check that a literal dollar sign in text can be followed by empty * brackets to be just as a dollar sign. */ TEST_FEATURE ("with bracketed dollar sign"); TEST_ALLOC_FAIL { str = environ_expand (NULL, "${}test", env); if (test_alloc_failed) { TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); continue; } TEST_EQ_STR (str, "$test"); nih_free (str); } /* Check that attempting to expand an unknown variable results in * an error being raised. */ TEST_FEATURE ("with simple expansion of unknown variable"); str = environ_expand (NULL, "this is a $WIBBLE test", env); TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENVIRON_UNKNOWN_PARAM); nih_free (error); /* Check that attempting to expand an unknown variable results in * an error being raised. */ TEST_FEATURE ("with bracketed expansion of unknown variable"); str = environ_expand (NULL, "this is a ${WIBBLE} test", env); TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENVIRON_UNKNOWN_PARAM); nih_free (error); /* Check that attempting to expand an unknown variable results in * an error being raised. */ TEST_FEATURE ("with expansion of unknown variable within expression name"); str = environ_expand (NULL, "this is a ${$WIBBLE:-$FOO} test", env); TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENVIRON_UNKNOWN_PARAM); nih_free (error); /* Check that attempting to expand an unknown variable results in * an error being raised. */ TEST_FEATURE ("with expansion of unknown variable within expression argument"); str = environ_expand (NULL, "this is a ${$FOO:-$WIBBLE} test", env); TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENVIRON_UNKNOWN_PARAM); nih_free (error); /* Check that inventing a new operator results in an error * being raised. */ TEST_FEATURE ("with unknown operator in expression"); str = environ_expand (NULL, "this is a ${$FOO:!$BAR test", env); TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENVIRON_EXPECTED_OPERATOR); nih_free (error); /* Check that forgetting to close a brace results in an error * being raised. */ TEST_FEATURE ("with missing close brace after expression"); str = environ_expand (NULL, "this is a ${$FOO:-$BAR test", env); TEST_EQ_P (str, NULL); error = nih_error_get (); TEST_EQ (error->number, ENVIRON_MISMATCHED_BRACES); nih_free (error); } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_add (); test_remove (); test_append (); test_set (); test_lookup (); test_get (); test_getn (); test_all_valid (); test_expand (); return 0; } upstart-1.13.2/init/tests/test_util.h0000664000175000017500000000066512373101356014525 00000000000000#ifndef TEST_UTIL_H #define TEST_UTIL_H #include "event_operator.h" #include "conf.h" #include "job_class.h" #include "session.h" #include "log.h" /* Prototypes */ int event_operator_diff (EventOperator *a, EventOperator *b) __attribute__ ((warn_unused_result)); Session *session_from_chroot (const char *chroot) __attribute__ ((warn_unused_result)); void ensure_env_clean (void); void clean_env (void); #endif /* TEST_UTIL_H */ upstart-1.13.2/init/tests/test_control.c0000664000175000017500000017010512373101356015220 00000000000000/* upstart * * test_dbus.c - test suite for init/dbus.c * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "blocked.h" #include "job_class.h" #include "job.h" #include "conf.h" #include "control.h" #include "errors.h" #include "test_util_common.h" extern const char *control_server_address; extern int no_inherit_env; void test_server_open (void) { NihError *err; const char * address; struct sockaddr_un addr; socklen_t addrlen; int ret, fd; TEST_FUNCTION ("control_server_open"); program_name = "test"; control_init (); nih_io_init (); control_server_address = "unix:abstract=/com/ubuntu/upstart/test"; /* Check that control_server_open() creates a new listening D-Bus * server and sets the control_server global. */ TEST_FEATURE ("with expected success"); assert (NIH_LIST_EMPTY (nih_io_watches)); ret = control_server_open (); TEST_EQ (ret, 0); TEST_NE_P (control_server, NULL); /* D-Bus provides no method to obtain the fd of the server, so * we have to steal it. */ assert (! NIH_LIST_EMPTY (nih_io_watches)); fd = ((NihIoWatch *)nih_io_watches->next)->fd; TEST_TRUE (fcntl (fd, F_GETFD) & FD_CLOEXEC); TEST_TRUE (dbus_server_get_is_connected (control_server)); control_server_close (); dbus_shutdown (); /* Check that if something else is already listening on that address, * control_server_open returns NULL and a D-Bus error code. */ TEST_FEATURE ("with already listening"); fd = socket (PF_UNIX, SOCK_STREAM, 0); assert (fd >= 0); address = "unix:abstract=/com/ubuntu/upstart/test"; assert (address = strchr (address, '/')); addr.sun_family = AF_UNIX; addr.sun_path[0] = '\0'; strncpy (addr.sun_path + 1, address, sizeof (addr.sun_path) - 1); addrlen = offsetof (struct sockaddr_un, sun_path) + 1; addrlen += strlen (address); assert0 (bind (fd, &addr, addrlen)); assert0 (listen (fd, SOMAXCONN)); ret = control_server_open (); TEST_LT (ret, 0); TEST_EQ_P (control_server, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_DBUS_ERROR); TEST_EQ_STR (((NihDBusError *)err)->name, DBUS_ERROR_ADDRESS_IN_USE); nih_free (err); dbus_shutdown (); close (fd); } void test_server_connect (void) { NihListEntry *entry; NihDBusObject *object; DBusConnection *conn; JobClass *class1, *class2; Job *job1, *job2; pid_t pid; int fd, wait_fd, status; TEST_FUNCTION ("control_server_connect"); program_name = "test"; control_init (); nih_io_init (); control_server_address = "unix:abstract=/com/ubuntu/upstart/test"; assert0 (control_server_open ()); assert (NIH_LIST_EMPTY (control_conns)); /* Check that a new connection to our server is accepted and stored * in the connections list, with the manager object registered on * it. */ TEST_FEATURE ("with no jobs"); TEST_CHILD_WAIT (pid, wait_fd) { DBusConnection *conn; control_server_close (); nih_signal_set_handler (SIGTERM, nih_signal_handler); assert (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); conn = nih_dbus_connect ("unix:abstract=/com/ubuntu/upstart/test", NULL); assert (conn != NULL); TEST_CHILD_RELEASE (wait_fd); nih_main_loop (); dbus_connection_unref (conn); dbus_shutdown (); exit (0); } assert (nih_timer_add_timeout (NULL, 1, (NihTimerCb)nih_main_term_signal, NULL)); nih_main_loop (); TEST_LIST_NOT_EMPTY (control_conns); entry = (NihListEntry *)control_conns->next; TEST_ALLOC_SIZE (entry, sizeof (NihListEntry)); TEST_NE_P (entry->data, NULL); conn = entry->data; dbus_connection_get_unix_fd (conn, &fd); TEST_TRUE (fcntl (fd, F_GETFD) & FD_CLOEXEC); TEST_TRUE (dbus_connection_get_object_path_data (conn, DBUS_PATH_UPSTART, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART); TEST_EQ_P (object->data, NULL); kill (pid, SIGTERM); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); dbus_connection_close (conn); dbus_connection_unref (conn); nih_free (entry); /* Check that when there are existing jobs and instances, the * new connection has them automatically registered. */ TEST_FEATURE ("with existing jobs"); class1 = job_class_new (NULL, "foo", NULL); nih_hash_add (job_classes, &class1->entry); class2 = job_class_new (NULL, "bar", NULL); job1 = job_new (class2, "test1"); job2 = job_new (class2, "test2"); nih_hash_add (job_classes, &class2->entry); TEST_CHILD_WAIT (pid, wait_fd) { DBusConnection *conn; control_server_close (); nih_signal_set_handler (SIGTERM, nih_signal_handler); assert (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); conn = nih_dbus_connect ("unix:abstract=/com/ubuntu/upstart/test", NULL); assert (conn != NULL); TEST_CHILD_RELEASE (wait_fd); nih_main_loop (); dbus_connection_unref (conn); dbus_shutdown (); exit (0); } assert (nih_timer_add_timeout (NULL, 1, (NihTimerCb)nih_main_term_signal, NULL)); nih_main_loop (); TEST_LIST_NOT_EMPTY (control_conns); entry = (NihListEntry *)control_conns->next; TEST_ALLOC_SIZE (entry, sizeof (NihListEntry)); TEST_NE_P (entry->data, NULL); conn = entry->data; dbus_connection_get_unix_fd (conn, &fd); TEST_TRUE (fcntl (fd, F_GETFD) & FD_CLOEXEC); TEST_TRUE (dbus_connection_get_object_path_data (conn, DBUS_PATH_UPSTART, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART); TEST_EQ_P (object->data, NULL); TEST_TRUE (dbus_connection_get_object_path_data (conn, DBUS_PATH_UPSTART "/jobs/foo", (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART "/jobs/foo"); TEST_EQ_P (object->data, class1); TEST_TRUE (dbus_connection_get_object_path_data (conn, DBUS_PATH_UPSTART "/jobs/bar", (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART "/jobs/bar"); TEST_EQ_P (object->data, class2); TEST_TRUE (dbus_connection_get_object_path_data (conn, DBUS_PATH_UPSTART "/jobs/bar/test1", (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART "/jobs/bar/test1"); TEST_EQ_P (object->data, job1); TEST_TRUE (dbus_connection_get_object_path_data (conn, DBUS_PATH_UPSTART "/jobs/bar/test2", (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART "/jobs/bar/test2"); TEST_EQ_P (object->data, job2); kill (pid, SIGTERM); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); dbus_connection_close (conn); dbus_connection_unref (conn); nih_free (entry); nih_free (class1); nih_free (class2); control_server_close (); dbus_shutdown (); } void test_server_close (void) { /* Check that control_server_close sets control_server back to * NULL, as well as disconnected and unreferencing the server. */ TEST_FUNCTION ("control_server_close"); control_init (); control_server_address = "unix:abstract=/com/ubuntu/upstart/test"; assert0 (control_server_open ()); assert (control_server != NULL); control_server_close (); TEST_EQ_P (control_server, NULL); dbus_shutdown (); } static int drop_connection = FALSE; static int refuse_registration = FALSE; static DBusConnection *server_conn = NULL; static int my_connect_handler (DBusServer *server, DBusConnection *conn) { DBusMessage *message, *reply; char *id = ":1"; dbus_uint32_t request; assert (server_conn == NULL); dbus_connection_ref (conn); /* Expect Hello from the client, return a fake unique name */ TEST_DBUS_MESSAGE (conn, message); assert (dbus_message_is_method_call (message, DBUS_INTERFACE_DBUS, "Hello")); reply = dbus_message_new_method_return (message); assert (reply != NULL); dbus_message_append_args (reply, DBUS_TYPE_STRING, &id, DBUS_TYPE_INVALID); assert (dbus_connection_send (conn, reply, NULL)); dbus_connection_flush (conn); dbus_message_unref (reply); dbus_message_unref (message); if (drop_connection) { dbus_connection_unref (conn); return FALSE; } request = (refuse_registration ? DBUS_REQUEST_NAME_REPLY_EXISTS : DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); /* Expect RequestName from the client, return a fake unique name */ TEST_DBUS_MESSAGE (conn, message); assert (dbus_message_is_method_call (message, DBUS_INTERFACE_DBUS, "RequestName")); reply = dbus_message_new_method_return (message); assert (reply != NULL); dbus_message_append_args (reply, DBUS_TYPE_UINT32, &request, DBUS_TYPE_INVALID); assert (dbus_connection_send (conn, reply, NULL)); dbus_connection_flush (conn); dbus_message_unref (reply); dbus_message_unref (message); server_conn = conn; dbus_connection_unref (conn); return TRUE; } void test_bus_open (void) { FILE *output; JobClass *class1, *class2; Job *job1, *job2; NihError *err; NihListEntry *entry; NihDBusObject *object; pid_t pid; int ret, wait_fd, fd, status; TEST_FUNCTION ("control_bus_open"); program_name = "test"; control_init (); output = tmpfile (); err = 0; /* Check that control_bus_open() opens a connection to the system bus, * we test this by faking the registration part of the system bus and * making sure everything works. The control_bus global should be * set to non-NULL and also stored in the connections list. */ TEST_FEATURE ("with system bus"); drop_connection = FALSE; refuse_registration = FALSE; server_conn = NULL; TEST_CHILD_WAIT (pid, wait_fd) { DBusServer *server; nih_signal_set_handler (SIGTERM, nih_signal_handler); assert (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); server = nih_dbus_server ("unix:abstract=/com/ubuntu/upstart/test", my_connect_handler, NULL); TEST_CHILD_RELEASE (wait_fd); nih_main_loop (); assert (server_conn != NULL); dbus_connection_close (server_conn); dbus_connection_unref (server_conn); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); exit (0); } setenv ("DBUS_SYSTEM_BUS_ADDRESS", "unix:abstract=/com/ubuntu/upstart/test", TRUE); ret = control_bus_open (); TEST_EQ (ret, 0); TEST_NE_P (control_bus, NULL); TEST_LIST_NOT_EMPTY (control_conns); entry = (NihListEntry *)control_conns->next; TEST_ALLOC_SIZE (entry, sizeof (NihListEntry)); TEST_EQ_P (entry->data, control_bus); dbus_connection_get_unix_fd (control_bus, &fd); TEST_TRUE (fcntl (fd, F_GETFD) & FD_CLOEXEC); TEST_TRUE (dbus_connection_get_object_path_data (control_bus, DBUS_PATH_UPSTART, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART); TEST_EQ_P (object->data, NULL); kill (pid, SIGTERM); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_DIVERT_STDERR (output) { control_bus_close (); } rewind (output); dbus_shutdown (); unsetenv ("DBUS_SYSTEM_BUS_ADDRESS"); /* Check that existing jobs and instances are registered on the * new bus connection. This inherently checks that this does not * cause signals to be emitted because our fake server expects the * first message to be a request name method. */ TEST_FEATURE ("with existing jobs"); drop_connection = FALSE; refuse_registration = FALSE; server_conn = NULL; class1 = job_class_new (NULL, "foo", NULL); nih_hash_add (job_classes, &class1->entry); class2 = job_class_new (NULL, "bar", NULL); job1 = job_new (class2, "test1"); job2 = job_new (class2, "test2"); nih_hash_add (job_classes, &class2->entry); TEST_CHILD_WAIT (pid, wait_fd) { DBusServer *server; nih_signal_set_handler (SIGTERM, nih_signal_handler); assert (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); server = nih_dbus_server ("unix:abstract=/com/ubuntu/upstart/test", my_connect_handler, NULL); TEST_CHILD_RELEASE (wait_fd); nih_main_loop (); assert (server_conn != NULL); dbus_connection_close (server_conn); dbus_connection_unref (server_conn); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); exit (0); } setenv ("DBUS_SYSTEM_BUS_ADDRESS", "unix:abstract=/com/ubuntu/upstart/test", TRUE); ret = control_bus_open (); TEST_EQ (ret, 0); TEST_NE_P (control_bus, NULL); TEST_LIST_NOT_EMPTY (control_conns); entry = (NihListEntry *)control_conns->next; TEST_ALLOC_SIZE (entry, sizeof (NihListEntry)); TEST_EQ_P (entry->data, control_bus); TEST_TRUE (dbus_connection_get_object_path_data (control_bus, DBUS_PATH_UPSTART, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART); TEST_EQ_P (object->data, NULL); TEST_TRUE (dbus_connection_get_object_path_data (control_bus, DBUS_PATH_UPSTART "/jobs/foo", (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART "/jobs/foo"); TEST_EQ_P (object->data, class1); TEST_TRUE (dbus_connection_get_object_path_data (control_bus, DBUS_PATH_UPSTART "/jobs/bar", (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART "/jobs/bar"); TEST_EQ_P (object->data, class2); TEST_TRUE (dbus_connection_get_object_path_data (control_bus, DBUS_PATH_UPSTART "/jobs/bar/test1", (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART "/jobs/bar/test1"); TEST_EQ_P (object->data, job1); TEST_TRUE (dbus_connection_get_object_path_data (control_bus, DBUS_PATH_UPSTART "/jobs/bar/test2", (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, DBUS_PATH_UPSTART "/jobs/bar/test2"); TEST_EQ_P (object->data, job2); kill (pid, SIGTERM); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); TEST_DIVERT_STDERR (output) { control_bus_close (); } rewind (output); dbus_shutdown (); unsetenv ("DBUS_SYSTEM_BUS_ADDRESS"); nih_free (class1); nih_free (class2); /* Check that if the system bus drops the connection during * registration, control_bus_open returns an error. */ TEST_FEATURE ("with disconnect during registration"); drop_connection = TRUE; refuse_registration = FALSE; server_conn = NULL; TEST_CHILD_WAIT (pid, wait_fd) { DBusServer *server; nih_signal_set_handler (SIGTERM, nih_signal_handler); assert (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); server = nih_dbus_server ("unix:abstract=/com/ubuntu/upstart/test", my_connect_handler, NULL); TEST_CHILD_RELEASE (wait_fd); nih_main_loop (); assert (server_conn == NULL); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); exit (0); } setenv ("DBUS_SYSTEM_BUS_ADDRESS", "unix:abstract=/com/ubuntu/upstart/test", TRUE); ret = control_bus_open (); TEST_LT (ret, 0); TEST_EQ_P (control_bus, NULL); TEST_LIST_EMPTY (control_conns); err = nih_error_get (); TEST_EQ (err->number, NIH_DBUS_ERROR); /* Under valgrind we seem to get NoReply instead */ if (strcmp (((NihDBusError *)err)->name, DBUS_ERROR_NO_REPLY)) { TEST_EQ_STR (((NihDBusError *)err)->name, DBUS_ERROR_DISCONNECTED); } nih_free (err); kill (pid, SIGTERM); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); dbus_shutdown (); unsetenv ("DBUS_SYSTEM_BUS_ADDRESS"); /* Check that if the system bus says our name is already taken, * control_bus_open returns an error. */ TEST_FEATURE ("with our name already taken"); drop_connection = FALSE; refuse_registration = TRUE; server_conn = NULL; TEST_CHILD_WAIT (pid, wait_fd) { DBusServer *server; nih_signal_set_handler (SIGTERM, nih_signal_handler); assert (nih_signal_add_handler (NULL, SIGTERM, nih_main_term_signal, NULL)); server = nih_dbus_server ("unix:abstract=/com/ubuntu/upstart/test", my_connect_handler, NULL); TEST_CHILD_RELEASE (wait_fd); nih_main_loop (); assert (server_conn != NULL); dbus_connection_close (server_conn); dbus_connection_unref (server_conn); dbus_server_disconnect (server); dbus_server_unref (server); dbus_shutdown (); exit (0); } setenv ("DBUS_SYSTEM_BUS_ADDRESS", "unix:abstract=/com/ubuntu/upstart/test", TRUE); ret = control_bus_open (); TEST_LT (ret, 0); TEST_EQ_P (control_bus, NULL); TEST_LIST_EMPTY (control_conns); err = nih_error_get (); TEST_EQ (err->number, CONTROL_NAME_TAKEN); nih_free (err); kill (pid, SIGTERM); waitpid (pid, &status, 0); TEST_TRUE (WIFEXITED (status)); TEST_EQ (WEXITSTATUS (status), 0); dbus_shutdown (); unsetenv ("DBUS_SYSTEM_BUS_ADDRESS"); /* Check that if the system bus is not listening, control_bus_open * returns NULL and a D-Bus error code. */ TEST_FEATURE ("with no system bus"); setenv ("DBUS_SYSTEM_BUS_ADDRESS", "unix:abstract=/com/ubuntu/upstart/test", TRUE); ret = control_bus_open (); TEST_LT (ret, 0); TEST_EQ_P (control_bus, NULL); TEST_LIST_EMPTY (control_conns); err = nih_error_get (); TEST_EQ (err->number, NIH_DBUS_ERROR); TEST_EQ_STR (((NihDBusError *)err)->name, DBUS_ERROR_NO_SERVER); nih_free (err); dbus_shutdown (); unsetenv ("DBUS_SYSTEM_BUS_ADDRESS"); } void test_bus_close (void) { FILE *output; NihListEntry *entry; pid_t dbus_pid; /* Check that control_bus_close sets control_bus back to NULL * and is removed from the list of active connections. */ TEST_FUNCTION ("control_bus_close"); control_init (); output = tmpfile (); TEST_DBUS (dbus_pid); assert (NIH_LIST_EMPTY (control_conns)); assert0 (control_bus_open ()); assert (control_bus != NULL); assert (! NIH_LIST_EMPTY (control_conns)); entry = (NihListEntry *)control_conns->next; TEST_FREE_TAG (entry); TEST_DIVERT_STDERR (output) { control_bus_close (); } rewind (output); TEST_EQ_P (control_bus, NULL); TEST_FREE (entry); TEST_LIST_EMPTY (control_conns); TEST_FILE_EQ (output, "test: Disconnected from D-Bus system bus\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); fclose (output); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_disconnected (void) { FILE *output; NihListEntry *entry; pid_t dbus_pid; /* Check that if the bus connection is disconnected, control_bus is * set back to NULL automatically. */ TEST_FUNCTION ("control_disconnected"); program_name = "test"; output = tmpfile (); control_init (); drop_connection = FALSE; refuse_registration = FALSE; server_conn = NULL; assert (NIH_LIST_EMPTY (control_conns)); TEST_DBUS (dbus_pid); assert0 (control_bus_open ()); assert (control_bus != NULL); assert (! NIH_LIST_EMPTY (control_conns)); entry = (NihListEntry *)control_conns->next; TEST_FREE_TAG (entry); TEST_DBUS_END (dbus_pid); TEST_DIVERT_STDERR (output) { while (control_bus && dbus_connection_read_write_dispatch (control_bus, -1)) ; } rewind (output); TEST_EQ_P (control_bus, NULL); TEST_FREE (entry); TEST_LIST_EMPTY (control_conns); TEST_FILE_EQ (output, "test: Disconnected from D-Bus system bus\n"); TEST_FILE_END (output); TEST_FILE_RESET (output); fclose (output); dbus_shutdown (); } void test_reload_configuration (void) { FILE *f; ConfSource *source1, *source2, *source3; char dirname[PATH_MAX], filename[PATH_MAX]; NihDBusMessage *message; int ret; /* Check that we can ask the daemon to reload its configuration; * there's no need to simulate this deeply, we just set up a config * and then reload it and see whether it turned up. */ TEST_FUNCTION ("control_reload_configuration"); TEST_FILENAME (dirname); mkdir (dirname, 0755); strcpy (filename, dirname); strcat (filename, "/foo.conf"); source1 = conf_source_new (NULL, filename, CONF_FILE); f = fopen (filename, "w"); fprintf (f, "#empty\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/bar"); mkdir (filename, 0755); source2 = conf_source_new (NULL, filename, CONF_JOB_DIR); strcpy (filename, dirname); strcat (filename, "/bar/bar.conf"); f = fopen (filename, "w"); fprintf (f, "script\n"); fprintf (f, " echo\n"); fprintf (f, "end script\n"); fclose (f); strcpy (filename, dirname); strcat (filename, "/baz"); /* XXX: note that this will generate an error message when this * test runs since "/baz" does not exist as a directory. */ source3 = conf_source_new (NULL, filename, CONF_DIR); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; ret = control_reload_configuration (NULL, message); TEST_EQ (ret, 0); nih_free (message); TEST_HASH_NOT_EMPTY (source1->files); TEST_HASH_NOT_EMPTY (source2->files); TEST_HASH_EMPTY (source3->files); nih_free (source1); nih_free (source2); nih_free (source3); strcpy (filename, dirname); strcat (filename, "/foo.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/bar/bar.conf"); unlink (filename); strcpy (filename, dirname); strcat (filename, "/bar"); rmdir (filename); rmdir (dirname); } void test_get_job_by_name (void) { NihDBusMessage *message = NULL; JobClass *class; char *path; NihError *error; NihDBusError *dbus_error; int ret; TEST_FUNCTION ("control_get_job_by_name"); nih_error_init (); job_class_init (); class = job_class_new (NULL, "test", NULL); nih_hash_add (job_classes, &class->entry); /* Check that when given a known job name, the path to that job * is returned as a duplicate child of the message structure. */ TEST_FEATURE ("with known job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = control_get_job_by_name (NULL, message, "test", &path); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (path, message); TEST_EQ_STR (path, class->path); nih_free (message); } /* Check that when given an unknown job name, an unknown job * D-Bus error is raised and an error returned. */ TEST_FEATURE ("with unknown job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = control_get_job_by_name (NULL, message, "foo", &path); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.UnknownJob"); nih_free (error); nih_free (message); } /* Check that when given an illegal job name, an invalid args * D-Bus error is raised and an error returned. */ TEST_FEATURE ("with illegal job name"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = control_get_job_by_name (NULL, message, "", &path); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_ERROR_INVALID_ARGS); nih_free (error); nih_free (message); } nih_free (class); } void test_get_all_jobs (void) { NihDBusMessage *message = NULL; JobClass *class1, *class2, *class3; NihError *error; char **paths; int ret; TEST_FUNCTION ("control_get_all_jobs"); nih_error_init (); job_class_init (); /* Check that paths for each of the registered jobs are returned * in an array allocated as a child of the message structure. */ TEST_FEATURE ("with registered jobs"); class1 = job_class_new (NULL, "frodo", NULL); nih_hash_add (job_classes, &class1->entry); class2 = job_class_new (NULL, "bilbo", NULL); nih_hash_add (job_classes, &class2->entry); class3 = job_class_new (NULL, "sauron", NULL); nih_hash_add (job_classes, &class3->entry); TEST_ALLOC_FAIL { int found1 = FALSE, found2 = FALSE, found3 = FALSE, i; TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = control_get_all_jobs (NULL, message, &paths); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (paths, message); TEST_ALLOC_SIZE (paths, sizeof (char *) * 4); TEST_EQ_P (paths[3], NULL); for (i = 0; i < 3; i++) { TEST_ALLOC_PARENT (paths[i], paths); if (! strcmp (paths[i], class1->path)) found1 = TRUE; if (! strcmp (paths[i], class2->path)) found2 = TRUE; if (! strcmp (paths[i], class3->path)) found3 = TRUE; } TEST_TRUE (found1); TEST_TRUE (found2); TEST_TRUE (found3); nih_free (message); } nih_free (class3); nih_free (class2); nih_free (class1); /* Check that when no jobs are registered, an empty array is * returned instead of an error. */ TEST_FEATURE ("with no registered jobs"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = control_get_all_jobs (NULL, message, &paths); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (paths, message); TEST_ALLOC_SIZE (paths, sizeof (char *) * 1); TEST_EQ_P (paths[0], NULL); nih_free (message); } } void test_emit_event (void) { DBusConnection *conn, *client_conn; pid_t dbus_pid; DBusMessage *method, *reply; NihDBusMessage *message = NULL; dbus_uint32_t serial; char **env; int ret; Event *event; Blocked * blocked; NihError *error; NihDBusError *dbus_error; TEST_FUNCTION ("control_emit_event"); nih_error_init (); nih_main_loop_init (); event_init (); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); /* Check that we can emit an event with an empty environment list * which will be added to the event queue while the message is * blocked. When the event is finished, the reply will be sent * and the message structure freed. */ TEST_FEATURE ("with empty environment list"); TEST_ALLOC_FAIL { method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), DBUS_PATH_UPSTART, DBUS_INTERFACE_UPSTART, "EmitEvent"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); } ret = control_emit_event (NULL, message, "test", env, TRUE); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); dbus_message_unref (method); continue; } TEST_EQ (ret, 0); TEST_LIST_NOT_EMPTY (events); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "test"); TEST_EQ_P (event->env[0], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_EMIT_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_discard (message); TEST_NOT_FREE (message); event_poll (); TEST_LIST_EMPTY (events); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); } /* Check that if we supply an environment list, it's placed straight * into the event. */ TEST_FEATURE ("with environment list"); TEST_ALLOC_FAIL { method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), DBUS_PATH_UPSTART, DBUS_INTERFACE_UPSTART, "EmitEvent"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO=BAR")); assert (nih_str_array_add (&env, message, NULL, "BAR=BAZ")); } ret = control_emit_event (NULL, message, "test", env, TRUE); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); dbus_message_unref (method); continue; } TEST_EQ (ret, 0); TEST_LIST_NOT_EMPTY (events); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "test"); TEST_EQ_STR (event->env[0], "FOO=BAR"); TEST_EQ_STR (event->env[1], "BAR=BAZ"); TEST_EQ_P (event->env[2], NULL); TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)event->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, event); TEST_EQ (blocked->type, BLOCKED_EMIT_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_discard (message); TEST_NOT_FREE (message); event_poll (); TEST_LIST_EMPTY (events); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); } /* Check that we can emit an event without waiting for it to * finish, we should get the reply straight away. */ TEST_FEATURE ("with no wait"); TEST_ALLOC_FAIL { method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), DBUS_PATH_UPSTART, DBUS_INTERFACE_UPSTART, "EmitEvent"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); } ret = control_emit_event (NULL, message, "test", env, FALSE); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); dbus_message_unref (method); continue; } TEST_EQ (ret, 0); TEST_LIST_NOT_EMPTY (events); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "test"); TEST_EQ_P (event->env[0], NULL); TEST_LIST_EMPTY (&event->blocking); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); event_poll (); TEST_LIST_EMPTY (events); } /* Check that if the event is marked as failed, an ordinary reply * is not sent when its finished, but an error instead. */ TEST_FEATURE ("with failed event"); method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), DBUS_PATH_UPSTART, DBUS_INTERFACE_UPSTART, "EmitEvent"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (NULL); ret = control_emit_event (NULL, message, "test", env, TRUE); nih_discard (env); TEST_EQ (ret, 0); TEST_LIST_NOT_EMPTY (events); event = (Event *)events->next; TEST_ALLOC_SIZE (event, sizeof (Event)); TEST_EQ_STR (event->name, "test"); TEST_EQ_P (event->env[0], NULL); nih_discard (message); TEST_NOT_FREE (message); event->failed = TRUE; event_poll (); TEST_LIST_EMPTY (events); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_TRUE (dbus_message_is_error (reply, DBUS_INTERFACE_UPSTART ".Error.EventFailed")); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); /* Check that if the event name is empty, an error is returned * immediately. */ TEST_FEATURE ("with empty name"); method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), DBUS_PATH_UPSTART, DBUS_INTERFACE_UPSTART, "EmitEvent"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; env = nih_str_array_new (message); ret = control_emit_event (NULL, message, "", env, TRUE); TEST_LT (ret, 0); dbus_error = (NihDBusError *)nih_error_get (); TEST_ALLOC_SIZE (dbus_error, sizeof (NihDBusError)); TEST_EQ (dbus_error->number, NIH_DBUS_ERROR); TEST_EQ_STR (dbus_error->name, DBUS_ERROR_INVALID_ARGS); nih_free (dbus_error); nih_free (message); dbus_message_unref (method); /* Check that if an entry in the environment list is missing an * equals, an error is returned immediately. */ TEST_FEATURE ("with missing equals in environment list"); method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), DBUS_PATH_UPSTART, DBUS_INTERFACE_UPSTART, "EmitEvent"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO_BAR")); ret = control_emit_event (NULL, message, "test", env, TRUE); TEST_LT (ret, 0); dbus_error = (NihDBusError *)nih_error_get (); TEST_ALLOC_SIZE (dbus_error, sizeof (NihDBusError)); TEST_EQ (dbus_error->number, NIH_DBUS_ERROR); TEST_EQ_STR (dbus_error->name, DBUS_ERROR_INVALID_ARGS); nih_free (dbus_error); nih_free (message); dbus_message_unref (method); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_get_version (void) { NihDBusMessage *message = NULL; char *version; NihError *error; int ret; /* Check that the function returns the package string as a newly * allocated child of the message structure. */ TEST_FUNCTION ("control_get_version"); nih_error_init (); job_class_init (); package_string = "init (upstart 1.0)"; TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = control_get_version (NULL, message, &version); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (version, message); TEST_EQ_STR (version, package_string); nih_free (message); } } void test_get_log_priority (void) { NihDBusMessage *message = NULL; char *priority; NihError *error; int ret; TEST_FUNCTION ("control_get_log_priority"); nih_error_init (); job_class_init (); /* Check that the function returns the correct string for the * NIH_LOG_FATAL priority as an allocated child of the message * structure. */ TEST_FEATURE ("with fatal"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_FATAL; ret = control_get_log_priority (NULL, message, &priority); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (priority, message); TEST_EQ_STR (priority, "fatal"); nih_free (message); } /* Check that the function returns the correct string for the * NIH_LOG_ERROR priority as an allocated child of the message * structure. */ TEST_FEATURE ("with error"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_ERROR; ret = control_get_log_priority (NULL, message, &priority); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (priority, message); TEST_EQ_STR (priority, "error"); nih_free (message); } /* Check that the function returns the correct string for the * NIH_LOG_WARN priority as an allocated child of the message * structure. */ TEST_FEATURE ("with warn"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_WARN; ret = control_get_log_priority (NULL, message, &priority); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (priority, message); TEST_EQ_STR (priority, "warn"); nih_free (message); } /* Check that the function returns the correct string for the * NIH_LOG_MESSAGE priority as an allocated child of the message * structure. */ TEST_FEATURE ("with message"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_MESSAGE; ret = control_get_log_priority (NULL, message, &priority); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (priority, message); TEST_EQ_STR (priority, "message"); nih_free (message); } /* Check that the function returns the correct string for the * NIH_LOG_INFO priority as an allocated child of the message * structure. */ TEST_FEATURE ("with info"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_INFO; ret = control_get_log_priority (NULL, message, &priority); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (priority, message); TEST_EQ_STR (priority, "info"); nih_free (message); } /* Check that the function returns the correct string for the * NIH_LOG_DEBUG priority as an allocated child of the message * structure. */ TEST_FEATURE ("with debug"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_DEBUG; ret = control_get_log_priority (NULL, message, &priority); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (priority, message); TEST_EQ_STR (priority, "debug"); nih_free (message); } nih_log_priority = NIH_LOG_UNKNOWN; } void test_set_log_priority (void) { NihDBusMessage *message = NULL; NihError *error; NihDBusError *dbus_err; int ret; TEST_FUNCTION ("control_set_log_priority"); nih_error_init (); job_class_init (); /* Check that the function sets the log priority to NIH_LOG_FATAL * when given the correct string. */ TEST_FEATURE ("with fatal"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_UNKNOWN; ret = control_set_log_priority (NULL, message, "fatal"); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_EQ (nih_log_priority, NIH_LOG_FATAL); nih_free (message); } /* Check that the function sets the log priority to NIH_LOG_ERROR * when given the correct string. */ TEST_FEATURE ("with error"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_UNKNOWN; ret = control_set_log_priority (NULL, message, "error"); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_EQ (nih_log_priority, NIH_LOG_ERROR); nih_free (message); } /* Check that the function sets the log priority to NIH_LOG_WARN * when given the correct string. */ TEST_FEATURE ("with warn"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_UNKNOWN; ret = control_set_log_priority (NULL, message, "warn"); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_EQ (nih_log_priority, NIH_LOG_WARN); nih_free (message); } /* Check that the function sets the log priority to NIH_LOG_MESSAGE * when given the correct string. */ TEST_FEATURE ("with message"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_UNKNOWN; ret = control_set_log_priority (NULL, message, "message"); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_EQ (nih_log_priority, NIH_LOG_MESSAGE); nih_free (message); } /* Check that the function sets the log priority to NIH_LOG_INFO * when given the correct string. */ TEST_FEATURE ("with info"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_UNKNOWN; ret = control_set_log_priority (NULL, message, "info"); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_EQ (nih_log_priority, NIH_LOG_INFO); nih_free (message); } /* Check that the function sets the log priority to NIH_LOG_DEBUG * when given the correct string. */ TEST_FEATURE ("with debug"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_UNKNOWN; ret = control_set_log_priority (NULL, message, "debug"); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_EQ (nih_log_priority, NIH_LOG_DEBUG); nih_free (message); } /* Check that the function returns an invalid arguments error when * given an unrecognised string. */ TEST_FEATURE ("with unknown string"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } nih_log_priority = NIH_LOG_MESSAGE; ret = control_set_log_priority (NULL, message, "wibble"); TEST_LT (ret, 0); error = nih_error_get (); if (test_alloc_failed && (error->number == ENOMEM)) { nih_free (error); nih_free (message); continue; } TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_err = (NihDBusError *)error; TEST_EQ_STR (dbus_err->name, DBUS_ERROR_INVALID_ARGS); nih_free (dbus_err); TEST_EQ (nih_log_priority, NIH_LOG_MESSAGE); nih_free (message); } nih_log_priority = NIH_LOG_UNKNOWN; } void test_list_env (void) { NihDBusMessage *message = NULL; int ret; nih_local char **env = NULL; nih_local char **job_details = NULL; nih_local char **job_details2 = NULL; JobClass *class; Job *job; NihError *error; TEST_FUNCTION ("control_list_env"); nih_error_init (); job_class_init (); job_class_environment_init (); no_inherit_env = TRUE; message = nih_new (NULL, NihDBusMessage); TEST_NE_P (message, NULL); message->connection = NULL; message->message = NULL; job_details = nih_str_array_new (NULL); nih_assert (job_details); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); nih_hash_add (job_classes, &class->entry); assert0 (job_class_environment_set ("hello=world", TRUE)); /************************************************************/ TEST_FEATURE ("with empty array"); ret = control_list_env (NULL, message, job_details, &env); TEST_EQ (ret, 0); /* Default variables that Upstart adds */ TEST_STR_MATCH (env[0], "PATH=*"); TEST_STR_MATCH (env[1], "TERM=*"); TEST_EQ_STR (env[2], "hello=world"); TEST_EQ_P (env[3], NULL); /************************************************************/ TEST_FEATURE ("with empty job class name"); job_details2 = nih_str_array_copy (NULL, NULL, job_details); TEST_NE_P (job_details2, NULL); nih_assert (nih_str_array_add (&job_details2, NULL, NULL, "")); ret = control_list_env (NULL, message, job_details2, &env); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with missing instance name"); /* add name */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "foo")); ret = control_list_env (NULL, message, job_details, &env); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ /* We can't wrap this in a TEST_ALLOC_FAIL() block since the * nih_dbus_*() calls such as nih_dbus_error_raise_printf() use * NIH_MUST() which defeats the fail macro */ TEST_FEATURE ("with correct job details"); /* add instance */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "")); ret = control_list_env (NULL, message, job_details, &env); TEST_EQ (ret, 0); nih_free (message); } void test_get_env (void) { NihDBusMessage *message = NULL; int ret; char *value = NULL; nih_local char **job_details = NULL; nih_local char **job_details2 = NULL; JobClass *class; Job *job; NihError *error; TEST_FUNCTION ("control_get_env"); nih_error_init (); job_class_init (); job_class_environment_init (); no_inherit_env = TRUE; message = nih_new (NULL, NihDBusMessage); TEST_NE_P (message, NULL); message->connection = NULL; message->message = NULL; job_details = nih_str_array_new (NULL); nih_assert (job_details); job_details2 = nih_str_array_copy (NULL, NULL, job_details); TEST_NE_P (job_details2, NULL); nih_assert (nih_str_array_add (&job_details2, NULL, NULL, "")); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); nih_hash_add (job_classes, &class->entry); assert0 (job_class_environment_set ("hello=world", TRUE)); /************************************************************/ TEST_FEATURE ("with NULL variable name"); ret = control_get_env (NULL, message, job_details2, NULL, &value); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with empty variable name"); ret = control_get_env (NULL, message, job_details2, "", &value); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with empty job class name"); ret = control_get_env (NULL, message, job_details2, "hello", &value); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with missing instance name"); /* add name */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "foo")); ret = control_get_env (NULL, message, job_details, "hello", &value); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with correct job details"); /* add instance */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "")); ret = control_get_env (NULL, message, job_details, "hello", &value); TEST_EQ (ret, 0); TEST_EQ_STR (value, "world"); /************************************************************/ /* tidy up */ nih_free (value); nih_free (message); } void test_set_env (void) { NihDBusMessage *message = NULL; int ret; nih_local char **job_details = NULL; nih_local char **job_details2 = NULL; JobClass *class; Job *job; NihError *error; TEST_FUNCTION ("control_set_env"); nih_error_init (); job_class_init (); job_class_environment_init (); no_inherit_env = TRUE; message = nih_new (NULL, NihDBusMessage); TEST_NE_P (message, NULL); message->connection = NULL; message->message = NULL; job_details = nih_str_array_new (NULL); nih_assert (job_details); job_details2 = nih_str_array_copy (NULL, NULL, job_details); TEST_NE_P (job_details2, NULL); nih_assert (nih_str_array_add (&job_details2, NULL, NULL, "")); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); nih_hash_add (job_classes, &class->entry); /************************************************************/ TEST_FEATURE ("with NULL variable name"); ret = control_set_env (NULL, message, job_details2, NULL, TRUE); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with empty variable name"); ret = control_set_env (NULL, message, job_details2, "", TRUE); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with empty job class name"); ret = control_set_env (NULL, message, job_details2, "hello=world", TRUE); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with missing instance name"); /* add name */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "foo")); ret = control_set_env (NULL, message, job_details, "hello=world", TRUE); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with correct job details"); /* add instance */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "")); ret = control_set_env (NULL, message, job_details, "hello=world", TRUE); TEST_EQ (ret, 0); /************************************************************/ /* tidy up */ nih_free (message); } void test_unset_env (void) { NihDBusMessage *message = NULL; int ret; nih_local char **job_details = NULL; nih_local char **job_details2 = NULL; JobClass *class; Job *job; NihError *error; TEST_FUNCTION ("control_unset_env"); nih_error_init (); job_class_init (); job_class_environment_init (); no_inherit_env = TRUE; message = nih_new (NULL, NihDBusMessage); TEST_NE_P (message, NULL); message->connection = NULL; message->message = NULL; job_details = nih_str_array_new (NULL); nih_assert (job_details); job_details2 = nih_str_array_copy (NULL, NULL, job_details); TEST_NE_P (job_details2, NULL); nih_assert (nih_str_array_add (&job_details2, NULL, NULL, "")); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); nih_hash_add (job_classes, &class->entry); assert0 (job_class_environment_set ("hello=world", TRUE)); /************************************************************/ TEST_FEATURE ("with NULL variable name"); ret = control_unset_env (NULL, message, job_details2, NULL); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with empty variable name"); ret = control_unset_env (NULL, message, job_details2, ""); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with empty job class name"); ret = control_unset_env (NULL, message, job_details2, "hello"); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with missing instance name"); /* add name */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "foo")); ret = control_unset_env (NULL, message, job_details, "hello"); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with correct job details"); /* add instance */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "")); ret = control_unset_env (NULL, message, job_details, "hello"); TEST_EQ (ret, 0); /************************************************************/ /* tidy up */ nih_free (message); } void test_reset_env (void) { NihDBusMessage *message = NULL; int ret; nih_local char **job_details = NULL; nih_local char **job_details2 = NULL; JobClass *class; Job *job; NihError *error; TEST_FUNCTION ("control_reset_env"); nih_error_init (); job_class_init (); job_class_environment_init (); no_inherit_env = TRUE; message = nih_new (NULL, NihDBusMessage); TEST_NE_P (message, NULL); message->connection = NULL; message->message = NULL; job_details = nih_str_array_new (NULL); nih_assert (job_details); class = job_class_new (NULL, "foo", NULL); TEST_NE_P (class, NULL); job = job_new (class, ""); TEST_NE_P (job, NULL); nih_hash_add (job_classes, &class->entry); /************************************************************/ TEST_FEATURE ("with empty job class name"); job_details2 = nih_str_array_copy (NULL, NULL, job_details); TEST_NE_P (job_details2, NULL); nih_assert (nih_str_array_add (&job_details2, NULL, NULL, "")); ret = control_reset_env (NULL, message, job_details2); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with missing instance name"); /* add name */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "foo")); ret = control_reset_env (NULL, message, job_details); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); nih_free (error); /************************************************************/ TEST_FEATURE ("with correct job details"); /* add instance */ nih_assert (nih_str_array_add (&job_details, NULL, NULL, "")); ret = control_reset_env (NULL, message, job_details); TEST_EQ (ret, 0); /************************************************************/ /* tidy up */ nih_free (message); } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_server_open (); test_server_connect (); test_server_close (); test_bus_open (); test_bus_close (); test_disconnected (); test_reload_configuration (); test_get_job_by_name (); test_get_all_jobs (); test_emit_event (); test_get_version (); test_get_log_priority (); test_set_log_priority (); test_list_env (); test_get_env (); test_set_env (); test_unset_env (); test_reset_env (); return 0; } upstart-1.13.2/init/tests/test_xdg.c0000664000175000017500000002703112373101356014321 00000000000000/* upstart * * test_xdg.c - test suite for init/xdg.c * * Copyright © 2012 Canonical Ltd. * Author: Dmitrijs Ledkovs * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include "xdg.h" #include "test_util_common.h" void _test_dir_created (char * dirname) { struct stat statbuf; TEST_EQ (lstat (dirname, &statbuf), 0); TEST_TRUE (S_ISDIR (statbuf.st_mode)); /* Check that the created directory has 0700 permissions, as per XDG spec */ TEST_EQ (0700, statbuf.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)); } void test_get_home_subdir (void) { char dirname[PATH_MAX]; char *dir; char * expected=NULL; TEST_FUNCTION ("get_home_subdir"); TEST_FEATURE ("with HOME not set"); TEST_EQ (unsetenv ("HOME"), 0); TEST_ALLOC_FAIL { dir = get_home_subdir ("test", FALSE); TEST_EQ_P (dir, NULL); } TEST_FEATURE ("with HOME set"); TEST_FILENAME (dirname); TEST_EQ (setenv ("HOME", dirname, 1), 0); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { dir = NULL; expected = NIH_MUST (nih_sprintf (NULL, "%s/test", dirname)); } dir = get_home_subdir ("test", FALSE); if (test_alloc_failed) { TEST_EQ_P (dir, NULL); } else { TEST_EQ_STR (dir, expected); nih_free (dir); } if (expected) nih_free (expected); } } void _test_get_home (char * env_var_name, char * dir_name, char * (*function)(void)) { char dirname[PATH_MAX]; char onemore[PATH_MAX]; char * outname; char * expected; TEST_FEATURE ("with HOME set and without environment override"); TEST_FILENAME (dirname); TEST_EQ (setenv ("HOME", dirname, 1), 0); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (unsetenv (env_var_name), 0); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { expected = NIH_MUST (nih_sprintf (NULL, "%s/%s", dirname, dir_name)); } outname = NULL; outname = function (); if (! test_alloc_failed) { TEST_EQ_STR (outname, expected); _test_dir_created (expected); } else { TEST_EQ_P (outname, NULL); } if (outname) nih_free (outname); rmdir (expected); nih_free (expected); } TEST_FEATURE ("with HOME set and with empty environment override"); TEST_EQ (setenv (env_var_name, "", 1), 0); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { expected = NIH_MUST (nih_sprintf (NULL, "%s/%s", dirname, dir_name)); } outname = NULL; outname = function (); if (test_alloc_failed) { TEST_EQ_P (outname, NULL); } else { TEST_EQ_STR (outname, expected); _test_dir_created (expected); } if (outname) nih_free (outname); rmdir (expected); nih_free (expected); } TEST_FEATURE ("with HOME set and with relative environment override"); TEST_EQ (setenv (env_var_name, "../", 1), 0); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { expected = NIH_MUST (nih_sprintf (NULL, "%s/%s", dirname, dir_name)); } outname = NULL; outname = function (); if (test_alloc_failed) { TEST_EQ_P (outname, NULL); } else { TEST_EQ_STR (outname, expected); _test_dir_created (expected); } if (outname) nih_free (outname); rmdir (expected); nih_free (expected); } TEST_FEATURE ("with HOME set and with environment override"); TEST_FILENAME (onemore); expected = NIH_MUST (nih_sprintf (NULL, "%s", onemore)); TEST_EQ (setenv (env_var_name, expected, 1), 0); TEST_ALLOC_FAIL { outname = NULL; outname = function (); if (test_alloc_failed) { TEST_EQ_P (outname, NULL); } else { TEST_EQ_STR (outname, expected); _test_dir_created (expected); } if (outname) nih_free (outname); rmdir (expected); } TEST_EQ (rmdir (dirname), 0); TEST_FEATURE ("without HOME set and with environment override"); TEST_EQ (unsetenv ("HOME"), 0); TEST_ALLOC_FAIL { outname = NULL; outname = function (); if (test_alloc_failed) { TEST_EQ_P (outname, NULL); } else { TEST_EQ_STR (outname, expected); _test_dir_created (expected); } if (outname) nih_free (outname); rmdir (expected); } nih_free(expected); TEST_FEATURE ("without HOME set and with empty environment override"); TEST_EQ (setenv (env_var_name, "", 1), 0); TEST_ALLOC_FAIL { outname = NULL; outname = function (); TEST_EQ_P (outname, NULL); } TEST_FEATURE ("without HOME set and without environment override"); TEST_EQ (unsetenv (env_var_name), 0); TEST_ALLOC_FAIL { outname = NULL; outname = function (); TEST_EQ_P (outname, NULL); } } void test_get_config_home (void) { TEST_FUNCTION ("xdg_get_config_home"); _test_get_home ("XDG_CONFIG_HOME", ".config", &xdg_get_config_home); } void test_get_cache_home (void) { TEST_FUNCTION ("xdg_get_cache_home"); _test_get_home ("XDG_CACHE_HOME", ".cache", &xdg_get_cache_home); } void test_get_config_dirs (void) { char **dirs = NULL; TEST_FUNCTION ("xdg_get_config_dirs"); TEST_FEATURE ("without environment override set"); TEST_EQ (unsetenv ("XDG_CONFIG_DIRS"), 0); TEST_ALLOC_FAIL { dirs = NULL; dirs = xdg_get_config_dirs(); if (test_alloc_failed) { TEST_EQ_P (dirs, NULL); } else { TEST_EQ_STR (dirs[0], "/etc/xdg"); TEST_EQ (dirs[1], NULL); nih_free (dirs); } } TEST_FEATURE ("with empty environment override"); TEST_EQ (setenv ("XDG_CONFIG_DIRS", "", 1), 0); TEST_ALLOC_FAIL { dirs = NULL; dirs = xdg_get_config_dirs(); if (test_alloc_failed) { TEST_EQ_P (dirs, NULL); } else { TEST_EQ_STR (dirs[0], "/etc/xdg"); TEST_EQ (dirs[1], NULL); nih_free (dirs); } } TEST_FEATURE ("with environment override set to single path"); TEST_EQ (setenv ("XDG_CONFIG_DIRS", "/etc/xdg/xdg-test", 1), 0); TEST_ALLOC_FAIL { dirs = NULL; dirs = xdg_get_config_dirs(); if (test_alloc_failed) { TEST_EQ_P (dirs, NULL); } else { TEST_EQ_STR (dirs[0], "/etc/xdg/xdg-test"); TEST_EQ (dirs[1], NULL); nih_free (dirs); } } TEST_FEATURE ("with environment override set to multiple paths"); TEST_FEATURE ("with environment override set to single path"); TEST_EQ (setenv ("XDG_CONFIG_DIRS", "/etc/xdg/xdg-test:/etc/xdg/xdg-other", 1), 0); TEST_ALLOC_FAIL { dirs = NULL; dirs = xdg_get_config_dirs(); if (test_alloc_failed) { TEST_EQ_P (dirs, NULL); } else { TEST_EQ_STR (dirs[0], "/etc/xdg/xdg-test"); TEST_EQ_STR (dirs[1], "/etc/xdg/xdg-other"); TEST_EQ (dirs[2], NULL); nih_free (dirs); } } } void test_get_user_upstart_dirs (void) { char dirname[PATH_MAX]; char ** dirs = NULL; char * path = NULL; char ** expected = NULL; /* Currently only one test for "typical" output. * Not sure what else to test here. */ TEST_FUNCTION ("get_user_upstart_dirs"); TEST_FEATURE ("with HOME set"); TEST_FILENAME (dirname); TEST_EQ (setenv ("HOME", dirname, 1), 0); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (unsetenv ("XDG_CONFIG_HOME"), 0); TEST_EQ (unsetenv ("XDG_CONFIG_DIRS"), 0); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { expected = nih_str_array_new (NULL); path = NIH_MUST (nih_sprintf (NULL, "%s/.config/upstart", dirname)); assert (nih_str_array_add (&expected, NULL, NULL, path)); nih_free(path); path = NIH_MUST (nih_sprintf (NULL, "%s/.init", dirname)); assert (nih_str_array_add (&expected, NULL, NULL, path)); nih_free(path); } dirs = NULL; dirs = get_user_upstart_dirs (); if (test_alloc_failed) { TEST_EQ_P (dirs, NULL); } else { TEST_EQ_STR (dirs[0], expected[0]); //_test_dir_created (expected[0]); TEST_EQ_STR (dirs[1], expected[1]); TEST_EQ_STR (dirs[2], "/etc/xdg/upstart"); TEST_EQ_STR (dirs[3], SYSTEM_USERCONFDIR); TEST_EQ (dirs[4], NULL); nih_free (dirs); } TEST_ALLOC_SAFE { rmdir (expected[0]); path = nih_sprintf (NULL, "%s/.config", dirname); rmdir (path); nih_free (path); nih_free (expected); } } TEST_FEATURE ("with some invalid XDG_CONFIG_DIRS"); TEST_EQ (setenv ("XDG_CONFIG_DIRS", "/etc/xdg/xdg-subdir:../haha:/etc/xdg", 1), 0); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { expected = nih_str_array_new (NULL); path = NIH_MUST (nih_sprintf (NULL, "%s/.config/upstart", dirname)); assert (nih_str_array_add (&expected, NULL, NULL, path)); nih_free(path); path = NIH_MUST (nih_sprintf (NULL, "%s/.init", dirname)); assert (nih_str_array_add (&expected, NULL, NULL, path)); nih_free(path); } dirs = NULL; dirs = get_user_upstart_dirs (); if (test_alloc_failed) { TEST_EQ_P (dirs, NULL); } else { TEST_EQ_STR (dirs[0], expected[0]); _test_dir_created (expected[0]); TEST_EQ_STR (dirs[1], expected[1]); TEST_EQ_STR (dirs[2], "/etc/xdg/xdg-subdir/upstart"); TEST_EQ_STR (dirs[3], "/etc/xdg/upstart"); TEST_EQ_STR (dirs[4], SYSTEM_USERCONFDIR); TEST_EQ (dirs[5], NULL); nih_free (dirs); } TEST_ALLOC_SAFE { rmdir (expected[0]); path = nih_sprintf (NULL, "%s/.config", dirname); rmdir (path); nih_free (path); nih_free (expected); } } TEST_EQ (rmdir (dirname), 0); } void test_get_user_log_dir (void) { char dirname[PATH_MAX]; char *expected; char *path; TEST_FUNCTION ("get_user_log_dir"); TEST_FEATURE ("with HOME set"); TEST_FILENAME (dirname); TEST_EQ (setenv ("HOME", dirname, 1), 0); TEST_EQ (mkdir (dirname, 0755), 0); TEST_EQ (unsetenv ("XDG_CACHE_HOME"), 0); expected = nih_sprintf (NULL, "%s/.cache/upstart", dirname); TEST_ALLOC_FAIL { path = get_user_log_dir (); if (test_alloc_failed) { TEST_EQ_P (path, NULL); } else { TEST_EQ_STR (path, expected); _test_dir_created (expected); nih_free (path); } } rmdir (expected); nih_free (expected); path = nih_sprintf (NULL, "%s/.cache", dirname); rmdir (path); nih_free (path); rmdir (dirname); } void test_get_session_dir (void) { char dirname[PATH_MAX]; char *expected; char *path; char *orig_xdg_runtime_dir; orig_xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR"); TEST_FUNCTION ("get_session_dir"); TEST_FEATURE ("with XDG_RUNTIME_DIR set"); TEST_FILENAME (dirname); assert0 (setenv ("XDG_RUNTIME_DIR", dirname, 1)); TEST_EQ (mkdir (dirname, 0755), 0); expected = nih_sprintf (NULL, "%s/upstart/sessions", dirname); TEST_ALLOC_FAIL { path = get_session_dir (); if (test_alloc_failed) { TEST_EQ_P (path, NULL); } else { TEST_EQ_STR (path, expected); _test_dir_created (expected); nih_free (path); } } if (orig_xdg_runtime_dir) setenv ("XDG_RUNTIME_DIR", orig_xdg_runtime_dir, 1); TEST_FEATURE ("with XDG_RUNTIME_DIR unset"); assert0 (unsetenv ("XDG_RUNTIME_DIR")); /* no fallback */ path = get_session_dir (); TEST_EQ_P (path, NULL); rmdir (expected); nih_free (expected); path = nih_sprintf (NULL, "%s/upstart", dirname); rmdir (path); nih_free (path); rmdir (dirname); if (orig_xdg_runtime_dir) setenv ("XDG_RUNTIME_DIR", orig_xdg_runtime_dir, 1); } int main (int argc, char *argv[]) { test_common_setup (); test_get_home_subdir (); test_get_config_home (); test_get_config_dirs (); test_get_user_upstart_dirs (); test_get_cache_home (); test_get_user_log_dir (); test_get_session_dir (); test_common_cleanup (); return 0; } upstart-1.13.2/init/tests/test_job_class.c0000664000175000017500000025770312373101356015511 00000000000000/* upstart * * test_job_class.c - test suite for init/job_class.c * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "blocked.h" #include "event.h" #include "job.h" #include "conf.h" #include "control.h" void test_new (void) { JobClass *class; int i; /* Check that we can create a new JobClass structure; the structure * should be allocated with nih_alloc but not placed in the jobs * hash. */ TEST_FUNCTION ("job_class_new"); job_class_init (); TEST_ALLOC_FAIL { class = job_class_new (NULL, "test", NULL); if (test_alloc_failed) { TEST_EQ_P (class, NULL); continue; } TEST_ALLOC_SIZE (class, sizeof (JobClass)); TEST_LIST_EMPTY (&class->entry); TEST_ALLOC_PARENT (class->name, class); TEST_EQ_STR (class->name, "test"); TEST_ALLOC_PARENT (class->path, class); TEST_EQ_STR (class->path, DBUS_PATH_UPSTART "/jobs/test"); TEST_ALLOC_PARENT (class->instance, class); TEST_EQ_STR (class->instance, ""); TEST_ALLOC_PARENT (class->instances, class); TEST_ALLOC_SIZE (class->instances, sizeof (NihHash)); TEST_HASH_EMPTY (class->instances); TEST_EQ_P (class->description, NULL); TEST_EQ_P (class->author, NULL); TEST_EQ_P (class->version, NULL); TEST_EQ_P (class->env, NULL); TEST_EQ_P (class->export, NULL); TEST_EQ_P (class->start_on, NULL); TEST_EQ_P (class->stop_on, NULL); TEST_EQ_P (class->emits, NULL); TEST_NE_P (class->process, NULL); TEST_ALLOC_PARENT (class->process, class); TEST_ALLOC_SIZE (class->process, sizeof (Process *) * PROCESS_LAST); for (i = 0; i < PROCESS_LAST; i++) TEST_EQ_P (class->process[i], NULL); TEST_EQ (class->expect, EXPECT_NONE); TEST_EQ (class->task, FALSE); TEST_EQ (class->kill_timeout, 5); TEST_EQ (class->kill_signal, SIGTERM); TEST_EQ (class->reload_signal, SIGHUP); TEST_EQ (class->respawn, FALSE); TEST_EQ (class->respawn_limit, 10); TEST_EQ (class->respawn_interval, 5); TEST_EQ_P (class->normalexit, NULL); TEST_EQ (class->normalexit_len, 0); TEST_EQ (class->console, CONSOLE_LOG); TEST_EQ (class->umask, 022); TEST_EQ (class->nice, JOB_NICE_INVALID); TEST_EQ (class->oom_score_adj, 0); for (i = 0; i < RLIMIT_NLIMITS; i++) TEST_EQ_P (class->limits[i], NULL); TEST_EQ_P (class->chroot, NULL); TEST_EQ_P (class->chdir, NULL); TEST_EQ_P (class->setuid, NULL); TEST_EQ_P (class->setgid, NULL); TEST_EQ_P (class->apparmor_switch, NULL); TEST_FALSE (class->deleted); TEST_LIST_EMPTY (&class->cgroups); nih_free (class); } } void test_consider (void) { pid_t dbus_pid; DBusError dbus_error; DBusConnection *conn, *client_conn; DBusMessage *message; NihListEntry *entry; NihDBusObject *object; ConfSource *source1, *source2, *source3; ConfFile *file1, *file2, *file3; JobClass *class1, *class2, *class3, *class4, *ptr; Job *job; char *path; int ret; TEST_FUNCTION ("job_class_consider"); dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); source1 = conf_source_new (NULL, "/tmp/foo", CONF_DIR); source2 = conf_source_new (NULL, "/tmp/bar", CONF_JOB_DIR); file1 = conf_file_new (source2, "/tmp/bar/frodo"); class1 = file1->job = job_class_new (NULL, "frodo", NULL); class1->console = CONSOLE_NONE; file2 = conf_file_new (source2, "/tmp/bar/bilbo"); class2 = file2->job = job_class_new (NULL, "bilbo", NULL); class2->console = CONSOLE_NONE; source3 = conf_source_new (NULL, "/tmp/baz", CONF_JOB_DIR); file3 = conf_file_new (source3, "/tmp/baz/frodo"); class3 = file3->job = job_class_new (NULL, "frodo", NULL); class3->console = CONSOLE_NONE; control_init (); entry = nih_list_entry_new (NULL); entry->data = conn; nih_list_add (control_conns, &entry->entry); /* Check that when there is no registered class and we consider the * best class to use, it becomes the registered class. */ TEST_FEATURE ("with no registered class and best class"); ret = job_class_consider (class1); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_TRUE (ret); TEST_EQ_P (ptr, class1); TEST_TRUE (dbus_connection_get_object_path_data (conn, class1->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class1->path); TEST_EQ_P (object->data, class1); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobAdded")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class1->path); dbus_message_unref (message); nih_list_remove (&class1->entry); dbus_connection_unregister_object_path (conn, class1->path); /* Check that when there is no registered class and we consider a * class that is not the best to use, what should be the best * becomes the registered class. In practice, this eventuality * should obviously never happen. */ TEST_FEATURE ("with no registered class and not best class"); ret = job_class_consider (class3); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_FALSE (ret); TEST_EQ_P (ptr, class1); TEST_TRUE (dbus_connection_get_object_path_data (conn, class1->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class1->path); TEST_EQ_P (object->data, class1); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobAdded")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class1->path); dbus_message_unref (message); nih_list_remove (&class1->entry); dbus_connection_unregister_object_path (conn, class1->path); /* Check that when there is a registered class that cannot be * replaced because it has an active job, it is not replaced, even * if our class is better. */ TEST_FEATURE ("with registered class that cannot be replaced"); nih_list_remove (&entry->entry); job = job_new (class3, ""); job->goal = JOB_START; job->state = JOB_RUNNING; nih_list_add (control_conns, &entry->entry); nih_hash_add (job_classes, &class3->entry); job_class_register (class3, conn, FALSE); ret = job_class_consider (class1); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_FALSE (ret); TEST_EQ_P (ptr, class3); TEST_TRUE (dbus_connection_get_object_path_data (conn, class3->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class3->path); TEST_EQ_P (object->data, class3); message = dbus_message_new_signal ("/", "com.ubuntu.Upstart.Test", "TestPassed"); assert (message != NULL); dbus_connection_send (conn, message, NULL); dbus_message_unref (message); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, "com.ubuntu.Upstart.Test", "TestPassed")); dbus_message_unref (message); nih_free (job); nih_list_remove (&class3->entry); dbus_connection_unregister_object_path (conn, class3->path); /* Check that when there is a registered class that can be * replaced, and our class is the best replacement, our class * becomes the hash table member. */ TEST_FEATURE ("with replacable registered class and best class"); nih_hash_add (job_classes, &class3->entry); job_class_register (class3, conn, FALSE); ret = job_class_consider (class1); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_TRUE (ret); TEST_EQ_P (ptr, class1); TEST_TRUE (dbus_connection_get_object_path_data (conn, class1->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class1->path); TEST_EQ_P (object->data, class1); TEST_LIST_EMPTY (&class3->entry); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobRemoved")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class3->path); dbus_message_unref (message); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobAdded")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class1->path); dbus_message_unref (message); nih_list_remove (&class1->entry); dbus_connection_unregister_object_path (conn, class1->path); /* Check that when there is a registered class that can be * replaced, and our class is not the best replacement, the best * becomes the hash table member. */ TEST_FEATURE ("with replacable registered class and not best class"); class4 = job_class_new (NULL, "frodo", NULL); class4->console = CONSOLE_NONE; nih_hash_add (job_classes, &class4->entry); job_class_register (class4, conn, FALSE); ret = job_class_consider (class3); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_FALSE (ret); TEST_EQ_P (ptr, class1); TEST_TRUE (dbus_connection_get_object_path_data (conn, class1->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class1->path); TEST_EQ_P (object->data, class1); TEST_LIST_EMPTY (&class4->entry); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobRemoved")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class4->path); dbus_message_unref (message); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobAdded")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class1->path); dbus_message_unref (message); nih_list_remove (&class1->entry); dbus_connection_unregister_object_path (conn, class1->path); nih_free (class4); nih_free (source3); nih_free (source2); nih_free (source1); nih_free (entry); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_reconsider (void) { pid_t dbus_pid; DBusError dbus_error; DBusConnection *conn, *client_conn; DBusMessage *message; NihListEntry *entry; NihDBusObject *object; ConfSource *source1, *source2, *source3; ConfFile *file1, *file2, *file3; JobClass *class1, *class2, *class3, *class4, *ptr; Job *job; char *path; int ret; TEST_FUNCTION ("job_class_reconsider"); dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); source1 = conf_source_new (NULL, "/tmp/foo", CONF_DIR); source2 = conf_source_new (NULL, "/tmp/bar", CONF_JOB_DIR); file1 = conf_file_new (source2, "/tmp/bar/frodo"); class1 = file1->job = job_class_new (NULL, "frodo", NULL); class1->console = CONSOLE_NONE; file2 = conf_file_new (source2, "/tmp/bar/bilbo"); class2 = file2->job = job_class_new (NULL, "bilbo", NULL); class2->console = CONSOLE_NONE; source3 = conf_source_new (NULL, "/tmp/baz", CONF_JOB_DIR); file3 = conf_file_new (source3, "/tmp/baz/frodo"); class3 = file3->job = job_class_new (NULL, "frodo", NULL); class3->console = CONSOLE_NONE; control_init (); entry = nih_list_entry_new (NULL); entry->data = conn; nih_list_add (control_conns, &entry->entry); /* Check that when we reconsider the registered class and it is * still the best class, it remains the registered class. */ TEST_FEATURE ("with registered best class"); nih_hash_add (job_classes, &class1->entry); job_class_register (class1, conn, FALSE); ret = job_class_reconsider (class1); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_FALSE (ret); TEST_EQ_P (ptr, class1); TEST_TRUE (dbus_connection_get_object_path_data (conn, class1->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class1->path); TEST_EQ_P (object->data, class1); message = dbus_message_new_signal ("/", "com.ubuntu.Upstart.Test", "TestPassed"); assert (message != NULL); dbus_connection_send (conn, message, NULL); dbus_message_unref (message); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, "com.ubuntu.Upstart.Test", "TestPassed")); dbus_message_unref (message); nih_list_remove (&class1->entry); dbus_connection_unregister_object_path (conn, class1->path); /* Check that when we reconsider the registered class and it is * no longer the best class, it is replaced by the best. */ TEST_FEATURE ("with registered not best class"); nih_hash_add (job_classes, &class3->entry); job_class_register (class3, conn, FALSE); ret = job_class_reconsider (class3); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_TRUE (ret); TEST_EQ_P (ptr, class1); TEST_TRUE (dbus_connection_get_object_path_data (conn, class1->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class1->path); TEST_EQ_P (object->data, class1); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobRemoved")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class3->path); dbus_message_unref (message); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobAdded")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class1->path); dbus_message_unref (message); nih_list_remove (&class1->entry); dbus_connection_unregister_object_path (conn, class1->path); /* Check that when we reconsider a class that cannot be replaced, * it is not, even if there is a better. */ TEST_FEATURE ("with registered not best class that can't be replaced"); nih_list_remove (&entry->entry); job = job_new (class3, ""); job->goal = JOB_START; job->state = JOB_RUNNING; nih_list_add (control_conns, &entry->entry); nih_hash_add (job_classes, &class3->entry); job_class_register (class3, conn, FALSE); ret = job_class_reconsider (class3); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_FALSE (ret); TEST_EQ_P (ptr, class3); TEST_TRUE (dbus_connection_get_object_path_data (conn, class3->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class3->path); TEST_EQ_P (object->data, class3); message = dbus_message_new_signal ("/", "com.ubuntu.Upstart.Test", "TestPassed"); assert (message != NULL); dbus_connection_send (conn, message, NULL); dbus_message_unref (message); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, "com.ubuntu.Upstart.Test", "TestPassed")); dbus_message_unref (message); nih_free (job); nih_list_remove (&class3->entry); dbus_connection_unregister_object_path (conn, class3->path); /* Check that if the class we reconsidered is not the registered * class, an election is not forced. */ TEST_FEATURE ("with unregistered class"); nih_hash_add (job_classes, &class3->entry); job_class_register (class3, conn, FALSE); ret = job_class_reconsider (class1); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_TRUE (ret); TEST_EQ_P (ptr, class3); TEST_TRUE (dbus_connection_get_object_path_data (conn, class3->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class3->path); TEST_EQ_P (object->data, class3); message = dbus_message_new_signal ("/", "com.ubuntu.Upstart.Test", "TestPassed"); assert (message != NULL); dbus_connection_send (conn, message, NULL); dbus_message_unref (message); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, "com.ubuntu.Upstart.Test", "TestPassed")); dbus_message_unref (message); nih_list_remove (&class3->entry); dbus_connection_unregister_object_path (conn, class3->path); /* Check that if there is no registered class, an election is * not forced. */ TEST_FEATURE ("with no registered class"); ret = job_class_reconsider (class1); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_TRUE (ret); TEST_EQ_P (ptr, NULL); TEST_TRUE (dbus_connection_get_object_path_data (conn, class1->path, (void **)&object)); TEST_EQ_P (object, NULL); message = dbus_message_new_signal ("/", "com.ubuntu.Upstart.Test", "TestPassed"); assert (message != NULL); dbus_connection_send (conn, message, NULL); dbus_message_unref (message); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, "com.ubuntu.Upstart.Test", "TestPassed")); dbus_message_unref (message); /* Check that when there are no more classes left to consider, * the registered class is simply removed. */ TEST_FEATURE ("with no classes to replace it"); nih_free (source3); nih_free (source2); nih_free (source1); class4 = job_class_new (NULL, "frodo", NULL); class4->console = CONSOLE_NONE; nih_hash_add (job_classes, &class4->entry); job_class_register (class4, conn, FALSE); ret = job_class_reconsider (class4); ptr = (JobClass *)nih_hash_lookup (job_classes, "frodo"); TEST_TRUE (ret); TEST_EQ_P (ptr, NULL); TEST_TRUE (dbus_connection_get_object_path_data (conn, class4->path, (void **)&object)); TEST_EQ_P (object, NULL); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobRemoved")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class4->path); dbus_message_unref (message); nih_free (class4); nih_free (entry); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_register (void) { pid_t dbus_pid; DBusError dbus_error; DBusConnection *conn, *client_conn; DBusMessage *message; JobClass *class; NihDBusObject *object; char *path; TEST_FUNCTION ("job_class_register"); dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); /* Check that we can register an existing job class on the bus * using its path and that the JobAdded signal is emitted to * announce it. */ TEST_FEATURE ("with signal emission"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; assert (dbus_connection_get_object_path_data (conn, class->path, (void **)&object)); assert (object == NULL); job_class_register (class, conn, TRUE); TEST_TRUE (dbus_connection_get_object_path_data (conn, class->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class->path); TEST_EQ_P (object->data, class); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobAdded")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class->path); dbus_message_unref (message); nih_free (class); /* Check that we can register the job without emitting the signal * by emitting a signal immediately afterwards. */ TEST_FEATURE ("without signal emission"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; assert (dbus_connection_get_object_path_data (conn, class->path, (void **)&object)); assert (object == NULL); job_class_register (class, conn, FALSE); TEST_TRUE (dbus_connection_get_object_path_data (conn, class->path, (void **)&object)); TEST_ALLOC_SIZE (object, sizeof (NihDBusObject)); TEST_EQ_STR (object->path, class->path); TEST_EQ_P (object->data, class); message = dbus_message_new_signal ("/", "com.ubuntu.Upstart.Test", "TestPassed"); assert (message != NULL); dbus_connection_send (conn, message, NULL); dbus_message_unref (message); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, "com.ubuntu.Upstart.Test", "TestPassed")); dbus_message_unref (message); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_unregister (void) { pid_t dbus_pid; DBusError dbus_error; DBusConnection *conn, *client_conn; DBusMessage *message; JobClass *class; NihDBusObject *object; char *path; /* Check that we can unregister an object for a job class from * the bus and that the JobRemoved signal is emitted as a result. * Don't worry about its instances, we can never unregister while * it has them. */ TEST_FUNCTION ("job_class_unregister"); dbus_error_init (&dbus_error); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); dbus_bus_add_match (client_conn, "type='signal'", &dbus_error); assert (! dbus_error_is_set (&dbus_error)); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; assert (dbus_connection_get_object_path_data (conn, class->path, (void **)&object)); assert (object == NULL); job_class_register (class, conn, FALSE); assert (dbus_connection_get_object_path_data (conn, class->path, (void **)&object)); assert (object != NULL); assert (object->data == class); job_class_unregister (class, conn); TEST_TRUE (dbus_connection_get_object_path_data (conn, class->path, (void **)&object)); TEST_EQ_P (object, NULL); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, message); TEST_TRUE (dbus_message_is_signal (message, DBUS_INTERFACE_UPSTART, "JobRemoved")); TEST_TRUE (dbus_message_get_args (message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, class->path); dbus_message_unref (message); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); } void test_environment (void) { JobClass *class; char **env; size_t len; TEST_FUNCTION ("job_class_environment"); /* Check that a job class created with an empty environment will * just have the built-ins in the returned environment. */ TEST_FEATURE ("with no configured environment"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; /* necessary to call this initially to avoid disrupting * TEST_ALLOC_FAIL()'s bookkeeping. */ job_class_environment_init (); TEST_ALLOC_FAIL { env = job_class_environment (NULL, class, &len); if (test_alloc_failed) { TEST_EQ_P (env, NULL); continue; } TEST_NE_P (env, NULL); TEST_EQ (len, 2); TEST_ALLOC_SIZE (env, sizeof (char *) * 3); TEST_ALLOC_PARENT (env[0], env); TEST_EQ_STRN (env[0], "PATH="); TEST_ALLOC_PARENT (env[1], env); TEST_EQ_STRN (env[1], "TERM="); TEST_EQ_P (env[2], NULL); nih_free (env); } nih_free (class); /* Check that a job class created with defined environment variables * will have those appended to the environment as well as the builtins. */ TEST_FEATURE ("with configured environment"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->env = nih_str_array_new (class); assert (nih_str_array_add (&(class->env), class, NULL, "FOO=BAR")); assert (nih_str_array_add (&(class->env), class, NULL, "BAR=BAZ")); TEST_ALLOC_FAIL { env = job_class_environment (NULL, class, &len); if (test_alloc_failed) { TEST_EQ_P (env, NULL); continue; } TEST_NE_P (env, NULL); TEST_EQ (len, 4); TEST_ALLOC_SIZE (env, sizeof (char *) * 5); TEST_ALLOC_PARENT (env[0], env); TEST_EQ_STRN (env[0], "PATH="); TEST_ALLOC_PARENT (env[1], env); TEST_EQ_STRN (env[1], "TERM="); TEST_ALLOC_PARENT (env[2], env); TEST_EQ_STR (env[2], "FOO=BAR"); TEST_ALLOC_PARENT (env[3], env); TEST_EQ_STR (env[3], "BAR=BAZ"); TEST_EQ_P (env[4], NULL); nih_free (env); } nih_free (class); /* Check that configured environment override built-ins. */ TEST_FEATURE ("with configuration overriding built-ins"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->env = nih_str_array_new (class); assert (nih_str_array_add (&(class->env), class, NULL, "FOO=BAR")); assert (nih_str_array_add (&(class->env), class, NULL, "BAR=BAZ")); assert (nih_str_array_add (&(class->env), class, NULL, "TERM=elmo")); TEST_ALLOC_FAIL { env = job_class_environment (NULL, class, &len); if (test_alloc_failed) { TEST_EQ_P (env, NULL); continue; } TEST_NE_P (env, NULL); TEST_EQ (len, 4); TEST_ALLOC_SIZE (env, sizeof (char *) * 5); TEST_ALLOC_PARENT (env[0], env); TEST_EQ_STRN (env[0], "PATH="); TEST_ALLOC_PARENT (env[1], env); TEST_EQ_STR (env[1], "TERM=elmo"); TEST_ALLOC_PARENT (env[2], env); TEST_EQ_STR (env[2], "FOO=BAR"); TEST_ALLOC_PARENT (env[3], env); TEST_EQ_STR (env[3], "BAR=BAZ"); TEST_EQ_P (env[4], NULL); nih_free (env); } nih_free (class); } void test_get_instance (void) { NihDBusMessage *message = NULL; char **env; JobClass *class = NULL; Job *job = NULL; char *path; int ret; NihError *error; NihDBusError *dbus_error; TEST_FUNCTION ("job_class_get_instance"); nih_error_init (); /* Check that we can obtain the path of an existing instance, and * that a copy is returned in the pointer given. */ TEST_FEATURE ("with running job"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; env = nih_str_array_new (message); } ret = job_class_get_instance (class, message, env, &path); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (path, message); TEST_EQ_STR (path, job->path); nih_free (message); nih_free (class); } /* Check that if there's no such instance, a D-Bus error is raised. */ TEST_FEATURE ("with unknown job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; env = nih_str_array_new (message); ret = job_class_get_instance (class, message, env, &path); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.UnknownInstance"); nih_free (dbus_error); nih_free (message); nih_free (class); /* Check that the environment parameter is used to locate instances. */ TEST_FEATURE ("with environment"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->instance = "$FOO"; job = job_new (class, "wibble"); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO=wibble")); assert (nih_str_array_add (&env, message, NULL, "BAR=wobble")); } ret = job_class_get_instance (class, message, env, &path); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (path, message); TEST_EQ_STR (path, job->path); nih_free (message); nih_free (class); } /* Check that if the environment table is not valid, an error * is returned. */ TEST_FEATURE ("with invalid environment"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->instance = "$FOO"; job = job_new (class, "wibble"); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO BAR=wibble")); ret = job_class_get_instance (class, message, env, &path); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_ERROR_INVALID_ARGS); nih_free (dbus_error); nih_free (message); nih_free (class); } void test_get_instance_by_name (void) { NihDBusMessage *message = NULL; JobClass *class; Job *job; char *path; NihError *error; NihDBusError *dbus_error; int ret; TEST_FUNCTION ("job_class_get_instance_by_name"); nih_error_init (); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; /* Check that when given a known instance name, the path to that * instance is returned as a duplicate child of the message * structure. */ TEST_FEATURE ("with known job"); job = job_new (class, "foo"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = job_class_get_instance_by_name (class, message, "foo", &path); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (path, message); TEST_EQ_STR (path, job->path); nih_free (message); } nih_free (job); /* Check that when given the name of the singleton instance, the * path to that instance is returned as a duplicate child of the * message structure. */ TEST_FEATURE ("with singleton job"); job = job_new (class, ""); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = job_class_get_instance_by_name (class, message, "", &path); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (path, message); TEST_EQ_STR (path, job->path); nih_free (message); } nih_free (job); /* Check that when given an unknown instance name, an unknown * instance D-Bus error is raised and an error returned. */ TEST_FEATURE ("with unknown instance"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = job_class_get_instance_by_name (class, message, "foo", &path); TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.UnknownInstance"); nih_free (error); nih_free (message); } nih_free (class); } void test_get_all_instances (void) { NihDBusMessage *message = NULL; JobClass *class; Job *job1, *job2, *job3; NihError *error; char **paths; int ret; TEST_FUNCTION ("job_class_get_all_instances"); nih_error_init (); job_class_init (); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; /* Check that paths for each of the active instances are returned * in an array allocated as a child of the message structure. */ TEST_FEATURE ("with active instances"); job1 = job_new (class, "frodo"); job2 = job_new (class, "bilbo"); job3 = job_new (class, "sauron"); TEST_ALLOC_FAIL { int found1 = FALSE, found2 = FALSE, found3 = FALSE, i; TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = job_class_get_all_instances (class, message, &paths); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (paths, message); TEST_ALLOC_SIZE (paths, sizeof (char *) * 4); TEST_EQ_P (paths[3], NULL); for (i = 0; i < 3; i++) { TEST_ALLOC_PARENT (paths[i], paths); if (! strcmp (paths[i], job1->path)) found1 = TRUE; if (! strcmp (paths[i], job2->path)) found2 = TRUE; if (! strcmp (paths[i], job3->path)) found3 = TRUE; } TEST_TRUE (found1); TEST_TRUE (found2); TEST_TRUE (found3); nih_free (message); } nih_free (job3); nih_free (job2); nih_free (job1); /* Check that when no instances exist for the given class, an empty * array is returned instead of an error. */ TEST_FEATURE ("with no instances"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } ret = job_class_get_all_instances (class, message, &paths); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (paths, message); TEST_ALLOC_SIZE (paths, sizeof (char *) * 1); TEST_EQ_P (paths[0], NULL); nih_free (message); } nih_free (class); } void test_start (void) { DBusConnection *conn, *client_conn; pid_t dbus_pid; DBusMessage *method, *reply; NihDBusMessage *message; char **env; char *path; dbus_uint32_t serial; JobClass *class; Job *job; Blocked * blocked; int ret; NihError *error; NihDBusError *dbus_error; TEST_FUNCTION ("job_class_start"); nih_error_init (); nih_main_loop_init (); event_init (); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); /* Check that we can start a new instance of a job, and that it's * goal should be start. If we then hurry it though to running, * the reply will be sent to the sender. */ TEST_FEATURE ("with new job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Start"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_start (class, message, env, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_NE_P (job, NULL); TEST_ALLOC_SIZE (job, sizeof (Job)); TEST_ALLOC_PARENT (job, class); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_EQ_P (job->start_env, NULL); TEST_EQ_P (job->stop_env, NULL); TEST_NE_P (job->env, NULL); TEST_EQ_STRN (job->env[0], "PATH="); TEST_EQ_STRN (job->env[1], "TERM="); TEST_EQ_P (job->env[2], NULL); TEST_NE_P (job->env, env); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_JOB_START_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); TEST_TRUE (dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job->path); dbus_message_unref (reply); nih_free (class); /* Check that we can start a new instance of a job without waiting * for it to complete, the reply should be sent to the sender * immediately and the job not blocked. */ TEST_FEATURE ("with no wait"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Start"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_start (class, message, env, FALSE); TEST_EQ (ret, 0); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_NE_P (job, NULL); TEST_ALLOC_SIZE (job, sizeof (Job)); TEST_ALLOC_PARENT (job, class); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_LIST_EMPTY (&job->blocking); TEST_EQ_P (job->start_env, NULL); TEST_EQ_P (job->stop_env, NULL); TEST_NE_P (job->env, NULL); TEST_EQ_STRN (job->env[0], "PATH="); TEST_EQ_STRN (job->env[1], "TERM="); TEST_EQ_P (job->env[2], NULL); TEST_NE_P (job->env, env); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); TEST_TRUE (dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job->path); dbus_message_unref (reply); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_LIST_EMPTY (&job->blocking); nih_free (class); /* Check that start can be used to restart an existing instance of * a job and that the goal gets reset to start. If we then hurry * it through to running, the reply will be sent to the sender. */ TEST_FEATURE ("with stopping job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Start"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_start (class, message, env, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_NE_P (job, NULL); TEST_ALLOC_SIZE (job, sizeof (Job)); TEST_ALLOC_PARENT (job, class); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ_P (job->env, NULL); TEST_EQ_P (job->stop_env, NULL); TEST_NE_P (job->start_env, NULL); TEST_EQ_STRN (job->start_env[0], "PATH="); TEST_EQ_STRN (job->start_env[1], "TERM="); TEST_EQ_P (job->start_env[2], NULL); TEST_NE_P (job->start_env, env); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_JOB_START_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_NOT_FREE (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); TEST_TRUE (dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job->path); dbus_message_unref (reply); nih_free (class); /* Check that if we attempt to start a job that's already started, * a D-Bus error is raised immediately. */ TEST_FEATURE ("with starting job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_STARTING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Start"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_start (class, message, env, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.AlreadyStarted"); nih_free (dbus_error); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); nih_free (class); /* Check that the environment parameter is used to locate and * name instances, and is then placed in the job as the environment * when it's starting. */ TEST_FEATURE ("with environment"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->instance = "$FOO"; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Start"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO=wibble")); assert (nih_str_array_add (&env, message, NULL, "BAR=wobble")); ret = job_class_start (class, message, env, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_HASH_NOT_EMPTY (class->instances); job = (Job *)nih_hash_lookup (class->instances, "wibble"); TEST_NE_P (job, NULL); TEST_ALLOC_SIZE (job, sizeof (Job)); TEST_ALLOC_PARENT (job, class); TEST_EQ_STR (job->name, "wibble"); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_NE_P (job->start_env, env); TEST_NE_P (job->stop_env, env); TEST_NE_P (job->env, NULL); TEST_EQ_STRN (job->env[0], "PATH="); TEST_EQ_STRN (job->env[1], "TERM="); TEST_EQ_STR (job->env[2], "FOO=wibble"); TEST_EQ_STR (job->env[3], "BAR=wobble"); TEST_EQ_P (job->env[4], NULL); TEST_NE_P (job->env, env); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_JOB_START_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); TEST_TRUE (dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job->path); dbus_message_unref (reply); nih_free (class); /* Check that if the environment table is not valid, an error * is returned. */ TEST_FEATURE ("with invalid environment"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Start"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO")); ret = job_class_start (class, message, env, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_ERROR_INVALID_ARGS); nih_free (dbus_error); TEST_HASH_EMPTY (class->instances); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); event_poll (); } void test_stop (void) { DBusConnection *conn, *client_conn; pid_t dbus_pid; DBusMessage *method, *reply; NihDBusMessage *message; char **env; dbus_uint32_t serial; JobClass *class; Job *job; Blocked * blocked; int ret; NihError *error; NihDBusError *dbus_error; TEST_FUNCTION ("job_class_stop"); nih_error_init (); nih_main_loop_init (); event_init (); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); /* Check that stop can be used on an existing instance to set the * goal to stop. If we then hurry it through to waiting, the reply * will be sent to the sender. */ TEST_FEATURE ("with running job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Stop"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); TEST_FREE_TAG (job); ret = job_class_stop (class, message, env, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_NOT_FREE (job); TEST_EQ_P (job->env, NULL); TEST_EQ_P (job->start_env, NULL); TEST_NE_P (job->stop_env, NULL); TEST_EQ_P (job->stop_env[0], NULL); TEST_NE_P (job->stop_env, env); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_JOB_STOP_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_FREE (job); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); nih_free (class); /* Check that we can stop a job without waiting for the command * to finish, the reply should be sent to the sender immediately * and no blocking entry created. */ TEST_FEATURE ("with no wait"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Stop"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); TEST_FREE_TAG (job); ret = job_class_stop (class, message, env, FALSE); TEST_EQ (ret, 0); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); TEST_NOT_FREE (job); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_LIST_EMPTY (&job->blocking); TEST_EQ_P (job->env, NULL); TEST_EQ_P (job->start_env, NULL); TEST_NE_P (job->stop_env, NULL); TEST_EQ_P (job->stop_env[0], NULL); TEST_NE_P (job->stop_env, env); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_FREE (job); nih_free (class); /* Check that if we attempt to stop a job that's already stopped, * a D-Bus error is raised immediately. */ TEST_FEATURE ("with stopping job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Stop"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_stop (class, message, env, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.AlreadyStopped"); nih_free (dbus_error); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); nih_free (class); /* Check that if there's no such instance, a D-Bus error is raised * immediately. */ TEST_FEATURE ("with unknown job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Stop"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_stop (class, message, env, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.UnknownInstance"); nih_free (dbus_error); nih_free (class); /* Check that the environment parameter is used to locate and * name instances, and is then placed in the job as the environment * for the pre-stop script. */ TEST_FEATURE ("with environment"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->instance = "$FOO"; job = job_new (class, "wibble"); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Stop"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO=wibble")); assert (nih_str_array_add (&env, message, NULL, "BAR=wobble")); TEST_FREE_TAG (job); ret = job_class_stop (class, message, env, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_NOT_FREE (job); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ_P (job->env, NULL); TEST_EQ_P (job->start_env, NULL); TEST_NE_P (job->stop_env, NULL); TEST_EQ_STR (job->stop_env[0], "FOO=wibble"); TEST_EQ_STR (job->stop_env[1], "BAR=wobble"); TEST_EQ_P (job->stop_env[2], NULL); TEST_NE_P (job->stop_env, env); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_JOB_STOP_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_FREE (job); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); dbus_message_unref (reply); nih_free (class); /* Check that if the environment table is not valid, an error * is returned. */ TEST_FEATURE ("with invalid environment"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Stop"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO")); ret = job_class_stop (class, message, env, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_ERROR_INVALID_ARGS); nih_free (dbus_error); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); event_poll (); } void test_restart (void) { DBusConnection *conn, *client_conn; pid_t dbus_pid; DBusMessage *method, *reply; NihDBusMessage *message; char **env; char *path; dbus_uint32_t serial; JobClass *class; Job *job; Blocked * blocked; int ret; NihError *error; NihDBusError *dbus_error; TEST_FUNCTION ("job_class_restart"); nih_error_init (); nih_main_loop_init (); event_init (); TEST_DBUS (dbus_pid); TEST_DBUS_OPEN (conn); TEST_DBUS_OPEN (client_conn); /* Check that restart can be used on an existing instance to set the * goal to start while stopping the job first. If we then hurry it * through to waiting, the reply will be sent to the sender. */ TEST_FEATURE ("with running job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Restart"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_restart (class, message, env, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ_P (job->env, NULL); TEST_EQ_P (job->stop_env, NULL); TEST_NE_P (job->start_env, NULL); TEST_EQ_STRN (job->start_env[0], "PATH="); TEST_EQ_STRN (job->start_env[1], "TERM="); TEST_EQ_P (job->start_env[2], NULL); TEST_NE_P (job->start_env, env); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_JOB_RESTART_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_NOT_FREE (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); TEST_TRUE (dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job->path); dbus_message_unref (reply); nih_free (class); /* Check that we can restart the job without waiting for the command * to finish, the reply should be sent immediately and no blocking * entry created. */ TEST_FEATURE ("with no wait"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Restart"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_restart (class, message, env, FALSE); TEST_EQ (ret, 0); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ_P (job->env, NULL); TEST_EQ_P (job->stop_env, NULL); TEST_NE_P (job->start_env, NULL); TEST_EQ_STRN (job->start_env[0], "PATH="); TEST_EQ_STRN (job->start_env[1], "TERM="); TEST_EQ_P (job->start_env[2], NULL); TEST_NE_P (job->start_env, env); TEST_LIST_EMPTY (&job->blocking); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); TEST_TRUE (dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job->path); dbus_message_unref (reply); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); nih_free (class); /* Check that if we attempt to restart a job that's already stopped, * a D-Bus error is raised immediately. */ TEST_FEATURE ("with stopping job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_STOP; job->state = JOB_STOPPING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Restart"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_restart (class, message, env, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.AlreadyStopped"); nih_free (dbus_error); TEST_EQ (job->goal, JOB_STOP); TEST_EQ (job->state, JOB_STOPPING); nih_free (class); /* Check that if there's no such instance, a D-Bus error is raised * immediately. */ TEST_FEATURE ("with unknown job"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Restart"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); ret = job_class_restart (class, message, env, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_INTERFACE_UPSTART ".Error.UnknownInstance"); nih_free (dbus_error); nih_free (class); /* Check that the environment parameter is used to locate and * name instances, and is then placed in the job as the environment * when it's starting again. */ TEST_FEATURE ("with environment"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->instance = "$FOO"; job = job_new (class, "wibble"); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Restart"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO=wibble")); assert (nih_str_array_add (&env, message, NULL, "BAR=wobble")); ret = job_class_restart (class, message, env, TRUE); TEST_EQ (ret, 0); nih_discard (message); TEST_NOT_FREE (message); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STOPPING); TEST_EQ_P (job->stop_env, NULL); TEST_EQ_STRN (job->start_env[0], "PATH="); TEST_EQ_STRN (job->start_env[1], "TERM="); TEST_EQ_STR (job->start_env[2], "FOO=wibble"); TEST_EQ_STR (job->start_env[3], "BAR=wobble"); TEST_EQ_P (job->start_env[4], NULL); TEST_LIST_NOT_EMPTY (&job->blocking); blocked = (Blocked *)job->blocking.next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_ALLOC_PARENT (blocked, job); TEST_EQ (blocked->type, BLOCKED_JOB_RESTART_METHOD); TEST_EQ_P (blocked->message, message); TEST_ALLOC_PARENT (blocked->message, blocked); TEST_FREE_TAG (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_STARTING); TEST_EQ_STRN (job->env[0], "PATH="); TEST_EQ_STRN (job->env[1], "TERM="); TEST_EQ_STR (job->env[2], "FOO=wibble"); TEST_EQ_STR (job->env[3], "BAR=wobble"); TEST_EQ_P (job->env[4], NULL); TEST_NOT_FREE (blocked); nih_free (job->blocker); job->blocker = NULL; job_change_state (job, job_next_state (job)); TEST_EQ (job->goal, JOB_START); TEST_EQ (job->state, JOB_RUNNING); TEST_LIST_EMPTY (&job->blocking); TEST_FREE (blocked); TEST_FREE (message); dbus_message_unref (method); dbus_connection_flush (conn); TEST_DBUS_MESSAGE (client_conn, reply); TEST_EQ (dbus_message_get_type (reply), DBUS_MESSAGE_TYPE_METHOD_RETURN); TEST_EQ (dbus_message_get_reply_serial (reply), serial); TEST_TRUE (dbus_message_get_args (reply, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)); TEST_EQ_STR (path, job->path); dbus_message_unref (reply); nih_free (class); /* Check that if the environment table is not valid, an error * is returned. */ TEST_FEATURE ("with invalid environment"); class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; job = job_new (class, ""); job->goal = JOB_START; job->state = JOB_RUNNING; method = dbus_message_new_method_call ( dbus_bus_get_unique_name (conn), class->path, DBUS_INTERFACE_UPSTART_JOB, "Restart"); dbus_connection_send (client_conn, method, &serial); dbus_connection_flush (client_conn); dbus_message_unref (method); TEST_DBUS_MESSAGE (conn, method); assert (dbus_message_get_serial (method) == serial); message = nih_new (NULL, NihDBusMessage); message->connection = conn; message->message = method; TEST_FREE_TAG (message); env = nih_str_array_new (message); assert (nih_str_array_add (&env, message, NULL, "FOO")); ret = job_class_restart (class, message, env, TRUE); TEST_LT (ret, 0); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); dbus_message_unref (method); error = nih_error_get (); TEST_EQ (error->number, NIH_DBUS_ERROR); TEST_ALLOC_SIZE (error, sizeof (NihDBusError)); dbus_error = (NihDBusError *)error; TEST_EQ_STR (dbus_error->name, DBUS_ERROR_INVALID_ARGS); nih_free (dbus_error); nih_free (class); TEST_DBUS_CLOSE (conn); TEST_DBUS_CLOSE (client_conn); TEST_DBUS_END (dbus_pid); dbus_shutdown (); event_poll (); } void test_get_name (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; NihError *error; char *name; int ret; /* Check that the name of the job class is returned from the * property, as a child of the message. */ TEST_FUNCTION ("job_class_get_name"); nih_error_init (); job_class_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } name = NULL; ret = job_class_get_name (class, message, &name); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (name, message); TEST_EQ_STR (name, "test"); nih_free (message); nih_free (class); } } void test_get_description (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; NihError *error; char *description; int ret; TEST_FUNCTION ("job_class_get_description"); nih_error_init (); job_class_init (); /* Check that the description of the job class is returned from the * property, as a child of the message. */ TEST_FEATURE ("with description"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->description = nih_strdup (class, "a test job"); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } description = NULL; ret = job_class_get_description (class, message, &description); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (description, message); TEST_EQ_STR (description, "a test job"); nih_free (message); nih_free (class); } /* Check that when there is no description, the empty string is * returned instead. */ TEST_FEATURE ("with no description"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } description = NULL; ret = job_class_get_description (class, message, &description); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (description, message); TEST_EQ_STR (description, ""); nih_free (message); nih_free (class); } } void test_get_author (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; NihError *error; char *author; int ret; TEST_FUNCTION ("job_class_get_author"); nih_error_init (); job_class_init (); /* Check that the author of the job class is returned from the * property, as a child of the message. */ TEST_FEATURE ("with author"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->author = nih_strdup (class, "a test job"); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } author = NULL; ret = job_class_get_author (class, message, &author); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (author, message); TEST_EQ_STR (author, "a test job"); nih_free (message); nih_free (class); } /* Check that when there is no author, the empty string is * returned instead. */ TEST_FEATURE ("with no author"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } author = NULL; ret = job_class_get_author (class, message, &author); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (author, message); TEST_EQ_STR (author, ""); nih_free (message); nih_free (class); } } void test_get_version (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; NihError *error; char *version; int ret; TEST_FUNCTION ("job_class_get_version"); nih_error_init (); job_class_init (); /* Check that the version of the job class is returned from the * property, as a child of the message. */ TEST_FEATURE ("with version"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->version = nih_strdup (class, "a test job"); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } version = NULL; ret = job_class_get_version (class, message, &version); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (version, message); TEST_EQ_STR (version, "a test job"); nih_free (message); nih_free (class); } /* Check that when there is no version, the empty string is * returned instead. */ TEST_FEATURE ("with no version"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } version = NULL; ret = job_class_get_version (class, message, &version); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (version, message); TEST_EQ_STR (version, ""); nih_free (message); nih_free (class); } } void test_get_start_on (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; EventOperator *oper = NULL; EventOperator *and_oper = NULL; NihError *error; char ***start_on; int ret; TEST_FUNCTION ("job_class_get_start_on"); /* Check that the job's start_on tree is returned as a flattened * array of string arrays, as a child of the message. */ TEST_FEATURE ("with event tree"); nih_error_init (); job_class_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->start_on = event_operator_new ( class, EVENT_OR, NULL, NULL); and_oper = event_operator_new ( class, EVENT_AND, NULL, NULL); nih_tree_add (&class->start_on->node, &and_oper->node, NIH_TREE_LEFT); oper = event_operator_new ( class->start_on, EVENT_MATCH, "foo", NULL); oper->env = nih_str_array_new (oper); NIH_MUST (nih_str_array_add (&oper->env, oper, NULL, "omnomnom")); NIH_MUST (nih_str_array_add (&oper->env, oper, NULL, "ABER=crombie")); NIH_MUST (nih_str_array_add (&oper->env, oper, NULL, "HOBBIT=frodo")); nih_tree_add (&class->start_on->node, &oper->node, NIH_TREE_RIGHT); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wibble", NULL); nih_tree_add (&and_oper->node, &oper->node, NIH_TREE_LEFT); oper = event_operator_new ( class->start_on, EVENT_MATCH, "wobble", NULL); nih_tree_add (&and_oper->node, &oper->node, NIH_TREE_RIGHT); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } start_on = NULL; ret = job_class_get_start_on (class, message, &start_on); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (start_on, message); TEST_ALLOC_SIZE (start_on, sizeof (char **) * 6); TEST_ALLOC_SIZE (start_on[0], sizeof (char *) * 2); TEST_EQ_STR (start_on[0][0], "wibble"); TEST_EQ_P (start_on[0][1], NULL); TEST_ALLOC_SIZE (start_on[1], sizeof (char *) * 2); TEST_EQ_STR (start_on[1][0], "wobble"); TEST_EQ_P (start_on[1][1], NULL); TEST_ALLOC_SIZE (start_on[2], sizeof (char *) * 2); TEST_EQ_STR (start_on[2][0], "/AND"); TEST_EQ_P (start_on[2][1], NULL); TEST_ALLOC_SIZE (start_on[3], sizeof (char *) * 5); TEST_EQ_STR (start_on[3][0], "foo"); TEST_EQ_STR (start_on[3][1], "omnomnom"); TEST_EQ_STR (start_on[3][2], "ABER=crombie"); TEST_EQ_STR (start_on[3][3], "HOBBIT=frodo"); TEST_EQ_P (start_on[3][4], NULL); TEST_ALLOC_SIZE (start_on[4], sizeof (char *) * 2); TEST_EQ_STR (start_on[4][0], "/OR"); TEST_EQ_P (start_on[4][1], NULL); TEST_EQ_P (start_on[5], NULL); nih_free (message); nih_free (class); } /* Check that an empty array is returned when the job has no * start_on operator tree. */ TEST_FEATURE ("with no events"); nih_error_init (); job_class_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } start_on = NULL; ret = job_class_get_start_on (class, message, &start_on); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (start_on, message); TEST_ALLOC_SIZE (start_on, sizeof (char **)); TEST_EQ_P (start_on[0], NULL); nih_free (message); nih_free (class); } } void test_get_stop_on (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; EventOperator *oper = NULL; EventOperator *and_oper = NULL; NihError *error; char ***stop_on; int ret; TEST_FUNCTION ("job_class_get_stop_on"); /* Check that the job's stop_on tree is returned as a flattened * array of string arrays, as a child of the message. */ TEST_FEATURE ("with event tree"); nih_error_init (); job_class_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->stop_on = event_operator_new ( class, EVENT_OR, NULL, NULL); and_oper = event_operator_new ( class, EVENT_AND, NULL, NULL); nih_tree_add (&class->stop_on->node, &and_oper->node, NIH_TREE_LEFT); oper = event_operator_new ( class->stop_on, EVENT_MATCH, "foo", NULL); oper->env = nih_str_array_new (oper); NIH_MUST (nih_str_array_add (&oper->env, oper, NULL, "omnomnom")); NIH_MUST (nih_str_array_add (&oper->env, oper, NULL, "ABER=crombie")); NIH_MUST (nih_str_array_add (&oper->env, oper, NULL, "HOBBIT=frodo")); nih_tree_add (&class->stop_on->node, &oper->node, NIH_TREE_RIGHT); oper = event_operator_new ( class->stop_on, EVENT_MATCH, "wibble", NULL); nih_tree_add (&and_oper->node, &oper->node, NIH_TREE_LEFT); oper = event_operator_new ( class->stop_on, EVENT_MATCH, "wobble", NULL); nih_tree_add (&and_oper->node, &oper->node, NIH_TREE_RIGHT); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } stop_on = NULL; ret = job_class_get_stop_on (class, message, &stop_on); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (stop_on, message); TEST_ALLOC_SIZE (stop_on, sizeof (char **) * 6); TEST_ALLOC_SIZE (stop_on[0], sizeof (char *) * 2); TEST_EQ_STR (stop_on[0][0], "wibble"); TEST_EQ_P (stop_on[0][1], NULL); TEST_ALLOC_SIZE (stop_on[1], sizeof (char *) * 2); TEST_EQ_STR (stop_on[1][0], "wobble"); TEST_EQ_P (stop_on[1][1], NULL); TEST_ALLOC_SIZE (stop_on[2], sizeof (char *) * 2); TEST_EQ_STR (stop_on[2][0], "/AND"); TEST_EQ_P (stop_on[2][1], NULL); TEST_ALLOC_SIZE (stop_on[3], sizeof (char *) * 5); TEST_EQ_STR (stop_on[3][0], "foo"); TEST_EQ_STR (stop_on[3][1], "omnomnom"); TEST_EQ_STR (stop_on[3][2], "ABER=crombie"); TEST_EQ_STR (stop_on[3][3], "HOBBIT=frodo"); TEST_EQ_P (stop_on[3][4], NULL); TEST_ALLOC_SIZE (stop_on[4], sizeof (char *) * 2); TEST_EQ_STR (stop_on[4][0], "/OR"); TEST_EQ_P (stop_on[4][1], NULL); TEST_EQ_P (stop_on[5], NULL); nih_free (message); nih_free (class); } /* Check that an empty array is returned when the job has no * stop_on operator tree. */ TEST_FEATURE ("with no events"); nih_error_init (); job_class_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } stop_on = NULL; ret = job_class_get_stop_on (class, message, &stop_on); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (stop_on, message); TEST_ALLOC_SIZE (stop_on, sizeof (char **)); TEST_EQ_P (stop_on[0], NULL); nih_free (message); nih_free (class); } } void test_get_emits (void) { NihDBusMessage *message = NULL; JobClass *class = NULL; NihError *error; char **emits; int ret; TEST_FUNCTION ("job_class_get_emits"); /* Check that an array of strings is returned from the property * as a child of the message when the job declares that it emits * extra events. */ TEST_FEATURE ("with events"); nih_error_init (); job_class_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; class->emits = nih_str_array_new (class); NIH_MUST (nih_str_array_add (&class->emits, class, NULL, "foo")); NIH_MUST (nih_str_array_add (&class->emits, class, NULL, "bar")); NIH_MUST (nih_str_array_add (&class->emits, class, NULL, "baz")); message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } emits = NULL; ret = job_class_get_emits (class, message, &emits); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (emits, message); TEST_ALLOC_SIZE (emits, sizeof (char *) * 4); TEST_EQ_STR (emits[0], "foo"); TEST_EQ_STR (emits[1], "bar"); TEST_EQ_STR (emits[2], "baz"); TEST_EQ_P (emits[3], NULL); nih_free (message); nih_free (class); } /* Check that an empty array is returned from the property * as a child of the message when the job doesn't declare * any particular emitted events. */ TEST_FEATURE ("with no events"); nih_error_init (); job_class_init (); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { class = job_class_new (NULL, "test", NULL); class->console = CONSOLE_NONE; message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } emits = NULL; ret = job_class_get_emits (class, message, &emits); if (test_alloc_failed) { TEST_LT (ret, 0); error = nih_error_get (); TEST_EQ (error->number, ENOMEM); nih_free (error); nih_free (message); nih_free (class); continue; } TEST_EQ (ret, 0); TEST_ALLOC_PARENT (emits, message); TEST_ALLOC_SIZE (emits, sizeof (char *)); TEST_EQ_P (emits[0], NULL); nih_free (message); nih_free (class); } } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_new (); test_consider (); test_reconsider (); test_register (); test_unregister (); test_environment (); test_get_instance (); test_get_instance_by_name (); test_get_all_instances (); test_start (); test_stop (); test_restart (); test_get_name (); test_get_description (); test_get_author (); test_get_version (); test_get_start_on (); test_get_stop_on (); test_get_emits (); return 0; } upstart-1.13.2/init/tests/test_main.c0000664000175000017500000010614512373101356014467 00000000000000/* upstart * * test_main.c - test suite for init/main.c * * Copyright © 2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include "conf.h" #include "job_class.h" #include "job.h" #include "xdg.h" #include "test_util_common.h" void test_confdir (void) { char confdir_a[PATH_MAX]; char confdir_b[PATH_MAX]; char confdir_c[PATH_MAX]; char confdir_d[PATH_MAX]; char confdir_e[PATH_MAX]; char confdir_f[PATH_MAX]; char *xdg_config_home; char *xdg_runtime_dir; char logdir[PATH_MAX]; pid_t upstart_pid = 0; pid_t dbus_pid = 0; char **output; size_t lines; nih_local char *cmd = NULL; nih_local char *xdg_conf_dir = NULL; nih_local char *session_file = NULL; nih_local char *path = NULL; /* space for 2 sets of confdir options, 2 sets of * prepend-confdir, 2 sets of append-confdirs and a terminator. */ char *extra[13]; xdg_config_home = getenv ("XDG_CONFIG_HOME"); TEST_NE_P (xdg_config_home, NULL); xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR"); TEST_NE_P (xdg_runtime_dir, NULL); TEST_GROUP ("--confdir command-line option handling"); TEST_FILENAME (confdir_a); assert0 (mkdir (confdir_a, 0755)); TEST_FILENAME (confdir_b); assert0 (mkdir (confdir_b, 0755)); TEST_FILENAME (confdir_c); assert0 (mkdir (confdir_c, 0755)); TEST_FILENAME (confdir_d); assert0 (mkdir (confdir_d, 0755)); TEST_FILENAME (confdir_e); assert0 (mkdir (confdir_e, 0755)); TEST_FILENAME (confdir_f); assert0 (mkdir (confdir_f, 0755)); xdg_conf_dir = nih_sprintf (NULL, "%s/%s", xdg_config_home, "upstart"); TEST_NE_P (xdg_conf_dir, NULL); assert0 (mkdir (xdg_conf_dir, 0755)); TEST_FILENAME (logdir); assert0 (mkdir (logdir, 0755)); /* disable system default job dir */ assert0 (setenv ("UPSTART_NO_SYSTEM_USERCONFDIR", "1", 1)); TEST_DBUS (dbus_pid); /************************************************************/ TEST_FEATURE ("Session Init without --confdir"); CREATE_FILE (xdg_conf_dir, "foo.conf", "exec true"); CREATE_FILE (xdg_conf_dir, "bar.conf", "exec true"); CREATE_FILE (xdg_conf_dir, "baz.conf", "exec true"); start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 3); TEST_STR_MATCH (output[0], "bar stop/waiting"); TEST_STR_MATCH (output[1], "baz stop/waiting"); TEST_STR_MATCH (output[2], "foo stop/waiting"); nih_free (output); DELETE_FILE (xdg_conf_dir, "foo.conf"); DELETE_FILE (xdg_conf_dir, "bar.conf"); DELETE_FILE (xdg_conf_dir, "baz.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with --confdir"); CREATE_FILE (xdg_conf_dir, "xdg_dir_job.conf", "exec true"); CREATE_FILE (confdir_a, "conf_dir_job.conf", "exec true"); start_upstart_common (&upstart_pid, TRUE, FALSE, confdir_a, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); /* We expect jobs in xdg_conf_dir to be ignored */ TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "conf_dir_job stop/waiting"); nih_free (output); DELETE_FILE (xdg_conf_dir, "xdg_dir_job.conf"); DELETE_FILE (confdir_a, "conf_dir_job.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with --prepend-confdir"); CREATE_FILE (confdir_a, "foo.conf", "exec foo"); CREATE_FILE (confdir_a, "conflict.conf", "emits prepend"); CREATE_FILE (xdg_conf_dir, "conflict.conf", "emits confdir"); CREATE_FILE (xdg_conf_dir, "baz.conf", "exec baz"); extra[0] = "--prepend-confdir"; extra[1] = confdir_a; extra[2] = NULL; start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 3); TEST_STR_MATCH (output[0], "baz stop/waiting"); TEST_STR_MATCH (output[1], "conflict stop/waiting"); TEST_STR_MATCH (output[2], "foo stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "conflict"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict"); TEST_STR_MATCH (output[1], " emits prepend"); nih_free (output); DELETE_FILE (confdir_a, "foo.conf"); DELETE_FILE (confdir_a, "conflict.conf"); DELETE_FILE (xdg_conf_dir, "conflict.conf"); DELETE_FILE (xdg_conf_dir, "baz.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with --append-confdir"); CREATE_FILE (xdg_conf_dir, "xdg_dir_job.conf", "exec true"); CREATE_FILE (confdir_a, "conf_dir_job.conf", "exec true"); extra[0] = "--append-confdir"; extra[1] = confdir_a; extra[2] = NULL; start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); /* jobs in xdg_conf_dir should be considered */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conf_dir_job stop/waiting"); TEST_STR_MATCH (output[1], "xdg_dir_job stop/waiting"); nih_free (output); DELETE_FILE (xdg_conf_dir, "xdg_dir_job.conf"); DELETE_FILE (confdir_a, "conf_dir_job.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with multiple --confdir"); CREATE_FILE (xdg_conf_dir, "xdg_dir_job.conf", "exec true"); CREATE_FILE (confdir_a, "conf_dir_a_job.conf", "exec true"); CREATE_FILE (confdir_b, "conf_dir_b_job.conf", "exec true"); extra[0] = "--confdir"; extra[1] = confdir_a; extra[2] = "--confdir"; extra[3] = confdir_b; extra[4] = NULL; /* pass 2 confdir directories */ start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); /* We expect jobs in xdg_conf_dir to be ignored */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conf_dir_a_job stop/waiting"); TEST_STR_MATCH (output[1], "conf_dir_b_job stop/waiting"); nih_free (output); DELETE_FILE (xdg_conf_dir, "xdg_dir_job.conf"); DELETE_FILE (confdir_a, "conf_dir_a_job.conf"); DELETE_FILE (confdir_b, "conf_dir_b_job.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with multiple --prepend-confdir"); CREATE_FILE (xdg_conf_dir, "xdg_dir_job.conf", "exec true"); CREATE_FILE (confdir_a, "conf_dir_a_job.conf", "exec true"); CREATE_FILE (confdir_b, "conf_dir_b_job.conf", "exec true"); extra[0] = "--prepend-confdir"; extra[1] = confdir_a; extra[2] = "--prepend-confdir"; extra[3] = confdir_b; extra[4] = NULL; /* pass 2 confdir directories */ start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); /* jobs in xdg_conf_dir should be considered */ TEST_EQ (lines, 3); TEST_STR_MATCH (output[0], "conf_dir_a_job stop/waiting"); TEST_STR_MATCH (output[1], "conf_dir_b_job stop/waiting"); TEST_STR_MATCH (output[2], "xdg_dir_job stop/waiting"); nih_free (output); DELETE_FILE (xdg_conf_dir, "xdg_dir_job.conf"); DELETE_FILE (confdir_a, "conf_dir_a_job.conf"); DELETE_FILE (confdir_b, "conf_dir_b_job.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with multiple --append-confdir"); CREATE_FILE (xdg_conf_dir, "xdg_dir_job.conf", "exec true"); CREATE_FILE (confdir_a, "conf_dir_a_job.conf", "exec true"); CREATE_FILE (confdir_b, "conf_dir_b_job.conf", "exec true"); extra[0] = "--append-confdir"; extra[1] = confdir_a; extra[2] = "--append-confdir"; extra[3] = confdir_b; extra[4] = NULL; /* pass 2 confdir directories */ start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); /* jobs in xdg_conf_dir should be considered */ TEST_EQ (lines, 3); TEST_STR_MATCH (output[0], "conf_dir_a_job stop/waiting"); TEST_STR_MATCH (output[1], "conf_dir_b_job stop/waiting"); TEST_STR_MATCH (output[2], "xdg_dir_job stop/waiting"); nih_free (output); DELETE_FILE (xdg_conf_dir, "xdg_dir_job.conf"); DELETE_FILE (confdir_a, "conf_dir_a_job.conf"); DELETE_FILE (confdir_b, "conf_dir_b_job.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with multiple --confdir and conflicting names"); CREATE_FILE (xdg_conf_dir, "conflict.conf", "emits xdg_conf_dir"); CREATE_FILE (confdir_a, "conflict.conf", "emits confdir_a"); CREATE_FILE (confdir_b, "foo.conf", "exec true"); extra[0] = "--confdir"; extra[1] = confdir_a; extra[2] = "--confdir"; extra[3] = confdir_b; extra[4] = NULL; /* pass 2 confdir directories */ start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); /* We expect jobs in xdg_conf_dir to be ignored */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict stop/waiting"); TEST_STR_MATCH (output[1], "foo stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "conflict"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* Ensure the correct version of the conflict job is found */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict"); TEST_STR_MATCH (output[1], " emits confdir_a"); nih_free (output); DELETE_FILE (xdg_conf_dir, "conflict.conf"); DELETE_FILE (confdir_a, "conflict.conf"); DELETE_FILE (confdir_b, "foo.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with multiple --prepend-confdir and conflicting names"); CREATE_FILE (xdg_conf_dir, "conflict.conf", "emits xdg_conf_dir"); CREATE_FILE (confdir_a, "conflict.conf", "emits confdir_a"); CREATE_FILE (confdir_b, "foo.conf", "exec true"); extra[0] = "--prepend-confdir"; extra[1] = confdir_a; extra[2] = "--prepend-confdir"; extra[3] = confdir_b; extra[4] = NULL; /* pass 2 confdir directories */ start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); /* We expect jobs in xdg_conf_dir to be ignored */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict stop/waiting"); TEST_STR_MATCH (output[1], "foo stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "conflict"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* Ensure the correct version of the conflict job is found */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict"); TEST_STR_MATCH (output[1], " emits confdir_a"); nih_free (output); DELETE_FILE (xdg_conf_dir, "conflict.conf"); DELETE_FILE (confdir_a, "conflict.conf"); DELETE_FILE (confdir_b, "foo.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with multiple --append-confdir and conflicting names"); CREATE_FILE (xdg_conf_dir, "conflict.conf", "emits xdg_conf_dir"); CREATE_FILE (confdir_a, "conflict.conf", "emits confdir_a"); CREATE_FILE (confdir_b, "foo.conf", "exec true"); extra[0] = "--append-confdir"; extra[1] = confdir_a; extra[2] = "--append-confdir"; extra[3] = confdir_b; extra[4] = NULL; /* pass 2 confdir directories */ start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); /* We expect jobs in xdg_conf_dir to be ignored */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict stop/waiting"); TEST_STR_MATCH (output[1], "foo stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "conflict"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* Ensure the correct version of the conflict job is found */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict"); TEST_STR_MATCH (output[1], " emits xdg_conf_dir"); nih_free (output); DELETE_FILE (xdg_conf_dir, "conflict.conf"); DELETE_FILE (confdir_a, "conflict.conf"); DELETE_FILE (confdir_b, "foo.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with multiple --confdir, --prepend-confdir and --append-confdir with conflicting names"); CREATE_FILE (xdg_conf_dir, "conflict.conf", "emits xdg_conf_dir"); CREATE_FILE (confdir_a, "conflict.conf", "emits confdir_a"); CREATE_FILE (confdir_b, "foo.conf", "exec true"); CREATE_FILE (confdir_c, "conflict.conf", "emits confdir_c"); CREATE_FILE (confdir_d, "conflict.conf", "emits confdir_d"); CREATE_FILE (confdir_e, "bar.conf", "exec false"); extra[0] = "--prepend-confdir"; extra[1] = confdir_d; extra[2] = "--prepend-confdir"; extra[3] = confdir_e; extra[4] = "--confdir"; extra[5] = confdir_a; extra[6] = "--confdir"; extra[7] = confdir_b; extra[8] = "--append-confdir"; extra[9] = confdir_c; extra[10] = NULL; start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 3); TEST_STR_MATCH (output[0], "bar stop/waiting"); TEST_STR_MATCH (output[1], "conflict stop/waiting"); TEST_STR_MATCH (output[2], "foo stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "conflict"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* Ensure the correct version of the conflict job is found */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict"); TEST_STR_MATCH (output[1], " emits confdir_d"); nih_free (output); DELETE_FILE (xdg_conf_dir, "conflict.conf"); DELETE_FILE (confdir_a, "conflict.conf"); DELETE_FILE (confdir_b, "foo.conf"); DELETE_FILE (confdir_c, "conflict.conf"); DELETE_FILE (confdir_d, "conflict.conf"); DELETE_FILE (confdir_e, "bar.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("Session Init with multiple out of order --confdir, --prepend-confdir and --append-confdir"); CREATE_FILE (xdg_conf_dir, "conflict.conf", "emits xdg_conf_dir"); CREATE_FILE (confdir_a, "conflict.conf", "emits confdir_a"); CREATE_FILE (confdir_b, "foo.conf", "exec true"); CREATE_FILE (confdir_c, "conflict.conf", "emits confdir_c"); CREATE_FILE (confdir_d, "conflict.conf", "emits confdir_d"); CREATE_FILE (confdir_e, "bar.conf", "exec false"); CREATE_FILE (confdir_f, "baz.conf", "exec false"); extra[0] = "--append-confdir"; extra[1] = confdir_a; extra[2] = "--prepend-confdir"; extra[3] = confdir_e; extra[4] = "--confdir"; extra[5] = confdir_b; extra[6] = "--append-confdir"; extra[7] = confdir_c; extra[8] = "--prepend-confdir"; extra[9] = confdir_f; extra[10] = "--confdir"; extra[11] = confdir_d; extra[12] = NULL; start_upstart_common (&upstart_pid, TRUE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); session_file = get_session_file (xdg_runtime_dir, upstart_pid); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 4); TEST_STR_MATCH (output[0], "bar stop/waiting"); TEST_STR_MATCH (output[1], "baz stop/waiting"); TEST_STR_MATCH (output[2], "conflict stop/waiting"); TEST_STR_MATCH (output[3], "foo stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "conflict"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* Ensure the correct version of the conflict job is found */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict"); TEST_STR_MATCH (output[1], " emits confdir_d"); nih_free (output); DELETE_FILE (xdg_conf_dir, "conflict.conf"); DELETE_FILE (confdir_a, "conflict.conf"); DELETE_FILE (confdir_b, "foo.conf"); DELETE_FILE (confdir_c, "conflict.conf"); DELETE_FILE (confdir_d, "conflict.conf"); DELETE_FILE (confdir_e, "bar.conf"); DELETE_FILE (confdir_f, "baz.conf"); STOP_UPSTART (upstart_pid); assert0 (unlink (session_file)); /************************************************************/ TEST_FEATURE ("System Init without --confdir"); /* Use the "secret" interface */ assert0 (setenv ("UPSTART_CONFDIR", confdir_a, 1)); CREATE_FILE (confdir_a, "foo.conf", "exec true"); CREATE_FILE (confdir_a, "bar.conf", "exec true"); CREATE_FILE (confdir_a, "baz.conf", "exec true"); /* Disable user mode */ test_user_mode = FALSE; start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 3); TEST_STR_MATCH (output[0], "bar stop/waiting"); TEST_STR_MATCH (output[1], "baz stop/waiting"); TEST_STR_MATCH (output[2], "foo stop/waiting"); nih_free (output); DELETE_FILE (confdir_a, "foo.conf"); DELETE_FILE (confdir_a, "bar.conf"); DELETE_FILE (confdir_a, "baz.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with --confdir"); CREATE_FILE (confdir_a, "foo.conf", "exec true"); CREATE_FILE (confdir_a, "bar.conf", "exec true"); CREATE_FILE (confdir_b, "baz.conf", "exec true"); start_upstart_common (&upstart_pid, FALSE, FALSE, confdir_b, logdir, NULL); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "baz stop/waiting"); nih_free (output); DELETE_FILE (confdir_a, "foo.conf"); DELETE_FILE (confdir_a, "bar.conf"); DELETE_FILE (confdir_b, "baz.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with --prepend-confdir"); TEST_FALSE (file_exists ("/etc/init/must-not-exist-by-default.conf")); CREATE_FILE (confdir_a, "must-not-exist-by-default.conf", "exec true"); extra[0] = "--prepend-confdir"; extra[1] = confdir_a; extra[2] = NULL; start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), "must-not-exist-by-default"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "must-not-exist-by-default stop/waiting"); nih_free (output); DELETE_FILE (confdir_a, "must-not-exist-by-default.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with --append-confdir"); TEST_FALSE (file_exists ("/etc/init/must-not-exist-by-default.conf")); CREATE_FILE (confdir_a, "must-not-exist-by-default.conf", "exec true"); extra[0] = "--append-confdir"; extra[1] = confdir_a; extra[2] = NULL; start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), "must-not-exist-by-default"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "must-not-exist-by-default stop/waiting"); nih_free (output); DELETE_FILE (confdir_a, "must-not-exist-by-default.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with multiple --confdir"); assert0 (setenv ("UPSTART_CONFDIR", xdg_conf_dir, 1)); CREATE_FILE (xdg_conf_dir, "foo.conf", "exec true"); CREATE_FILE (confdir_a, "bar.conf", "exec true"); CREATE_FILE (confdir_b, "baz.conf", "exec true"); CREATE_FILE (confdir_b, "qux.conf", "exec true"); extra[0] = "--confdir"; extra[1] = confdir_a; extra[2] = "--confdir"; extra[3] = confdir_b; extra[4] = NULL; start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); /* Like a Session Init, the System Init behaviour is (now) to * honour all --confdirs. */ TEST_EQ (lines, 3); TEST_STR_MATCH (output[0], "bar stop/waiting"); TEST_STR_MATCH (output[1], "baz stop/waiting"); TEST_STR_MATCH (output[2], "qux stop/waiting"); nih_free (output); DELETE_FILE (xdg_conf_dir, "foo.conf"); DELETE_FILE (confdir_a, "bar.conf"); DELETE_FILE (confdir_b, "baz.conf"); DELETE_FILE (confdir_b, "qux.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with multiple --prepend-confdir"); TEST_FALSE (file_exists ("/etc/init/must-not-exist-by-default.conf")); TEST_FALSE (file_exists ("/etc/init/must-not-exist-by-default2.conf")); CREATE_FILE (confdir_a, "must-not-exist-by-default.conf", "exec true"); CREATE_FILE (confdir_b, "must-not-exist-by-default2.conf", "exec true"); extra[0] = "--prepend-confdir"; extra[1] = confdir_a; extra[2] = "--prepend-confdir"; extra[3] = confdir_b; extra[4] = NULL; start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), "must-not-exist-by-default"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "must-not-exist-by-default stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), "must-not-exist-by-default2"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "must-not-exist-by-default2 stop/waiting"); nih_free (output); DELETE_FILE (confdir_a, "must-not-exist-by-default.conf"); DELETE_FILE (confdir_b, "must-not-exist-by-default2.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with multiple --append-confdir"); TEST_FALSE (file_exists ("/etc/init/must-not-exist-by-default.conf")); TEST_FALSE (file_exists ("/etc/init/must-not-exist-by-default2.conf")); CREATE_FILE (confdir_a, "must-not-exist-by-default.conf", "exec true"); CREATE_FILE (confdir_b, "must-not-exist-by-default2.conf", "exec true"); extra[0] = "--append-confdir"; extra[1] = confdir_a; extra[2] = "--append-confdir"; extra[3] = confdir_b; extra[4] = NULL; start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), "must-not-exist-by-default"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "must-not-exist-by-default stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), "must-not-exist-by-default2"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "must-not-exist-by-default2 stop/waiting"); nih_free (output); DELETE_FILE (confdir_a, "must-not-exist-by-default.conf"); DELETE_FILE (confdir_b, "must-not-exist-by-default2.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with multiple --confdir and conflicting names"); assert0 (setenv ("UPSTART_CONFDIR", xdg_conf_dir, 1)); CREATE_FILE (xdg_conf_dir, "conflict.conf", "emits xdg_conf_dir"); CREATE_FILE (confdir_a, "conflict.conf", "emits confdir_a"); CREATE_FILE (confdir_b, "conflict.conf", "emits confdir_b"); extra[0] = "--confdir"; extra[1] = confdir_a; extra[2] = "--confdir"; extra[3] = confdir_b; extra[4] = NULL; /* pass 2 confdir directories */ start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 1); TEST_STR_MATCH (output[0], "conflict stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "conflict"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* Ensure the correct version of the conflict job is found */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict"); TEST_STR_MATCH (output[1], " emits confdir_a"); nih_free (output); DELETE_FILE (xdg_conf_dir, "conflict.conf"); DELETE_FILE (confdir_a, "conflict.conf"); DELETE_FILE (confdir_b, "conflict.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with multiple --prepend-confdir and conflicting names"); TEST_FALSE (file_exists ("/etc/init/must-not-exist-by-default.conf")); CREATE_FILE (confdir_a, "must-not-exist-by-default.conf", "emits confdir_a"); CREATE_FILE (confdir_b, "must-not-exist-by-default.conf", "emits confdir_b"); extra[0] = "--prepend-confdir"; extra[1] = confdir_a; extra[2] = "--prepend-confdir"; extra[3] = confdir_b; extra[4] = NULL; start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "must-not-exist-by-default"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* Ensure the correct version of the conflict job is found */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "must-not-exist-by-default"); TEST_STR_MATCH (output[1], " emits confdir_a"); nih_free (output); DELETE_FILE (confdir_a, "must-not-exist-by-default.conf"); DELETE_FILE (confdir_b, "must-not-exist-by-default.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with multiple --append-confdir and conflicting names"); TEST_FALSE (file_exists ("/etc/init/must-not-exist-by-default.conf")); CREATE_FILE (confdir_a, "must-not-exist-by-default.conf", "emits confdir_a"); CREATE_FILE (confdir_b, "must-not-exist-by-default.conf", "emits confdir_b"); extra[0] = "--append-confdir"; extra[1] = confdir_a; extra[2] = "--append-confdir"; extra[3] = confdir_b; extra[4] = NULL; start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "must-not-exist-by-default"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); /* Ensure the correct version of the conflict job is found */ TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "must-not-exist-by-default"); TEST_STR_MATCH (output[1], " emits confdir_a"); nih_free (output); DELETE_FILE (confdir_a, "must-not-exist-by-default.conf"); DELETE_FILE (confdir_b, "must-not-exist-by-default.conf"); STOP_UPSTART (upstart_pid); /************************************************************/ TEST_FEATURE ("System Init with multiple out of order --confdir, --prepend-confdir and --append-confdir"); CREATE_FILE (confdir_a, "conflict.conf", "emits confdir_a"); CREATE_FILE (confdir_a, "wibble.conf", "emits wobble"); CREATE_FILE (confdir_b, "conflict.conf", "emits confdir_b"); CREATE_FILE (confdir_c, "conflict.conf", "emits confdir_c"); CREATE_FILE (confdir_d, "foo.conf", "emits hello"); CREATE_FILE (confdir_e, "bar.conf", "emits world"); CREATE_FILE (confdir_e, "conflict.conf", "emits confdir_e"); CREATE_FILE (confdir_f, "conflict.conf", "emits confdir_f"); CREATE_FILE (confdir_f, "baz.conf", "exec true"); extra[0] = "--append-confdir"; extra[1] = confdir_a; extra[2] = "--prepend-confdir"; extra[3] = confdir_e; extra[4] = "--confdir"; extra[5] = confdir_b; extra[6] = "--append-confdir"; extra[7] = confdir_f; extra[8] = "--confdir"; extra[9] = confdir_c; extra[10] = "--prepend-confdir"; extra[11] = confdir_d; extra[12] = NULL; start_upstart_common (&upstart_pid, FALSE, FALSE, NULL, logdir, extra); /* Should be running */ assert0 (kill (upstart_pid, 0)); cmd = nih_sprintf (NULL, "%s list 2>&1", get_initctl ()); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); qsort (output, lines, sizeof (output[0]), strcmp_compar); TEST_EQ (lines, 5); TEST_STR_MATCH (output[0], "bar stop/waiting"); TEST_STR_MATCH (output[1], "baz stop/waiting"); TEST_STR_MATCH (output[2], "conflict stop/waiting"); TEST_STR_MATCH (output[3], "foo stop/waiting"); TEST_STR_MATCH (output[4], "wibble stop/waiting"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "conflict"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "conflict"); TEST_STR_MATCH (output[1], " emits confdir_e"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "wibble"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "wibble"); TEST_STR_MATCH (output[1], " emits wobble"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "foo"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "foo"); TEST_STR_MATCH (output[1], " emits hello"); nih_free (output); cmd = nih_sprintf (NULL, "%s show-config %s 2>&1", get_initctl (), "bar"); TEST_NE_P (cmd, NULL); RUN_COMMAND (NULL, cmd, &output, &lines); TEST_EQ (lines, 2); TEST_STR_MATCH (output[0], "bar"); TEST_STR_MATCH (output[1], " emits world"); nih_free (output); DELETE_FILE (confdir_a, "conflict.conf"); DELETE_FILE (confdir_a, "wibble.conf"); DELETE_FILE (confdir_b, "conflict.conf"); DELETE_FILE (confdir_c, "conflict.conf"); DELETE_FILE (confdir_d, "foo.conf"); DELETE_FILE (confdir_e, "bar.conf"); DELETE_FILE (confdir_e, "conflict.conf"); DELETE_FILE (confdir_f, "conflict.conf"); DELETE_FILE (confdir_f, "baz.conf"); STOP_UPSTART (upstart_pid); TEST_DBUS_END (dbus_pid); assert0 (rmdir (confdir_a)); assert0 (rmdir (confdir_b)); assert0 (rmdir (confdir_c)); assert0 (rmdir (confdir_d)); assert0 (rmdir (confdir_e)); assert0 (rmdir (confdir_f)); assert0 (rmdir (xdg_conf_dir)); assert0 (rmdir (logdir)); assert0 (unsetenv ("UPSTART_CONFDIR")); } int main (int argc, char *argv[]) { test_common_setup (); test_confdir (); test_common_cleanup (); return 0; } upstart-1.13.2/init/tests/test_event_operator.c0000664000175000017500000011165412373101356016600 00000000000000/* upstart * * test_event_operator.c - test suite for init/event_operator.c * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include "event_operator.h" #include "blocked.h" #include "parse_job.h" #include "conf.h" #include "test_util_common.h" #include "test_util.h" void test_operator_new (void) { EventOperator *oper; char **env; TEST_FUNCTION ("event_operator_new"); /* Check that we can create a new EventOperator structure to match * an event, and have the details filled in and returned. It * should not be placed into any tree structure. */ TEST_FEATURE ("with EVENT_MATCH"); TEST_ALLOC_FAIL { oper = event_operator_new (NULL, EVENT_MATCH, "test", NULL); if (test_alloc_failed) { TEST_EQ_P (oper, NULL); continue; } TEST_ALLOC_SIZE (oper, sizeof (EventOperator)); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); TEST_EQ (oper->value, FALSE); TEST_EQ_STR (oper->name, "test"); TEST_ALLOC_PARENT (oper->name, oper); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->event, NULL); nih_free (oper); } /* Check that environment passed to event_operator_new is reparented * to belong to the structure itself. */ TEST_FEATURE ("with EVENT_MATCH and environment"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { env = nih_str_array_new (NULL); NIH_MUST (nih_str_array_add (&env, NULL, NULL, "foo")); NIH_MUST (nih_str_array_add (&env, NULL, NULL, "BAR=frodo")); } oper = event_operator_new (NULL, EVENT_MATCH, "test", env); if (test_alloc_failed) { TEST_EQ_P (oper, NULL); TEST_ALLOC_PARENT (env, NULL); nih_free (env); continue; } nih_discard (env); TEST_ALLOC_SIZE (oper, sizeof (EventOperator)); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); TEST_EQ (oper->value, FALSE); TEST_EQ_STR (oper->name, "test"); TEST_ALLOC_PARENT (oper->name, oper); TEST_EQ_P (oper->env, env); TEST_ALLOC_PARENT (oper->env, oper); TEST_EQ_P (oper->event, NULL); nih_free (oper); } /* Check that an ordinary operator needs no name attached. */ TEST_FEATURE ("with EVENT_OR"); TEST_ALLOC_FAIL { oper = event_operator_new (NULL, EVENT_OR, NULL, NULL); if (test_alloc_failed) { TEST_EQ_P (oper, NULL); continue; } TEST_ALLOC_SIZE (oper, sizeof (EventOperator)); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); TEST_EQ (oper->value, FALSE); TEST_EQ_P (oper->name, NULL); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->event, NULL); nih_free (oper); } } void test_operator_copy (void) { EventOperator *oper = NULL, *copy; EventOperator *oper1 = NULL, *oper2 = NULL, *copy1, *copy2; TEST_FUNCTION ("event_operator_copy"); event_init (); /* Check that we can copy a plain event operator, the value should * be copied as well, and the other fields left as NULL. */ TEST_FEATURE ("with EVENT_OR"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { oper = event_operator_new (NULL, EVENT_OR, NULL, NULL); oper->value = TRUE; } copy = event_operator_copy (NULL, oper); if (test_alloc_failed) { TEST_EQ_P (copy, NULL); nih_free (oper); continue; } TEST_ALLOC_SIZE (copy, sizeof (EventOperator)); TEST_EQ_P (copy->node.parent, NULL); TEST_EQ_P (copy->node.left, NULL); TEST_EQ_P (copy->node.right, NULL); TEST_EQ (copy->type, EVENT_OR); TEST_EQ (copy->value, TRUE); TEST_EQ_P (copy->name, NULL); TEST_EQ_P (copy->env, NULL); TEST_EQ_P (copy->event, NULL); nih_free (copy); nih_free (oper); } /* Check that we can copy and EVENT_MATCH operator which does not * have any environment or matched event. */ TEST_FEATURE ("with EVENT_MATCH and no environment or event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { oper = event_operator_new (NULL, EVENT_MATCH, "test", NULL); oper->value = TRUE; } copy = event_operator_copy (NULL, oper); if (test_alloc_failed) { TEST_EQ_P (copy, NULL); nih_free (oper); continue; } TEST_ALLOC_SIZE (copy, sizeof (EventOperator)); TEST_EQ_P (copy->node.parent, NULL); TEST_EQ_P (copy->node.left, NULL); TEST_EQ_P (copy->node.right, NULL); TEST_EQ (copy->type, EVENT_MATCH); TEST_EQ (copy->value, TRUE); TEST_EQ_STR (copy->name, "test"); TEST_ALLOC_PARENT (copy->name, copy); TEST_EQ_P (copy->env, NULL); TEST_EQ_P (copy->event, NULL); nih_free (copy); nih_free (oper); } /* Check that environment to an EVENT_MATCH operator are also copied, * and each entry within the array copied too. */ TEST_FEATURE ("with EVENT_MATCH and environment"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { oper = event_operator_new (NULL, EVENT_MATCH, "test", NULL); oper->value = TRUE; NIH_MUST (nih_str_array_add (&oper->env, oper, NULL, "FOO=foo")); NIH_MUST (nih_str_array_add (&oper->env, oper, NULL, "BAR=bar")); } copy = event_operator_copy (NULL, oper); if (test_alloc_failed) { TEST_EQ_P (copy, NULL); nih_free (oper); continue; } TEST_ALLOC_SIZE (copy, sizeof (EventOperator)); TEST_EQ_P (copy->node.parent, NULL); TEST_EQ_P (copy->node.left, NULL); TEST_EQ_P (copy->node.right, NULL); TEST_EQ (copy->type, EVENT_MATCH); TEST_EQ (copy->value, TRUE); TEST_EQ_STR (copy->name, "test"); TEST_ALLOC_PARENT (copy->name, copy); TEST_ALLOC_PARENT (copy->env, copy); TEST_ALLOC_SIZE (copy->env, sizeof (char *) * 3); TEST_ALLOC_PARENT (copy->env[0], copy->env); TEST_ALLOC_PARENT (copy->env[1], copy->env); TEST_EQ_STR (copy->env[0], "FOO=foo"); TEST_EQ_STR (copy->env[1], "BAR=bar"); TEST_EQ_P (copy->env[2], NULL); TEST_EQ_P (copy->event, NULL); nih_free (copy); nih_free (oper); } /* Check that if the EVENT_MATCH operator has a referenced event, * the event is copied and referenced a second time. */ TEST_FEATURE ("with EVENT_MATCH and referenced event"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { oper = event_operator_new (NULL, EVENT_MATCH, "test", NULL); oper->value = TRUE; oper->event = event_new (oper, "test", NULL); event_block (oper->event); } copy = event_operator_copy (NULL, oper); if (test_alloc_failed) { TEST_EQ_P (copy, NULL); nih_free (oper); continue; } TEST_ALLOC_SIZE (copy, sizeof (EventOperator)); TEST_EQ_P (copy->node.parent, NULL); TEST_EQ_P (copy->node.left, NULL); TEST_EQ_P (copy->node.right, NULL); TEST_EQ (copy->type, EVENT_MATCH); TEST_EQ (copy->value, TRUE); TEST_EQ_STR (copy->name, "test"); TEST_ALLOC_PARENT (copy->name, copy); TEST_EQ_P (copy->env, NULL); TEST_EQ_P (copy->event, oper->event); TEST_EQ (copy->event->blockers, 2); nih_free (copy); nih_free (oper); } /* Check that if the operator has children, these are copied as * well, including their state. */ TEST_FEATURE ("with children"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { oper = event_operator_new (NULL, EVENT_OR, NULL, NULL); oper->value = TRUE; oper1 = event_operator_new (NULL, EVENT_MATCH, "foo", NULL); oper1->value = TRUE; oper1->event = event_new (oper1, "foo", NULL); event_block (oper1->event); nih_tree_add (&oper->node, &oper1->node, NIH_TREE_LEFT); oper2 = event_operator_new (NULL, EVENT_MATCH, "bar", NULL); oper2->value = TRUE; oper2->event = event_new (oper2, "foo", NULL); event_block (oper2->event); nih_tree_add (&oper->node, &oper2->node, NIH_TREE_RIGHT); } copy = event_operator_copy (NULL, oper); if (test_alloc_failed) { TEST_EQ_P (copy, NULL); nih_free (oper); TEST_EQ (oper1->event->blockers, 1); nih_free (oper1); TEST_EQ (oper2->event->blockers, 1); nih_free (oper2); continue; } TEST_ALLOC_SIZE (copy, sizeof (EventOperator)); TEST_EQ_P (copy->node.parent, NULL); TEST_NE_P (copy->node.left, NULL); TEST_NE_P (copy->node.right, NULL); TEST_EQ (copy->type, EVENT_OR); TEST_EQ (copy->value, TRUE); TEST_EQ_P (copy->name, NULL); TEST_EQ_P (copy->env, NULL); copy1 = (EventOperator *)copy->node.left; TEST_ALLOC_SIZE (copy1, sizeof (EventOperator)); TEST_ALLOC_PARENT (copy1, copy); TEST_EQ_P (copy1->node.parent, ©->node); TEST_EQ_P (copy1->node.left, NULL); TEST_EQ_P (copy1->node.right, NULL); TEST_EQ (copy1->type, EVENT_MATCH); TEST_EQ (copy1->value, TRUE); TEST_EQ_STR (copy1->name, "foo"); TEST_ALLOC_PARENT (copy1->name, copy1); TEST_EQ_P (copy1->env, NULL); TEST_EQ_P (copy1->event, oper1->event); TEST_EQ (copy1->event->blockers, 2); nih_free (copy1); copy2 = (EventOperator *)copy->node.right; TEST_ALLOC_SIZE (copy2, sizeof (EventOperator)); TEST_ALLOC_PARENT (copy2, copy); TEST_EQ_P (copy2->node.parent, ©->node); TEST_EQ_P (copy2->node.left, NULL); TEST_EQ_P (copy2->node.right, NULL); TEST_EQ (copy2->type, EVENT_MATCH); TEST_EQ (copy2->value, TRUE); TEST_EQ_STR (copy2->name, "bar"); TEST_ALLOC_PARENT (copy2->name, copy2); TEST_EQ_P (copy2->env, NULL); TEST_EQ_P (copy2->event, oper2->event); TEST_EQ (copy2->event->blockers, 2); nih_free (copy2); nih_free (copy); nih_free (oper1); nih_free (oper2); nih_free (oper); } event_poll (); } void test_operator_destroy (void) { EventOperator *oper; Event *event; TEST_FUNCTION ("event_operator_destroy"); /* Check that when an event operator is destroyed, the referenced * event is unblocked and unreferenced. */ TEST_FEATURE ("with referenced event"); oper = event_operator_new (NULL, EVENT_MATCH, "foo", NULL); oper->value = TRUE; event = event_new (NULL, "foo", NULL); oper->event = event; event_block (event); nih_free (oper); TEST_EQ (event->blockers, 0); nih_free (event); /* Check that when an event operator without an event is destroyed, * everything works. */ TEST_FEATURE ("without referenced event"); oper = event_operator_new (NULL, EVENT_MATCH, "foo", NULL); nih_free (oper); event_poll (); } void test_operator_update (void) { EventOperator *oper1, *oper2, *oper3; TEST_FUNCTION ("event_operator_update"); oper1 = event_operator_new (NULL, EVENT_OR, NULL, NULL); oper2 = event_operator_new (NULL, EVENT_MATCH, "foo", NULL); oper3 = event_operator_new (NULL, EVENT_MATCH, "bar", NULL); nih_tree_add (&oper1->node, &oper2->node, NIH_TREE_LEFT); nih_tree_add (&oper1->node, &oper3->node, NIH_TREE_RIGHT); /* Check that EVENT_OR is FALSE if both children are FALSE. */ TEST_FEATURE ("with EVENT_OR and both children FALSE"); oper1->value = oper2->value = oper3->value = FALSE; event_operator_update (oper1); TEST_EQ (oper1->value, FALSE); /* Check that EVENT_OR is TRUE if only the left child is TRUE. */ TEST_FEATURE ("with EVENT_OR and only left child TRUE"); oper1->value = oper3->value = FALSE; oper2->value = TRUE; event_operator_update (oper1); TEST_EQ (oper1->value, TRUE); /* Check that EVENT_OR is TRUE if only the right child is TRUE. */ TEST_FEATURE ("with EVENT_OR and only right child TRUE"); oper1->value = oper2->value = FALSE; oper3->value = TRUE; event_operator_update (oper1); TEST_EQ (oper1->value, TRUE); /* Check that EVENT_OR is TRUE if both children are TRUE. */ TEST_FEATURE ("with EVENT_OR and both children TRUE"); oper1->value = FALSE; oper2->value = oper3->value = TRUE; event_operator_update (oper1); TEST_EQ (oper1->value, TRUE); /* Check that EVENT_AND is FALSE if both children are FALSE. */ TEST_FEATURE ("with EVENT_AND and both children FALSE"); oper1->type = EVENT_AND; oper1->value = oper2->value = oper3->value = FALSE; event_operator_update (oper1); TEST_EQ (oper1->value, FALSE); /* Check that EVENT_AND is FALSE if only the left child is TRUE. */ TEST_FEATURE ("with EVENT_AND and only left child TRUE"); oper1->value = oper3->value = FALSE; oper2->value = TRUE; event_operator_update (oper1); TEST_EQ (oper1->value, FALSE); /* Check that EVENT_AND is FALSE if only the right child is TRUE. */ TEST_FEATURE ("with EVENT_AND and only right child TRUE"); oper1->value = oper2->value = FALSE; oper3->value = TRUE; event_operator_update (oper1); TEST_EQ (oper1->value, FALSE); /* Check that EVENT_AND is TRUE if both children are TRUE. */ TEST_FEATURE ("with EVENT_AND and both children TRUE"); oper1->value = FALSE; oper2->value = oper3->value = TRUE; event_operator_update (oper1); TEST_EQ (oper1->value, TRUE); nih_free (oper1); nih_free (oper2); nih_free (oper3); } void test_operator_match (void) { EventOperator *oper; Event *event; char *env1[5], *env2[5], *env[4]; TEST_FUNCTION ("event_operator_match"); event = event_new (NULL, "foo", NULL); /* Check that two events with different names do not match. */ TEST_FEATURE ("with different name events"); oper = event_operator_new (NULL, EVENT_MATCH, "bar", NULL); TEST_FALSE (event_operator_match (oper, event, NULL)); nih_free (oper); /* Check that two events with the same names match. */ TEST_FEATURE ("with same name events"); oper = event_operator_new (NULL, EVENT_MATCH, "foo", NULL); TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that two events with the same environment lists match. */ TEST_FEATURE ("with same environment lists"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = NULL; oper->env = env2; oper->env[0] = "FRODO=foo"; oper->env[1] = "BILBO=bar"; oper->env[2] = "MERRY=baz"; oper->env[3] = NULL; TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that two events with the same environment lists but wrong * values do not match. */ TEST_FEATURE ("with environment lists and wrong values"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = NULL; oper->env = env2; oper->env[0] = "FRODO=foo"; oper->env[1] = "BILBO=baz"; oper->env[2] = "MERRY=bar"; oper->env[3] = NULL; TEST_FALSE (event_operator_match (oper, event, NULL)); /* Check that negation permits matching against a value other than * the one given. */ TEST_FEATURE ("with environment lists and wrong values negated"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = NULL; oper->env = env2; oper->env[0] = "FRODO=foo"; oper->env[1] = "BILBO!=baz"; oper->env[2] = "MERRY=baz"; oper->env[3] = NULL; TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that negation means that a matching value is not considered * a match. */ TEST_FEATURE ("with environment lists and correct values negated"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = NULL; oper->env = env2; oper->env[0] = "FRODO=foo"; oper->env[1] = "BILBO!=bar"; oper->env[2] = "MERRY=baz"; oper->env[3] = NULL; TEST_FALSE (event_operator_match (oper, event, NULL)); /* Check that the environment list in the operator may be shorter. */ TEST_FEATURE ("with shorter environment list in operator"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = NULL; oper->env = env2; oper->env[0] = "FRODO=foo"; oper->env[1] = "BILBO=bar"; oper->env[2] = NULL; TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that the operator may match the event's environment list * by value only. */ TEST_FEATURE ("with matching value lists"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = NULL; oper->env = env2; oper->env[0] = "foo"; oper->env[1] = "bar"; oper->env[2] = "baz"; oper->env[3] = NULL; TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that the operator may not match the event's environment list * by value if a value is wrong. */ TEST_FEATURE ("with non-matching value lists"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = NULL; oper->env = env2; oper->env[0] = "foo"; oper->env[1] = "baz"; oper->env[2] = "bar"; oper->env[3] = NULL; TEST_FALSE (event_operator_match (oper, event, NULL)); /* Check that when the operator matches by value, the list of values * may be smaller than the actual environment. */ TEST_FEATURE ("with shorter value list in operator"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = NULL; oper->env = env2; oper->env[0] = "foo"; oper->env[1] = "bar"; oper->env[2] = NULL; TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that the environment list in event may not be shorter. */ TEST_FEATURE ("with shorter list in event"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = NULL; oper->env = env2; oper->env[0] = "foo"; oper->env[1] = "bar"; oper->env[2] = "baz"; oper->env[3] = NULL; TEST_FALSE (event_operator_match (oper, event, NULL)); /* Check that two events with the same environment lists match * in any order. */ TEST_FEATURE ("with different order environment lists"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = NULL; oper->env = env2; oper->env[0] = "BILBO=bar"; oper->env[1] = "FRODO=foo"; oper->env[2] = "MERRY=baz"; oper->env[3] = NULL; TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that the operator may match by value until it first matches * by name. */ TEST_FEATURE ("with value list and variable list"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = "MERRY=baz"; event->env[3] = "PIPPIN=quux"; event->env[4] = NULL; oper->env = env2; oper->env[0] = "foo"; oper->env[1] = "bar"; oper->env[2] = "PIPPIN=quux"; oper->env[3] = NULL; TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that unknown variable names never match. */ TEST_FEATURE ("with unknown variable in operator"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = NULL; oper->env = env2; oper->env[0] = "MERRY=baz"; oper->env[1] = NULL; TEST_FALSE (event_operator_match (oper, event, NULL)); /* Check that the operator environment may be globs. */ TEST_FEATURE ("with globs in operator environment"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = NULL; oper->env = env2; oper->env[0] = "BILBO=b?r"; oper->env[1] = NULL; TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that the operator values may be globs. */ TEST_FEATURE ("with globs in operator value"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = NULL; oper->env = env2; oper->env[0] = "f*"; oper->env[1] = NULL; TEST_TRUE (event_operator_match (oper, event, NULL)); /* Check that the operator values may contain variable references * which will be expanded before match. */ TEST_FEATURE ("with variable reference in operator"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = NULL; oper->env = env2; oper->env[0] = "$FOO"; oper->env[1] = NULL; env[0] = "FOO=foo"; env[1] = NULL; TEST_TRUE (event_operator_match (oper, event, env)); /* Check that unknown variable references do not match. */ TEST_FEATURE ("with unknown variable reference in operator"); event->env = env1; event->env[0] = "FRODO=foo"; event->env[1] = "BILBO=bar"; event->env[2] = NULL; oper->env = env2; oper->env[0] = "$WIBBLE"; oper->env[1] = NULL; env[0] = "FOO=foo"; env[1] = NULL; TEST_FALSE (event_operator_match (oper, event, env)); nih_free (oper); nih_free (event); } void test_operator_handle (void) { EventOperator *oper1, *oper2, *oper3, *oper4, *oper5; char *env1[2], *env2[3], *env[2]; Event *event; int ret; TEST_FUNCTION ("event_operator_handle"); oper1 = event_operator_new (NULL, EVENT_OR, NULL, NULL); oper2 = event_operator_new (NULL, EVENT_AND, NULL, NULL); oper3 = event_operator_new (NULL, EVENT_MATCH, "foo", NULL); oper4 = event_operator_new (NULL, EVENT_MATCH, "bar", NULL); oper5 = event_operator_new (NULL, EVENT_MATCH, "baz", NULL); oper5->env = env1; oper5->env[0] = "BAR=$WIBBLE"; oper5->env[1] = NULL; nih_tree_add (&oper1->node, &oper2->node, NIH_TREE_LEFT); nih_tree_add (&oper2->node, &oper3->node, NIH_TREE_LEFT); nih_tree_add (&oper2->node, &oper4->node, NIH_TREE_RIGHT); nih_tree_add (&oper1->node, &oper5->node, NIH_TREE_RIGHT); /* Check that a non-matching event doesn't touch the tree. */ TEST_FEATURE ("with non-matching event"); event = event_new (NULL, "frodo", NULL); ret = event_operator_handle (oper1, event, NULL); TEST_EQ (ret, FALSE); TEST_EQ (oper1->value, FALSE); TEST_EQ (oper2->value, FALSE); TEST_EQ (oper3->value, FALSE); TEST_EQ_P (oper3->event, NULL); TEST_EQ (oper4->value, FALSE); TEST_EQ_P (oper4->event, NULL); TEST_EQ (oper5->value, FALSE); TEST_EQ_P (oper5->event, NULL); TEST_EQ (event->blockers, 0); /* Check that matching an event in the tree results in the event * being referenced and blocked, and stored in the operator. * The tree value should not be updated since the expression is not * TRUE. */ TEST_FEATURE ("with matching event"); event = event_new (NULL, "foo", NULL); ret = event_operator_handle (oper1, event, NULL); TEST_EQ (ret, TRUE); TEST_EQ (oper1->value, FALSE); TEST_EQ (oper2->value, FALSE); TEST_EQ (oper3->value, TRUE); TEST_EQ_P (oper3->event, event); TEST_EQ (oper4->value, FALSE); TEST_EQ_P (oper4->event, NULL); TEST_EQ (oper5->value, FALSE); TEST_EQ_P (oper5->event, NULL); TEST_EQ (event->blockers, 1); /* Check that a duplicate matching event in the tree is not * referenced or blocked since the tree already matched the first. */ TEST_FEATURE ("with duplicate matching event"); event = event_new (NULL, "foo", NULL); TEST_FREE_TAG (oper3->event); ret = event_operator_handle (oper1, event, NULL); TEST_EQ (ret, FALSE); TEST_EQ (oper1->value, FALSE); TEST_EQ (oper2->value, FALSE); TEST_EQ (oper3->value, TRUE); TEST_NE_P (oper3->event, event); TEST_NOT_FREE (oper3->event); TEST_EQ (oper4->value, FALSE); TEST_EQ_P (oper4->event, NULL); TEST_EQ (oper5->value, FALSE); TEST_EQ_P (oper5->event, NULL); TEST_EQ (event->blockers, 0); nih_free (event); /* Check that matching an event in the tree results in the event * being referenced and blocked, and stored in the operator. * Since the event tips the balance, it should update the expression. */ TEST_FEATURE ("with matching event and complete expression"); event = event_new (NULL, "bar", NULL); ret = event_operator_handle (oper1, event, NULL); TEST_EQ (ret, TRUE); TEST_EQ (oper1->value, TRUE); TEST_EQ (oper2->value, TRUE); TEST_EQ (oper3->value, TRUE); TEST_NE_P (oper3->event, NULL); TEST_EQ (oper4->value, TRUE); TEST_EQ_P (oper4->event, event); TEST_EQ (oper5->value, FALSE); TEST_EQ_P (oper5->event, NULL); TEST_EQ (event->blockers, 1); event_operator_reset (oper1); /* Check that an environment array is passed through and used to * match the expression. */ TEST_FEATURE ("with environment"); event = event_new (NULL, "baz", NULL); event->env = env2; event->env[0] = "FOO=bar"; event->env[1] = "BAR=baz"; event->env[2] = NULL; env[0] = "WIBBLE=baz"; env[1] = NULL; ret = event_operator_handle (oper1, event, env); TEST_EQ (ret, TRUE); TEST_EQ (oper1->value, TRUE); TEST_EQ (oper2->value, FALSE); TEST_EQ (oper3->value, FALSE); TEST_EQ_P (oper4->event, NULL); TEST_EQ (oper4->value, FALSE); TEST_EQ_P (oper4->event, NULL); TEST_EQ (oper5->value, TRUE); TEST_EQ_P (oper5->event, event); TEST_EQ (event->blockers, 1); event_operator_reset (oper1); nih_free (oper1); nih_free (oper2); nih_free (oper3); nih_free (oper4); nih_free (oper5); event_poll (); } void test_operator_environment (void) { EventOperator *root, *oper1, *oper2, *oper3, *oper4, *oper5, *oper6; Event *event1, *event2, *event3; char **env, **ptr; size_t len; TEST_FUNCTION ("event_operator_environment"); root = event_operator_new (NULL, EVENT_OR, NULL, NULL); oper1 = event_operator_new (root, EVENT_AND, NULL, NULL); oper2 = event_operator_new (root, EVENT_AND, NULL, NULL); oper3 = event_operator_new (root, EVENT_MATCH, "foo", NULL); oper4 = event_operator_new (root, EVENT_MATCH, "bar", NULL); oper5 = event_operator_new (root, EVENT_MATCH, "frodo", NULL); oper6 = event_operator_new (root, EVENT_MATCH, "bilbo", NULL); nih_tree_add (&root->node, &oper1->node, NIH_TREE_LEFT); nih_tree_add (&root->node, &oper2->node, NIH_TREE_RIGHT); nih_tree_add (&oper1->node, &oper3->node, NIH_TREE_LEFT); nih_tree_add (&oper1->node, &oper4->node, NIH_TREE_RIGHT); nih_tree_add (&oper2->node, &oper5->node, NIH_TREE_LEFT); nih_tree_add (&oper2->node, &oper6->node, NIH_TREE_RIGHT); root->value = TRUE; oper1->value = TRUE; oper3->value = TRUE; oper3->event = event1 = event_new (NULL, "foo", NULL); event_block (oper3->event); NIH_MUST (nih_str_array_add (&oper3->event->env, oper3->event, NULL, "FOO=APPLE")); NIH_MUST (nih_str_array_add (&oper3->event->env, oper3->event, NULL, "TEA=YES")); oper4->value = TRUE; oper4->event = event2 = event_new (NULL, "bar", NULL); event_block (oper4->event); NIH_MUST (nih_str_array_add (&oper4->event->env, oper4->event, NULL, "BAR=ORANGE")); NIH_MUST (nih_str_array_add (&oper4->event->env, oper4->event, NULL, "COFFEE=NO")); oper6->value = TRUE; oper6->event = event3 = event_new (NULL, "bilbo", NULL); event_block (oper6->event); NIH_MUST (nih_str_array_add (&oper6->event->env, oper6->event, NULL, "FRODO=BAGGINS")); NIH_MUST (nih_str_array_add (&oper6->event->env, oper6->event, NULL, "BILBO=WIBBLE")); /* Check that the environment from each of the events is appended * to the passed array; except for the event that was matched but not * in the true tree. */ TEST_FEATURE ("with environment table"); TEST_ALLOC_FAIL { env = NULL; len = 0; ptr = event_operator_environment (root, &env, NULL, &len, NULL); if (test_alloc_failed) { TEST_EQ_P (ptr, NULL); if (env) nih_free (env); continue; } TEST_NE_P (env, NULL); TEST_ALLOC_SIZE (env, sizeof (char *) * 5); TEST_EQ (len, 4); TEST_ALLOC_PARENT (env[0], env); TEST_EQ_STR (env[0], "FOO=APPLE"); TEST_ALLOC_PARENT (env[1], env); TEST_EQ_STR (env[1], "TEA=YES"); TEST_ALLOC_PARENT (env[2], env); TEST_EQ_STR (env[2], "BAR=ORANGE"); TEST_ALLOC_PARENT (env[3], env); TEST_EQ_STR (env[3], "COFFEE=NO"); TEST_EQ_P (env[4], NULL); nih_free (env); } /* Check that if we also give the name of an environment variable, * this will contain a space-separated list of the event names. */ TEST_FEATURE ("with environment variable for event list"); TEST_ALLOC_FAIL { env = NULL; len = 0; ptr = event_operator_environment (root, &env, NULL, &len, "UPSTART_EVENTS"); if (test_alloc_failed) { TEST_EQ_P (ptr, NULL); if (env) nih_free (env); continue; } TEST_NE_P (env, NULL); TEST_ALLOC_SIZE (env, sizeof (char *) * 6); TEST_EQ (len, 5); TEST_ALLOC_PARENT (env[0], env); TEST_EQ_STR (env[0], "FOO=APPLE"); TEST_ALLOC_PARENT (env[1], env); TEST_EQ_STR (env[1], "TEA=YES"); TEST_ALLOC_PARENT (env[2], env); TEST_EQ_STR (env[2], "BAR=ORANGE"); TEST_ALLOC_PARENT (env[3], env); TEST_EQ_STR (env[3], "COFFEE=NO"); TEST_ALLOC_PARENT (env[4], env); TEST_EQ_STR (env[4], "UPSTART_EVENTS=foo bar"); TEST_EQ_P (env[5], NULL); nih_free (env); } /* Check that if no events are matched the environment table only * has an empty events list. */ TEST_FEATURE ("with no matches"); TEST_ALLOC_FAIL { env = NULL; len = 0; ptr = event_operator_environment (oper5, &env, NULL, &len, "UPSTART_EVENTS"); if (test_alloc_failed) { TEST_EQ_P (ptr, NULL); if (env) nih_free (env); continue; } TEST_NE_P (env, NULL); TEST_ALLOC_SIZE (env, sizeof (char *) * 2); TEST_EQ (len, 1); TEST_ALLOC_PARENT (env[0], env); TEST_EQ_STR (env[0], "UPSTART_EVENTS="); TEST_EQ_P (env[1], NULL); nih_free (env); } nih_free (root); nih_free (event1); nih_free (event2); nih_free (event3); } void test_operator_events (void) { EventOperator *root, *oper1, *oper2, *oper3, *oper4, *oper5, *oper6; Event *event1, *event2, *event3; NihList *list = NULL; Blocked *blocked; TEST_FUNCTION ("event_operator_events"); root = event_operator_new (NULL, EVENT_OR, NULL, NULL); oper1 = event_operator_new (root, EVENT_AND, NULL, NULL); oper2 = event_operator_new (root, EVENT_AND, NULL, NULL); oper3 = event_operator_new (root, EVENT_MATCH, "foo", NULL); oper4 = event_operator_new (root, EVENT_MATCH, "bar", NULL); oper5 = event_operator_new (root, EVENT_MATCH, "frodo", NULL); oper6 = event_operator_new (root, EVENT_MATCH, "bilbo", NULL); nih_tree_add (&root->node, &oper1->node, NIH_TREE_LEFT); nih_tree_add (&root->node, &oper2->node, NIH_TREE_RIGHT); nih_tree_add (&oper1->node, &oper3->node, NIH_TREE_LEFT); nih_tree_add (&oper1->node, &oper4->node, NIH_TREE_RIGHT); nih_tree_add (&oper2->node, &oper5->node, NIH_TREE_LEFT); nih_tree_add (&oper2->node, &oper6->node, NIH_TREE_RIGHT); root->value = TRUE; oper1->value = TRUE; oper3->value = TRUE; oper3->event = event1 = event_new (NULL, "foo", NULL); event_block (oper3->event); oper4->value = TRUE; oper4->event = event2 = event_new (NULL, "bar", NULL); event_block (oper4->event); oper6->value = TRUE; oper6->event = event3 = event_new (NULL, "bilbo", NULL); event_block (oper6->event); /* Check that the events are appended in tree order to the list * and each event is referenced and blocked; the event that was * matched, but not in the operator tree, should not be added. */ TEST_FEATURE ("with matches in tree"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { list = nih_list_new (NULL); } event_operator_events (root, NULL, list); TEST_LIST_NOT_EMPTY (list); blocked = (Blocked *)list->next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, oper3->event); TEST_EQ (blocked->event->blockers, 2); event_unblock (blocked->event); nih_free (blocked); blocked = (Blocked *)list->next; TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, oper4->event); TEST_EQ (blocked->event->blockers, 2); event_unblock (blocked->event); nih_free (blocked); TEST_LIST_EMPTY (list); TEST_EQ (oper6->event->blockers, 1); nih_free (list); } /* Check that if no events are matched, the list remains empty. */ TEST_FEATURE ("with no matches"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { list = nih_list_new (NULL); } event_operator_events (oper5, NULL, list); TEST_LIST_EMPTY (list); TEST_EQ (oper3->event->blockers, 1); TEST_EQ (oper4->event->blockers, 1); TEST_EQ (oper6->event->blockers, 1); nih_free (list); } nih_free (root); nih_free (event1); nih_free (event2); nih_free (event3); } void test_operator_reset (void) { EventOperator *oper1, *oper2, *oper3, *oper4, *oper5; Event *event1, *event2; /* Check that we can reset all of the operators in the tree, * discarding any events that were referenced or blocked and setting * all the values back to FALSE. */ TEST_FUNCTION ("event_operator_reset"); oper1 = event_operator_new (NULL, EVENT_OR, NULL, NULL); oper2 = event_operator_new (NULL, EVENT_AND, NULL, NULL); oper3 = event_operator_new (NULL, EVENT_MATCH, "foo", NULL); oper4 = event_operator_new (NULL, EVENT_MATCH, "bar", NULL); oper5 = event_operator_new (NULL, EVENT_MATCH, "baz", NULL); nih_tree_add (&oper1->node, &oper2->node, NIH_TREE_LEFT); nih_tree_add (&oper2->node, &oper3->node, NIH_TREE_LEFT); nih_tree_add (&oper2->node, &oper4->node, NIH_TREE_RIGHT); nih_tree_add (&oper1->node, &oper5->node, NIH_TREE_RIGHT); event1 = event_new (NULL, "foo", NULL); event2 = event_new (NULL, "bar", NULL); event_operator_handle (oper1, event1, NULL); event_operator_handle (oper1, event2, NULL); TEST_EQ (oper1->value, TRUE); TEST_EQ (oper2->value, TRUE); TEST_EQ (oper3->value, TRUE); TEST_EQ_P (oper3->event, event1); TEST_EQ (oper4->value, TRUE); TEST_EQ (oper4->event, event2); TEST_EQ (oper5->value, FALSE); TEST_EQ (event1->blockers, 1); TEST_EQ (event2->blockers, 1); event_operator_reset (oper1); TEST_EQ (oper1->value, FALSE); TEST_EQ (oper2->value, FALSE); TEST_EQ (oper3->value, FALSE); TEST_EQ_P (oper3->event, NULL); TEST_EQ (oper4->value, FALSE); TEST_EQ (oper4->event, NULL); TEST_EQ (oper5->value, FALSE); TEST_EQ (event1->blockers, 0); TEST_EQ (event2->blockers, 0); nih_free (oper1); nih_free (oper2); nih_free (oper3); nih_free (oper4); nih_free (oper5); event_poll (); } void test_operator_serialisation (void) { JobClass *job = NULL; EventOperator *oper1, *oper2; nih_local char *oper1_string = NULL; nih_local char *oper2_string = NULL; int ret; struct test_operator { char *description; char *value; }; struct test_operator test_operators[] = { { "with simple operator", "started JOB=second_test\n" }, { "with or operator", "runlevel [23] or not-container" }, { "with and operator", "(local-filesystems and net-device-up)" }, { "with complex operator", "runlevel [23] and (\n" "not-container or\n" "container CONTAINER=lxc or\n" "container CONTAINER=lxc-libvirt)" }, { "with complex operator (2)", "((filesystem " "and runlevel [!06] " "and started dbus " "and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 " "or stopped udev-fallback-graphics)) " "or runlevel PREVLEVEL=S)"}, { "with complex operator (3)", "(started plymouth\n" "and (graphics-device-added PRIMARY_DEVICE_FOR_DISPLAY=1\n" "or drm-device-added PRIMARY_DEVICE_FOR_DISPLAY=1\n" "or stopped udev-fallback-graphics))" }, { "with complex operator (4)", "(startup and\n" "(graphics-device-added PRIMARY_DEVICE_FOR_DISPLAY=1\n" "or drm-device-added PRIMARY_DEVICE_FOR_DISPLAY=1\n" "or stopped udevtrigger or container))"}, { NULL, NULL } }; struct test_operator *test; /* Check correct serialisation/deserialisation of complex * operators, to be sure that we can generate a correct round-trip * during re-exec. */ TEST_FUNCTION ("event_operator_serialisation"); nih_error_init (); job_class_init (); conf_init (); job = job_class_new (NULL, "operator_test", NULL); for (test = test_operators; test && test->value; test++) { json_object *json; TEST_FEATURE (test->description); oper1 = parse_on_simple (job, "start", test->value); TEST_NE_P (oper1, NULL); json = event_operator_serialise_all (oper1); TEST_NE_P (json, NULL); oper2 = event_operator_deserialise_all (job, json); TEST_NE_P (oper2, NULL); /* Test the new, full serialisation format */ ret = event_operator_diff (oper1, oper2); assert0 (ret); /* Test the original string-based serialisation * format. */ oper1_string = event_operator_collapse (oper1); TEST_NE_P (oper1_string, NULL); oper2_string = event_operator_collapse (oper2); TEST_NE_P (oper2_string, NULL); TEST_EQ_STR (oper1_string, oper2_string); json_object_put (json); TEST_EQ (oper1->value, oper2->value); TEST_EQ (oper1->type, oper2->type); if (oper1->name || oper2->name) { TEST_EQ_STR (oper1->name, oper2->name); } /* We don't get to use the macros here because we need to * walk both trees in tandem */ TEST_TWO_TREES_FOREACH (&oper1->node, &oper2->node, iter1, iter2) { EventOperator *oper1_sub = (EventOperator *)iter1; EventOperator *oper2_sub = (EventOperator *)iter2; TEST_EQ (oper1_sub->value, oper2_sub->value); TEST_EQ (oper1_sub->type, oper2_sub->type); if (oper1_sub->name || oper2_sub->name) { TEST_EQ_STR (oper1_sub->name, oper2_sub->name); } } } } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_operator_new (); test_operator_copy (); test_operator_destroy (); test_operator_update (); test_operator_match (); test_operator_handle (); test_operator_environment (); test_operator_events (); test_operator_reset (); test_operator_serialisation (); return 0; } upstart-1.13.2/init/tests/test_parse_conf.c0000664000175000017500000000360512373101356015657 00000000000000/* upstart * * test_parse_conf.c - test suite for init/parse_conf.c * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include "parse_conf.h" #include "conf.h" #include "errors.h" void test_parse_conf (void) { ConfSource *source; ConfFile *file; NihError *err; size_t pos, lineno; char buf[1024]; int ret; TEST_FUNCTION ("parse_conf"); source = conf_source_new (NULL, "/path", CONF_DIR); file = conf_file_new (source, "/path/file"); /* Check that a simple configuration can be parsed. */ TEST_FEATURE ("with simple file"); strcpy (buf, "# nothing to test\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; ret = parse_conf (file, buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_LT (ret, 0); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (ret, 0); } nih_free (source); } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_parse_conf (); return 0; } upstart-1.13.2/init/tests/test_blocked.c0000664000175000017500000002166412373101356015150 00000000000000/* upstart * * test_blocked.c - test suite for init/blocked.c * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include "job_class.h" #include "job.h" #include "event.h" #include "blocked.h" void test_new (void) { Blocked *blocked; JobClass *class; Job *job; Event *event; NihDBusMessage *message = NULL; TEST_FUNCTION ("blocked_new"); /* Check that we can create a new blocked record for a job, with the * details filled in correctly. The returned structure should not be * in a list. */ TEST_FEATURE ("with job"); class = job_class_new (NULL, "test", NULL); job = job_new (class, ""); TEST_ALLOC_FAIL { blocked = blocked_new (NULL, BLOCKED_JOB, job); if (test_alloc_failed) { TEST_EQ_P (blocked, NULL); continue; } TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_LIST_EMPTY (&blocked->entry); TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ_P (blocked->job, job); nih_free (blocked); } nih_free (class); /* Check that we can create a new blocked record for an event, with * the details filled in correctly. The returned structure should * not be in a list. */ TEST_FEATURE ("with event"); event = event_new (NULL, "foo", NULL); TEST_ALLOC_FAIL { blocked = blocked_new (NULL, BLOCKED_EVENT, event); if (test_alloc_failed) { TEST_EQ_P (blocked, NULL); continue; } TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_LIST_EMPTY (&blocked->entry); TEST_EQ (blocked->type, BLOCKED_EVENT); TEST_EQ_P (blocked->event, event); nih_free (blocked); } nih_free (event); /* Check that we can create a new blocked record for a D-Bus message, * with the details filled in correctly and the D-Bus message * referenced. The returned structure should not be in a list. */ TEST_FEATURE ("with D-Bus EmitEvent method"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } TEST_FREE_TAG (message); blocked = blocked_new (NULL, BLOCKED_EMIT_METHOD, message); if (test_alloc_failed) { TEST_EQ_P (blocked, NULL); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); continue; } TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_LIST_EMPTY (&blocked->entry); TEST_EQ (blocked->type, BLOCKED_EMIT_METHOD); TEST_EQ_P (blocked->message, message); nih_discard (message); TEST_NOT_FREE (message); nih_free (blocked); TEST_FREE (message); } /* Check that we can create a new blocked record for a D-Bus message, * with the details filled in correctly and the D-Bus message * referenced. The returned structure should not be in a list. */ TEST_FEATURE ("with D-Bus Instance.Start method"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } TEST_FREE_TAG (message); blocked = blocked_new (NULL, BLOCKED_INSTANCE_START_METHOD, message); if (test_alloc_failed) { TEST_EQ_P (blocked, NULL); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); continue; } TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_LIST_EMPTY (&blocked->entry); TEST_EQ (blocked->type, BLOCKED_INSTANCE_START_METHOD); TEST_EQ_P (blocked->message, message); nih_discard (message); TEST_NOT_FREE (message); nih_free (blocked); TEST_FREE (message); } /* Check that we can create a new blocked record for a D-Bus message, * with the details filled in correctly and the D-Bus message * referenced. The returned structure should not be in a list. */ TEST_FEATURE ("with D-Bus Instance.Stop method"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } TEST_FREE_TAG (message); blocked = blocked_new (NULL, BLOCKED_INSTANCE_STOP_METHOD, message); if (test_alloc_failed) { TEST_EQ_P (blocked, NULL); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); continue; } TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_LIST_EMPTY (&blocked->entry); TEST_EQ (blocked->type, BLOCKED_INSTANCE_STOP_METHOD); TEST_EQ_P (blocked->message, message); nih_discard (message); TEST_NOT_FREE (message); nih_free (blocked); TEST_FREE (message); } /* Check that we can create a new blocked record for a D-Bus message, * with the details filled in correctly and the D-Bus message * referenced. The returned structure should not be in a list. */ TEST_FEATURE ("with D-Bus Instance.Restart method"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } TEST_FREE_TAG (message); blocked = blocked_new (NULL, BLOCKED_INSTANCE_RESTART_METHOD, message); if (test_alloc_failed) { TEST_EQ_P (blocked, NULL); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); continue; } TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_LIST_EMPTY (&blocked->entry); TEST_EQ (blocked->type, BLOCKED_INSTANCE_RESTART_METHOD); TEST_EQ_P (blocked->message, message); nih_discard (message); TEST_NOT_FREE (message); nih_free (blocked); TEST_FREE (message); } /* Check that we can create a new blocked record for a D-Bus message, * with the details filled in correctly and the D-Bus message * referenced. The returned structure should not be in a list. */ TEST_FEATURE ("with D-Bus Job.Start method"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } TEST_FREE_TAG (message); blocked = blocked_new (NULL, BLOCKED_JOB_START_METHOD, message); if (test_alloc_failed) { TEST_EQ_P (blocked, NULL); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); continue; } TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_LIST_EMPTY (&blocked->entry); TEST_EQ (blocked->type, BLOCKED_JOB_START_METHOD); TEST_EQ_P (blocked->message, message); nih_discard (message); TEST_NOT_FREE (message); nih_free (blocked); TEST_FREE (message); } /* Check that we can create a new blocked record for a D-Bus message, * with the details filled in correctly and the D-Bus message * referenced. The returned structure should not be in a list. */ TEST_FEATURE ("with D-Bus Job.Stop method"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } TEST_FREE_TAG (message); blocked = blocked_new (NULL, BLOCKED_JOB_STOP_METHOD, message); if (test_alloc_failed) { TEST_EQ_P (blocked, NULL); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); continue; } TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_LIST_EMPTY (&blocked->entry); TEST_EQ (blocked->type, BLOCKED_JOB_STOP_METHOD); TEST_EQ_P (blocked->message, message); nih_discard (message); TEST_NOT_FREE (message); nih_free (blocked); TEST_FREE (message); } /* Check that we can create a new blocked record for a D-Bus message, * with the details filled in correctly and the D-Bus message * referenced. The returned structure should not be in a list. */ TEST_FEATURE ("with D-Bus Job.Restart method"); TEST_ALLOC_FAIL { TEST_ALLOC_SAFE { message = nih_new (NULL, NihDBusMessage); message->connection = NULL; message->message = NULL; } TEST_FREE_TAG (message); blocked = blocked_new (NULL, BLOCKED_JOB_RESTART_METHOD, message); if (test_alloc_failed) { TEST_EQ_P (blocked, NULL); TEST_NOT_FREE (message); nih_discard (message); TEST_FREE (message); continue; } TEST_ALLOC_SIZE (blocked, sizeof (Blocked)); TEST_LIST_EMPTY (&blocked->entry); TEST_EQ (blocked->type, BLOCKED_JOB_RESTART_METHOD); TEST_EQ_P (blocked->message, message); nih_discard (message); TEST_NOT_FREE (message); nih_free (blocked); TEST_FREE (message); } } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_new (); return 0; } upstart-1.13.2/init/tests/test_system.c0000664000175000017500000000561212373101356015064 00000000000000/* upstart * * test_system.c - test suite for init/system.c * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include "system.h" void test_kill (void) { pid_t pid1, pid2, pid3; int ret, status; TEST_FUNCTION ("system_kill"); /* Check that when we normally kill the process, the TERM signal * is sent to all processes in its process group. */ TEST_FEATURE ("with TERM signal"); TEST_CHILD (pid1) { pause (); } TEST_CHILD (pid2) { pause (); } setpgid (pid1, pid1); setpgid (pid2, pid1); ret = system_kill (pid1, SIGTERM); waitpid (pid1, &status, 0); TEST_EQ (ret, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGTERM); waitpid (pid2, &status, 0); TEST_EQ (ret, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGTERM); /* Check that when we force the kill, the KILL signal is sent * instead. */ TEST_FEATURE ("with KILL signal"); TEST_CHILD (pid1) { pause (); } TEST_CHILD (pid2) { pause (); } setpgid (pid1, pid1); setpgid (pid2, pid1); ret = system_kill (pid1, SIGKILL); waitpid (pid1, &status, 0); TEST_EQ (ret, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGKILL); waitpid (pid2, &status, 0); TEST_EQ (ret, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGKILL); /* Check that we can still send the signal to the process group * when the leader is no longer around. */ TEST_FEATURE ("with no group leader"); TEST_CHILD (pid1) { pause (); } TEST_CHILD (pid2) { pause (); } TEST_CHILD (pid3) { pause (); } setpgid (pid1, pid1); setpgid (pid2, pid1); setpgid (pid3, pid1); kill (pid1, SIGTERM); waitpid (pid1, &status, 0); ret = system_kill (pid2, SIGTERM); waitpid (pid2, &status, 0); TEST_EQ (ret, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGTERM); waitpid (pid3, &status, 0); TEST_EQ (ret, 0); TEST_TRUE (WIFSIGNALED (status)); TEST_EQ (WTERMSIG (status), SIGTERM); } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_kill (); return 0; } upstart-1.13.2/init/tests/test_process.c0000664000175000017500000001032412373101356015212 00000000000000/* upstart * * test_process.c - test suite for init/process.c * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include "process.h" void test_new (void) { Process *process; /* Check that we can create a new Process structure; the structure * should be allocated with nih_alloc and have sensible defaults. */ TEST_FUNCTION ("process_new"); TEST_ALLOC_FAIL { process = process_new (NULL); if (test_alloc_failed) { TEST_EQ_P (process, NULL); continue; } TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_EQ_P (process->command, NULL); nih_free (process); } } void test_name (void) { const char *name; TEST_FUNCTION ("process_name"); /* Check that PROCESS_MAIN returns the right string. */ TEST_FEATURE ("with main process"); name = process_name (PROCESS_MAIN); TEST_EQ_STR (name, "main"); /* Check that PROCESS_SECURITY returns the right string. */ TEST_FEATURE ("with security process"); name = process_name (PROCESS_SECURITY); TEST_EQ_STR (name, "security"); /* Check that PROCESS_PRE_START returns the right string. */ TEST_FEATURE ("with pre-start process"); name = process_name (PROCESS_PRE_START); TEST_EQ_STR (name, "pre-start"); /* Check that PROCESS_POST_START returns the right string. */ TEST_FEATURE ("with post-start process"); name = process_name (PROCESS_POST_START); TEST_EQ_STR (name, "post-start"); /* Check that PROCESS_PRE_STOP returns the right string. */ TEST_FEATURE ("with pre-stop process"); name = process_name (PROCESS_PRE_STOP); TEST_EQ_STR (name, "pre-stop"); /* Check that PROCESS_POST_STOP returns the right string. */ TEST_FEATURE ("with post-stop process"); name = process_name (PROCESS_POST_STOP); TEST_EQ_STR (name, "post-stop"); /* Check that an invalid process returns NULL. */ TEST_FEATURE ("with invalid process"); name = process_name (1234); TEST_EQ_P (name, NULL); } void test_from_name (void) { ProcessType process; TEST_FUNCTION ("process_from_name"); /* Check that PROCESS_MAIN is returned for the string. */ TEST_FEATURE ("with main process"); process = process_from_name ("main"); TEST_EQ (process, PROCESS_MAIN); /* Check that PROCESS_SECURITY is returned for the string. */ TEST_FEATURE ("with security process"); process = process_from_name ("security"); TEST_EQ (process, PROCESS_SECURITY); /* Check that PROCESS_PRE_START is returned for the string. */ TEST_FEATURE ("with pre-start process"); process = process_from_name ("pre-start"); TEST_EQ (process, PROCESS_PRE_START); /* Check that PROCESS_POST_START is returned for the string. */ TEST_FEATURE ("with post-start process"); process = process_from_name ("post-start"); TEST_EQ (process, PROCESS_POST_START); /* Check that PROCESS_PRE_STOP is returned for the string. */ TEST_FEATURE ("with pre-stop process"); process = process_from_name ("pre-stop"); TEST_EQ (process, PROCESS_PRE_STOP); /* Check that PROCESS_POST_STOP is returned for the string. */ TEST_FEATURE ("with post-stop process"); process = process_from_name ("post-stop"); TEST_EQ (process, PROCESS_POST_STOP); /* Check that -1 is returned for an invalid string. */ TEST_FEATURE ("with invalid process"); process = process_from_name ("wibble"); TEST_EQ (process, (ProcessType)-1); } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_new (); test_name (); test_from_name (); return 0; } upstart-1.13.2/init/tests/test_conf_preload.sh.in0000664000175000017500000000377512373101356017000 00000000000000#!/bin/sh -e #--------------------------------------------------------------------- # Script to run a test in a modified environment where inotify can be # disabled. #--------------------------------------------------------------------- # Copyright (C) 2013 Canonical Ltd. # # Author: James Hunt # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # #--------------------------------------------------------------------- die() { msg="$*" echo "ERROR: $msg" >&2 exit 1 } # Name of test to run in modified environment test_name=test_conf build_dir="@abs_builddir@" test_path="$build_dir/$test_name" preload_library="$build_dir/@inotify_preload_library@" for file in "$test_path" "$preload_library" do [ -e "$file" ] || die "file $file not found" done # Install the preload library to a temporary location since we need the # full path to the shared library for LD_PRELOAD. install_dir=$(mktemp -d --tmpdir="$builddir") libtool --mode=install install \ "$preload_library" "$install_dir" >/dev/null 2>&1 installed_lib=$(basename "$preload_library") installed_so="$install_dir/$(echo "$installed_lib"|cut -d\. -f1).so" [ -f "$installed_so" ] || die "cannot find $installed_so" echo echo "INFO: Running test $test_name in LD_PRELOAD environment which allows inotify to be disabled/enabled" echo # Run test in modified environment LD_PRELOAD=$installed_so $test_path # clean up libtool --mode=uninstall \ rm "$install_dir/$installed_lib" >/dev/null 2>&1 upstart-1.13.2/init/tests/data/0000775000175000017500000000000012402042412013310 500000000000000upstart-1.13.2/init/tests/data/upstart-session.json0000664000175000017500000321735712373101356017342 00000000000000{ "sessions" : [ { "chroot" : "/mnt", "conf_path" : "/mnt/etc/init" } ], "conf_sources" : [ { "conf_files" : [], "session" : 0, "flag" : 1, "type" : "CONF_FILE", "path" : "/etc/init.conf" }, { "conf_files" : [ { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups" }, "flag" : 1, "path" : "/etc/init/cups.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "setvtrgb" }, "flag" : 1, "path" : "/etc/init/setvtrgb.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "startpar-bridge" }, "flag" : 1, "path" : "/etc/init/startpar-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty5" }, "flag" : 1, "path" : "/etc/init/tty5.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dmesg" }, "flag" : 1, "path" : "/etc/init/dmesg.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "friendly-recovery" }, "flag" : 1, "path" : "/etc/init/friendly-recovery.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface" }, "flag" : 1, "path" : "/etc/init/network-interface.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-stop" }, "flag" : 1, "path" : "/etc/init/plymouth-stop.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "procps" }, "flag" : 1, "path" : "/etc/init/procps.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rsyslog" }, "flag" : 1, "path" : "/etc/init/rsyslog.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "systemd-logind" }, "flag" : 1, "path" : "/etc/init/systemd-logind.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev" }, "flag" : 1, "path" : "/etc/init/udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "atd" }, "flag" : 1, "path" : "/etc/init/atd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "/etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty2" }, "flag" : 1, "path" : "/etc/init/tty2.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty6" }, "flag" : 1, "path" : "/etc/init/tty6.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "anacron" }, "flag" : 1, "path" : "/etc/init/anacron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-reboot" }, "flag" : 1, "path" : "/etc/init/mountall-reboot.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "/etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bluetooth" }, "flag" : 1, "path" : "/etc/init/bluetooth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cryptdisks-enable" }, "flag" : 1, "path" : "/etc/init/cryptdisks-enable.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lightdm" }, "flag" : 1, "path" : "/etc/init/lightdm.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "/etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall.sh" }, "flag" : 1, "path" : "/etc/init/mountall.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-dev" }, "flag" : 1, "path" : "/etc/init/mounted-dev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-var" }, "flag" : 1, "path" : "/etc/init/mounted-var.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-container" }, "flag" : 1, "path" : "/etc/init/network-interface-container.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "passwd" }, "flag" : 1, "path" : "/etc/init/passwd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-restore" }, "flag" : 1, "path" : "/etc/init/rfkill-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe" }, "flag" : 1, "path" : "/etc/init/failsafe.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "modemmanager" }, "flag" : 1, "path" : "/etc/init/modemmanager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "/etc/init/mountkernfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "pulseaudio" }, "flag" : 1, "path" : "/etc/init/pulseaudio.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc-sysinit" }, "flag" : 1, "path" : "/etc/init/rc-sysinit.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty1" }, "flag" : 1, "path" : "/etc/init/tty1.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty3" }, "flag" : 1, "path" : "/etc/init/tty3.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "container-detect" }, "flag" : 1, "path" : "/etc/init/container-detect.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe-x" }, "flag" : 1, "path" : "/etc/init/failsafe-x.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hostname" }, "flag" : 1, "path" : "/etc/init/hostname.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-manager" }, "flag" : 1, "path" : "/etc/init/network-manager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "shutdown" }, "flag" : 1, "path" : "/etc/init/shutdown.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "/etc/init/upstart-file-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "/etc/init/bootmisc.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "/etc/init/flush-early-job-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock" }, "flag" : 1, "path" : "/etc/init/hwclock.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "/etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-font" }, "flag" : 1, "path" : "/etc/init/console-font.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console" }, "flag" : 1, "path" : "/etc/init/console.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "irqbalance" }, "flag" : 1, "path" : "/etc/init/irqbalance.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-security" }, "flag" : 1, "path" : "/etc/init/network-interface-security.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "resolvconf" }, "flag" : 1, "path" : "/etc/init/resolvconf.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "apport" }, "flag" : 1, "path" : "/etc/init/apport.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-cups-reload" }, "flag" : 1, "path" : "/etc/init/avahi-cups-reload.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot.sh" }, "flag" : 1, "path" : "/etc/init/checkroot.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-tmp" }, "flag" : 1, "path" : "/etc/init/mounted-tmp.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-store" }, "flag" : 1, "path" : "/etc/init/rfkill-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ubiquity" }, "flag" : 1, "path" : "/etc/init/ubiquity.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cryptdisks-udev" }, "flag" : 1, "path" : "/etc/init/cryptdisks-udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-run" }, "flag" : 1, "path" : "/etc/init/mounted-run.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty4" }, "flag" : 1, "path" : "/etc/init/tty4.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevmonitor" }, "flag" : 1, "path" : "/etc/init/udevmonitor.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevtrigger" }, "flag" : 1, "path" : "/etc/init/udevtrigger.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkfs.sh" }, "flag" : 1, "path" : "/etc/init/checkfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups-browsed" }, "flag" : 1, "path" : "/etc/init/cups-browsed.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-finish" }, "flag" : 1, "path" : "/etc/init/udev-finish.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cron" }, "flag" : 1, "path" : "/etc/init/cron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "kmod" }, "flag" : 1, "path" : "/etc/init/kmod.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-proc" }, "flag" : 1, "path" : "/etc/init/mounted-proc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "wait-for-state" }, "flag" : 1, "path" : "/etc/init/wait-for-state.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "control-alt-delete" }, "flag" : 1, "path" : "/etc/init/control-alt-delete.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-net" }, "flag" : 1, "path" : "/etc/init/mountall-net.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "/etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-splash" }, "flag" : 1, "path" : "/etc/init/plymouth-splash.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc" }, "flag" : 1, "path" : "/etc/init/rc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ufw" }, "flag" : 1, "path" : "/etc/init/ufw.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "/etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-log" }, "flag" : 1, "path" : "/etc/init/plymouth-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-ready" }, "flag" : 1, "path" : "/etc/init/plymouth-ready.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth" }, "flag" : 1, "path" : "/etc/init/plymouth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "/etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "acpid" }, "flag" : 1, "path" : "/etc/init/acpid.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-restore" }, "flag" : 1, "path" : "/etc/init/alsa-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-store" }, "flag" : 1, "path" : "/etc/init/alsa-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-daemon" }, "flag" : 1, "path" : "/etc/init/avahi-daemon.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-setup" }, "flag" : 1, "path" : "/etc/init/console-setup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hybrid-gfx" }, "flag" : 1, "path" : "/etc/init/hybrid-gfx.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "/etc/init/mounted-debugfs.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "/etc/init/mountnfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "networking" }, "flag" : 1, "path" : "/etc/init/networking.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "/etc/init/upstart-udev-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dbus" }, "flag" : 1, "path" : "/etc/init/dbus.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-shell" }, "flag" : 1, "path" : "/etc/init/mountall-shell.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall" }, "flag" : 1, "path" : "/etc/init/mountall.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mtab.sh" }, "flag" : 1, "path" : "/etc/init/mtab.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rcS" }, "flag" : 1, "path" : "/etc/init/rcS.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "whoopsie" }, "flag" : 1, "path" : "/etc/init/whoopsie.conf" } ], "session" : 0, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "/etc/init" }, { "conf_files" : [ { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "alsa-store" }, "flag" : 1, "path" : "/mnt/etc/init/alsa-store.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "container-detect" }, "flag" : 1, "path" : "/mnt/etc/init/container-detect.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "cryptdisks-enable" }, "flag" : 1, "path" : "/mnt/etc/init/cryptdisks-enable.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "cryptdisks-udev" }, "flag" : 1, "path" : "/mnt/etc/init/cryptdisks-udev.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "friendly-recovery" }, "flag" : 1, "path" : "/mnt/etc/init/friendly-recovery.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "lightdm" }, "flag" : 1, "path" : "/mnt/etc/init/lightdm.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "passwd" }, "flag" : 1, "path" : "/mnt/etc/init/passwd.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "alsa-restore" }, "flag" : 1, "path" : "/mnt/etc/init/alsa-restore.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "console-font" }, "flag" : 1, "path" : "/mnt/etc/init/console-font.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "control-alt-delete" }, "flag" : 1, "path" : "/mnt/etc/init/control-alt-delete.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "hwclock" }, "flag" : 1, "path" : "/mnt/etc/init/hwclock.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "hybrid-gfx" }, "flag" : 1, "path" : "/mnt/etc/init/hybrid-gfx.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "kmod" }, "flag" : 1, "path" : "/mnt/etc/init/kmod.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty1" }, "flag" : 1, "path" : "/mnt/etc/init/tty1.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "checkfs.sh" }, "flag" : 1, "path" : "/mnt/etc/init/checkfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-net" }, "flag" : 1, "path" : "/mnt/etc/init/mountall-net.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "/mnt/etc/init/mounted-debugfs.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-dev" }, "flag" : 1, "path" : "/mnt/etc/init/mounted-dev.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rc-sysinit" }, "flag" : 1, "path" : "/mnt/etc/init/rc-sysinit.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-var" }, "flag" : 1, "path" : "/mnt/etc/init/mounted-var.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "/mnt/etc/init/mountkernfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-manager" }, "flag" : 1, "path" : "/mnt/etc/init/network-manager.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "procps" }, "flag" : 1, "path" : "/mnt/etc/init/procps.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "wait-for-state" }, "flag" : 1, "path" : "/mnt/etc/init/wait-for-state.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "avahi-daemon" }, "flag" : 1, "path" : "/mnt/etc/init/avahi-daemon.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "foo" }, "flag" : 1, "path" : "/mnt/etc/init/foo.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty6" }, "flag" : 1, "path" : "/mnt/etc/init/tty6.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "/mnt/etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "/mnt/etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-interface-security" }, "flag" : 1, "path" : "/mnt/etc/init/network-interface-security.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "/mnt/etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udev-finish" }, "flag" : 1, "path" : "/mnt/etc/init/udev-finish.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udevtrigger" }, "flag" : 1, "path" : "/mnt/etc/init/udevtrigger.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "hostname" }, "flag" : 1, "path" : "/mnt/etc/init/hostname.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-log" }, "flag" : 1, "path" : "/mnt/etc/init/plymouth-log.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "cron" }, "flag" : 1, "path" : "/mnt/etc/init/cron.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "cups-browsed" }, "flag" : 1, "path" : "/mnt/etc/init/cups-browsed.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "dmesg" }, "flag" : 1, "path" : "/mnt/etc/init/dmesg.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall.sh" }, "flag" : 1, "path" : "/mnt/etc/init/mountall.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-run" }, "flag" : 1, "path" : "/mnt/etc/init/mounted-run.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth" }, "flag" : 1, "path" : "/mnt/etc/init/plymouth.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "pulseaudio" }, "flag" : 1, "path" : "/mnt/etc/init/pulseaudio.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rsyslog" }, "flag" : 1, "path" : "/mnt/etc/init/rsyslog.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "/mnt/etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "/mnt/etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "/mnt/etc/init/upstart-udev-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "acpid" }, "flag" : 1, "path" : "/mnt/etc/init/acpid.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "/mnt/etc/init/bootmisc.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-shell" }, "flag" : 1, "path" : "/mnt/etc/init/mountall-shell.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-stop" }, "flag" : 1, "path" : "/mnt/etc/init/plymouth-stop.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rfkill-restore" }, "flag" : 1, "path" : "/mnt/etc/init/rfkill-restore.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rfkill-store" }, "flag" : 1, "path" : "/mnt/etc/init/rfkill-store.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "anacron" }, "flag" : 1, "path" : "/mnt/etc/init/anacron.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "bluetooth" }, "flag" : 1, "path" : "/mnt/etc/init/bluetooth.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-tmp" }, "flag" : 1, "path" : "/mnt/etc/init/mounted-tmp.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "/mnt/etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-interface-container" }, "flag" : 1, "path" : "/mnt/etc/init/network-interface-container.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "whoopsie" }, "flag" : 1, "path" : "/mnt/etc/init/whoopsie.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "console-setup" }, "flag" : 1, "path" : "/mnt/etc/init/console-setup.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "console" }, "flag" : 1, "path" : "/mnt/etc/init/console.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "dbus" }, "flag" : 1, "path" : "/mnt/etc/init/dbus.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "/mnt/etc/init/flush-early-job-log.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-ready" }, "flag" : 1, "path" : "/mnt/etc/init/plymouth-ready.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "startpar-bridge" }, "flag" : 1, "path" : "/mnt/etc/init/startpar-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "systemd-logind" }, "flag" : 1, "path" : "/mnt/etc/init/systemd-logind.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty2" }, "flag" : 1, "path" : "/mnt/etc/init/tty2.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udevmonitor" }, "flag" : 1, "path" : "/mnt/etc/init/udevmonitor.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "ufw" }, "flag" : 1, "path" : "/mnt/etc/init/ufw.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "avahi-cups-reload" }, "flag" : 1, "path" : "/mnt/etc/init/avahi-cups-reload.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "checkroot.sh" }, "flag" : 1, "path" : "/mnt/etc/init/checkroot.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "irqbalance" }, "flag" : 1, "path" : "/mnt/etc/init/irqbalance.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall" }, "flag" : 1, "path" : "/mnt/etc/init/mountall.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "/mnt/etc/init/mountnfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-interface" }, "flag" : 1, "path" : "/mnt/etc/init/network-interface.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "networking" }, "flag" : 1, "path" : "/mnt/etc/init/networking.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-splash" }, "flag" : 1, "path" : "/mnt/etc/init/plymouth-splash.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty4" }, "flag" : 1, "path" : "/mnt/etc/init/tty4.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "ubiquity" }, "flag" : 1, "path" : "/mnt/etc/init/ubiquity.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "failsafe-x" }, "flag" : 1, "path" : "/mnt/etc/init/failsafe-x.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rc" }, "flag" : 1, "path" : "/mnt/etc/init/rc.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "setvtrgb" }, "flag" : 1, "path" : "/mnt/etc/init/setvtrgb.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty5" }, "flag" : 1, "path" : "/mnt/etc/init/tty5.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "atd" }, "flag" : 1, "path" : "/mnt/etc/init/atd.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "/mnt/etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "modemmanager" }, "flag" : 1, "path" : "/mnt/etc/init/modemmanager.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-reboot" }, "flag" : 1, "path" : "/mnt/etc/init/mountall-reboot.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-proc" }, "flag" : 1, "path" : "/mnt/etc/init/mounted-proc.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rcS" }, "flag" : 1, "path" : "/mnt/etc/init/rcS.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "/mnt/etc/init/upstart-file-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "cups" }, "flag" : 1, "path" : "/mnt/etc/init/cups.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty3" }, "flag" : 1, "path" : "/mnt/etc/init/tty3.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udev" }, "flag" : 1, "path" : "/mnt/etc/init/udev.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "apport" }, "flag" : 1, "path" : "/mnt/etc/init/apport.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "failsafe" }, "flag" : 1, "path" : "/mnt/etc/init/failsafe.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mtab.sh" }, "flag" : 1, "path" : "/mnt/etc/init/mtab.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "resolvconf" }, "flag" : 1, "path" : "/mnt/etc/init/resolvconf.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "shutdown" }, "flag" : 1, "path" : "/mnt/etc/init/shutdown.conf" } ], "session" : 1, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "/mnt/etc/init" } ], "job_classes" : [ { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-cups-reload", "instance" : "", "description" : "Reload cups, upon starting avahi-daemon to make sure remote queues are populated", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reload cups" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dmitrijs Ledkovs ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/avahi_2dcups_2dreload", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NEW", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 373, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-daemon", "instance" : "", "description" : "mDNS/DNS-SD daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 0, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NEW", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 373, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty4 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 1, "name" : "not-container", "type" : "EVENT_MATCH", "event" : 2 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NEW", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 371, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NEW", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 371, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-cups-reload", "instance" : "", "description" : "Reload cups, upon starting avahi-daemon to make sure remote queues are populated", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reload cups" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dmitrijs Ledkovs ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/avahi_2dcups_2dreload", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-daemon", "instance" : "", "description" : "mDNS/DNS-SD daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/avahi_2ddaemon", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 1, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/rc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/rsyslog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty4 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/tty4", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/udev", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/whoopsie", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-setup", "instance" : "", "description" : "set console keymap", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "irqbalance", "instance" : "", "description" : "CPU interrupts balancing daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\ttest -f /etc/default/irqbalance && . /etc/default/irqbalance\n\n\ttest \"$ENABLED\" != \"0\" || exit 0\n\n\tif test \"$ONESHOT\" != \"0\"; then\n\t\tDOPTIONS=\"--oneshot\"\n\tfi\n\n\texec /usr/sbin/irqbalance $DOPTIONS\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/irqbalance", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "systemd-logind", "instance" : "", "description" : "SystemD login management service", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-logind" }, { "script" : 1, "command" : " # only start if PAM module is actually available, not if libpam-systemd is\n # removed but not purged\n [ -e /lib/*/security/pam_systemd.so ] || { stop; exit 0; }\n\n # this is being done by systemd or mountall usually, but not during\n # upgrades from earlier distro releases\n if ! mountpoint -q /sys/fs/cgroup; then\n mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup\n fi\n mkdir -p /run/systemd\n if ! mountpoint -q /sys/fs/cgroup/systemd; then\n mkdir -p /sys/fs/cgroup/systemd\n mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 16384, "rlim_max" : 16384 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "SYSTEMD_LOG_TARGET=syslog" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty5 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 1, "name" : "not-container", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/apport", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-setup", "instance" : "", "description" : "set console keymap", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/console_2dsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "irqbalance", "instance" : "", "description" : "CPU interrupts balancing daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\ttest -f /etc/default/irqbalance && . /etc/default/irqbalance\n\n\ttest \"$ENABLED\" != \"0\" || exit 0\n\n\tif test \"$ONESHOT\" != \"0\"; then\n\t\tDOPTIONS=\"--oneshot\"\n\tfi\n\n\texec /usr/sbin/irqbalance $DOPTIONS\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/irqbalance", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "systemd-logind", "instance" : "", "description" : "SystemD login management service", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-logind" }, { "script" : 1, "command" : " # only start if PAM module is actually available, not if libpam-systemd is\n # removed but not purged\n [ -e /lib/*/security/pam_systemd.so ] || { stop; exit 0; }\n\n # this is being done by systemd or mountall usually, but not during\n # upgrades from earlier distro releases\n if ! mountpoint -q /sys/fs/cgroup; then\n mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup\n fi\n mkdir -p /run/systemd\n if ! mountpoint -q /sys/fs/cgroup/systemd; then\n mkdir -p /sys/fs/cgroup/systemd\n mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 16384, "rlim_max" : 16384 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "SYSTEMD_LOG_TARGET=syslog" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/systemd_2dlogind", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty5 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/tty5", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 14393, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=filesystem net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/failsafe/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "failsafe-boot" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/failsafe", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hybrid-gfx", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hybrid-detect" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hybrid_2dgfx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "modemmanager", "instance" : "", "description" : "modem connection manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/modem-manager" }, { "script" : 1, "command" : "[ -x /usr/sbin/modem-manager ] || stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/modemmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-store", "instance" : "", "description" : "store software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n mkdir -p /var/lib/rfkill\n > /var/lib/rfkill/saved-state\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n entry=\"$(cat $device/name) $(cat $device/soft)\"\n echo $entry >> /var/lib/rfkill/saved-state\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/failsafe", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hybrid-gfx", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hybrid-detect" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/hybrid_2dgfx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "modemmanager", "instance" : "", "description" : "modem connection manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/modem-manager" }, { "script" : 1, "command" : "[ -x /usr/sbin/modem-manager ] || stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/modemmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-store", "instance" : "", "description" : "store software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n mkdir -p /var/lib/rfkill\n > /var/lib/rfkill/saved-state\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n entry=\"$(cat $device/name) $(cat $device/soft)\"\n echo $entry >> /var/lib/rfkill/saved-state\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/rfkill_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "atd", "instance" : "", "description" : "deferred execution scheduler", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/atd", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 373, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/dbus/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/dbus", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "failsafe-x", "instance" : "", "description" : "Recovery options if display manager fails to start", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/share/xdiagnose/failsafeXServer \"$JOB\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/failsafe_2dx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "gdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "atd", "instance" : "", "description" : "deferred execution scheduler", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/atd", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/dbus", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "failsafe-x", "instance" : "", "description" : "Recovery options if display manager fails to start", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/share/xdiagnose/failsafeXServer \"$JOB\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/failsafe_2dx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "gdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/resolvconf", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/cow", "MOUNTPOINT=/", "TYPE=overlayfs", "OPTIONS=rw", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-manager", "instance" : "", "description" : "network connection manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 1, "name" : "local-filesystems", "type" : "EVENT_MATCH", "event" : 4 }, { "env" : [ "dbus" ], "value" : 1, "name" : "started", "type" : "EVENT_MATCH", "event" : 6 }, { "value" : 1, "type" : "EVENT_AND" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-manager", "instance" : "", "description" : "network connection manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/network_2dmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-store", "instance" : "", "description" : "save sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl store" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 14517, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/cups-browsed.log", "io_watch_fd" : 30, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=cups", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups-browsed", "instance" : "", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "respawn_interval" : 240, "process" : [ { "script" : 0, "command" : "/usr/sbin/cups-browsed" }, { "script" : 1, "command" : "[ -x /usr/sbin/cups-browsed ]\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Till Kamppeter ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "cups" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "setvtrgb", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "setvtrgb /etc/vtrgb" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/setvtrgb", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "tty1" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-store", "instance" : "", "description" : "save sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl store" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/alsa_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups-browsed", "instance" : "", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "respawn_interval" : 240, "process" : [ { "script" : 0, "command" : "/usr/sbin/cups-browsed" }, { "script" : 1, "command" : "[ -x /usr/sbin/cups-browsed ]\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Till Kamppeter ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/cups_2dbrowsed", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "cups" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "setvtrgb", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "setvtrgb /etc/vtrgb" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/setvtrgb", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "tty1" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-restore", "instance" : "", "description" : "restore sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl restore" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lightdm", "instance" : "", "description" : "LightDM Display Manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Robert Ancell ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 1, "name" : "filesystem", "type" : "EVENT_MATCH", "event" : 5 }, { "env" : [ "[!06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 1, "name" : "started", "type" : "EVENT_MATCH", "event" : 6 }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 1, "name" : "plymouth-ready", "type" : "EVENT_MATCH", "event" : 1 }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "PREVLEVEL=S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-restore", "instance" : "", "description" : "restore sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl restore" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/alsa_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/cron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lightdm", "instance" : "", "description" : "LightDM Display Manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Robert Ancell ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/lightdm", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "[!06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "plymouth-ready", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "PREVLEVEL=S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountall", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/console", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/console", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 373, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bluetooth/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bluetooth", "instance" : "", "description" : "bluetooth daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/bluetoothd" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/cow", "MOUNTPOINT=/", "TYPE=overlayfs", "OPTIONS=rw", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/cow", "MOUNTPOINT=/", "TYPE=overlayfs", "OPTIONS=rw", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dstop", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rcS", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/acpid", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bluetooth", "instance" : "", "description" : "bluetooth daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/bluetoothd" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/bluetooth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/plymouth_2dstop", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/rcS", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/ufw", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "recovery", "startup", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "friendly-recovery", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Only start friendly-recovery when booting in recovery mode\n if ! grep -q \"recovery\" /proc/cmdline; then\n exit 0\n fi\n\n if [ -x /lib/recovery-mode/recovery-menu ]; then\n exec /lib/recovery-mode/recovery-menu\n else\n exec /sbin/sulogin\n fi\n" }, { "script" : 1, "command" : " if plymouth --ping; then\n plymouth hide-splash || true\n fi\n\n # Try to set the hostname and initialize the console\n start hostname || true\n start console-setup || true\n start setvtrgb || true\n\n # Make sure /run contains the required directories for the\n # recovery menu options\n mkdir -p /run/lock /run/shm || true\n\n # Emit the mounted event to trigger resolvconf and mounted-run\n initctl emit mounted MOUNTPOINT=/run || true\n\n # Finally start udev\n start udev || true\n udevadm trigger --action=add || true\n udevadm settle || true\n\n # And turn off kernel messages (to avoid corrupting the menu)\n dmesg --console-off || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if plymouth --ping; then\n plymouth show-splash\nfi\ninitctl emit startup\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/friendly_2drecovery", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "recovery", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc_2dsysinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 1, "name" : "filesystem", "type" : "EVENT_MATCH", "event" : 5 }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "starting-dm" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "env" : [ "gdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "kdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ubiquity", "instance" : "", "description" : "Ubuntu live CD installer", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -x /usr/bin/ubiquity-dm || exit 0\n\n ubiquity=\n automatic=\n debug=\n ldtp=\n noninteractive=\n choose=\n frontend=\n for x in $(cat /proc/cmdline); do\n\tcase $x in\n\t debug-ubiquity)\n\t\tdebug=\"-d\"\n\t\tubiquity=1\n\t\t;;\n\t automatic-ubiquity)\n\t\tautomatic=\"--automatic\"\n\t\tubiquity=1\n\t\t;;\n\t maybe-ubiquity)\n\t\tubiquity=1\n\t\tchoose=\"--greeter\"\n\t\t;;\n\t ldtp-ubiquity)\n\t\tubiquity=1\n\t\tldtp=\"--ldtp\"\n\t\t;;\n\t only-ubiquity)\n\t\tubiquity=1\n\t\t;;\n\t noninteractive)\n\t\tubiquity=1\n\t\tnoninteractive=1\n\t\t;;\n\t ubiquity/frontend=*)\n\t\tfrontend=\"${x#*=}\"\n\t\t;;\n\tesac\n done\n [ \"$ubiquity\" ]\n\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale\n if [ -n \"$LANG\" ]; then\n export LANG\n fi\n if [ -n \"$LANGUAGE\" ]; then\n export LANGUAGE\n fi\n fi\n\n initctl emit starting-dm DM=ubiquity-dm\n\n # turn off console blanking for install process\n setterm -blank 0 > /dev/console\n\n if [ -n \"$noninteractive\" ]; then\n\tplymouth quit || :\n\texec ubiquity noninteractive $debug\n else\n\tif ! ubiquity-dm vt7 :0 ubuntu /usr/bin/ubiquity $debug $automatic $choose $ldtp --only $frontend; then\n\t # has X crashed, or has ubiquity?\n if [ \"$automatic\" ] && ! [ -f /var/log/installer/version ]; then\n # in case we crashed before the X startup sequence\n plymouth quit || :\n exec ubiquity noninteractive $debug\n else\n # something more serious has happened, e.g. debconf locked?!\n exit 1\n fi\n\tfi\n fi\n exit 0\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Ubuntu Installer Team ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 1 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/ubiquity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "recovery", "startup", "mounted" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "friendly-recovery", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Only start friendly-recovery when booting in recovery mode\n if ! grep -q \"recovery\" /proc/cmdline; then\n exit 0\n fi\n\n if [ -x /lib/recovery-mode/recovery-menu ]; then\n exec /lib/recovery-mode/recovery-menu\n else\n exec /sbin/sulogin\n fi\n" }, { "script" : 1, "command" : " if plymouth --ping; then\n plymouth hide-splash || true\n fi\n\n # Try to set the hostname and initialize the console\n start hostname || true\n start console-setup || true\n start setvtrgb || true\n\n # Make sure /run contains the required directories for the\n # recovery menu options\n mkdir -p /run/lock /run/shm || true\n\n # Emit the mounted event to trigger resolvconf and mounted-run\n initctl emit mounted MOUNTPOINT=/run || true\n\n # Finally start udev\n start udev || true\n udevadm trigger --action=add || true\n udevadm settle || true\n\n # And turn off kernel messages (to avoid corrupting the menu)\n dmesg --console-off || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if plymouth --ping; then\n plymouth show-splash\nfi\ninitctl emit startup\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/friendly_2drecovery", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "recovery", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/rc_2dsysinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "starting-dm" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "env" : [ "gdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "kdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ubiquity", "instance" : "", "description" : "Ubuntu live CD installer", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -x /usr/bin/ubiquity-dm || exit 0\n\n ubiquity=\n automatic=\n debug=\n ldtp=\n noninteractive=\n choose=\n frontend=\n for x in $(cat /proc/cmdline); do\n\tcase $x in\n\t debug-ubiquity)\n\t\tdebug=\"-d\"\n\t\tubiquity=1\n\t\t;;\n\t automatic-ubiquity)\n\t\tautomatic=\"--automatic\"\n\t\tubiquity=1\n\t\t;;\n\t maybe-ubiquity)\n\t\tubiquity=1\n\t\tchoose=\"--greeter\"\n\t\t;;\n\t ldtp-ubiquity)\n\t\tubiquity=1\n\t\tldtp=\"--ldtp\"\n\t\t;;\n\t only-ubiquity)\n\t\tubiquity=1\n\t\t;;\n\t noninteractive)\n\t\tubiquity=1\n\t\tnoninteractive=1\n\t\t;;\n\t ubiquity/frontend=*)\n\t\tfrontend=\"${x#*=}\"\n\t\t;;\n\tesac\n done\n [ \"$ubiquity\" ]\n\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale\n if [ -n \"$LANG\" ]; then\n export LANG\n fi\n if [ -n \"$LANGUAGE\" ]; then\n export LANGUAGE\n fi\n fi\n\n initctl emit starting-dm DM=ubiquity-dm\n\n # turn off console blanking for install process\n setterm -blank 0 > /dev/console\n\n if [ -n \"$noninteractive\" ]; then\n\tplymouth quit || :\n\texec ubiquity noninteractive $debug\n else\n\tif ! ubiquity-dm vt7 :0 ubuntu /usr/bin/ubiquity $debug $automatic $choose $ldtp --only $frontend; then\n\t # has X crashed, or has ubiquity?\n if [ \"$automatic\" ] && ! [ -f /var/log/installer/version ]; then\n # in case we crashed before the X startup sequence\n plymouth quit || :\n exec ubiquity noninteractive $debug\n else\n # something more serious has happened, e.g. debconf locked?!\n exit 1\n fi\n\tfi\n fi\n exit 0\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Ubuntu Installer Team ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 1 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/ubiquity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 14507, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups", "instance" : "", "description" : "CUPS printing spooler/server", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cupsd -F" }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "script" : 1, "command" : " # wait until daemon is ready\n timeout=6\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Michael Sweet ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "pulseaudio", "instance" : "", "description" : "System PulseAudio sound server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS" }, { "script" : 0, "command" : "install -d -m755 -o pulse -g pulse /run/pulse" }, { "script" : 1, "command" : "if [ -e /var/run/pulse/.esd_auth ]; then\n\tchown pulse:pulse-access /var/run/pulse/.esd_auth\n\tchmod 640 /var/run/pulse/.esd_auth\nfi\nif [ -e /var/run/pulse/.pulse-cookie ]; then\n\tchown pulse:pulse-access /var/run/pulse/.pulse-cookie\n\tchmod 640 /var/run/pulse/.pulse-cookie\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Pali Rohár ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DISALLOW_MODULE_LOADING=1", "PULSEAUDIO_ARGS=" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/pulseaudio", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NEW", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 373, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "socket" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups", "instance" : "", "description" : "CUPS printing spooler/server", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cupsd -F" }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "script" : 1, "command" : " # wait until daemon is ready\n timeout=6\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Michael Sweet ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/cups", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "pulseaudio", "instance" : "", "description" : "System PulseAudio sound server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS" }, { "script" : 0, "command" : "install -d -m755 -o pulse -g pulse /run/pulse" }, { "script" : 1, "command" : "if [ -e /var/run/pulse/.esd_auth ]; then\n\tchown pulse:pulse-access /var/run/pulse/.esd_auth\n\tchmod 640 /var/run/pulse/.esd_auth\nfi\nif [ -e /var/run/pulse/.pulse-cookie ]; then\n\tchown pulse:pulse-access /var/run/pulse/.pulse-cookie\n\tchmod 640 /var/run/pulse/.pulse-cookie\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Pali Rohár ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DISALLOW_MODULE_LOADING=1", "PULSEAUDIO_ARGS=" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/pulseaudio", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "socket" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "anacron", "instance" : "", "description" : "anac(h)ronistic cron", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "anacron -s" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/anacron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty2 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 1, "name" : "not-container", "type" : "EVENT_MATCH", "event" : 2 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NEW", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 373, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/cow", "MOUNTPOINT=/", "TYPE=overlayfs", "OPTIONS=rw", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "file" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "anacron", "instance" : "", "description" : "anac(h)ronistic cron", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "anacron -s" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/anacron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty2 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/tty2", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "file" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty3 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 1, "name" : "not-container", "type" : "EVENT_MATCH", "event" : 2 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty3 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/tty3", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cryptdisks-udev", "instance" : "$DEVNAME", "description" : "enable encrypted block devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -r /lib/cryptsetup/cryptdisks.functions ] || { stop; exit 0; }\n\n . /lib/cryptsetup/cryptdisks.functions\n\n case \"$CRYPTDISKS_ENABLE\" in\n [Nn]*)\n exit 1\n ;;\n esac\n\n INITSTATE=udev\n crypttab_start_one_disk \"$DEVNAME\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cryptdisks_2dudev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "ID_FS_USAGE=crypto" ], "value" : 0, "name" : "block-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cryptdisks-udev", "instance" : "$DEVNAME", "description" : "enable encrypted block devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -r /lib/cryptsetup/cryptdisks.functions ] || { stop; exit 0; }\n\n . /lib/cryptsetup/cryptdisks.functions\n\n case \"$CRYPTDISKS_ENABLE\" in\n [Nn]*)\n exit 1\n ;;\n esac\n\n INITSTATE=udev\n crypttab_start_one_disk \"$DEVNAME\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/cryptdisks_2dudev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "ID_FS_USAGE=crypto" ], "value" : 0, "name" : "block-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dshell", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=3323", "USEC_INITIALIZED=6174", "UPSTART_EVENTS=net-device-added" ], "name" : "lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:03.0/virtio0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MM_CANDIDATE=1", "ID_MODEL_FROM_DATABASE=Virtio network device", "ID_MODEL_ID=0x1000", "ID_NET_NAME_MAC=enx525400ce12f7", "ID_PCI_CLASS_FROM_DATABASE=Network controller", "ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller", "ID_VENDOR_FROM_DATABASE=Red Hat, Inc", "ID_VENDOR_ID=0x1af4", "IFINDEX=2", "INTERFACE=eth0", "MATCHDEVID=0x0", "MATCHIFTYPE=1", "SEQNUM=3090", "USEC_INITIALIZED=7875", "UPSTART_EVENTS=net-device-added" ], "name" : "eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 0, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 12960, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/plymouth-ready-startup.log", "io_watch_fd" : 28, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "blocking" : [ { "type" : "BLOCKED_EVENT", "data" : { "index" : 0 } } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=startup" ], "name" : "startup", "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dready/startup", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "plymouth-ready" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 3 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 14407, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dupstart_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dupstart_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty1 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 1, "name" : "not-container", "type" : "EVENT_MATCH", "event" : 2 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udevmonitor", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 14565, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/mnt/var/log/upstart/foo.log", "io_watch_fd" : 33, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "blocking" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/foo/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "foo", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "sleep 99999" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/foo", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountall_2dshell", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 1, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/plymouth_2dupstart_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty1 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/tty1", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/udevmonitor", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cryptdisks-enable", "instance" : "", "description" : "enable remaining boot-time encrypted block devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -r /lib/cryptsetup/cryptdisks.functions ] || { stop; exit 0; }\n\n . /lib/cryptsetup/cryptdisks.functions\n\n case \"$CRYPTDISKS_ENABLE\" in\n [Nn]*)\n exit 1\n ;;\n esac\n\n INITSTATE=\"init\"\n do_start\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cryptdisks_2denable", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dmesg", "instance" : "", "description" : "save kernel messages", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/dmesg", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "networking", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/networking/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-restore", "instance" : "", "description" : "restore software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -f /var/lib/rfkill/saved-state ] ||\n [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n while read line; do\n set -- $line\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n if [ -f $device/soft ] &&\n [ \"$(cat $device/name)\" = \"$1\" ]; then\n echo $2 > $device/soft\n fi\n done\n done < /var/lib/rfkill/saved-state\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty6 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 1, "name" : "not-container", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cryptdisks-enable", "instance" : "", "description" : "enable remaining boot-time encrypted block devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -r /lib/cryptsetup/cryptdisks.functions ] || { stop; exit 0; }\n\n . /lib/cryptsetup/cryptdisks.functions\n\n case \"$CRYPTDISKS_ENABLE\" in\n [Nn]*)\n exit 1\n ;;\n esac\n\n INITSTATE=\"init\"\n do_start\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/cryptdisks_2denable", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dmesg", "instance" : "", "description" : "save kernel messages", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/dmesg", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/networking", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-restore", "instance" : "", "description" : "restore software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -f /var/lib/rfkill/saved-state ] ||\n [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n while read line; do\n set -- $line\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n if [ -f $device/soft ] &&\n [ \"$(cat $device/name)\" = \"$1\" ]; then\n echo $2 > $device/soft\n fi\n done\n done < /var/lib/rfkill/saved-state\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/rfkill_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/login -f ubuntu /dev/tty6 2>&1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/tty6", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-font", "instance" : "", "description" : "set console font", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/udev/console-setup-tty fbcon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dfont", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-font", "instance" : "", "description" : "set console font", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/udev/console-setup-tty fbcon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/console_2dfont", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fmnt/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null } ], "events" : [ { "progress" : "EVENT_HANDLING", "session" : 0, "name" : "startup", "blockers" : 1, "failed" : 1, "fd" : -1 }, { "blocking" : [], "progress" : "EVENT_HANDLING", "env" : [], "name" : "plymouth-ready", "blockers" : 1, "failed" : 0, "session" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [], "session" : 0, "name" : "not-container", "blockers" : 6, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=udev-fallback-graphics", "INSTANCE=", "RESULT=failed", "PROCESS=main", "EXIT_STATUS=1" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [], "session" : 0, "name" : "local-filesystems", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [], "session" : 0, "name" : "filesystem", "blockers" : 2, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=dbus", "INSTANCE=" ], "session" : 0, "name" : "started", "blockers" : 2, "failed" : 0, "fd" : -1 } ] } upstart-1.13.2/init/tests/data/upstart-1.8.json0000664000175000017500000072620412373101356016156 00000000000000{ "sessions" : [], "job_classes" : [ { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 925, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopping dbus", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : "stopping dbus", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-daemon", "instance" : "", "description" : "mDNS/DNS-SD daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon", "deleted" : 0, "chdir" : null, "start_on" : "(filesystem and started dbus)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1242, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty4/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and ((not-container or container CONTAINER=lxc) or container CONTAINER=lxc-libvirt))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1456, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "CRASH_DB_URL=https://daisy.ubuntu.com", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/whoopsie/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 28649, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [06]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [06]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 28647, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopped udev", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : "stopped udev", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : "starting udev", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 3475, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [06]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [06]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "deleted" : 0, "chdir" : null, "start_on" : "filesystem", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1247, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty5/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and not-container)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "enabled=1" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/apport/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : "local-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1161, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopping portmap", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEFAULTFILE=/etc/default/nfs-common", "JOB=portmap", "INSTANCE=", "ON_BOOT=y", "UPSTART_EVENTS=local-filesystems started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/statd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "stopping portmap", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "statd", "instance" : "", "description" : "NSM status monitor", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\tif [ -f \"$DEFAULTFILE\" ]; then\n\t . \"$DEFAULTFILE\"\n\tfi\n\n\tif [ \"x$NEED_STATD\" != xno ]; then\n\t\texec rpc.statd -L $STATDOPTS\n\tfi\n" }, { "script" : 1, "command" : "\tif [ -f \"$DEFAULTFILE\" ]; then\n\t . \"$DEFAULTFILE\"\n\tfi\n\n\t[ \"x$NEED_STATD\" != xno ] || { stop; exit 0; }\n\tlogger -t statd-pre-start \"$UPSTART_EVENTS\" || true\n\techo UPSTART_EVENTS = \"$UPSTART_EVENTS\"\n\n exec sm-notify\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULTFILE=/etc/default/nfs-common" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/statd", "deleted" : 0, "chdir" : null, "start_on" : "(started portmap ON_BOOT= or (local-filesystems and started portmap ON_BOOT=y))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 769, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "deconfiguring-networking", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/dbus/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "deconfiguring-networking", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/dbus", "deleted" : 0, "chdir" : null, "start_on" : "local-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1138, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "unmounted-remote-filesystems", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "ON_BOOT=y", "UPSTART_EVENTS=start-rpcbind" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/portmap/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "unmounted-remote-filesystems", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "portmap", "instance" : "", "description" : "RPC portmapper replacement", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "OPTIONS=\"-w\"\nif [ -f /etc/default/rpcbind ]; then\n\t. /etc/default/rpcbind\nelif [ -f /etc/rpcbind.conf ]; then\n\t. /etc/rpcbind.conf\nfi\nexec rpcbind $OPTIONS\n" }, { "script" : 0, "command" : "mkdir -p /run/rpcbind" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Colin Watson ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "ON_BOOT=" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/portmap", "deleted" : 0, "chdir" : null, "start_on" : "start-rpcbind", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [06]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [06]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "deleted" : 0, "chdir" : null, "start_on" : "mounted MOUNTPOINT=/run", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 5400, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/atd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "atd", "instance" : "", "description" : "deferred execution scheduler", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/atd", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1322, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/autofs/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "autofs", "instance" : "", "description" : "Automounter", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ -f /etc/default/autofs ] ; then\n . /etc/default/autofs\nfi\nexec /usr/sbin/automount $OPTIONS\n" }, { "script" : 1, "command" : "modprobe -q autofs4 || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/autofs", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/e6de9a06-e40a-46e5-be9c-61c72a13705c", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : "mounted MOUNTPOINT=/", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "starting rc RUNLEVEL=[016]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "LXC_AUTO=false", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lxc/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "starting rc RUNLEVEL=[016]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lxc", "instance" : "", "description" : "lxc", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -f /etc/default/lxc ] && . /etc/default/lxc\n\n\t[ \"x$LXC_AUTO\" = \"xtrue\" ] || { stop; exit 0; }\n\n\t# don't load profiles if mount mediation is not supported\n\tSYSF=/sys/kernel/security/apparmor/features/mount/mask\n\tif [ -f $SYSF ]; then\n\t\tif [ -x /lib/init/apparmor-profile-load ]; then\n\t\t\t/lib/init/apparmor-profile-load usr.bin.lxc-start\n\t\t\t/lib/init/apparmor-profile-load lxc-containers\n\t\tfi\n\tfi\n\n\tls /etc/lxc/auto/* > /dev/null 2>&1 || exit 0;\n\tfor f in /etc/lxc/auto/*; do\n\t\tc=\"$(basename $f .conf)\"\n\t\tstart lxc-instance NAME=$c CONFIG=$f\n\tdone\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Serge Hallyn ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "LXC_AUTO=false" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lxc", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1177, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopping dbus", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=local-filesystems started static-network-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "stopping dbus", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-manager", "instance" : "", "description" : "network connection manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager", "deleted" : 0, "chdir" : null, "start_on" : "((local-filesystems and started dbus) and static-network-up)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 5435, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/cups-browsed.log", "io_watch_fd" : 16, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [016]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [016]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups-browsed", "instance" : "", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cups-browsed" }, { "script" : 1, "command" : "[ -x /usr/sbin/cups-browsed ]\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 3, "author" : "Till Kamppeter ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed", "deleted" : 0, "chdir" : null, "start_on" : "((filesystem and started avahi-daemon) and (started cups or runlevel [2345]))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1337, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cron/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cron", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1313, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/lightdm.log", "io_watch_fd" : 21, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [016]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "JOB=udev-fallback-graphics", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=filesystem runlevel started stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lightdm/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [016]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lightdm", "instance" : "", "description" : "LightDM Display Manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" } ], "respawn_limit" : 10, "author" : "Robert Ancell ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm", "deleted" : 0, "chdir" : null, "start_on" : "((((filesystem and runlevel [!06]) and started dbus) and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 or stopped udev-fallback-graphics)) or runlevel PREVLEVEL=S)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1304, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/acpid/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 902, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopping dbus", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bluetooth/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "stopping dbus", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bluetooth", "instance" : "", "description" : "bluetooth daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/bluetoothd" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n" } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth", "deleted" : 0, "chdir" : null, "start_on" : "started dbus", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/e6de9a06-e40a-46e5-be9c-61c72a13705c", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : "mounted MOUNTPOINT=/", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/e6de9a06-e40a-46e5-be9c-61c72a13705c", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : "mounted MOUNTPOINT=/", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : "remote-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!023456]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!023456]", "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "deleted" : 0, "chdir" : null, "start_on" : "((starting network-interface or starting network-manager) or starting networking)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 17529, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 535, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "socket" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : "net-device-up IFACE=lo", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 28131, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [016]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [016]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups", "instance" : "", "description" : "CUPS printing spooler/server", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cupsd -F" }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "script" : 1, "command" : " # wait until daemon is ready\n timeout=6\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n echo \"CUPS POST-START DONE\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 3, "author" : "Michael Sweet ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups", "deleted" : 0, "chdir" : null, "start_on" : "((filesystem and started avahi-daemon) and (started dbus or runlevel [2345]))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1262, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty2/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and ((not-container or container CONTAINER=lxc) or container CONTAINER=lxc-libvirt))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 17531, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 535, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=proc", "MOUNTPOINT=/proc", "TYPE=proc", "OPTIONS=nodev,noexec,nosuid", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "file" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : "mounted", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1263, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty3/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and ((not-container or container CONTAINER=lxc) or container CONTAINER=lxc-libvirt))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopped lxc", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "USE_LXC_BRIDGE=false", "LXC_BRIDGE=lxcbr0", "LXC_ADDR=10.0.3.1", "LXC_NETMASK=255.255.255.0", "LXC_NETWORK=10.0.3.0/24", "LXC_DHCP_RANGE=10.0.3.2,10.0.3.254", "LXC_DHCP_MAX=253", "varrun=/var/run/lxc", "JOB=lxc", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lxc_2dnet/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "stopped lxc", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lxc-net", "instance" : "", "description" : "lxc network", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -f /etc/default/lxc ] && . /etc/default/lxc\n\n\t[ \"x$USE_LXC_BRIDGE\" = \"xtrue\" ] || { stop; exit 0; }\n\n\tcleanup() {\n\t\t# dnsmasq failed to start, clean up the bridge\n\t\tiptables -t nat -D POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE || true\n\t\tifconfig ${LXC_BRIDGE} down || true\n\t\tbrctl delbr ${LXC_BRIDGE} || true\n\t}\n\n\tif [ -d /sys/class/net/${LXC_BRIDGE} ]; then\n\t\tif [ ! -f ${varrun}/network_up ]; then\n\t\t\t# bridge exists, but we didn't start it\n\t\t\tstop;\n\t\tfi\n\t\texit 0;\n\tfi\n\n\t# set up the lxc network\n\techo 1 > /proc/sys/net/ipv4/ip_forward\n\tmkdir -p ${varrun}\n\tbrctl addbr ${LXC_BRIDGE}\n\tifconfig ${LXC_BRIDGE} ${LXC_ADDR} netmask ${LXC_NETMASK} up\n\tiptables -t nat -A POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE\n\tdnsmasq -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file=${varrun}/dnsmasq.pid --conf-file= --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override --except-interface=lo --interface=${LXC_BRIDGE} --dhcp-leasefile=/var/lib/misc/dnsmasq.${LXC_BRIDGE}.leases --dhcp-authoritative || cleanup\n\ttouch ${varrun}/network_up\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -f /etc/default/lxc ] && . /etc/default/lxc\n\t[ -f \"${varrun}/network_up\" ] || exit 0;\n\t# if $LXC_BRIDGE has attached interfaces, don't shut it down\n\tls /sys/class/net/${LXC_BRIDGE}/brif/* > /dev/null 2>&1 && exit 0;\n\n\tif [ -d /sys/class/net/${LXC_BRIDGE} ]; then\n\t\tifconfig ${LXC_BRIDGE} down\n\t\tiptables -t nat -D POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE || true\n\t\tpid=`cat ${varrun}/dnsmasq.pid 2>/dev/null` && kill -9 $pid || true\n\t\trm -f ${varrun}/dnsmasq.pid\n\t\tbrctl delbr ${LXC_BRIDGE}\n\tfi\n\trm -f ${varrun}/network_up\n" } ], "respawn_limit" : 10, "author" : "Serge Hallyn ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "USE_LXC_BRIDGE=false", "LXC_BRIDGE=lxcbr0", "LXC_ADDR=10.0.3.1", "LXC_NETMASK=255.255.255.0", "LXC_NETWORK=10.0.3.0/24", "LXC_DHCP_RANGE=10.0.3.2,10.0.3.254", "LXC_DHCP_MAX=253", "varrun=/var/run/lxc" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lxc_2dnet", "deleted" : 0, "chdir" : null, "start_on" : "starting lxc", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 17527, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 535, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dtest_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-test-bridge", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/upstart-test-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dtest_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "net-device-removed INTERFACE=$INTERFACE", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lxcbr0", "DEVPATH=/devices/virtual/net/lxcbr0", "SUBSYSTEM=net", "ACTION=add", "DEVTYPE=bridge", "ID_MM_CANDIDATE=1", "IFINDEX=3", "INTERFACE=lxcbr0", "SEQNUM=1550", "UDEV_LOG=3", "USEC_INITIALIZED=6286474", "UPSTART_EVENTS=net-device-added" ], "name" : "lxcbr0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lxcbr0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "net-device-removed INTERFACE=$INTERFACE", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=1396", "UDEV_LOG=3", "USEC_INITIALIZED=4313914", "UPSTART_EVENTS=net-device-added" ], "name" : "lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "net-device-removed INTERFACE=$INTERFACE", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:03.0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MM_CANDIDATE=1", "ID_MODEL_FROM_DATABASE=82540EM Gigabit Ethernet Controller", "ID_MODEL_ID=/sys/devices/pci0000:00/0000:00:03.0", "ID_VENDOR_FROM_DATABASE=Intel Corporation", "ID_VENDOR_ID=0x8086", "IFINDEX=2", "INTERFACE=eth0", "MATCHADDR=52:54:00:12:34:56", "MATCHIFTYPE=1", "SEQNUM=1246", "UDEV_LOG=3", "USEC_INITIALIZED=3956259", "UPSTART_EVENTS=net-device-added" ], "name" : "eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "net-device-removed INTERFACE=$INTERFACE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : "net-device-added", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 25570, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 1345, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/respawn-test.log", "io_watch_fd" : 14, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/respawn_2dtest/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "respawn-test", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "sleep 999" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/respawn_2dtest", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1522, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=stopped not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty1/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "deleted" : 0, "chdir" : null, "start_on" : "(stopped rc RUNLEVEL=[2345] and ((not-container or container CONTAINER=lxc) or container CONTAINER=lxc-libvirt))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "network-manager", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dmanager", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lxcbr0", "INTERFACE=lxcbr0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lxcbr0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flxcbr0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "networking", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : "((starting network-interface or starting network-manager) or starting networking)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "unmounted-remote-filesystems", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/networking/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "unmounted-remote-filesystems", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "deleted" : 0, "chdir" : null, "start_on" : "((local-filesystems and (stopped udevtrigger or container)) or runlevel [2345])", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1267, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty_2dserial/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty-serial", "instance" : "", "description" : "Maintain a getty on first serial port given as 'console=' kernel argument", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # check for console entry\n [ -z \"`grep console= /proc/cmdline`\" ] && exit 0\n OLD_IFS=$IFS\n\n for arg in $(cat /proc/cmdline)\n do\n case \"$arg\" in\n console=*)\n IFS=','\n set -- ${arg#console=}\n\n # no device specified\n [ -z \"$1\" ] && continue\n \n # handle braille devices\n [ \"$1\" = brl ] && shift\n \n # Extract device name, also handling scenario where user\n # specifies full path to device. Specifying a full path is oddly\n # not valid, but since it's a potentially common scenario, we\n # handle it.\n PORT=${1#/dev/}\n DEVICE=\"/dev/$PORT\"\n \n # device doesn't exist\n [ ! -e \"${DEVICE}\" ] && continue\n \n # only allow authorized terminals\n grep -q \"^${PORT}$\" /etc/securetty || continue\n \n # device already has an associated job\n [ -f /etc/init/$PORT.conf ] && continue\n \n # invalid options specified\n options=\"$2\"\n if [ -n \"$options\" ]; then\n echo \"$options\" | egrep \"[0-9]{4,}(n|o|e)[0-9]r*\" || continue\n fi\n \n # delimit options with commas for easier parsing\n options=$(echo \"$options\" | sed -r \\\n -e 's/^([0-9]{4,})/\\1,/g' \\\n -e 's/(n|o|e)/\\1,/g' \\\n -e 's/(7|8)/\\1,/g')\n IFS=','\n set -- $options\n \n SPEED=\"$1\"\n PARITY=\"$2\"\n BITS=\"$3\"\n FLOW=\"$4\"\n \n GETTY_ARGS=\"\"\n \n [ -z \"$SPEED\" ] && SPEED='115200,57600,38400,19200,9600'\n [ -z \"$BITS\" ] && BITS=8\n [ -n \"$BITS\" -a \"$BITS\" -eq 8 ] && GETTY_ARGS=\"$GETTY_ARGS -8 \"\n [ -n \"$FLOW\" ] && GETTY_ARGS=\"$GETTY_ARGS --flow-control\"\n\texport TERM=linux\n \texport IFS=$OLD_IFS\n\tset > /tmp/james\n GETTY_ARGS=\"$GETTY_ARGS $SPEED $PORT\"\n exec /sbin/getty $GETTY_ARGS\n\tbreak\n ;;\n esac\n done\n ## XXX: WORKS!!\n #export TERM=linux\n #export IFS=$OLD_IFS\n #exec /sbin/getty $GETTY_ARGS\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty_2dserial", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and ((not-container or container CONTAINER=lxc) or container CONTAINER=lxc-libvirt))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1268, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty6/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and not-container)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 906, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 343, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : "unmounted-remote-filesystems", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "PIPEFS_MOUNTPOINT=/run/rpc_pipefs", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/idmapd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "unmounted-remote-filesystems", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "idmapd", "instance" : "", "description" : "NFSv4 id <-> name mapper", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rpc.idmapd" }, { "script" : 1, "command" : "\tdo_modprobe() {\n\t\tmodprobe -q \"$1\" || true\n\t}\n\n\tdo_modprobe nfs\n\tdo_modprobe nfsd\n\n\tdo_modprobe sunrpc\n\n\tif ! mountpoint -q \"$PIPEFS_MOUNTPOINT\"\n\tthen\n\t\tmkdir -p \"$PIPEFS_MOUNTPOINT\"\n\t\tmount -t rpc_pipefs rpc_pipefs \"$PIPEFS_MOUNTPOINT\" || true\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if mountpoint -q \"$PIPEFS_MOUNTPOINT\"\nthen\n\t# ignore any failures caused by the filesystem still\n\t# being in use\n\tumount \"$PIPEFS_MOUNTPOINT\" || true\nfi\n" } ], "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "PIPEFS_MOUNTPOINT=/run/rpc_pipefs" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/idmapd", "deleted" : 0, "chdir" : null, "start_on" : "local-filesystems", "umask" : 18, "setgid" : null } ], "events" : [ { "progress" : "EVENT_HANDLING", "env" : [ "JOB=cups", "INSTANCE=" ], "session" : 0, "name" : "started", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=udev", "INSTANCE=" ], "session" : 0, "name" : "started", "blockers" : 3, "failed" : 0, "fd" : -1 } ] } upstart-1.13.2/init/tests/data/upstart-pre-security.json0000664000175000017500000000403512373101356020272 00000000000000{ "sessions": [ ], "events": [ { "session": 0, "name": "Christmas", "env": [ "JOB=udevtrigger", "INSTANCE=", "RESULT=ok" ], "fd": -1, "progress": "EVENT_HANDLING", "failed": 1, "blockers": 1 } ], "job_classes": [ { "session": 0, "name": "security", "path": "\/com\/ubuntu\/Upstart\/jobs\/security", "instance": "", "jobs": [ { "name": "", "path": "\/com\/ubuntu\/Upstart\/jobs\/security\/_", "goal": "JOB_START", "state": "JOB_RUNNING", "env": [ ], "start_env": [ ], "stop_env": [ ], "stop_on": "runlevel [06]", "fds": [ ], "pid": [ 10, 11, 12, 13, 14 ], "kill_process": "PROCESS_INVALID", "failed": 0, "failed_process": "PROCESS_INVALID", "exit_status": 0, "respawn_time": 0, "respawn_count": 0, "trace_forks": 1, "trace_state": "TRACE_NONE", "log": [ { "path": null }, { "path": null }, { "path": null }, { "path": null }, { "path": null } ] } ], "description": null, "author": null, "version": null, "env": [ ], "export": [ ], "start_on": "virtual-filesystems", "stop_on": "runlevel [06]", "emits": [ ], "process": [ { "script": 0, "command": "a" }, { "script": 0, "command": "b" }, { "script": 0, "command": "c" }, { "script": 0, "command": "d" }, { "script": 0, "command": "e" } ], "expect": "EXPECT_FORK", "task": 0, "kill_timeout": 5, "kill_signal": 15, "respawn": 1, "respawn_limit": 10, "respawn_interval": 5, "normalexit": [ ], "console": "CONSOLE_LOG", "umask": 18, "nice": -21, "oom_score_adj": 0, "limits": [ { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 } ], "chroot": null, "chdir": null, "setuid": null, "setgid": null, "deleted": 0, "debug": 0, "usage": null } ] } upstart-1.13.2/init/tests/data/upstart-1.6.json0000664000175000017500000000373012373101356016144 00000000000000{ "sessions": [ ], "events": [ { "session": 0, "name": "Christmas", "fd": -1, "progress": "EVENT_PENDING", "failed": 0, "blockers": 0, "blocking": [ { "data": { "class": "bar", "name": "" }, "type": "BLOCKED_JOB" } ] } ], "job_classes": [ { "session": 0, "name": "bar", "path": "\/com\/ubuntu\/Upstart\/jobs\/bar", "instance": "", "jobs": [ { "name": "", "path": "\/com\/ubuntu\/Upstart\/jobs\/bar\/_", "goal": "JOB_STOP", "state": "JOB_WAITING", "env": [ ], "start_env": [ ], "stop_env": [ ], "fds": [ ], "pid": [ 0, 0, 0, 0, 0 ], "blocker": 0, "kill_process": "PROCESS_INVALID", "failed": 0, "failed_process": "PROCESS_INVALID", "exit_status": 0, "respawn_time": 0, "respawn_count": 0, "trace_forks": 0, "trace_state": "TRACE_NONE", "log": [ { "path": null }, { "path": null }, { "path": null }, { "path": null }, { "path": null } ] } ], "description": null, "author": null, "version": null, "env": [ ], "export": [ ], "emits": [ ], "process": [ { "script": 0, "command": null }, { "script": 0, "command": null }, { "script": 0, "command": null }, { "script": 0, "command": null }, { "script": 0, "command": null } ], "expect": "EXPECT_NONE", "task": 0, "kill_timeout": 5, "kill_signal": 15, "respawn": 0, "respawn_limit": 10, "respawn_interval": 5, "normalexit": [ ], "console": "CONSOLE_LOG", "umask": 18, "nice": 0, "oom_score_adj": 0, "limits": [ { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 }, { "rlim_cur": 0, "rlim_max": 0 } ], "chroot": null, "chdir": null, "setuid": null, "setgid": null, "deleted": 0, "debug": 0, "usage": null } ] } upstart-1.13.2/init/tests/data/upstart-session-infinity.json0000664000175000017500000446102312373101356021161 00000000000000{ "sessions" : [ { "chroot" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482", "conf_path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init" }, { "chroot" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f", "conf_path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init" } ], "conf_sources" : [ { "conf_files" : [], "session" : 0, "flag" : 1, "type" : "CONF_FILE", "path" : "/etc/init.conf" }, { "conf_files" : [ { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups" }, "flag" : 1, "path" : "/etc/init/cups.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "setvtrgb" }, "flag" : 1, "path" : "/etc/init/setvtrgb.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "startpar-bridge" }, "flag" : 1, "path" : "/etc/init/startpar-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty5" }, "flag" : 1, "path" : "/etc/init/tty5.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "zram-config" }, "flag" : 1, "path" : "/etc/init/zram-config.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dmesg" }, "flag" : 1, "path" : "/etc/init/dmesg.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "friendly-recovery" }, "flag" : 1, "path" : "/etc/init/friendly-recovery.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface" }, "flag" : 1, "path" : "/etc/init/network-interface.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-stop" }, "flag" : 1, "path" : "/etc/init/plymouth-stop.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "pre-start-wrapper" }, "flag" : 1, "path" : "/etc/init/pre-start-wrapper.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "procps" }, "flag" : 1, "path" : "/etc/init/procps.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rsyslog" }, "flag" : 1, "path" : "/etc/init/rsyslog.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "systemd-logind" }, "flag" : 1, "path" : "/etc/init/systemd-logind.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev" }, "flag" : 1, "path" : "/etc/init/udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "winbind" }, "flag" : 1, "path" : "/etc/init/winbind.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "atd" }, "flag" : 1, "path" : "/etc/init/atd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "/etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty2" }, "flag" : 1, "path" : "/etc/init/tty2.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty6" }, "flag" : 1, "path" : "/etc/init/tty6.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "anacron" }, "flag" : 1, "path" : "/etc/init/anacron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-reboot" }, "flag" : 1, "path" : "/etc/init/mountall-reboot.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ssh" }, "flag" : 1, "path" : "/etc/init/ssh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "/etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead-other" }, "flag" : 1, "path" : "/etc/init/ureadahead-other.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "autofs" }, "flag" : 1, "path" : "/etc/init/autofs.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bluetooth" }, "flag" : 1, "path" : "/etc/init/bluetooth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cryptdisks-enable" }, "flag" : 1, "path" : "/etc/init/cryptdisks-enable.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "idmapd" }, "flag" : 1, "path" : "/etc/init/idmapd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lightdm" }, "flag" : 1, "path" : "/etc/init/lightdm.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lxc-net" }, "flag" : 1, "path" : "/etc/init/lxc-net.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "/etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall.sh" }, "flag" : 1, "path" : "/etc/init/mountall.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-dev" }, "flag" : 1, "path" : "/etc/init/mounted-dev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-var" }, "flag" : 1, "path" : "/etc/init/mounted-var.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-container" }, "flag" : 1, "path" : "/etc/init/network-interface-container.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "passwd" }, "flag" : 1, "path" : "/etc/init/passwd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "qemu-kvm" }, "flag" : 1, "path" : "/etc/init/qemu-kvm.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-restore" }, "flag" : 1, "path" : "/etc/init/rfkill-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe" }, "flag" : 1, "path" : "/etc/init/failsafe.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "gssd" }, "flag" : 1, "path" : "/etc/init/gssd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "modemmanager" }, "flag" : 1, "path" : "/etc/init/modemmanager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "/etc/init/mountkernfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "portmap" }, "flag" : 1, "path" : "/etc/init/portmap.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "pulseaudio" }, "flag" : 1, "path" : "/etc/init/pulseaudio.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc-sysinit" }, "flag" : 1, "path" : "/etc/init/rc-sysinit.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "reload-smbd" }, "flag" : 1, "path" : "/etc/init/reload-smbd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty1" }, "flag" : 1, "path" : "/etc/init/tty1.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty3" }, "flag" : 1, "path" : "/etc/init/tty3.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "container-detect" }, "flag" : 1, "path" : "/etc/init/container-detect.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe-x" }, "flag" : 1, "path" : "/etc/init/failsafe-x.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hostname" }, "flag" : 1, "path" : "/etc/init/hostname.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock-save" }, "flag" : 1, "path" : "/etc/init/hwclock-save.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-manager" }, "flag" : 1, "path" : "/etc/init/network-manager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "portmap-wait" }, "flag" : 1, "path" : "/etc/init/portmap-wait.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "shutdown" }, "flag" : 1, "path" : "/etc/init/shutdown.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "statd" }, "flag" : 1, "path" : "/etc/init/statd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "/etc/init/upstart-file-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "/etc/init/bootmisc.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "/etc/init/flush-early-job-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "foo" }, "flag" : 1, "path" : "/etc/init/foo.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock" }, "flag" : 1, "path" : "/etc/init/hwclock.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead" }, "flag" : 1, "path" : "/etc/init/ureadahead.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "binfmt-support" }, "flag" : 1, "path" : "/etc/init/binfmt-support.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "/etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-font" }, "flag" : 1, "path" : "/etc/init/console-font.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console" }, "flag" : 1, "path" : "/etc/init/console.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "irqbalance" }, "flag" : 1, "path" : "/etc/init/irqbalance.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-security" }, "flag" : 1, "path" : "/etc/init/network-interface-security.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "resolvconf" }, "flag" : 1, "path" : "/etc/init/resolvconf.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "apport" }, "flag" : 1, "path" : "/etc/init/apport.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-cups-reload" }, "flag" : 1, "path" : "/etc/init/avahi-cups-reload.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot.sh" }, "flag" : 1, "path" : "/etc/init/checkroot.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "env" }, "flag" : 1, "path" : "/etc/init/env.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "libvirt-bin" }, "flag" : 1, "path" : "/etc/init/libvirt-bin.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-tmp" }, "flag" : 1, "path" : "/etc/init/mounted-tmp.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-store" }, "flag" : 1, "path" : "/etc/init/rfkill-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "statd-mounting" }, "flag" : 1, "path" : "/etc/init/statd-mounting.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ubiquity" }, "flag" : 1, "path" : "/etc/init/ubiquity.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cryptdisks-udev" }, "flag" : 1, "path" : "/etc/init/cryptdisks-udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hostname.sh" }, "flag" : 1, "path" : "/etc/init/hostname.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-run" }, "flag" : 1, "path" : "/etc/init/mounted-run.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty4" }, "flag" : 1, "path" : "/etc/init/tty4.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevmonitor" }, "flag" : 1, "path" : "/etc/init/udevmonitor.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevtrigger" }, "flag" : 1, "path" : "/etc/init/udevtrigger.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cgroup-lite" }, "flag" : 1, "path" : "/etc/init/cgroup-lite.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkfs.sh" }, "flag" : 1, "path" : "/etc/init/checkfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups-browsed" }, "flag" : 1, "path" : "/etc/init/cups-browsed.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lxc" }, "flag" : 1, "path" : "/etc/init/lxc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "nmbd" }, "flag" : 1, "path" : "/etc/init/nmbd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "smbd" }, "flag" : 1, "path" : "/etc/init/smbd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-finish" }, "flag" : 1, "path" : "/etc/init/udev-finish.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "xinetd" }, "flag" : 1, "path" : "/etc/init/xinetd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cron" }, "flag" : 1, "path" : "/etc/init/cron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "kmod" }, "flag" : 1, "path" : "/etc/init/kmod.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lxc-instance" }, "flag" : 1, "path" : "/etc/init/lxc-instance.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-proc" }, "flag" : 1, "path" : "/etc/init/mounted-proc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "screen-cleanup" }, "flag" : 1, "path" : "/etc/init/screen-cleanup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "wait-for-state" }, "flag" : 1, "path" : "/etc/init/wait-for-state.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "control-alt-delete" }, "flag" : 1, "path" : "/etc/init/control-alt-delete.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "gssd-mounting" }, "flag" : 1, "path" : "/etc/init/gssd-mounting.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-net" }, "flag" : 1, "path" : "/etc/init/mountall-net.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "/etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-splash" }, "flag" : 1, "path" : "/etc/init/plymouth-splash.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc" }, "flag" : 1, "path" : "/etc/init/rc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rpcbind-boot" }, "flag" : 1, "path" : "/etc/init/rpcbind-boot.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ufw" }, "flag" : 1, "path" : "/etc/init/ufw.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "/etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-log" }, "flag" : 1, "path" : "/etc/init/plymouth-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-ready" }, "flag" : 1, "path" : "/etc/init/plymouth-ready.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth" }, "flag" : 1, "path" : "/etc/init/plymouth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "/etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "acpid" }, "flag" : 1, "path" : "/etc/init/acpid.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-restore" }, "flag" : 1, "path" : "/etc/init/alsa-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-store" }, "flag" : 1, "path" : "/etc/init/alsa-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-daemon" }, "flag" : 1, "path" : "/etc/init/avahi-daemon.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-setup" }, "flag" : 1, "path" : "/etc/init/console-setup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hybrid-gfx" }, "flag" : 1, "path" : "/etc/init/hybrid-gfx.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "/etc/init/mounted-debugfs.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "/etc/init/mountnfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "networking" }, "flag" : 1, "path" : "/etc/init/networking.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-dbus-bridge" }, "flag" : 1, "path" : "/etc/init/upstart-dbus-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "/etc/init/upstart-udev-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dbus" }, "flag" : 1, "path" : "/etc/init/dbus.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "idmapd-mounting" }, "flag" : 1, "path" : "/etc/init/idmapd-mounting.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-shell" }, "flag" : 1, "path" : "/etc/init/mountall-shell.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall" }, "flag" : 1, "path" : "/etc/init/mountall.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mtab.sh" }, "flag" : 1, "path" : "/etc/init/mtab.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rcS" }, "flag" : 1, "path" : "/etc/init/rcS.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "whoopsie" }, "flag" : 1, "path" : "/etc/init/whoopsie.conf" } ], "session" : 0, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "/etc/init" }, { "conf_files" : [ { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "container-detect" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/container-detect.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/flush-early-job-log.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-net" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountall-net.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-tmp" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mounted-tmp.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "control-alt-delete" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/control-alt-delete.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "hwclock-save" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/hwclock-save.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountkernfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "passwd" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/passwd.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty4" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/tty4.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty5" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/tty5.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udevmonitor" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/udevmonitor.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "failsafe" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/failsafe.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "kmod" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/kmod.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-run" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mounted-run.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty2" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/tty2.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rc" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/rc.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "shutdown" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/shutdown.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountall.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "checkfs.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/checkfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty6" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/tty6.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udevtrigger" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/udevtrigger.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-reboot" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountall-reboot.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mounted-debugfs.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-dev" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mounted-dev.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "networking" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/networking.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rcS" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/rcS.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/bootmisc.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty1" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/tty1.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-interface" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/network-interface.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-stop" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/plymouth-stop.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-splash" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/plymouth-splash.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/plymouth.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "startpar-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/startpar-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-interface-security" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/network-interface-security.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rc-sysinit" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/rc-sysinit.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udev" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/udev.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountnfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-var" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mounted-var.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/upstart-file-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "checkroot.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/checkroot.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mtab.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mtab.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "wait-for-state" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/wait-for-state.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-shell" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountall-shell.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-ready" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/plymouth-ready.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "console" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/console.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mountall.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-proc" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/mounted-proc.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-interface-container" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/network-interface-container.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-log" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/plymouth-log.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "procps" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/procps.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty3" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/tty3.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/upstart-udev-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "hostname" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/hostname.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udev-finish" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/udev-finish.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "hwclock" }, "flag" : 1, "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init/hwclock.conf" } ], "session" : 1, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init" }, { "conf_files" : [ { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "network-interface-container" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/network-interface-container.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "procps" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/procps.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "console" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/console.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountall.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountall.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "wait-for-state" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/wait-for-state.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mounted-proc" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mounted-proc.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mounted-run" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mounted-run.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mounted-var" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mounted-var.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "networking" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/networking.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "plymouth-ready" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/plymouth-ready.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "plymouth-stop" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/plymouth-stop.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "tty3" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/tty3.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/upstart-file-bridge.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "hwclock" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/hwclock.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "tty5" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/tty5.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "udevmonitor" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/udevmonitor.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "hwclock-save" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/hwclock-save.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountnfs.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "rcS" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/rcS.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "tty1" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/tty1.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "tty4" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/tty4.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/bootmisc.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "hostname" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/hostname.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "rc" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/rc.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "udev" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/udev.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "checkfs.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/checkfs.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "control-alt-delete" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/control-alt-delete.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "foo" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/foo.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/upstart-udev-bridge.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountall" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountall.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "network-interface-security" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/network-interface-security.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "tty2" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/tty2.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "passwd" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/passwd.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "plymouth-log" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/plymouth-log.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "rc-sysinit" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/rc-sysinit.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/flush-early-job-log.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mounted-dev" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mounted-dev.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "udevtrigger" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/udevtrigger.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "kmod" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/kmod.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountall-reboot" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountall-reboot.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountall-shell" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountall-shell.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mounted-tmp" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mounted-tmp.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "plymouth" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/plymouth.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "shutdown" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/shutdown.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "checkroot.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/checkroot.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "tty6" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/tty6.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "dbus" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/dbus.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "startpar-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/startpar-bridge.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "udev-finish" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/udev-finish.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "upstart-dbus-bridge" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/upstart-dbus-bridge.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "container-detect" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/container-detect.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mtab.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mtab.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "network-interface" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/network-interface.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "failsafe" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/failsafe.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mounted-debugfs.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountkernfs.sh.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "plymouth-splash" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/plymouth-splash.conf" }, { "conf_source" : 3, "job_class" : { "session" : 2, "name" : "mountall-net" }, "flag" : 1, "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init/mountall-net.conf" } ], "session" : 2, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init" } ], "job_classes" : [ { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-cups-reload", "instance" : "", "description" : "Reload cups, upon starting avahi-daemon to make sure remote queues are populated", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reload cups" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dmitrijs Ledkovs ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/avahi_2dcups_2dreload", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1074, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-daemon", "instance" : "", "description" : "mDNS/DNS-SD daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=none", "MOUNTPOINT=/sys/fs/cgroup", "TYPE=tmpfs", "OPTIONS=optional,uid=0,gid=0,mode=0755,size=1024", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cgroup_2dlite/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cgroup-lite", "instance" : "", "description" : "mount available cgroup filesystems", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "test -x /bin/cgroups-mount || { stop; exit 0; }\ntest -d /sys/fs/cgroup || { stop; exit 0; }\n/bin/cgroups-mount\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ -x /bin/cgroups-umount ]\nthen\n\t/bin/cgroups-umount\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Serge Hallyn ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgroup_2dlite", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/fs/cgroup" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1794, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/nmbd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "nmbd", "instance" : "", "description" : "NetBIOS name server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "nmbd -D" }, { "script" : 1, "command" : "\t[ -f /etc/samba/smb.conf ] || { stop; exit 0; }\n\n\tinstall -o root -g root -m 755 -d /var/run/samba\n\tNMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null || true`\n\n\t[ \"x$NMBD_DISABLED\" = xYes ] && { stop; exit 0; }\n\n\texit 0\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/nmbd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE!=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/qemu_2dkvm/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "qemu-kvm", "instance" : "", "description" : "KVM", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "# Silently exit if the package isn't installed anymore\nif [ ! -e /usr/bin/kvm ]; then\n\texit 0\nfi\n[ -r /etc/default/qemu-kvm ] && . /etc/default/qemu-kvm\n# Enable KSM, respecting the default configuration file\nif [ \"$KSM_ENABLED\" = \"1\" ]; then\n\t[ -w /sys/kernel/mm/ksm/run ] && echo 1 > /sys/kernel/mm/ksm/run || true\n\tif [ -w /sys/kernel/mm/ksm/sleep_millisecs ]; then\n\t\tif [ -n \"$SLEEP_MILLISECS\" ]; then\n\t\t\techo \"$SLEEP_MILLISECS\" > /sys/kernel/mm/ksm/sleep_millisecs || true\n\t\tfi\n\tfi\nelse\n\t[ -w /sys/kernel/mm/ksm/run ] && echo 0 > /sys/kernel/mm/ksm/run || true\nfi\n# If /etc/default/qemu-kvm says to, load vhost_net. Default is not to.\nif [ \"$VHOST_NET_ENABLED\" = \"1\" ]; then\n\tmodprobe -b vhost_net || true\nfi\n# mount hugepages if available and requested\nif [ \"$KVM_HUGEPAGES\" -eq \"1\" ]; then\n\tif ! grep -q hugetlbfs /proc/filesystems; then\n\t\tlogger -t qemu-kvm \"Error: hugepages not available in the kernel!\"\n\telif grep -q /run/hugepages/kvm /proc/mounts; then\n\t\tlogger -t qemu-kvm \"/run/hugepages/kvm already mounted\"\n\telif ! grep -q kvm /etc/group; then\n\t\tlogger -t qemu-kvm \"Error: group kvm does not exist!\"\n\telse\n\t\tkvmgid=`grep kvm /etc/group | cut -d: -f 3`\n\t\tmkdir -p /run/hugepages/kvm\n\t\tmount -t hugetlbfs hugetlbfs-kvm -o mode=775,gid=$kvmgid /run/hugepages/kvm\n\tfi\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/qemu_2dkvm", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 0, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 980, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "screen-cleanup", "instance" : "", "description" : "GNU Screen Cleanup", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "SCREENDIR=/var/run/screen\nif [ -L $SCREENDIR ] || [ ! -d $SCREENDIR ]; then\n\trm -f $SCREENDIR\n\tmkdir $SCREENDIR\n\tchown root:utmp $SCREENDIR\nfi\nfind $SCREENDIR -type p -delete\n# If the local admin has used dpkg-statoverride to install the screen\n# binary with different set[ug]id bits, change the permissions of\n# $SCREENDIR accordingly\nBINARYPERM=`stat -c%a /usr/bin/screen`\nif [ \"$BINARYPERM\" -ge 4000 ]; then\n\tchmod 0755 $SCREENDIR\nelif [ \"$BINARYPERM\" -ge 2000 ]; then\n\tchmod 0775 $SCREENDIR\nelse\n\tchmod 0777 $SCREENDIR\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/screen_2dcleanup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1147, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty4/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 492, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 487, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead-other", "instance" : "", "description" : "Read required files in advance (for other mountpoints)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon $MOUNTPOINT" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 4 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead_2dother", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "DEVICE=[/UL]*", "MOUNTPOINT=/?*" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1817, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=eth0", "LOGICAL=eth0", "ADDRFAM=NetworkManager", "METHOD=NetworkManager", "UPSTART_EVENTS=local-filesystems net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/winbind/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "winbind", "instance" : "", "description" : "Samba Winbind", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "[ -r /etc/default/winbind ] && . /etc/default/winbind\nexec /usr/sbin/winbindd -F $WINBINDD_OPTS\n" }, { "script" : 1, "command" : "test -x /usr/sbin/winbindd || exit 0\nmkdir -p /var/run/samba/winbindd_privileged\nchgrp winbindd_priv /var/run/samba/winbindd_privileged\nchmod 0750 /var/run/samba/winbindd_privileged\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "David Weber", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/winbind", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE!=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 1, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/rc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/tty4", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/udev", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 2, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/rc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/tty4", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/udev", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "enabled=1", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/apport/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n echo 2 > /proc/sys/fs/suid_dumpable\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo 0 > /proc/sys/fs/suid_dumpable\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-setup", "instance" : "", "description" : "set console keymap", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock-save", "instance" : "", "description" : "save system clock to hardware clock", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock_2dsave", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "idmapd" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "idmapd" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "idmapd-mounting", "instance" : "$MOUNTPOINT", "description" : "Block the mounting event for NFS4 filesytems until idmapd is running", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\n status idmapd | grep -q \"start/running\" && exit 0\n\n # If it's already starting we'll get killed by the impending 'stop on\n # started idmapd' \n # If it wasn't already starting, we'll either get killed by the stop\n # on started or stopped.\n # So, its safe to sleep forever here and rely on upstart to kill us,\n\n while sleep 3600; do :; done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 3840 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/idmapd_2dmounting", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "TYPE=nfs*" ], "value" : 0, "name" : "mounting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1352, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/irqbalance/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "irqbalance", "instance" : "", "description" : "CPU interrupts balancing daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\ttest -f /etc/default/irqbalance && . /etc/default/irqbalance\n\n\ttest \"$ENABLED\" != \"0\" || exit 0\n\n\tif test \"$ONESHOT\" != \"0\"; then\n\t\tDOPTIONS=\"--oneshot\"\n\tfi\n\n\texec /usr/sbin/irqbalance $DOPTIONS\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/irqbalance", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rpcbind-boot", "instance" : "", "description" : "Upstart job to start rpcbind on boot only", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl emit --no-wait start-rpcbind ON_BOOT=y" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rpcbind_2dboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 848, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=local-filesystems net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/smbd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "smbd", "instance" : "", "description" : "SMB/CIFS File Server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "smbd -F" }, { "script" : 1, "command" : "\tRUN_MODE=\"daemons\"\n\n\t[ -r /etc/default/samba ] && . /etc/default/samba\n\n\t[ \"$RUN_MODE\" = inetd ] && { stop; exit 0; }\n\n\tinstall -o root -g root -m 755 -d /var/run/samba\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/smbd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "value" : 1, "name" : "net-device-up", "type" : "EVENT_MATCH", "event" : 5 }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1076, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/systemd-logind.log", "io_watch_fd" : 17, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "SYSTEMD_LOG_TARGET=syslog", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "systemd-logind", "instance" : "", "description" : "SystemD login management service", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-logind" }, { "script" : 1, "command" : " # only start if PAM module is actually available, not if libpam-systemd is\n # removed but not purged\n [ -e /lib/*/security/pam_systemd.so ] || { stop; exit 0; }\n\n # this is being done by systemd or mountall usually, but not during\n # upgrades from earlier distro releases\n if ! mountpoint -q /sys/fs/cgroup; then\n mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup\n fi\n mkdir -p /run/systemd\n if ! mountpoint -q /sys/fs/cgroup/systemd; then\n mkdir -p /sys/fs/cgroup/systemd\n mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 16384, "rlim_max" : 16384 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "SYSTEMD_LOG_TARGET=syslog" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1153, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty5/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock-save", "instance" : "", "description" : "save system clock to hardware clock", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/hwclock_2dsave", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/tty5", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock-save", "instance" : "", "description" : "save system clock to hardware clock", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/hwclock_2dsave", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/tty5", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/failsafe", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hybrid-gfx", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hybrid-detect" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hybrid_2dgfx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 999, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/modemmanager.log", "io_watch_fd" : 20, "fd" : 12 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/modemmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "modemmanager", "instance" : "", "description" : "modem connection manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/modem-manager" }, { "script" : 1, "command" : "[ -x /usr/sbin/modem-manager ] || stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/modemmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-store", "instance" : "", "description" : "store software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n mkdir -p /var/lib/rfkill\n > /var/lib/rfkill/saved-state\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n entry=\"$(cat $device/name) $(cat $device/soft)\"\n echo $entry >> /var/lib/rfkill/saved-state\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 959, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "portmap" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEFAULTFILE=/etc/default/nfs-common", "JOB=portmap", "INSTANCE=", "ON_BOOT=y", "UPSTART_EVENTS=local-filesystems started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/statd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "portmap" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "statd", "instance" : "", "description" : "NSM status monitor", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\tif [ -f \"$DEFAULTFILE\" ]; then\n\t . \"$DEFAULTFILE\"\n\tfi\n\n\tif [ \"x$NEED_STATD\" != xno ]; then\n\t\texec rpc.statd -L $STATDOPTS\n\tfi\n" }, { "script" : 1, "command" : "\tif [ -f \"$DEFAULTFILE\" ]; then\n\t . \"$DEFAULTFILE\"\n\tfi\n\n\t[ \"x$NEED_STATD\" != xno ] || { stop; exit 0; }\n\tlogger -t statd-pre-start \"$UPSTART_EVENTS\" || true\n\techo UPSTART_EVENTS = \"$UPSTART_EVENTS\"\n\n exec sm-notify\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULTFILE=/etc/default/nfs-common" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/statd", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "portmap", "ON_BOOT=" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "portmap", "ON_BOOT=y" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/failsafe", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/failsafe", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1341, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/atd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "atd", "instance" : "", "description" : "deferred execution scheduler", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/atd", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 976, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/dbus/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/dbus", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "failsafe-x", "instance" : "", "description" : "Recovery options if display manager fails to start", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/share/xdiagnose/failsafeXServer \"$JOB\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/failsafe_2dx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "gdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 749, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "ON_BOOT=y", "UPSTART_EVENTS=start-rpcbind" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/portmap/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [ "ON_BOOT" ], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "portmap", "instance" : "", "description" : "RPC portmapper replacement", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "OPTIONS=\"-w\"\nif [ -f /etc/default/rpcbind ]; then\n\t. /etc/default/rpcbind\nelif [ -f /etc/rpcbind.conf ]; then\n\t. /etc/rpcbind.conf\nfi\nexec rpcbind $OPTIONS\n" }, { "script" : 0, "command" : "mkdir -p /run/rpcbind" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Colin Watson ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "ON_BOOT=" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/portmap", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "start-rpcbind", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1204, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ssh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_NONE", "kill_signal" : 15, "name" : "ssh", "instance" : "", "description" : "OpenSSH server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/sshd -D" }, { "script" : 1, "command" : " test -x /usr/sbin/sshd || { stop; exit 0; }\n test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }\n test -c /dev/null || { stop; exit 0; }\n\n mkdir -p -m0755 /var/run/sshd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ssh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/dbus", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1364, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/autofs/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "autofs", "instance" : "", "description" : "Automounter", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ -f /etc/default/autofs ] ; then\n . /etc/default/autofs\nfi\nexec /usr/sbin/automount $OPTIONS\n" }, { "script" : 1, "command" : "modprobe -q autofs4 || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/autofs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/6669d411-80c3-41cc-a629-ad84e1ee6854", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "rc", "RUNLEVEL=[016]" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "LXC_AUTO=false", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lxc/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "rc", "RUNLEVEL=[016]" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lxc", "instance" : "", "description" : "lxc", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -f /etc/default/lxc ] && . /etc/default/lxc\n\n\t[ \"x$LXC_AUTO\" = \"xtrue\" ] || { stop; exit 0; }\n\n\t# don't load profiles if mount mediation is not supported\n\tSYSF=/sys/kernel/security/apparmor/features/mount/mask\n\tif [ -f $SYSF ]; then\n\t\tif [ -x /lib/init/apparmor-profile-load ]; then\n\t\t\t/lib/init/apparmor-profile-load usr.bin.lxc-start\n\t\t\t/lib/init/apparmor-profile-load lxc-containers\n\t\tfi\n\tfi\n\n\tls /etc/lxc/auto/* > /dev/null 2>&1 || exit 0;\n\tfor f in /etc/lxc/auto/*; do\n\t\tc=\"$(basename $f .conf)\"\n\t\tstart lxc-instance NAME=$c CONFIG=$f\n\tdone\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Serge Hallyn ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "LXC_AUTO=false" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lxc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1403, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=local-filesystems started static-network-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-manager", "instance" : "", "description" : "network connection manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-store", "instance" : "", "description" : "save sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl store" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1212, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/cups-browsed.log", "io_watch_fd" : 23, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=avahi-daemon", "INSTANCE=", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=filesystem started runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups-browsed", "instance" : "", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "respawn_interval" : 240, "process" : [ { "script" : 0, "command" : "/usr/sbin/cups-browsed" }, { "script" : 1, "command" : "[ -x /usr/sbin/cups-browsed ]\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Till Kamppeter ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "cups" ], "value" : 1, "name" : "started", "type" : "EVENT_MATCH", "event" : 4 }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "env", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/locale || true\nenv\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/env", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "setvtrgb", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "setvtrgb /etc/vtrgb" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/setvtrgb", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "tty1" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "statd" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "statd" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "statd-mounting", "instance" : "$MOUNTPOINT", "description" : "Block the mounting event for NFS filesytems until statd is running", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\n . /etc/default/nfs-common\n\n [ \"x$NEED_STATD\" != \"xno\" ] || exit 0\n status statd | grep -q \"start/running\" && exit 0\n\n # If its already starting we'll get killed by the impending 'stop on\n # started statd' \n # If it wasn't already starting, we'll either get killed by the stop\n # on started or stopped.\n # So, its safe to sleep forever here and rely on upstart to kill us,\n\n while sleep 3600; do :; done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/statd_2dmounting", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "TYPE=nfs" ], "value" : 0, "name" : "mounting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-restore", "instance" : "", "description" : "restore sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl restore" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1340, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cron/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1326, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/lightdm.log", "io_watch_fd" : 49, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem runlevel started plymouth-ready" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lightdm/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lightdm", "instance" : "", "description" : "LightDM Display Manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Robert Ancell ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "[!06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "plymouth-ready", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "PREVLEVEL=S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS || true\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale || true\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "pre-start-wrapper", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "start ssh || { echo 'OMG duplicate instance'; exit 1; }\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/pre_2dstart_2dwrapper", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1302, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/xinetd.log", "io_watch_fd" : 28, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "PIDFILE=/var/run/xinetd.pid", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/xinetd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "xinetd", "instance" : "", "description" : "xinetd daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " INETD_COMPAT=Yes\n XINETD_OPTS=\"-stayalive\"\n\n # per upstart convention, options should be set in the upstart job itself.\n # However, to be friendly, source and respect old defaults file.\n [ ! -f /etc/default/xinetd ] || . /etc/default/xinetd\n\n case \"$INETD_COMPAT\" in\n [Yy]*)\n XINETD_OPTS=\"$XINETD_OPTS -inetd_compat\"\n if perl -MSocket -e 'exit (!socket($sock, AF_INET6, SOCK_STREAM, 0))'; then\n XINETD_OPTS=\"$XINETD_OPTS -inetd_ipv6\"\n fi\n ;;\n esac\n\n checkportmap () {\n if grep \"^[^ *#]\" /etc/xinetd.conf | grep -q 'rpc/'; then\n if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then\n echo\n echo \"WARNING: portmapper inactive - RPC services unavailable!\"\n echo \" Commenting out or removing the RPC services from\"\n echo \" the /etc/xinetd.conf file will remove this message.\"\n echo\n fi\n fi\n }\n\n checkportmap\n exec /usr/sbin/xinetd -dontfork -pidfile \"$PIDFILE\" $XINETD_OPTS\n" }, { "script" : 1, "command" : "test -x /usr/sbin/xinetd || { stop; exit 0; }\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "xinetd_pid=$(status | awk '/stop\\/pre-stop/ { print $NF }')\n[ -n \"${xinetd_pid}\" ] || exit 0\nkill -QUIT \"${xinetd_pid}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "PIDFILE=/var/run/xinetd.pid" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/xinetd", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS || true\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale || true\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountall", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS || true\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale || true\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountall", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "binfmt-support", "instance" : "", "description" : "Enabling additional executable binary formats", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "update-binfmts --enable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Colin Watson ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/binfmt_2dsupport", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/console", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 6 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=hostname", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/hostname_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname.sh", "instance" : "", "description" : "Signal sysvinit that hostname is set", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/hostname_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "hostname" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/zram_2dconfig/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "zram-config", "instance" : "", "description" : "Initializes zram swaping", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # load dependency modules\n NRDEVICES=$(grep -c ^processor /proc/cpuinfo | sed 's/^0$/1/')\n if modinfo zram | grep -q ' zram_num_devices:' 2>/dev/null; then\n MODPROBE_ARGS=\"zram_num_devices=${NRDEVICES}\"\n elif modinfo zram | grep -q ' num_devices:' 2>/dev/null; then\n MODPROBE_ARGS=\"num_devices=${NRDEVICES}\"\n else\n exit 1\n fi\n modprobe zram $MODPROBE_ARGS\n\n # Calculate memory to use for zram (1/2 of ram)\n totalmem=`free | grep -e \"^Mem:\" | sed -e 's/^Mem: *//' -e 's/ *.*//'`\n mem=$(((totalmem / 2 / ${NRDEVICES}) * 1024))\n\n # initialize the devices\n for i in $(seq ${NRDEVICES}); do\n DEVNUMBER=$((i - 1))\n echo $mem > /sys/block/zram${DEVNUMBER}/disksize\n mkswap /dev/zram${DEVNUMBER}\n swapon -p 5 /dev/zram${DEVNUMBER}\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if DEVICES=$(grep zram /proc/swaps | awk '{print $1}'); then\n for i in $DEVICES; do\n swapoff $i\n done\nfi\nrmmod -w zram\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Adam Conrad ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/zram_2dconfig", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/console", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/console", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1314, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/acpid/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1008, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bluetooth/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bluetooth", "instance" : "", "description" : "bluetooth daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/bluetoothd" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/6669d411-80c3-41cc-a629-ad84e1ee6854", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/6669d411-80c3-41cc-a629-ad84e1ee6854", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1443, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "rc", "RUNLEVEL=[016]" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "libvirtd_opts=-d", "start_libvirtd=yes", "libvirtd_shutdown_timeout=30", "libvirt_uris=qemu:///system lxc:///", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/libvirt_2dbin/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rc", "RUNLEVEL=[016]" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "libvirt-bin", "instance" : "", "description" : "libvirt daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "[ -r /etc/default/libvirt-bin ] && . /etc/default/libvirt-bin\nexec /usr/sbin/libvirtd $libvirtd_opts\n" }, { "script" : 1, "command" : "[ -r /etc/default/libvirt-bin ] && . /etc/default/libvirt-bin\n[ ! \"x$start_libvirtd\" = \"xyes\" ] && { stop; exit 0; }\nmkdir -p /var/run/libvirt\n# Clean up a pidfile that might be left around\nrm -f /var/run/libvirtd.pid\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -r /etc/default/libvirt-bin ] && . /etc/default/libvirt-bin\n\n\tlog_msg()\n\t{\n\t\tlogf=\"/var/log/libvirt/shutdownlog.log\"\n\t\tlogger -p daemon.debug -s -t libvirt -- \"$@\" >> $logf 2>&1\n\t}\n\n\trun_virsh()\n\t{\n\t\t# We parse the output for things like domain state;\n\t\t# make sure the output is in the language we expect.\n\t\tLANG=C virsh \"$@\"\n\t}\n\n\tif [ -z \"$RUNLEVEL\" ]; then\n\t\texit 0\n\tfi\n\n\tif [ \"$RUNLEVEL\" -ne 0 ] && [ \"$RUNLEVEL\" -ne 1 ] && [ \"$RUNLEVEL\" -ne 6 ]; then\n\t\texit 0\n\tfi\n\tlog_msg \"libvirt-bin: entering pre-stop at $(date)\"\n\n\tfor uri in $libvirt_uris; do\n\t\tfor domain in $(run_virsh -c \"$uri\" list | awk '$3 == \"running\" {print $2}'); do\n\t\t\tlog_msg \"libvirt-bin: attempting clean shutdown of $domain at $(date)\"\n\t\t\trun_virsh -c \"$uri\" shutdown \"$domain\" >/dev/null\n\t\tdone\n\tdone\n\n\tdelay=$libvirtd_shutdown_timeout\n\twhile [ $delay -gt 0 ]; do\n\t\tfor uri in $libvirt_uris; do\n\t\t\tif ! run_virsh -c \"$uri\" list | awk '$3 == \"running\" {exit 1}'; then\n\t\t\t\t# VMs at this URI are still running. Wait, then\n\t\t\t\t# start at the beginning looking for running VMs.\n\t\t\t\tsleep 1\n\t\t\t\tdelay=$(($delay - 1))\n\t\t\t\tcontinue 2\n\t\t\tfi\n\t\tdone\n\t\tbreak\n\tdone\n\n\tfor uri in $libvirt_uris; do\n\t\tfor domain in $(run_virsh -c \"$uri\" list | awk '$3 == \"running\" {print $2}'); do\n\t\t\tlog_msg \"destroying $domain\"\n\t\t\trun_virsh -c \"$uri\" destroy \"$domain\" >/dev/null\n\t\tdone\n\tdone\n\tlog_msg \"libvirt-bin: exiting pre-stop at $(date)\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "libvirtd_opts=-d", "start_libvirtd=yes", "libvirtd_shutdown_timeout=30", "libvirt_uris=qemu:///system lxc:///" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/libvirt_2dbin", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dstop", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rcS", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "reload-smbd", "instance" : "", "description" : "Samba Auto-reload Integration", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if status smbd | grep -q \"running\"; then\n reload smbd\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "James Page ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/reload_2dsmbd", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "cups" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/plymouth_2dstop", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/rcS", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/plymouth_2dstop", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/rcS", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "recovery", "startup", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "friendly-recovery", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Only start friendly-recovery when booting in recovery mode\n if ! grep -q \"recovery\" /proc/cmdline; then\n exit 0\n fi\n\n if [ -x /lib/recovery-mode/recovery-menu ]; then\n exec /lib/recovery-mode/recovery-menu\n else\n exec /sbin/sulogin\n fi\n" }, { "script" : 1, "command" : " if plymouth --ping; then\n plymouth hide-splash || true\n fi\n\n # Try to set the hostname and initialize the console\n start hostname || true\n start console-setup || true\n start setvtrgb || true\n\n # Make sure /run contains the required directories for the\n # recovery menu options\n mkdir -p /run/lock /run/shm || true\n\n # Emit the mounted event to trigger resolvconf and mounted-run\n initctl emit mounted MOUNTPOINT=/run || true\n\n # Finally start udev\n start udev || true\n udevadm trigger --action=add || true\n udevadm settle || true\n\n # And turn off kernel messages (to avoid corrupting the menu)\n dmesg --console-off || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if plymouth --ping; then\n plymouth show-splash\nfi\ninitctl emit startup\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/friendly_2drecovery", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "recovery", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "gssd" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "gssd" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "gssd-mounting", "instance" : "$MOUNTPOINT", "description" : "Block the mounting event for NFS4 filesytems until gssd is running", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\n DEFAULTFILE=/etc/default/nfs-common\n\n if [ -f \"$DEFAULTFILE\" ]; then\n . \"$DEFAULTFILE\"\n fi\n\n if [ -f /etc/fstab ]; then\n exec 9<&0 ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 3840 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/gssd_2dmounting", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "TYPE=nfs*", "OPTIONS=*sec*krb5*" ], "value" : 0, "name" : "mounting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "lxc" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 30, "name" : "lxc-instance", "instance" : "$NAME", "description" : "lxc instance", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "lxc-start -n $NAME -f $CONFIG" }, { "script" : 1, "command" : "\n\tlxc-info -n $NAME 2>/dev/null | grep state | grep -q \"RUNNING\" && {stop; exit 0; }\n\t[ -f $CONFIG ] || {stop; exit 0; }\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Christian Kampka ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 120, "usage" : "NAME=name of LXC instance, CONFIG=full path to configuration file", "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lxc_2dinstance", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc_2dsysinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "starting-dm" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "env" : [ "gdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "kdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ubiquity", "instance" : "", "description" : "Ubuntu live CD installer", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -x /usr/bin/ubiquity-dm || exit 0\n\n ubiquity=\n automatic=\n debug=\n ldtp=\n noninteractive=\n choose=\n frontend=\n for x in $(cat /proc/cmdline); do\n\tcase $x in\n\t debug-ubiquity)\n\t\tdebug=\"-d\"\n\t\tubiquity=1\n\t\t;;\n\t automatic-ubiquity)\n\t\tautomatic=\"--automatic\"\n\t\tubiquity=1\n\t\t;;\n\t maybe-ubiquity)\n\t\tubiquity=1\n\t\tchoose=\"--greeter\"\n\t\t;;\n\t ldtp-ubiquity)\n\t\tubiquity=1\n\t\tldtp=\"--ldtp\"\n\t\t;;\n\t only-ubiquity)\n\t\tubiquity=1\n\t\t;;\n\t noninteractive)\n\t\tubiquity=1\n\t\tnoninteractive=1\n\t\t;;\n\t ubiquity/frontend=*)\n\t\tfrontend=\"${x#*=}\"\n\t\t;;\n\tesac\n done\n [ \"$ubiquity\" ]\n\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale\n if [ -n \"$LANG\" ]; then\n export LANG\n fi\n if [ -n \"$LANGUAGE\" ]; then\n export LANGUAGE\n fi\n fi\n\n initctl emit starting-dm DM=ubiquity-dm\n\n # turn off console blanking for install process\n setterm -blank 0 > /dev/console\n\n if [ -n \"$noninteractive\" ]; then\n\tplymouth quit || :\n\texec ubiquity noninteractive $debug\n else\n\tif ! ubiquity-dm vt7 :0 ubuntu /usr/bin/ubiquity $debug $automatic $choose $ldtp --only $frontend; then\n\t # has X crashed, or has ubiquity?\n if [ \"$automatic\" ] && ! [ -f /var/log/installer/version ]; then\n # in case we crashed before the X startup sequence\n plymouth quit || :\n exec ubiquity noninteractive $debug\n else\n # something more serious has happened, e.g. debconf locked?!\n exit 1\n fi\n\tfi\n fi\n exit 0\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Ubuntu Installer Team ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 1 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/ubiquity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/rc_2dsysinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/rc_2dsysinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 11734, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups", "instance" : "", "description" : "CUPS printing spooler/server", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cupsd -F" }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "script" : 1, "command" : " # wait until daemon is ready\n timeout=6\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Michael Sweet ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 1, "name" : "runlevel", "type" : "EVENT_MATCH", "event" : 3 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "pulseaudio", "instance" : "", "description" : "System PulseAudio sound server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS" }, { "script" : 0, "command" : "install -d -m755 -o pulse -g pulse /run/pulse" }, { "script" : 1, "command" : "if [ -e /var/run/pulse/.esd_auth ]; then\n\tchown pulse:pulse-access /var/run/pulse/.esd_auth\n\tchmod 640 /var/run/pulse/.esd_auth\nfi\nif [ -e /var/run/pulse/.pulse-cookie ]; then\n\tchown pulse:pulse-access /var/run/pulse/.pulse-cookie\n\tchmod 640 /var/run/pulse/.pulse-cookie\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Pali Rohár ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DISALLOW_MODULE_LOADING=1", "PULSEAUDIO_ARGS=" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/pulseaudio", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 709, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "socket" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "socket" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "socket" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "anacron", "instance" : "", "description" : "anac(h)ronistic cron", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "anacron -s" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/anacron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1166, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty2/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NORMAL", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 7, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=startup" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2ddbus_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "dbus" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-dbus-bridge", "instance" : "", "description" : "Bridge D-Bus signal events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-dbus-bridge --daemon --system" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2ddbus_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 372, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=proc", "MOUNTPOINT=/proc", "TYPE=proc", "OPTIONS=nodev,noexec,nosuid", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "file" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/tty2", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "file" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/tty2", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "dbus" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-dbus-bridge", "instance" : "", "description" : "Bridge D-Bus signal events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-dbus-bridge --daemon --system" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/upstart_2ddbus_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "file" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1167, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty3/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/tty3", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/tty3", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cryptdisks-udev", "instance" : "$DEVNAME", "description" : "enable encrypted block devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -r /lib/cryptsetup/cryptdisks.functions ] || { stop; exit 0; }\n\n . /lib/cryptsetup/cryptdisks.functions\n\n case \"$CRYPTDISKS_ENABLE\" in\n [Nn]*)\n exit 1\n ;;\n esac\n\n INITSTATE=udev\n crypttab_start_one_disk \"$DEVNAME\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cryptdisks_2dudev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "ID_FS_USAGE=crypto" ], "value" : 0, "name" : "block-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "lxc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "USE_LXC_BRIDGE=false", "LXC_BRIDGE=lxcbr0", "LXC_ADDR=10.0.3.1", "LXC_NETMASK=255.255.255.0", "LXC_NETWORK=10.0.3.0/24", "LXC_DHCP_RANGE=10.0.3.2,10.0.3.254", "LXC_DHCP_MAX=253", "LXC_DHCP_CONFILE=", "varrun=/var/run/lxc", "JOB=lxc", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lxc_2dnet/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "lxc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lxc-net", "instance" : "", "description" : "lxc network", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -f /etc/default/lxc ] && . /etc/default/lxc\n\n\t[ \"x$USE_LXC_BRIDGE\" = \"xtrue\" ] || { stop; exit 0; }\n\n\tcleanup() {\n\t\t# dnsmasq failed to start, clean up the bridge\n\t\tiptables -t nat -D POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE || true\n\t\tifconfig ${LXC_BRIDGE} down || true\n\t\tbrctl delbr ${LXC_BRIDGE} || true\n\t}\n\n\tif [ -d /sys/class/net/${LXC_BRIDGE} ]; then\n\t\tif [ ! -f ${varrun}/network_up ]; then\n\t\t\t# bridge exists, but we didn't start it\n\t\t\tstop;\n\t\tfi\n\t\texit 0;\n\tfi\n\n\t# set up the lxc network\n\tbrctl addbr ${LXC_BRIDGE} || { echo \"Missing bridge support in kernel\"; stop; exit 0; }\n\techo 1 > /proc/sys/net/ipv4/ip_forward\n\tmkdir -p ${varrun}\n\tifconfig ${LXC_BRIDGE} ${LXC_ADDR} netmask ${LXC_NETMASK} up\n\tiptables -t nat -A POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE\n\tdnsmasq -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file=${varrun}/dnsmasq.pid --conf-file=${LXC_DHCP_CONFILE} --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override --except-interface=lo --interface=${LXC_BRIDGE} --dhcp-leasefile=/var/lib/misc/dnsmasq.${LXC_BRIDGE}.leases --dhcp-authoritative || cleanup\n\ttouch ${varrun}/network_up\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -f /etc/default/lxc ] && . /etc/default/lxc\n\t[ -f \"${varrun}/network_up\" ] || exit 0;\n\t# if $LXC_BRIDGE has attached interfaces, don't shut it down\n\tls /sys/class/net/${LXC_BRIDGE}/brif/* > /dev/null 2>&1 && exit 0;\n\n\tif [ -d /sys/class/net/${LXC_BRIDGE} ]; then\n\t\tifconfig ${LXC_BRIDGE} down\n\t\tiptables -t nat -D POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE || true\n\t\tpid=`cat ${varrun}/dnsmasq.pid 2>/dev/null` && kill -9 $pid || true\n\t\trm -f ${varrun}/dnsmasq.pid\n\t\tbrctl delbr ${LXC_BRIDGE}\n\tfi\n\trm -f ${varrun}/network_up\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Serge Hallyn ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "USE_LXC_BRIDGE=false", "LXC_BRIDGE=lxcbr0", "LXC_ADDR=10.0.3.1", "LXC_NETMASK=255.255.255.0", "LXC_NETWORK=10.0.3.0/24", "LXC_DHCP_RANGE=10.0.3.2,10.0.3.254", "LXC_DHCP_MAX=253", "LXC_DHCP_CONFILE=", "varrun=/var/run/lxc" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lxc_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lxc" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "foo", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "exec env\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/foo", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "gssd", "instance" : "", "description" : "rpcsec_gss daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rpc.gssd" }, { "script" : 1, "command" : "\tdo_modprobe() {\n\t\tmodprobe -q \"$1\" || true\n\t}\n\n\tif [ -f \"$DEFAULTFILE\" ]; then\n\t\t. \"$DEFAULTFILE\"\n\tfi\n\n\t#\n\t# Parse the fstab file, and determine whether we need gssd. (The\n\t# /etc/defaults settings, if any, will override our autodetection.)\n\t# This code is partially adapted from the mountnfs.sh script in the\n\t# sysvinit package.\n\n\tif [ -f /etc/fstab ]; then\n\t\texec 9<&0 ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULTFILE=/etc/default/nfs-common", "PIPEFS_MOUNTPOINT=/run/rpc_pipefs" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/gssd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dshell", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lxcbr0", "DEVPATH=/devices/virtual/net/lxcbr0", "SUBSYSTEM=net", "ACTION=add", "DEVTYPE=bridge", "ID_MM_CANDIDATE=1", "IFINDEX=3", "INTERFACE=lxcbr0", "SEQNUM=3188", "USEC_INITIALIZED=6173", "UPSTART_EVENTS=net-device-added" ], "name" : "lxcbr0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lxcbr0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=virbr0", "DEVPATH=/devices/virtual/net/virbr0", "SUBSYSTEM=net", "ACTION=add", "DEVTYPE=bridge", "ID_MM_CANDIDATE=1", "IFINDEX=4", "INTERFACE=virbr0", "SEQNUM=3226", "USEC_INITIALIZED=4454", "UPSTART_EVENTS=net-device-added" ], "name" : "virbr0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/virbr0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=tun0", "DEVPATH=/devices/virtual/net/tun0", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=5", "INTERFACE=tun0", "SEQNUM=3250", "USEC_INITIALIZED=996", "UPSTART_EVENTS=net-device-added" ], "name" : "tun0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/tun0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=2934", "USEC_INITIALIZED=66", "UPSTART_EVENTS=net-device-added" ], "name" : "lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:1c.6/0000:05:00.0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MM_CANDIDATE=1", "ID_MODEL_FROM_DATABASE=AR8161 Gigabit Ethernet", "ID_MODEL_ID=0x1091", "ID_NET_NAME_MAC=enx902b34d60cf1", "ID_NET_NAME_PATH=enp5s0", "ID_OUI_FROM_DATABASE=GIGA-BYTE TECHNOLOGY CO.,LTD.", "ID_PCI_CLASS_FROM_DATABASE=Network controller", "ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller", "ID_VENDOR_FROM_DATABASE=Qualcomm Atheros", "ID_VENDOR_ID=0x1969", "IFINDEX=2", "INTERFACE=eth0", "SEQNUM=2457", "USEC_INITIALIZED=1368", "UPSTART_EVENTS=net-device-added" ], "name" : "eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 0, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 1, "name" : "drm-device-added", "type" : "EVENT_MATCH", "event" : 0 }, { "value" : 1, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 1 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dupstart_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "portmap" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "portmap" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "portmap-wait", "instance" : "$WAITER", "description" : "Start this job to wait until rpcbind is started or fails to start", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\n status portmap | grep -q \"start/running\" && exit 0\n\n start portmap ON_BOOT=y || true\n\n # Waiting forever is ok.. upstart will kill this job when\n # the portmap we tried to start above either starts or stops\n while sleep 3600; do :; done\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/portmap_2dwait", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 2707, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=stopped not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty1/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udevmonitor", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountall_2dshell", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 1, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/plymouth_2dupstart_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/tty1", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/udevmonitor", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "foo", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "sleep 1000" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/foo", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountall_2dshell", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 2, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/plymouth_2dupstart_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/tty1", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/udevmonitor", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cryptdisks-enable", "instance" : "", "description" : "enable remaining boot-time encrypted block devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -r /lib/cryptsetup/cryptdisks.functions ] || { stop; exit 0; }\n\n . /lib/cryptsetup/cryptdisks.functions\n\n case \"$CRYPTDISKS_ENABLE\" in\n [Nn]*)\n exit 1\n ;;\n esac\n\n INITSTATE=\"init\"\n do_start\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cryptdisks_2denable", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dmesg", "instance" : "", "description" : "save kernel messages", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/dmesg", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "network-manager", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dmanager", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=tun0", "INTERFACE=tun0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/tun0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2ftun0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lxcbr0", "INTERFACE=lxcbr0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lxcbr0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flxcbr0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=virbr0", "INTERFACE=virbr0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/virbr0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2fvirbr0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "networking", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/networking/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-restore", "instance" : "", "description" : "restore software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -f /var/lib/rfkill/saved-state ] ||\n [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n while read line; do\n set -- $line\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n if [ -f $device/soft ] &&\n [ \"$(cat $device/name)\" = \"$1\" ]; then\n echo $2 > $device/soft\n fi\n done\n done < /var/lib/rfkill/saved-state\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1169, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty6/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/networking", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/tty6", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/networking", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/tty6", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-font", "instance" : "", "description" : "set console font", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/udev/console-setup-tty fbcon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dfont", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 942, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "PIPEFS_MOUNTPOINT=/run/rpc_pipefs", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/idmapd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "idmapd", "instance" : "", "description" : "NFSv4 id <-> name mapper", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rpc.idmapd" }, { "script" : 1, "command" : "\tdo_modprobe() {\n\t\tmodprobe -q \"$1\" || true\n\t}\n\n\tdo_modprobe nfs\n\tdo_modprobe nfsd\n\n\tdo_modprobe sunrpc\n\n\tif ! mountpoint -q \"$PIPEFS_MOUNTPOINT\"\n\tthen\n\t\tmkdir -p \"$PIPEFS_MOUNTPOINT\"\n\t\tmount -t rpc_pipefs rpc_pipefs \"$PIPEFS_MOUNTPOINT\" || true\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if mountpoint -q \"$PIPEFS_MOUNTPOINT\"\nthen\n\t# ignore any failures caused by the filesystem still\n\t# being in use\n\tumount \"$PIPEFS_MOUNTPOINT\" || true\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "PIPEFS_MOUNTPOINT=/run/rpc_pipefs" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/idmapd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "rc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead", "instance" : "", "description" : "Read required files in advance", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "sleep 45" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 180, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fraring_2damd64_2d9684b2e0_2dc5c2_2d49f0_2d9baf_2d7eddd72f2482/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 2, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2fschroot_2fmount_2fsaucy_2damd64_2d4c0015a8_2d7e99_2d4d1b_2d8453_2d557a82aff76f/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null } ], "events" : [ { "progress" : "EVENT_HANDLING", "env" : [ "KERNEL=card0", "DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0", "DEVNAME=/dev/dri/card0", "SUBSYSTEM=drm", "ACTION=add", "DEVTYPE=drm_minor", "ID_FOR_SEAT=drm-pci-0000_00_02_0", "ID_PATH=pci-0000:00:02.0", "ID_PATH_TAG=pci-0000_00_02_0", "MAJOR=226", "MINOR=0", "PRIMARY_DEVICE_FOR_DISPLAY=1", "SEQNUM=2396", "TAGS=:seat:uaccess:", "USEC_INITIALIZED=9038" ], "session" : 0, "name" : "drm-device-added", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=udev-fallback-graphics", "INSTANCE=", "RESULT=ok" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=udevtrigger", "INSTANCE=", "RESULT=ok" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "runlevel", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=cups", "INSTANCE=" ], "session" : 0, "name" : "started", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "IFACE=eth0", "LOGICAL=eth0", "ADDRFAM=NetworkManager", "METHOD=NetworkManager" ], "session" : 0, "name" : "net-device-up", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 1, "fd" : -1 } ] } upstart-1.13.2/init/tests/data/upstart-1.13.json0000664000175000017500000221443212373101356016227 00000000000000{ "cgroup_manager_address" : "unix:path=/sys/fs/cgroup/cgmanager/sock", "conf_sources" : [ { "session" : 0, "path" : "//etc/init.conf", "type" : "CONF_FILE", "flag" : 1, "conf_files" : [] }, { "conf_files" : [ { "conf_source" : 1, "path" : "//etc/init/mounted-debugfs.conf", "job_class" : { "name" : "mounted-debugfs", "session" : 0 }, "flag" : 1 }, { "flag" : 1, "path" : "//etc/init/mountnfs.sh.conf", "job_class" : { "name" : "mountnfs.sh", "session" : 0 }, "conf_source" : 1 }, { "path" : "//etc/init/procps-instance.conf", "job_class" : { "name" : "procps-instance", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/pulseaudio.conf", "job_class" : { "session" : 0, "name" : "pulseaudio" } }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc-sysinit" }, "path" : "//etc/init/rc-sysinit.conf", "flag" : 1 }, { "flag" : 1, "path" : "//etc/init/setvtrgb.conf", "job_class" : { "session" : 0, "name" : "setvtrgb" }, "conf_source" : 1 }, { "conf_source" : 1, "job_class" : { "name" : "alsa-utils", "session" : 0 }, "path" : "//etc/init/alsa-utils.conf", "flag" : 1 }, { "job_class" : { "name" : "cgroup-procenv", "session" : 0 }, "path" : "//etc/init/cgroup-procenv.conf", "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "job_class" : { "name" : "lightdm", "session" : 0 }, "path" : "//etc/init/lightdm.conf", "flag" : 1 }, { "job_class" : { "session" : 0, "name" : "mountdevsubfs.sh" }, "path" : "//etc/init/mountdevsubfs.sh.conf", "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-proc" }, "path" : "//etc/init/mounted-proc.conf" }, { "job_class" : { "session" : 0, "name" : "network-interface" }, "path" : "//etc/init/network-interface.conf", "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-log" }, "path" : "//etc/init/plymouth-log.conf" }, { "flag" : 1, "job_class" : { "name" : "alsa-state", "session" : 0 }, "path" : "//etc/init/alsa-state.conf", "conf_source" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "name" : "atd", "session" : 0 }, "path" : "//etc/init/atd.conf" }, { "conf_source" : 1, "path" : "//etc/init/control-alt-delete.conf", "job_class" : { "name" : "control-alt-delete", "session" : 0 }, "flag" : 1 }, { "job_class" : { "session" : 0, "name" : "failsafe" }, "path" : "//etc/init/failsafe.conf", "conf_source" : 1, "flag" : 1 }, { "path" : "//etc/init/hwclock-save.conf", "job_class" : { "session" : 0, "name" : "hwclock-save" }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/irqbalance.conf", "job_class" : { "name" : "irqbalance", "session" : 0 } }, { "path" : "//etc/init/networking.conf", "job_class" : { "name" : "networking", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "path" : "//etc/init/ufw.conf", "job_class" : { "name" : "ufw", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-cups-reload" }, "path" : "//etc/init/avahi-cups-reload.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-font" }, "path" : "//etc/init/console-font.conf", "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hostname.sh" }, "path" : "//etc/init/hostname.sh.conf" }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/modemmanager.conf", "job_class" : { "session" : 0, "name" : "modemmanager" } }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-run" }, "path" : "//etc/init/mounted-run.conf" }, { "path" : "//etc/init/mounted-tmp.conf", "job_class" : { "name" : "mounted-tmp", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc" }, "path" : "//etc/init/rc.conf", "flag" : 1 }, { "conf_source" : 1, "path" : "//etc/init/rsyslog.conf", "job_class" : { "session" : 0, "name" : "rsyslog" }, "flag" : 1 }, { "job_class" : { "name" : "shutdown", "session" : 0 }, "path" : "//etc/init/shutdown.conf", "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth" }, "path" : "//etc/init/plymouth.conf" }, { "flag" : 1, "path" : "//etc/init/usb-modeswitch-upstart.conf", "job_class" : { "session" : 0, "name" : "usb-modeswitch-upstart" }, "conf_source" : 1 }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/anacron.conf", "job_class" : { "session" : 0, "name" : "anacron" } }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/cgroup-job2.conf", "job_class" : { "name" : "cgroup-job2", "session" : 0 } }, { "job_class" : { "session" : 0, "name" : "mountall-shell" }, "path" : "//etc/init/mountall-shell.conf", "conf_source" : 1, "flag" : 1 }, { "path" : "//etc/init/mounted-var.conf", "job_class" : { "name" : "mounted-var", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/plymouth-upstart-bridge.conf", "job_class" : { "name" : "plymouth-upstart-bridge", "session" : 0 } }, { "job_class" : { "session" : 0, "name" : "tty1" }, "path" : "//etc/init/tty1.conf", "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-fallback-graphics" }, "path" : "//etc/init/udev-fallback-graphics.conf", "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-finish" }, "path" : "//etc/init/udev-finish.conf" }, { "path" : "//etc/init/wait-for-state.conf", "job_class" : { "name" : "wait-for-state", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "path" : "//etc/init/acpid.conf", "job_class" : { "session" : 0, "name" : "acpid" }, "flag" : 1 }, { "path" : "//etc/init/alsa-restore.conf", "job_class" : { "session" : 0, "name" : "alsa-restore" }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "path" : "//etc/init/alsa-store.conf", "job_class" : { "session" : 0, "name" : "alsa-store" }, "conf_source" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "name" : "apparmor", "session" : 0 }, "path" : "//etc/init/apparmor.conf" }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/apport.conf", "job_class" : { "name" : "apport", "session" : 0 } }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cgproxy" }, "path" : "//etc/init/cgproxy.conf" }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/cron.conf", "job_class" : { "session" : 0, "name" : "cron" } }, { "job_class" : { "name" : "mountall-bootclean.sh", "session" : 0 }, "path" : "//etc/init/mountall-bootclean.sh.conf", "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/plymouth-stop.conf", "job_class" : { "session" : 0, "name" : "plymouth-stop" } }, { "conf_source" : 1, "path" : "//etc/init/procps.conf", "job_class" : { "session" : 0, "name" : "procps" }, "flag" : 1 }, { "path" : "//etc/init/hwclock.conf", "job_class" : { "name" : "hwclock", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "path" : "//etc/init/plymouth-shutdown.conf", "job_class" : { "session" : 0, "name" : "plymouth-shutdown" }, "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "path" : "//etc/init/container-detect.conf", "job_class" : { "name" : "container-detect", "session" : 0 }, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/cups-browsed.conf", "job_class" : { "name" : "cups-browsed", "session" : 0 } }, { "path" : "//etc/init/gpu-manager.conf", "job_class" : { "name" : "gpu-manager", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "job_class" : { "name" : "mountall", "session" : 0 }, "path" : "//etc/init/mountall.conf", "conf_source" : 1 }, { "conf_source" : 1, "path" : "//etc/init/mtab.sh.conf", "job_class" : { "name" : "mtab.sh", "session" : 0 }, "flag" : 1 }, { "job_class" : { "name" : "rcS", "session" : 0 }, "path" : "//etc/init/rcS.conf", "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "name" : "whoopsie", "session" : 0 }, "path" : "//etc/init/whoopsie.conf" }, { "flag" : 1, "conf_source" : 1, "job_class" : { "name" : "mountall.sh", "session" : 0 }, "path" : "//etc/init/mountall.sh.conf" }, { "conf_source" : 1, "path" : "//etc/init/network-interface-security.conf", "job_class" : { "session" : 0, "name" : "network-interface-security" }, "flag" : 1 }, { "job_class" : { "name" : "tty5", "session" : 0 }, "path" : "//etc/init/tty5.conf", "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "path" : "//etc/init/upstart-force-slow-child.conf", "job_class" : { "name" : "upstart-force-slow-child", "session" : 0 }, "flag" : 1 }, { "path" : "//etc/init/friendly-recovery.conf", "job_class" : { "session" : 0, "name" : "friendly-recovery" }, "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "path" : "//etc/init/jh-failsafe.conf", "job_class" : { "session" : 0, "name" : "jh-failsafe" }, "flag" : 1 }, { "path" : "//etc/init/mountall-reboot.conf", "job_class" : { "name" : "mountall-reboot", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "path" : "//etc/init/mounted-dev.conf", "job_class" : { "session" : 0, "name" : "mounted-dev" }, "conf_source" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "name" : "tty4", "session" : 0 }, "path" : "//etc/init/tty4.conf" }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/ureadahead-other.conf", "job_class" : { "session" : 0, "name" : "ureadahead-other" } }, { "conf_source" : 1, "job_class" : { "name" : "avahi-daemon", "session" : 0 }, "path" : "//etc/init/avahi-daemon.conf", "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cgmanager" }, "path" : "//etc/init/cgmanager.conf" }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cgroup-job1" }, "path" : "//etc/init/cgroup-job1.conf" }, { "flag" : 1, "conf_source" : 1, "job_class" : { "name" : "cgroup-job3", "session" : 0 }, "path" : "//etc/init/cgroup-job3.conf" }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe-x" }, "path" : "//etc/init/failsafe-x.conf" }, { "conf_source" : 1, "job_class" : { "name" : "mountkernfs.sh", "session" : 0 }, "path" : "//etc/init/mountkernfs.sh.conf", "flag" : 1 }, { "job_class" : { "name" : "rebooter", "session" : 0 }, "path" : "//etc/init/rebooter.conf", "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "name" : "rfkill-restore", "session" : 0 }, "path" : "//etc/init/rfkill-restore.conf" }, { "flag" : 1, "conf_source" : 1, "job_class" : { "name" : "rfkill-store", "session" : 0 }, "path" : "//etc/init/rfkill-store.conf" }, { "conf_source" : 1, "path" : "//etc/init/udevtrigger.conf", "job_class" : { "session" : 0, "name" : "udevtrigger" }, "flag" : 1 }, { "conf_source" : 1, "job_class" : { "name" : "upstart-socket-bridge", "session" : 0 }, "path" : "//etc/init/upstart-socket-bridge.conf", "flag" : 1 }, { "flag" : 1, "path" : "//etc/init/ureadahead.conf", "job_class" : { "session" : 0, "name" : "ureadahead" }, "conf_source" : 1 }, { "path" : "//etc/init/cgroup-invalid.conf", "job_class" : { "session" : 0, "name" : "cgroup-invalid" }, "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "path" : "//etc/init/foo.conf", "job_class" : { "name" : "foo", "session" : 0 }, "flag" : 1 }, { "path" : "//etc/init/passwd.conf", "job_class" : { "session" : 0, "name" : "passwd" }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "name" : "procenv", "session" : 0 }, "path" : "//etc/init/procenv.conf" }, { "conf_source" : 1, "job_class" : { "name" : "startpar-bridge", "session" : 0 }, "path" : "//etc/init/startpar-bridge.conf", "flag" : 1 }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "block-runlevel" }, "path" : "//etc/init/block-runlevel.conf", "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/mountall-net.conf", "job_class" : { "name" : "mountall-net", "session" : 0 } }, { "flag" : 1, "job_class" : { "name" : "mountnfs-bootclean.sh", "session" : 0 }, "path" : "//etc/init/mountnfs-bootclean.sh.conf", "conf_source" : 1 }, { "flag" : 1, "path" : "//etc/init/network-manager.conf", "job_class" : { "name" : "network-manager", "session" : 0 }, "conf_source" : 1 }, { "flag" : 1, "job_class" : { "session" : 0, "name" : "resolvconf" }, "path" : "//etc/init/resolvconf.conf", "conf_source" : 1 }, { "conf_source" : 1, "path" : "//etc/init/tty3.conf", "job_class" : { "session" : 0, "name" : "tty3" }, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cgroup-job4" }, "path" : "//etc/init/cgroup-job4.conf" }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkfs.sh" }, "path" : "//etc/init/checkfs.sh.conf" }, { "path" : "//etc/init/dbus.conf", "job_class" : { "session" : 0, "name" : "dbus" }, "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "path" : "//etc/init/flush-early-job-log.conf", "job_class" : { "session" : 0, "name" : "flush-early-job-log" }, "flag" : 1 }, { "flag" : 1, "path" : "//etc/init/network-interface-container.conf", "job_class" : { "name" : "network-interface-container", "session" : 0 }, "conf_source" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-ready" }, "path" : "//etc/init/plymouth-ready.conf" }, { "flag" : 1, "path" : "//etc/init/plymouth-splash.conf", "job_class" : { "session" : 0, "name" : "plymouth-splash" }, "conf_source" : 1 }, { "flag" : 1, "path" : "//etc/init/checkroot-bootclean.sh.conf", "job_class" : { "name" : "checkroot-bootclean.sh", "session" : 0 }, "conf_source" : 1 }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot.sh" }, "path" : "//etc/init/checkroot.sh.conf" }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-setup" }, "path" : "//etc/init/console-setup.conf" }, { "flag" : 1, "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console" }, "path" : "//etc/init/console.conf" }, { "conf_source" : 1, "path" : "//etc/init/cups.conf", "job_class" : { "name" : "cups", "session" : 0 }, "flag" : 1 }, { "flag" : 1, "conf_source" : 1, "path" : "//etc/init/dmesg.conf", "job_class" : { "name" : "dmesg", "session" : 0 } }, { "flag" : 1, "path" : "//etc/init/tty2.conf", "job_class" : { "name" : "tty2", "session" : 0 }, "conf_source" : 1 }, { "path" : "//etc/init/tty8.conf", "job_class" : { "name" : "tty8", "session" : 0 }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "job_class" : { "name" : "udev", "session" : 0 }, "path" : "//etc/init/udev.conf", "conf_source" : 1 }, { "flag" : 1, "path" : "//etc/init/bluetooth.conf", "job_class" : { "session" : 0, "name" : "bluetooth" }, "conf_source" : 1 }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bootmisc.sh" }, "path" : "//etc/init/bootmisc.sh.conf", "flag" : 1 }, { "flag" : 1, "path" : "//etc/init/cgroup.conf", "job_class" : { "session" : 0, "name" : "cgroup" }, "conf_source" : 1 }, { "job_class" : { "session" : 0, "name" : "hostname" }, "path" : "//etc/init/hostname.conf", "conf_source" : 1, "flag" : 1 }, { "path" : "//etc/init/kmod.conf", "job_class" : { "session" : 0, "name" : "kmod" }, "conf_source" : 1, "flag" : 1 }, { "flag" : 1, "path" : "//etc/init/tty6.conf", "job_class" : { "session" : 0, "name" : "tty6" }, "conf_source" : 1 }, { "conf_source" : 1, "path" : "//etc/init/udevmonitor.conf", "job_class" : { "session" : 0, "name" : "udevmonitor" }, "flag" : 1 }, { "path" : "//etc/init/upstart-file-bridge.conf", "job_class" : { "session" : 0, "name" : "upstart-file-bridge" }, "conf_source" : 1, "flag" : 1 }, { "conf_source" : 1, "path" : "//etc/init/upstart-udev-bridge.conf", "job_class" : { "name" : "upstart-udev-bridge", "session" : 0 }, "flag" : 1 } ], "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "//etc/init", "session" : 0 } ], "job_environment" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "events" : [ { "session" : 0, "env" : [ "KERNEL=fb0", "DEVPATH=/devices/pci0000:00/0000:00:02.0/graphics/fb0", "DEVNAME=/dev/fb0", "SUBSYSTEM=graphics", "ACTION=add", "ID_FOR_SEAT=graphics-pci-0000_00_02_0", "ID_PATH=pci-0000:00:02.0", "ID_PATH_TAG=pci-0000_00_02_0", "MAJOR=29", "MINOR=0", "PRIMARY_DEVICE_FOR_DISPLAY=1", "SEQNUM=1625", "TAGS=:master-of-seat:seat:", "USEC_INITIALIZED=530" ], "name" : "graphics-device-added", "fd" : -1, "failed" : 0, "blockers" : 2, "progress" : "EVENT_HANDLING" }, { "name" : "runlevel", "session" : 0, "env" : [ "RUNLEVEL=2", "PREVLEVEL=N" ], "failed" : 0, "fd" : -1, "progress" : "EVENT_HANDLING", "blockers" : 2 }, { "fd" : -1, "failed" : 1, "env" : [ "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "stopped", "blockers" : 1, "progress" : "EVENT_HANDLING" } ], "control_bus_address" : null, "sessions" : [], "job_classes" : [ { "process" : [ { "command" : "reload cups", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 0, "emits" : [], "setgid" : null, "debug" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2dcups_2dreload", "kill_timeout" : 5, "name" : "avahi-cups-reload", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : "Dmitrijs Ledkovs ", "description" : "Reload cups, upon starting avahi-daemon to make sure remote queues are populated", "respawn_interval" : 5, "jobs" : [], "start_on" : [ { "name" : "started", "value" : 0, "env" : [ "avahi-daemon" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [], "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ] }, { "usage" : null, "cgmanager_wait" : 0, "name" : "avahi-daemon", "deleted" : 0, "kill_signal" : 15, "nice" : -21, "version" : null, "description" : "mDNS/DNS-SD daemon", "author" : null, "respawn_interval" : 5, "jobs" : [ { "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 2, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon/_", "pid" : [ 777, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "respawn_time" : 0, "goal" : "JOB_START", "stop_on" : [ { "value" : 0, "name" : "stopping", "env" : [ "dbus" ], "type" : "EVENT_MATCH" } ], "trace_state" : "TRACE_NONE", "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID" } ], "chdir" : null, "start_on" : [ { "name" : "filesystem", "value" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "env" : [ "dbus" ], "name" : "started", "value" : 0 }, { "type" : "EVENT_AND", "value" : 0 } ], "export" : [], "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "env" : [], "chroot" : null, "expect" : "EXPECT_DAEMON", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n", "script" : 1 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 1, "emits" : [], "setgid" : null, "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "stopping", "value" : 0, "env" : [ "dbus" ] } ], "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon", "oom_score_adj" : 0, "kill_timeout" : 5 }, { "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dnet", "oom_score_adj" : 0, "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 1, "setgid" : null, "debug" : 0, "process" : [ { "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "emits" : [], "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "chdir" : null, "start_on" : [ { "name" : "net-device-up", "value" : 0, "type" : "EVENT_MATCH" } ], "export" : [], "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "respawn_interval" : 5, "jobs" : [], "cgmanager_wait" : 0, "usage" : null, "name" : "mountall-net", "deleted" : 0, "kill_signal" : 15, "nice" : -21, "version" : null, "description" : "Mount network filesystems", "author" : null }, { "nice" : -21, "version" : null, "description" : null, "author" : null, "usage" : null, "cgmanager_wait" : 0, "name" : "mountnfs-bootclean.sh", "deleted" : 0, "kill_signal" : 15, "jobs" : [ { "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "respawn_time" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "pid" : [ 0, 0, 0, 0, 0, 0 ] } ], "respawn_interval" : 5, "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "export" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "env" : [], "chroot" : null, "emits" : [], "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "debug" : 0, "setgid" : null, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "oom_score_adj" : 0 }, { "deleted" : 0, "kill_signal" : 15, "name" : "passwd", "usage" : null, "cgmanager_wait" : 0, "author" : null, "description" : "Clear passwd locks", "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [], "export" : [], "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "chdir" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "chroot" : null, "env" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "cgroups" : [], "respawn" : 0, "process" : [ { "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock", "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "emits" : [], "setgid" : null, "debug" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/passwd", "session" : 0, "kill_timeout" : 5 }, { "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [ "INIT_VERBOSE" ], "chroot" : null, "setuid" : null, "reload_signal" : 1, "console" : "CONSOLE_OUTPUT", "apparmor_switch" : null, "instance" : "", "chdir" : null, "start_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[0123456]" ], "type" : "EVENT_MATCH" } ], "export" : [ "RUNLEVEL", "PREVLEVEL" ], "jobs" : [], "respawn_interval" : 5, "nice" : -21, "version" : null, "description" : "System V runlevel compatibility", "author" : "Scott James Remnant ", "cgmanager_wait" : 0, "usage" : null, "name" : "rc", "kill_signal" : 15, "deleted" : 0, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/rc", "oom_score_adj" : 0, "task" : 1, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "runlevel", "env" : [ "[!$RUNLEVEL]" ] } ], "setgid" : null, "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "process" : [ { "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n status plymouth-shutdown 2>/dev/null >/dev/null && start wait-for-state WAITER=rc WAIT_FOR=plymouth-shutdown || :\nfi\n/etc/init.d/rc $RUNLEVEL\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0 }, { "jobs" : [ { "trace_forks" : 1, "state" : "JOB_RUNNING", "stop_env" : [], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "pid" : [ 750, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "respawn_time" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0 } ], "respawn_interval" : 5, "nice" : -21, "version" : null, "description" : "system logging daemon", "author" : null, "cgmanager_wait" : 0, "usage" : null, "name" : "rsyslog", "kill_signal" : 15, "deleted" : 0, "expect" : "EXPECT_FORK", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "env" : [], "chroot" : null, "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "filesystem", "value" : 0 } ], "export" : [], "debug" : 0, "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[06]" ], "type" : "EVENT_MATCH" } ], "setgid" : null, "emits" : [], "process" : [ { "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n", "script" : 1 }, { "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 1, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "oom_score_adj" : 0, "task" : 0, "respawn_limit" : 10, "umask" : 18, "normalexit" : [] }, { "task" : 1, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/startpar_2dbridge", "emits" : [], "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "debug" : 0, "setgid" : null, "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "console" : "CONSOLE_LOG", "start_on" : [ { "value" : 0, "name" : "started", "env" : [ "JOB!=startpar-bridge" ], "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chdir" : null, "export" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [], "chroot" : null, "version" : null, "nice" : -21, "author" : "Steve Langasek ", "description" : null, "name" : "startpar-bridge", "usage" : null, "cgmanager_wait" : 0, "kill_signal" : 15, "deleted" : 0, "jobs" : [], "respawn_interval" : 5 }, { "emits" : [], "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "respawn" : 1, "cgroups" : [], "stop_on" : [ { "value" : 0, "name" : "runlevel", "env" : [ "[!23]" ], "type" : "EVENT_MATCH" } ], "debug" : 0, "setgid" : null, "task" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "version" : null, "nice" : -21, "author" : null, "description" : null, "name" : "tty4", "usage" : null, "cgmanager_wait" : 0, "deleted" : 0, "kill_signal" : 15, "jobs" : [ { "goal" : "JOB_START", "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel" } ], "trace_state" : "TRACE_NONE", "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "trace_forks" : 0, "stop_env" : [], "state" : "JOB_RUNNING", "pid" : [ 1204, 0, 0, 0, 0, 0 ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "start_env" : [], "path" : "/com/ubuntu/Upstart/jobs/tty4/_", "respawn_time" : 0 } ], "respawn_interval" : 5, "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "start_on" : [ { "env" : [ "[23]" ], "name" : "runlevel", "value" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "name" : "not-container", "value" : 0 }, { "name" : "container", "value" : 0, "env" : [ "CONTAINER=lxc" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 }, { "name" : "container", "value" : 0, "env" : [ "CONTAINER=lxc-libvirt" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 }, { "value" : 0, "type" : "EVENT_AND" } ], "chdir" : null, "export" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null }, { "jobs" : [ { "trace_state" : "TRACE_NONE", "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[06]" ] } ], "goal" : "JOB_START", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "start_env" : [], "pid" : [ 648, 0, 0, 0, 0, 0 ], "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 1, "respawn_time" : 0 } ], "respawn_interval" : 5, "nice" : -21, "version" : null, "description" : "device node and kernel event manager", "author" : null, "usage" : null, "cgmanager_wait" : 0, "name" : "udev", "deleted" : 0, "kill_signal" : 15, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_FORK", "env" : [], "chroot" : null, "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "virtual-filesystems" } ], "export" : [], "debug" : 0, "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "setgid" : null, "emits" : [], "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 1, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "oom_score_adj" : 0, "task" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10 }, { "jobs" : [ { "trace_forks" : 2, "state" : "JOB_RUNNING", "stop_env" : [], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "pid" : [ 635, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "respawn_time" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "stopped", "env" : [ "udev" ] } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0 } ], "respawn_interval" : 5, "version" : null, "nice" : -21, "author" : null, "description" : "Bridge udev events into upstart", "name" : "upstart-udev-bridge", "cgmanager_wait" : 0, "usage" : null, "deleted" : 0, "kill_signal" : 15, "expect" : "EXPECT_DAEMON", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "env" : [], "chroot" : null, "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [], "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "udev" ], "value" : 0, "name" : "stopped" } ], "debug" : 0, "setgid" : null, "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "respawn" : 1, "cgroups" : [], "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10 }, { "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "mounted", "value" : 0, "env" : [ "DEVICE=[/UL]*", "MOUNTPOINT=/?*" ] } ], "export" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_FORK", "env" : [], "chroot" : null, "nice" : -21, "version" : null, "description" : "Read required files in advance (for other mountpoints)", "author" : null, "usage" : null, "cgmanager_wait" : 0, "name" : "ureadahead-other", "deleted" : 0, "kill_signal" : 15, "jobs" : [], "respawn_interval" : 5, "task" : 0, "umask" : 18, "normalexit" : [ 0, 4 ], "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead_2dother", "oom_score_adj" : 0, "emits" : [], "process" : [ { "command" : "/sbin/ureadahead --daemon $MOUNTPOINT", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [], "debug" : 0, "setgid" : null }, { "respawn" : 1, "cgroups" : [], "process" : [ { "command" : "whoopsie", "script" : 0 }, { "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n", "script" : 1 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "emits" : [], "setgid" : null, "stop_on" : [ { "value" : 0, "name" : "runlevel", "env" : [ "[!2345]" ], "type" : "EVENT_MATCH" } ], "debug" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "session" : 0, "kill_timeout" : 5, "kill_signal" : 15, "deleted" : 0, "name" : "whoopsie", "usage" : null, "cgmanager_wait" : 0, "author" : null, "description" : "crash report submission daemon", "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [ { "respawn_time" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie/_", "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "CRASH_DB_URL=https://daisy.ubuntu.com", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "pid" : [ 1281, 0, 0, 0, 0, 0 ], "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 1, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ] } ], "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[2345]" ] } ], "chdir" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "chroot" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "expect" : "EXPECT_FORK", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ] }, { "setgid" : null, "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[!2345]" ] } ], "process" : [ { "command" : null, "script" : 0 }, { "command" : " # don't start in containers\n /bin/running-in-container && exit 0\n\n . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c %P\" > /proc/sys/kernel/core_pattern\n echo 2 > /proc/sys/fs/suid_dumpable\n", "script" : 1 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # don't stop in containers\n /bin/running-in-container && exit 0\n\n # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo 0 > /proc/sys/fs/suid_dumpable\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 0, "emits" : [], "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "oom_score_adj" : 0, "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "respawn_interval" : 5, "jobs" : [ { "goal" : "JOB_START", "stop_on" : [ { "value" : 0, "name" : "runlevel", "env" : [ "[!2345]" ], "type" : "EVENT_MATCH" } ], "trace_state" : "TRACE_NONE", "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID", "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport/_", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "enabled=1", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "respawn_time" : 0 } ], "cgmanager_wait" : 0, "usage" : null, "name" : "apport", "kill_signal" : 15, "deleted" : 0, "nice" : -21, "version" : null, "description" : "automatic crash report generation", "author" : null, "env" : [ "enabled=1" ], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel" } ], "export" : [], "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG" }, { "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "start_on" : [ { "type" : "EVENT_MATCH", "name" : "started", "value" : 0, "env" : [ "cgroup-job1" ] } ], "chdir" : null, "export" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null, "version" : null, "nice" : -21, "author" : null, "description" : null, "name" : "cgroup-job4", "usage" : null, "cgmanager_wait" : 0, "kill_signal" : 15, "deleted" : 0, "jobs" : [], "respawn_interval" : 5, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgroup_2djob4", "emits" : [], "process" : [ { "script" : 0, "command" : "sleep 999" }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "cgroups" : [ { "controller" : "cpuset", "names" : [ { "name" : "db/$UPSTART_CGROUP", "expanded" : null, "settings" : [ { "key" : "cpus", "value" : "2" } ] } ] } ], "respawn" : 0, "debug" : 0, "setgid" : null }, { "respawn_interval" : 5, "jobs" : [ { "respawn_time" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgroup_2dprocenv/_", "pid" : [ 728, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 2, "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID", "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "goal" : "JOB_START", "trace_state" : "TRACE_NONE" } ], "kill_signal" : 15, "deleted" : 0, "usage" : null, "cgmanager_wait" : 0, "name" : "cgroup-procenv", "description" : null, "author" : null, "nice" : -21, "version" : null, "chroot" : null, "env" : [], "expect" : "EXPECT_DAEMON", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "filesystem" } ], "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "setgid" : null, "debug" : 0, "respawn" : 0, "cgroups" : [ { "controller" : "memory", "names" : [ { "name" : "james-procenv-cgroup", "expanded" : null, "settings" : [ { "value" : "12428800", "key" : "limit_in_bytes" } ] } ] } ], "process" : [ { "command" : "/home/james/src/c/bin/test_nih_daemonise --daemon --logfile /tmp/test_nih_daemonise.log --pidfile /tmp/test_nih_daemonise.pid --pidlist-file test_nih_daemonise.pidlist --exec -- /usr/bin/procenv --file /tmp/procenv.log --exec -- sleep 999", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "emits" : [], "path" : "/com/ubuntu/Upstart/jobs/cgroup_2dprocenv", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0 }, { "usage" : null, "cgmanager_wait" : 0, "name" : "console-setup", "kill_signal" : 15, "deleted" : 0, "nice" : -21, "version" : null, "description" : "set console keymap", "author" : null, "respawn_interval" : 5, "jobs" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "virtual-filesystems", "value" : 0 }, { "env" : [ "rcS" ], "name" : "starting", "value" : 0, "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "type" : "EVENT_MATCH", "env" : [ "mountall-shell" ], "name" : "starting", "value" : 0 }, { "type" : "EVENT_OR", "value" : 0 } ], "export" : [], "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "env" : [], "chroot" : null, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [], "emits" : [], "setgid" : null, "debug" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/console_2dsetup", "oom_score_adj" : 0, "kill_timeout" : 5 }, { "kill_signal" : 15, "deleted" : 0, "name" : "gpu-manager", "usage" : null, "cgmanager_wait" : 0, "author" : null, "description" : null, "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [], "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "starting", "value" : 0, "env" : [ "lightdm" ] }, { "type" : "EVENT_MATCH", "name" : "starting", "value" : 0, "env" : [ "gdm" ] }, { "value" : 0, "type" : "EVENT_OR" }, { "type" : "EVENT_MATCH", "name" : "starting", "value" : 0, "env" : [ "kdm" ] }, { "value" : 0, "type" : "EVENT_OR" }, { "name" : "starting", "value" : 0, "env" : [ "xdm" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 }, { "name" : "starting", "value" : 0, "env" : [ "lxdm" ], "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chdir" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1, "chroot" : null, "env" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "gpu-manager --log /var/log/gpu-manager.log", "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "emits" : [], "setgid" : null, "debug" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/gpu_2dmanager", "session" : 0, "kill_timeout" : 5 }, { "debug" : 0, "setgid" : null, "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n", "script" : 1 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/hwclock_2dsave", "session" : 0, "task" : 1, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "jobs" : [], "respawn_interval" : 5, "author" : null, "description" : "save system clock to hardware clock", "version" : null, "nice" : -21, "deleted" : 0, "kill_signal" : 15, "name" : "hwclock-save", "usage" : null, "cgmanager_wait" : 0, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [], "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "setuid" : null, "reload_signal" : 1, "export" : [], "start_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[06]" ], "type" : "EVENT_MATCH" } ], "chdir" : null }, { "path" : "/com/ubuntu/Upstart/jobs/irqbalance", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "setgid" : null, "debug" : 0, "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[!2345]" ], "type" : "EVENT_MATCH" } ], "respawn" : 0, "cgroups" : [], "process" : [ { "script" : 1, "command" : "\ttest -f /etc/default/irqbalance && . /etc/default/irqbalance\n\n\ttest \"$ENABLED\" != \"0\" || exit 0\n\n\tif test \"$ONESHOT\" != \"0\"; then\n\t\tDOPTIONS=\"--oneshot\"\n\tfi\n\n\texec /usr/sbin/irqbalance $DOPTIONS\n\n" }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "emits" : [], "chroot" : null, "env" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_FORK", "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[2345]" ], "name" : "runlevel", "value" : 0 } ], "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "reload_signal" : 1, "setuid" : null, "respawn_interval" : 5, "jobs" : [], "kill_signal" : 15, "deleted" : 0, "cgmanager_wait" : 0, "usage" : null, "name" : "irqbalance", "description" : "CPU interrupts balancing daemon", "author" : "Chuck Short ", "nice" : -21, "version" : null }, { "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "env" : [], "chroot" : null, "reload_signal" : 1, "setuid" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "chdir" : null, "start_on" : [ { "name" : "filesystem", "value" : 0, "type" : "EVENT_MATCH" } ], "export" : [], "jobs" : [], "respawn_interval" : 5, "nice" : -21, "version" : null, "description" : "Flush boot log to disk", "author" : null, "usage" : null, "cgmanager_wait" : 0, "name" : "plymouth-log", "deleted" : 0, "kill_signal" : 15, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dlog", "oom_score_adj" : 0, "task" : 1, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "debug" : 0, "setgid" : null, "emits" : [], "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [] }, { "chroot" : null, "env" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[23]" ], "value" : 0, "name" : "runlevel" }, { "type" : "EVENT_MATCH", "name" : "not-container", "value" : 0 }, { "type" : "EVENT_AND", "value" : 0 } ], "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "respawn_interval" : 5, "jobs" : [ { "respawn_time" : 0, "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5/_", "pid" : [ 1208, 0, 0, 0, 0, 0 ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "start_env" : [], "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "goal" : "JOB_START", "trace_state" : "TRACE_NONE" } ], "deleted" : 0, "kill_signal" : 15, "cgmanager_wait" : 0, "usage" : null, "name" : "tty5", "description" : null, "author" : null, "nice" : -21, "version" : null, "path" : "/com/ubuntu/Upstart/jobs/tty5", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 5, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "task" : 0, "setgid" : null, "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[!23]" ] } ], "cgroups" : [], "respawn" : 1, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "emits" : [] }, { "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgroup_2dinvalid", "session" : 0, "kill_timeout" : 5, "respawn" : 0, "cgroups" : [ { "names" : [ { "name" : "james-procenv-cgroup", "expanded" : null, "settings" : [ { "value" : "12428800", "key" : "limit_in_bytes" } ] } ], "controller" : "invalid" } ], "process" : [ { "script" : 0, "command" : "sleep 999" }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "emits" : [], "setgid" : null, "debug" : 0, "export" : [], "start_on" : [ { "name" : "filesystem", "value" : 0, "type" : "EVENT_MATCH" } ], "chdir" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "reload_signal" : 1, "setuid" : null, "chroot" : null, "env" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "kill_signal" : 15, "deleted" : 0, "name" : "cgroup-invalid", "usage" : null, "cgmanager_wait" : 0, "author" : null, "description" : null, "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [] }, { "task" : 0, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/failsafe", "oom_score_adj" : 0, "session" : 0, "emits" : [ "failsafe-boot" ], "cgroups" : [], "respawn" : 0, "process" : [ { "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n", "script" : 1 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "static-network-up", "value" : 0 }, { "type" : "EVENT_MATCH", "env" : [ "rc-sysinit" ], "name" : "starting", "value" : 0 }, { "type" : "EVENT_OR", "value" : 0 } ], "setgid" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_OUTPUT", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "description" : "Failsafe Boot Delay", "author" : "Clint Byrum ", "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "cgmanager_wait" : 0, "usage" : null, "name" : "failsafe", "jobs" : [], "respawn_interval" : 5 }, { "jobs" : [ { "respawn_time" : 0, "trace_forks" : 0, "stop_env" : [], "state" : "JOB_RUNNING", "pid" : [ 922, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "path" : "/com/ubuntu/Upstart/jobs/modemmanager/_", "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "open_errno" : 9, "uid" : 0, "io_watch_fd" : 16, "detached" : 0, "remote_closed" : 0, "fd" : 21, "path" : "/var/log/upstart/modemmanager.log" }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "stop_on" : [ { "env" : [ "network-manager" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" } ], "goal" : "JOB_START", "trace_state" : "TRACE_NONE" } ], "respawn_interval" : 5, "author" : null, "description" : "modem connection manager", "version" : null, "nice" : -21, "kill_signal" : 15, "deleted" : 0, "name" : "modemmanager", "cgmanager_wait" : 0, "usage" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "starting", "env" : [ "network-manager" ] } ], "chdir" : null, "stop_on" : [ { "env" : [ "network-manager" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" } ], "debug" : 0, "setgid" : null, "emits" : [], "respawn" : 1, "cgroups" : [], "process" : [ { "script" : 0, "command" : "/usr/sbin/ModemManager" }, { "command" : "[ -x /usr/sbin/ModemManager ] || stop\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/modemmanager", "session" : 0, "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [] }, { "version" : null, "nice" : -21, "author" : null, "description" : "Signal sysvinit that local filesystems are mounted", "name" : "mountall.sh", "usage" : null, "cgmanager_wait" : 0, "deleted" : 0, "kill_signal" : 15, "jobs" : [ { "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "respawn_time" : 0, "goal" : "JOB_START", "trace_state" : "TRACE_NONE", "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID" } ], "respawn_interval" : 5, "reload_signal" : 1, "setuid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "start_on" : [ { "type" : "EVENT_MATCH", "name" : "local-filesystems", "value" : 0 } ], "chdir" : null, "export" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null, "emits" : [], "process" : [ { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 0, "debug" : 0, "setgid" : null, "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh" }, { "jobs" : [], "respawn_interval" : 5, "description" : "set sysctls from /etc/sysctl.conf", "author" : null, "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "usage" : null, "cgmanager_wait" : 0, "name" : "procps-instance", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [ "UPSTART_EVENTS=" ], "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "$UPSTART_EVENTS", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "value" : 0, "name" : "static-network-up" }, { "type" : "EVENT_OR", "value" : 0 } ], "debug" : 0, "setgid" : null, "emits" : [], "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n", "script" : 1 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/procps_2dinstance", "oom_score_adj" : 0, "session" : 0, "task" : 1, "umask" : 18, "respawn_limit" : 10, "normalexit" : [] }, { "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2dstore", "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "setgid" : null, "debug" : 0, "process" : [ { "script" : 1, "command" : " if [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n mkdir -p /var/lib/rfkill\n > /var/lib/rfkill/saved-state\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n entry=\"$(cat $device/name) $(cat $device/soft)\"\n echo $entry >> /var/lib/rfkill/saved-state\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 0, "emits" : [], "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[016]" ], "value" : 0, "name" : "runlevel" } ], "chdir" : null, "export" : [], "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "respawn_interval" : 5, "jobs" : [], "name" : "rfkill-store", "usage" : null, "cgmanager_wait" : 0, "deleted" : 0, "kill_signal" : 15, "version" : null, "nice" : -21, "author" : null, "description" : "store software rfkill state" }, { "cgroups" : [], "respawn" : 0, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "emits" : [], "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "alsa-store" ], "name" : "started", "value" : 0 } ], "debug" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dutils", "session" : 0, "kill_timeout" : 5, "deleted" : 0, "kill_signal" : 15, "name" : "alsa-utils", "cgmanager_wait" : 0, "usage" : null, "author" : null, "description" : "Signal sysvinit that alsa-utils tasks are complete", "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [], "export" : [], "start_on" : [ { "env" : [ "alsa-restore" ], "name" : "started", "value" : 0, "type" : "EVENT_MATCH" } ], "chdir" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "chroot" : null, "env" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE" }, { "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/atd", "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel" } ], "debug" : 0, "setgid" : null, "emits" : [], "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "respawn" : 1, "cgroups" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_FORK", "env" : [], "chroot" : null, "reload_signal" : 1, "setuid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "start_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[2345]" ] } ], "chdir" : null, "export" : [], "jobs" : [ { "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 1, "path" : "/com/ubuntu/Upstart/jobs/atd/_", "pid" : [ 1225, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "respawn_time" : 0, "goal" : "JOB_START", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "trace_state" : "TRACE_NONE", "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID" } ], "respawn_interval" : 5, "version" : null, "nice" : -21, "author" : null, "description" : "deferred execution scheduler", "name" : "atd", "cgmanager_wait" : 0, "usage" : null, "deleted" : 0, "kill_signal" : 15 }, { "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/dbus", "oom_score_adj" : 0, "session" : 0, "emits" : [], "cgroups" : [], "respawn" : 1, "process" : [ { "command" : "dbus-daemon --system --fork", "script" : 0 }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "command" : null, "script" : 0 } ], "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "deconfiguring-networking", "value" : 0 } ], "setgid" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "local-filesystems", "value" : 0 } ], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_FORK", "chroot" : null, "env" : [], "description" : "D-Bus system message bus", "author" : null, "nice" : -21, "version" : null, "kill_signal" : 15, "deleted" : 0, "usage" : null, "cgmanager_wait" : 0, "name" : "dbus", "jobs" : [ { "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "respawn_time" : 0, "trace_forks" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "pid" : [ 659, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/dbus/_" } ], "respawn_interval" : 5 }, { "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/failsafe_2dx", "oom_score_adj" : 0, "session" : 0, "task" : 1, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[06]" ], "name" : "runlevel", "value" : 0 } ], "setgid" : null, "emits" : [], "respawn" : 0, "cgroups" : [], "process" : [ { "script" : 0, "command" : "/usr/share/xdiagnose/failsafeXServer \"$JOB\"" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [], "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "env" : [ "lightdm", "RESULT=failed" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "env" : [ "gdm", "RESULT=failed" ], "name" : "stopped", "value" : 0 }, { "value" : 0, "type" : "EVENT_OR" } ], "jobs" : [], "respawn_interval" : 5, "description" : "Recovery options if display manager fails to start", "author" : null, "nice" : -21, "version" : null, "kill_signal" : 15, "deleted" : 0, "usage" : null, "cgmanager_wait" : 0, "name" : "failsafe-x" }, { "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "mounted", "env" : [ "MOUNTPOINT=/var" ] } ], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [], "description" : "Populate /var filesystem", "author" : null, "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "usage" : null, "cgmanager_wait" : 0, "name" : "mounted-var", "jobs" : [], "respawn_interval" : 5, "task" : 1, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dvar", "oom_score_adj" : 0, "session" : 0, "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "debug" : 0, "setgid" : null }, { "export" : [], "chdir" : null, "start_on" : [ { "env" : [ "[016]" ], "name" : "runlevel", "value" : 0, "type" : "EVENT_MATCH" }, { "name" : "stopped", "value" : 0, "env" : [ "xdm" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped" }, { "type" : "EVENT_OR", "value" : 0 }, { "type" : "EVENT_AND", "value" : 0 } ], "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "chroot" : null, "env" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_FORK", "deleted" : 0, "kill_signal" : 15, "cgmanager_wait" : 0, "usage" : null, "name" : "plymouth-shutdown", "description" : "userspace bootsplash utility", "author" : null, "nice" : -21, "version" : null, "respawn_interval" : 5, "jobs" : [], "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dshutdown", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 60, "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "/sbin/plymouthd --mode=shutdown", "script" : 0 }, { "command" : "status lightdm >/dev/null 2>/dev/null && start wait-for-state WAITER=plymouth-shutdown WAIT_FOR=lightdm TARGET_GOAL=stop WAIT_STATE=waiting || :\n", "script" : 1 }, { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "command" : "/bin/plymouth quit", "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "emits" : [], "setgid" : null, "debug" : 0 }, { "kill_timeout" : 60, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth", "session" : 0, "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "debug" : 0, "setgid" : null, "emits" : [], "respawn" : 0, "cgroups" : [], "process" : [ { "script" : 0, "command" : "/sbin/plymouthd --mode=boot --attach-to-session" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "expect" : "EXPECT_FORK", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "setuid" : null, "reload_signal" : 1, "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "starting", "env" : [ "mountall" ] } ], "chdir" : null, "jobs" : [], "respawn_interval" : 5, "author" : null, "description" : "userspace bootsplash utility", "version" : null, "nice" : -21, "deleted" : 0, "kill_signal" : 15, "name" : "plymouth", "cgmanager_wait" : 0, "usage" : null }, { "chroot" : null, "env" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "export" : [], "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "chdir" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "setuid" : null, "reload_signal" : 1, "respawn_interval" : 5, "jobs" : [ { "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[06]" ], "value" : 0, "name" : "runlevel" } ], "respawn_time" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ] } ], "deleted" : 0, "kill_signal" : 15, "name" : "resolvconf", "cgmanager_wait" : 0, "usage" : null, "author" : null, "description" : "Initialize or finalize resolvconf", "version" : null, "nice" : -21, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "session" : 0, "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "setgid" : null, "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[06]" ], "type" : "EVENT_MATCH" } ], "debug" : 0, "respawn" : 0, "cgroups" : [], "process" : [ { "script" : 0, "command" : null }, { "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "command" : null, "script" : 0 } ], "emits" : [] }, { "setgid" : null, "debug" : 0, "cgroups" : [], "respawn" : 0, "process" : [ { "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "emits" : [], "path" : "/com/ubuntu/Upstart/jobs/udev_2dfallback_2dgraphics", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "respawn_interval" : 5, "jobs" : [], "kill_signal" : 15, "deleted" : 0, "usage" : null, "cgmanager_wait" : 0, "name" : "udev-fallback-graphics", "description" : "load fallback graphics devices", "author" : null, "nice" : -21, "version" : null, "chroot" : null, "env" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "export" : [], "chdir" : null, "start_on" : [ { "name" : "startup", "value" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "value" : 1, "name" : "graphics-device-added", "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "event" : 0 }, { "type" : "EVENT_MATCH", "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "name" : "drm-device-added", "value" : 0 }, { "value" : 1, "type" : "EVENT_OR" }, { "type" : "EVENT_MATCH", "env" : [ "udevtrigger" ], "name" : "stopped", "value" : 0 }, { "type" : "EVENT_OR", "value" : 1 }, { "type" : "EVENT_MATCH", "value" : 0, "name" : "container" }, { "type" : "EVENT_OR", "value" : 1 }, { "type" : "EVENT_AND", "value" : 0 } ], "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null }, { "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "script" : 1, "command" : "exec /usr/sbin/usb_modeswitch_dispatcher --switch-upstart $UMS_PARAM\n" }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "debug" : 0, "setgid" : null, "task" : 1, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/usb_2dmodeswitch_2dupstart", "oom_score_adj" : 0, "session" : 0, "description" : null, "author" : null, "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "cgmanager_wait" : 0, "usage" : null, "name" : "usb-modeswitch-upstart", "jobs" : [], "respawn_interval" : 5, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "usb-modeswitch-upstart", "value" : 0 } ], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [] }, { "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "mounted", "env" : [ "MOUNTPOINT=/" ] } ], "jobs" : [ { "goal" : "JOB_START", "trace_state" : "TRACE_NONE", "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/e9c64d1b-e85b-4774-a40f-3f7a6f2f7a4e", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "trace_forks" : 0, "stop_env" : [], "state" : "JOB_RUNNING", "respawn_time" : 0 } ], "respawn_interval" : 5, "description" : "Signal sysvinit that the rootfs is mounted", "author" : null, "nice" : -21, "version" : null, "kill_signal" : 15, "deleted" : 0, "cgmanager_wait" : 0, "usage" : null, "name" : "checkroot.sh", "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "oom_score_adj" : 0, "session" : 0, "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "debug" : 0, "setgid" : null, "emits" : [], "respawn" : 0, "cgroups" : [], "process" : [ { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ] }, { "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "setuid" : null, "reload_signal" : 1, "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "control-alt-delete", "value" : 0 } ], "chdir" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "author" : "Scott James Remnant ", "description" : "emergency keypress handling", "version" : null, "nice" : -21, "kill_signal" : 15, "deleted" : 0, "name" : "control-alt-delete", "usage" : null, "cgmanager_wait" : 0, "jobs" : [], "respawn_interval" : 5, "task" : 1, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/control_2dalt_2ddelete", "session" : 0, "emits" : [], "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "shutdown -r now \"Control-Alt-Delete pressed\"", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "debug" : 0, "setgid" : null }, { "emits" : [], "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 0, "debug" : 0, "setgid" : null, "task" : 1, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/hwclock", "version" : null, "nice" : -21, "author" : null, "description" : "adjust system clock and timezone", "name" : "hwclock", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0, "jobs" : [], "respawn_interval" : 5, "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "start_on" : [ { "value" : 0, "name" : "starting", "env" : [ "mountall" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [], "chroot" : null }, { "usage" : null, "cgmanager_wait" : 0, "name" : "mounted-proc", "deleted" : 0, "kill_signal" : 15, "nice" : -21, "version" : null, "description" : "Fix-up sensitive /proc filesystem entries", "author" : null, "respawn_interval" : 5, "jobs" : [], "chdir" : null, "start_on" : [ { "name" : "mounted", "value" : 0, "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "type" : "EVENT_MATCH" } ], "export" : [], "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "env" : [ "MOUNTPOINT=/proc" ], "chroot" : null, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "process" : [ { "script" : 1, "command" : "if [ -e \"${MOUNTPOINT}\"/slabinfo ]; then\n chmod 0400 \"${MOUNTPOINT}\"/slabinfo\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [], "emits" : [], "setgid" : null, "debug" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "task" : 1, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dproc", "oom_score_adj" : 0, "kill_timeout" : 5 }, { "expect" : "EXPECT_FORK", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [], "chroot" : null, "setuid" : null, "reload_signal" : 1, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "started", "env" : [ "dbus" ], "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "type" : "EVENT_MATCH", "value" : 0, "name" : "static-network-up" }, { "value" : 0, "type" : "EVENT_AND" } ], "chdir" : null, "export" : [], "jobs" : [ { "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=local-filesystems started static-network-up" ], "start_env" : [], "pid" : [ 985, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager/_", "trace_forks" : 1, "state" : "JOB_RUNNING", "stop_env" : [], "respawn_time" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "stopping", "value" : 0, "env" : [ "dbus" ] } ], "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ] } ], "respawn_interval" : 5, "version" : null, "nice" : -21, "author" : null, "description" : "network connection manager", "name" : "network-manager", "usage" : null, "cgmanager_wait" : 0, "deleted" : 0, "kill_signal" : 15, "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager", "task" : 0, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "dbus" ], "name" : "stopping", "value" : 0 } ], "debug" : 0, "setgid" : null, "emits" : [], "process" : [ { "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n", "script" : 1 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn" : 1, "cgroups" : [] }, { "name" : "procenv", "cgmanager_wait" : 0, "usage" : null, "deleted" : 0, "kill_signal" : 15, "version" : null, "nice" : -21, "author" : null, "description" : null, "respawn_interval" : 5, "jobs" : [], "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "startup" } ], "chdir" : null, "export" : [], "reload_signal" : 1, "setuid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "process" : [ { "script" : 0, "command" : "procenv" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [], "emits" : [], "setgid" : null, "debug" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/procenv", "kill_timeout" : 5 }, { "emits" : [], "cgroups" : [], "respawn" : 1, "process" : [ { "command" : "/sbin/getty -8 38400 tty8", "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "debug" : 0, "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[!23]" ], "type" : "EVENT_MATCH" } ], "setgid" : null, "task" : 0, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/tty8", "oom_score_adj" : 0, "session" : 0, "description" : null, "author" : null, "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "usage" : null, "cgmanager_wait" : 0, "name" : "tty8", "jobs" : [ { "trace_state" : "TRACE_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "goal" : "JOB_START", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty8/_", "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=startup" ], "pid" : [ 455, 0, 0, 0, 0, 0 ], "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "respawn_time" : 0 } ], "respawn_interval" : 5, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "startup" } ], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [] }, { "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "start_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[!2345]" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [ "ALSACTLHOME=/var/run/alsa" ], "chroot" : null, "version" : null, "nice" : -21, "author" : null, "description" : "Store Sound Card State", "name" : "alsa-store", "usage" : null, "cgmanager_wait" : 0, "kill_signal" : 15, "deleted" : 0, "jobs" : [], "respawn_interval" : 5, "task" : 1, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dstore", "emits" : [], "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl -E HOME=\"$ALSACTLHOME\" store" }, { "script" : 1, "command" : "if ! test -d $ALSACTLHOME ; then\n mkdir -p $ALSACTLHOME\nfi\nif test -f /var/lib/alsa/state-daemon.conf ; then\n stop; exit 0\nfi\n" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [], "debug" : 0, "setgid" : null }, { "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[016]" ] } ], "debug" : 0, "cgroups" : [], "respawn" : 1, "process" : [ { "command" : "/usr/sbin/cups-browsed", "script" : 0 }, { "command" : "[ -x /usr/sbin/cups-browsed ]\nif [ -x /lib/init/apparmor-profile-load ]; then\n /lib/init/apparmor-profile-load usr.sbin.cups-browsed\nfi\n", "script" : 1 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "emits" : [], "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed", "session" : 0, "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 3, "task" : 0, "respawn_interval" : 240, "jobs" : [ { "trace_forks" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=cups", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "start_env" : [], "pid" : [ 823, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed/_", "respawn_time" : 0, "trace_state" : "TRACE_NONE", "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[016]" ], "type" : "EVENT_MATCH" } ], "goal" : "JOB_START", "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "open_errno" : 0, "io_watch_fd" : 20, "uid" : 0, "detached" : 0, "remote_closed" : 0, "path" : "/var/log/upstart/cups-browsed.log", "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0 } ], "kill_signal" : 15, "deleted" : 0, "name" : "cups-browsed", "usage" : null, "cgmanager_wait" : 0, "author" : "Till Kamppeter ", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "version" : null, "nice" : -21, "chroot" : null, "env" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "filesystem", "value" : 0 }, { "type" : "EVENT_MATCH", "env" : [ "cups" ], "name" : "started", "value" : 0 }, { "event" : 1, "name" : "runlevel", "value" : 1, "env" : [ "[2345]" ], "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "chdir" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1 }, { "version" : null, "nice" : -21, "author" : "Dustin Kirkland ", "description" : null, "name" : "setvtrgb", "cgmanager_wait" : 0, "usage" : null, "deleted" : 0, "kill_signal" : 15, "jobs" : [], "respawn_interval" : 5, "reload_signal" : 1, "setuid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "start_on" : [ { "env" : [ "plymouth-splash" ], "name" : "started", "value" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "env" : [ "tty1" ], "name" : "started", "value" : 0 }, { "value" : 0, "type" : "EVENT_OR" } ], "chdir" : null, "export" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "env" : [], "chroot" : null, "emits" : [], "process" : [ { "command" : "setvtrgb /etc/vtrgb", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "debug" : 0, "setgid" : null, "task" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/setvtrgb" }, { "jobs" : [], "respawn_interval" : 5, "description" : "Trigger an immediate shutdown on SIGPWR", "author" : null, "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "cgmanager_wait" : 0, "usage" : null, "name" : "shutdown", "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "name" : "power-status-changed", "value" : 0, "type" : "EVENT_MATCH" } ], "debug" : 0, "setgid" : null, "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/shutdown", "oom_score_adj" : 0, "session" : 0, "task" : 1, "normalexit" : [], "umask" : 18, "respawn_limit" : 10 }, { "env" : [ "ALSACTLHOME=/var/run/alsa" ], "chroot" : null, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[2345]" ] } ], "export" : [], "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "respawn_interval" : 5, "jobs" : [], "usage" : null, "cgmanager_wait" : 0, "name" : "alsa-restore", "deleted" : 0, "kill_signal" : 15, "nice" : -21, "version" : null, "description" : "Restore Sound Card State", "author" : null, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/alsa_2drestore", "oom_score_adj" : 0, "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "setgid" : null, "debug" : 0, "process" : [ { "command" : "/usr/sbin/alsactl -E HOME=\"$ALSACTLHOME\" restore", "script" : 0 }, { "command" : "if ! test -d $ALSACTLHOME ; then\n mkdir -p $ALSACTLHOME\nfi\nif test -f /var/lib/alsa/state-daemon.conf ; then\n stop; exit 0\nfi\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "emits" : [] }, { "task" : 0, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/cron", "oom_score_adj" : 0, "session" : 0, "emits" : [], "respawn" : 1, "cgroups" : [], "process" : [ { "script" : 0, "command" : "cron" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "debug" : 0, "stop_on" : [ { "value" : 0, "name" : "runlevel", "env" : [ "[!2345]" ], "type" : "EVENT_MATCH" } ], "setgid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[2345]" ], "type" : "EVENT_MATCH" } ], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_FORK", "chroot" : null, "env" : [], "description" : "regular background program processing daemon", "author" : null, "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "usage" : null, "cgmanager_wait" : 0, "name" : "cron", "jobs" : [ { "goal" : "JOB_START", "stop_on" : [ { "env" : [ "[!2345]" ], "name" : "runlevel", "value" : 0, "type" : "EVENT_MATCH" } ], "trace_state" : "TRACE_NONE", "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "pid" : [ 1226, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "path" : "/com/ubuntu/Upstart/jobs/cron/_", "trace_forks" : 1, "stop_env" : [], "state" : "JOB_RUNNING", "respawn_time" : 0 } ], "respawn_interval" : 5 }, { "jobs" : [ { "goal" : "JOB_START", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "trace_state" : "TRACE_NONE", "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "io_watch_fd" : 36, "uid" : 0, "detached" : 0, "remote_closed" : 0, "fd" : -1, "path" : "/var/log/upstart/lightdm.log", "open_errno" : 0 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID", "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm/_", "pid" : [ 1287, 0, 0, 0, 0, 0 ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem runlevel started plymouth-ready" ], "start_env" : [], "respawn_time" : 0 } ], "respawn_interval" : 15, "version" : null, "nice" : -21, "author" : "Robert Ancell ", "description" : "LightDM Display Manager", "name" : "lightdm", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null, "reload_signal" : 1, "setuid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "start_on" : [ { "type" : "EVENT_MATCH", "name" : "filesystem", "value" : 0 }, { "env" : [ "[!06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "type" : "EVENT_AND", "value" : 0 }, { "type" : "EVENT_MATCH", "value" : 0, "name" : "plymouth-ready" }, { "type" : "EVENT_AND", "value" : 0 }, { "env" : [ "PREVLEVEL=S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chdir" : null, "export" : [], "stop_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "runlevel", "env" : [ "[016]" ] } ], "debug" : 0, "setgid" : null, "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "command" : null, "script" : 0 }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "clear > /dev/tty7\nsleep 1\nif [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" }, { "command" : null, "script" : 0 } ], "respawn" : 1, "cgroups" : [], "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm", "task" : 0, "umask" : 18, "respawn_limit" : 2, "normalexit" : [] }, { "jobs" : [], "respawn_interval" : 5, "description" : "Mount filesystems on boot", "author" : null, "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "cgmanager_wait" : 0, "usage" : null, "name" : "mountall", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_DAEMON", "chroot" : null, "env" : [], "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "startup", "value" : 0 } ], "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "starting", "env" : [ "rcS" ] } ], "setgid" : null, "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "cgroups" : [], "respawn" : 0, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS || true\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # Doesn't work so well if mountall is responsible for mounting /proc, heh.\n if [ -e /proc/cmdline ]; then\n read line < /proc/cmdline\n for arg in $line; do\n case $arg in\n -q|--quiet|-v|--verbose|--debug)\n debug_arg=$arg\n ;;\n esac\n done < /proc/cmdline\n fi\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale || true\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix $debug_arg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : "rm -f /forcefsck 2>dev/null || true\n", "script" : 1 }, { "script" : 0, "command" : null } ], "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/mountall", "oom_score_adj" : 0, "session" : 0, "task" : 1, "umask" : 18, "normalexit" : [], "respawn_limit" : 10 }, { "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddebugfs", "oom_score_adj" : 0, "session" : 0, "task" : 1, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "debug" : 0, "setgid" : null, "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "mounted", "value" : 0, "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ] } ], "jobs" : [], "respawn_interval" : 5, "description" : "Fix-up /sys/kernel/debug filesystem", "author" : null, "nice" : -21, "version" : null, "kill_signal" : 15, "deleted" : 0, "cgmanager_wait" : 0, "usage" : null, "name" : "mounted-debugfs" }, { "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "session" : 0, "kill_timeout" : 5, "cgroups" : [], "respawn" : 0, "process" : [ { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "emits" : [], "setgid" : null, "debug" : 0, "export" : [], "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "chdir" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "chroot" : null, "env" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "kill_signal" : 15, "deleted" : 0, "name" : "mountkernfs.sh", "usage" : null, "cgmanager_wait" : 0, "author" : null, "description" : "Signal sysvinit that virtual filesystems are mounted", "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [ { "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "respawn_time" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0 } ] }, { "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/console", "kill_timeout" : 5, "process" : [ { "command" : "/sbin/getty -8 38400 console", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 1, "emits" : [], "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[!2345]" ] } ], "debug" : 0, "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "rc", "RUNLEVEL=[2345]" ], "name" : "stopped", "value" : 1, "event" : 2 }, { "value" : 0, "name" : "container", "env" : [ "CONTAINER=lxc" ], "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "chdir" : null, "export" : [], "setuid" : null, "reload_signal" : 1, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "env" : [], "chroot" : null, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "name" : "console", "usage" : null, "cgmanager_wait" : 0, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : null, "respawn_interval" : 5, "jobs" : [] }, { "start_on" : [ { "env" : [ "hostname" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [], "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "name" : "hostname.sh", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : "Signal sysvinit that hostname is set", "respawn_interval" : 5, "jobs" : [ { "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/hostname_2esh/_", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=hostname", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=stopped" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "respawn_time" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "" } ], "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/hostname_2esh", "kill_timeout" : 5, "process" : [ { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 0, "emits" : [], "setgid" : null, "debug" : 0 }, { "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/jh_2dfailsafe", "session" : 0, "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "debug" : 0, "setgid" : null, "emits" : [], "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "echo \"`date`: failsafe job ran\"\nenv\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1, "export" : [], "start_on" : [ { "value" : 0, "name" : "started", "env" : [ "failsafe" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "jobs" : [], "respawn_interval" : 5, "author" : null, "description" : null, "version" : null, "nice" : -21, "kill_signal" : 15, "deleted" : 0, "name" : "jh-failsafe", "cgmanager_wait" : 0, "usage" : null }, { "description" : "Populate and link to /run filesystem", "author" : null, "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "usage" : null, "cgmanager_wait" : 0, "name" : "mounted-run", "jobs" : [], "respawn_interval" : 5, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "mounted", "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ] } ], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [], "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd.dynamic &\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "debug" : 0, "setgid" : null, "task" : 1, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/mounted_2drun", "oom_score_adj" : 0, "session" : 0 }, { "kill_signal" : 15, "deleted" : 0, "cgmanager_wait" : 0, "usage" : null, "name" : "acpid", "description" : "ACPI daemon", "author" : null, "nice" : -21, "version" : null, "respawn_interval" : 5, "jobs" : [ { "respawn_time" : 0, "trace_forks" : 1, "state" : "JOB_RUNNING", "stop_env" : [], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "pid" : [ 1224, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/acpid/_", "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "trace_state" : "TRACE_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "name" : "runlevel", "value" : 0, "type" : "EVENT_MATCH" } ], "goal" : "JOB_START" } ], "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[2345]" ] } ], "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "reload_signal" : 1, "setuid" : null, "chroot" : null, "env" : [], "expect" : "EXPECT_FORK", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "respawn" : 1, "cgroups" : [], "process" : [ { "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket", "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "emits" : [], "setgid" : null, "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel" } ], "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 5 }, { "name" : "bluetooth", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : "bluetooth daemon", "respawn_interval" : 5, "jobs" : [ { "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "value" : 0, "name" : "stopping", "env" : [ "dbus" ], "type" : "EVENT_MATCH" } ], "respawn_time" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth/_", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "start_env" : [], "pid" : [ 725, 0, 0, 0, 0, 0 ] } ], "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "dbus" ], "name" : "started", "value" : 0 } ], "chdir" : null, "export" : [], "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "chroot" : null, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_FORK", "process" : [ { "command" : "/usr/sbin/bluetoothd", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "command" : null, "script" : 0 }, { "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n", "script" : 1 }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 1, "emits" : [], "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "dbus" ], "value" : 0, "name" : "stopping" } ], "debug" : 0, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "task" : 0, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth", "kill_timeout" : 5 }, { "jobs" : [ { "goal" : "JOB_START", "trace_state" : "TRACE_NONE", "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "trace_forks" : 0, "stop_env" : [], "state" : "JOB_RUNNING", "pid" : [ 0, 0, 0, 0, 0, 0 ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/e9c64d1b-e85b-4774-a40f-3f7a6f2f7a4e", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "start_env" : [], "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "respawn_time" : 0 } ], "respawn_interval" : 5, "nice" : -21, "version" : null, "description" : null, "author" : null, "cgmanager_wait" : 0, "usage" : null, "name" : "checkfs.sh", "deleted" : 0, "kill_signal" : 15, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null, "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "export" : [], "debug" : 0, "setgid" : null, "emits" : [], "process" : [ { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [], "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "oom_score_adj" : 0, "task" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10 }, { "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "task" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "debug" : 0, "setgid" : null, "emits" : [], "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 0, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null, "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "start_on" : [ { "type" : "EVENT_MATCH", "name" : "mounted", "value" : 0, "env" : [ "MOUNTPOINT=/" ] } ], "chdir" : null, "export" : [], "jobs" : [ { "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "respawn_time" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/e9c64d1b-e85b-4774-a40f-3f7a6f2f7a4e", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "pid" : [ 0, 0, 0, 0, 0, 0 ] } ], "respawn_interval" : 5, "version" : null, "nice" : -21, "author" : null, "description" : null, "name" : "checkroot-bootclean.sh", "usage" : null, "cgmanager_wait" : 0, "deleted" : 0, "kill_signal" : 15 }, { "author" : null, "description" : "load modules from /etc/modules", "version" : null, "nice" : -21, "kill_signal" : 15, "deleted" : 0, "name" : "kmod", "usage" : null, "cgmanager_wait" : 0, "jobs" : [], "respawn_interval" : 5, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "setuid" : null, "reload_signal" : 1, "export" : [], "start_on" : [ { "name" : "startup", "value" : 0, "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "type" : "EVENT_AND", "value" : 0 } ], "chdir" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "chroot" : null, "env" : [], "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] && files=\"/etc/modules\" || files=\"\"\n hash=\"#\"\n dirs=\"/etc/modules-load.d /run/modules-load.d /lib/modules-load.d\"\n for dir in $dirs; do\n files=\"$files $(run-parts --list --regex='\\.conf$' $dir 2> /dev/null || true)\"\n done\n for file in $files; do\n while read module args; do\n\t [ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\t modprobe $module $args || :\n done < $file\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "debug" : 0, "setgid" : null, "task" : 1, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/kmod", "session" : 0 }, { "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "reload_signal" : 1, "setuid" : null, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "remote-filesystems", "value" : 0 } ], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "description" : "Signal sysvinit that remote filesystems are mounted", "author" : null, "nice" : -21, "version" : null, "kill_signal" : 15, "deleted" : 0, "cgmanager_wait" : 0, "usage" : null, "name" : "mountnfs.sh", "jobs" : [ { "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "respawn_time" : 0 } ], "respawn_interval" : 5, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "oom_score_adj" : 0, "session" : 0, "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "debug" : 0, "setgid" : null }, { "respawn_interval" : 5, "jobs" : [], "name" : "plymouth-stop", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : null, "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "starting", "value" : 0, "env" : [ "gdm" ] }, { "name" : "starting", "value" : 0, "env" : [ "kdm" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 }, { "name" : "starting", "value" : 0, "env" : [ "xdm" ], "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "name" : "starting", "env" : [ "lxdm" ], "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "type" : "EVENT_MATCH", "env" : [ "lightdm" ], "name" : "starting", "value" : 0 }, { "type" : "EVENT_OR", "value" : 0 }, { "name" : "starting", "value" : 0, "env" : [ "uxlaunch" ], "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "type" : "EVENT_MATCH", "name" : "starting", "value" : 0, "env" : [ "ubiquity" ] }, { "type" : "EVENT_OR", "value" : 0 }, { "name" : "starting", "value" : 0, "env" : [ "oem-config" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 }, { "type" : "EVENT_MATCH", "value" : 0, "name" : "stopped", "env" : [ "rc", "RUNLEVEL=[2345]" ] }, { "type" : "EVENT_OR", "value" : 0 }, { "type" : "EVENT_MATCH", "name" : "starting", "value" : 0, "env" : [ "rcS" ] }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "name" : "starting", "env" : [ "mountall-shell" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 } ], "chdir" : null, "export" : [], "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "plymouth" ], "name" : "stopped", "value" : 0 } ], "debug" : 0, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [], "emits" : [], "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dstop", "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0 }, { "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/rcS", "session" : 0, "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "command" : "/sbin/sulogin", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "command" : null, "script" : 0 } ], "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[!S]" ], "type" : "EVENT_MATCH" } ], "debug" : 0, "setgid" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_OWNER", "setuid" : null, "reload_signal" : 1, "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "S" ] } ], "chdir" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "chroot" : null, "env" : [], "author" : "Scott James Remnant ", "description" : "System V single-user mode compatibility", "version" : null, "nice" : -21, "deleted" : 0, "kill_signal" : 15, "name" : "rcS", "usage" : null, "cgmanager_wait" : 0, "jobs" : [], "respawn_interval" : 5 }, { "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 5, "respawn" : 0, "cgroups" : [], "process" : [ { "command" : null, "script" : 0 }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "emits" : [], "setgid" : null, "debug" : 0, "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[!023456]" ], "type" : "EVENT_MATCH" } ], "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "starting", "env" : [ "network-interface" ] }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "name" : "starting", "env" : [ "networking" ], "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_OUTPUT", "setuid" : null, "reload_signal" : 1, "chroot" : null, "env" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "kill_signal" : 15, "deleted" : 0, "usage" : null, "cgmanager_wait" : 0, "name" : "ufw", "description" : "Uncomplicated firewall", "author" : null, "nice" : -21, "version" : null, "respawn_interval" : 5, "jobs" : [ { "respawn_time" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "pid" : [ 0, 0, 0, 0, 0, 0 ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "start_env" : [], "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID", "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "goal" : "JOB_START", "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[!023456]" ] } ], "trace_state" : "TRACE_NONE" } ] }, { "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "chdir" : null, "export" : [], "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "instance" : "$WAITER$WAIT_FOR", "console" : "CONSOLE_LOG", "respawn_interval" : 5, "jobs" : [], "name" : "wait-for-state", "usage" : null, "cgmanager_wait" : 0, "deleted" : 0, "kill_signal" : 15, "version" : null, "nice" : -21, "author" : "Clint Byrum ", "description" : "Waiting for state", "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/wait_2dfor_2dstate", "kill_timeout" : 5, "umask" : 18, "respawn_limit" : 10, "normalexit" : [ 2 ], "task" : 1, "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "debug" : 0, "process" : [ { "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf /etc/init/$WAIT_FOR.override 2>/dev/null; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 0, "emits" : [] }, { "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1, "export" : [], "chdir" : null, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [], "author" : null, "description" : null, "version" : null, "nice" : -21, "deleted" : 0, "kill_signal" : 15, "name" : "upstart-force-slow-child", "cgmanager_wait" : 0, "usage" : null, "jobs" : [ { "respawn_time" : 0, "pid" : [ 2403, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ], "path" : "/com/ubuntu/Upstart/jobs/upstart_2dforce_2dslow_2dchild/_", "trace_forks" : 0, "stop_env" : [], "state" : "JOB_SPAWNED", "blocking" : [], "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "io_watch_fd" : 18, "fd" : -1, "path" : "/var/log/upstart/upstart-force-slow-child.log", "open_errno" : 0 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "process_data" : [ { "valid" : 1, "script" : null, "job_process_fd" : @JOB_PROCESS_FD@, "process" : "PROCESS_MAIN", "status" : 0, "shell_fd" : -1 }, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "goal" : "JOB_START", "trace_state" : "TRACE_NONE" } ], "respawn_interval" : 5, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dforce_2dslow_2dchild", "session" : 0, "emits" : [], "respawn" : 0, "cgroups" : [ { "controller" : "memory", "names" : [ { "expanded" : null, "settings" : [ { "key" : "limit_in_bytes", "value" : "52428800" } ], "name" : "james-group1" } ] } ], "process" : [ { "command" : "sleep 999", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "debug" : 0, "setgid" : null }, { "setgid" : null, "debug" : 0, "process" : [ { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [], "emits" : [], "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "oom_score_adj" : 0, "kill_timeout" : 5, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "task" : 0, "respawn_interval" : 5, "jobs" : [ { "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "trace_forks" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "respawn_time" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ] } ], "usage" : null, "cgmanager_wait" : 0, "name" : "bootmisc.sh", "kill_signal" : 15, "deleted" : 0, "nice" : -21, "version" : null, "description" : null, "author" : null, "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chdir" : null, "start_on" : [ { "name" : "virtual-filesystems", "value" : 0, "type" : "EVENT_MATCH" } ], "export" : [], "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG" }, { "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/flush_2dearly_2djob_2dlog", "task" : 1, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "debug" : 0, "setgid" : null, "emits" : [], "process" : [ { "command" : "initctl notify-disk-writeable", "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null, "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "filesystem" } ], "chdir" : null, "export" : [], "jobs" : [], "respawn_interval" : 5, "version" : null, "nice" : -21, "author" : null, "description" : "flush early job output to logs", "name" : "flush-early-job-log", "usage" : null, "cgmanager_wait" : 0, "kill_signal" : 15, "deleted" : 0 }, { "export" : [], "start_on" : [ { "value" : 0, "name" : "recovery", "type" : "EVENT_MATCH" } ], "chdir" : null, "apparmor_switch" : null, "console" : "CONSOLE_OWNER", "instance" : "", "setuid" : null, "reload_signal" : 1, "chroot" : null, "env" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "deleted" : 0, "kill_signal" : 15, "name" : "friendly-recovery", "usage" : null, "cgmanager_wait" : 0, "author" : null, "description" : null, "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [], "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/friendly_2drecovery", "session" : 0, "kill_timeout" : 5, "cgroups" : [], "respawn" : 0, "process" : [ { "command" : " # Only start friendly-recovery when booting in recovery mode\n if ! grep -q \"recovery\" /proc/cmdline; then\n exit 0\n fi\n\n if [ -x /lib/recovery-mode/recovery-menu ]; then\n exec /lib/recovery-mode/recovery-menu\n else\n exec /sbin/sulogin\n fi\n", "script" : 1 }, { "script" : 1, "command" : " if plymouth --ping; then\n plymouth hide-splash || true\n fi\n\n # Try to set the hostname and initialize the console\n start hostname || true\n start console-setup || true\n start setvtrgb || true\n\n # Make sure /run contains the required directories for the\n # recovery menu options\n mkdir -p /run/lock /run/shm || true\n\n # Emit the mounted event to trigger resolvconf and mounted-run\n initctl emit mounted MOUNTPOINT=/run || true\n\n # Finally start udev\n start udev || true\n udevadm trigger --action=add || true\n udevadm settle || true\n\n # And turn off kernel messages (to avoid corrupting the menu)\n dmesg --console-off || true\n" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : "if plymouth --ping; then\n plymouth show-splash\nfi\ninitctl emit startup\n", "script" : 1 }, { "command" : null, "script" : 0 } ], "emits" : [ "recovery", "startup", "mounted" ], "setgid" : null, "debug" : 0 }, { "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/rc_2dsysinit", "task" : 1, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "stop_on" : [ { "name" : "runlevel", "value" : 0, "type" : "EVENT_MATCH" } ], "debug" : 0, "setgid" : null, "emits" : [ "runlevel" ], "process" : [ { "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "chroot" : null, "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "console" : "CONSOLE_OUTPUT", "instance" : "", "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "type" : "EVENT_MATCH", "name" : "failsafe-boot", "value" : 0 }, { "value" : 0, "type" : "EVENT_OR" } ], "chdir" : null, "export" : [], "jobs" : [], "respawn_interval" : 5, "version" : null, "nice" : -21, "author" : "Scott James Remnant ", "description" : "System V initialisation compatibility", "name" : "rc-sysinit", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0 }, { "export" : [], "start_on" : [ { "name" : "starting", "value" : 0, "env" : [ "rc-sysinit" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "setuid" : null, "reload_signal" : 1, "chroot" : null, "env" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "kill_signal" : 15, "deleted" : 0, "name" : "apparmor", "cgmanager_wait" : 0, "usage" : null, "author" : "Dimitri John Ledkov and Jamie Strandboge ", "description" : "Pre-cache and pre-load apparmor profiles", "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [], "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/apparmor", "session" : 0, "kill_timeout" : 5, "cgroups" : [], "respawn" : 0, "process" : [ { "script" : 1, "command" : " [ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n [ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n [ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\n [ -x /bin/running-in-container ] && /bin/running-in-container && exit 0\n\n # Need securityfs for any mode\n if [ ! -d /sys/kernel/security/apparmor ]; then\n if cut -d\" \" -f2,3 /proc/mounts | grep -q \"^/sys/kernel/security securityfs\"'$' ; then\n exit 0\n else\n mount -t securityfs none /sys/kernel/security || exit 0\n fi\n fi\n\n [ -w /sys/kernel/security/apparmor/.load ] || exit 0\n\n [ -x /usr/bin/aa-clickhook ] && {\n run=\n\n # If packages for system policy that affect click packages have been\n # updated since the last time we ran, run aa-clickhook -f\n for pkg in apparmor-easyprof-ubuntu apparmor ; do\n [ -f \"/var/lib/dpkg/info/${pkg}.md5sums\" ] || continue\n\n if ! diff -q \"/var/lib/dpkg/info/${pkg}.md5sums\" \"/var/lib/apparmor/profiles/.${pkg}.md5sums\" 2>/dev/null ; then\n # store md5sums in /var/lib/apparmor/profiles since\n # /var/cache/apparmor might be cleared by apparmor\n cp -f \"/var/lib/dpkg/info/${pkg}.md5sums\" \"/var/lib/apparmor/profiles/.${pkg}.md5sums\"\n run='yes'\n fi\n done\n\n if [ -n \"$run\" ]; then\n aa-clickhook -f\n fi\n }\n\n . /lib/apparmor/functions\n\n if [ \"$ACTION\" = \"teardown\" ]; then\n running_profile_names | while read profile; do\n unload_profile \"$profile\"\n done\n exit 0\n fi\n\n if [ \"$ACTION\" = \"clear\" ]; then\n clear_cache\n exit 0\n fi\n\n if [ \"$ACTION\" = \"reload\" ] || [ \"$ACTION\" = \"force-reload\" ]; then\n clear_cache\n load_configured_profiles\n\tunload_obsolete_profiles\n exit 0\n fi\n\n load_configured_profiles\n" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "emits" : [], "setgid" : null, "debug" : 0 }, { "author" : "Serge Hallyn ", "description" : "cgroup management proxy", "version" : null, "nice" : -21, "deleted" : 0, "kill_signal" : 15, "name" : "cgproxy", "usage" : null, "cgmanager_wait" : 0, "jobs" : [], "respawn_interval" : 5, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "setuid" : null, "reload_signal" : 1, "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "started", "value" : 0, "env" : [ "cgmanager" ] } ], "chdir" : null, "expect" : "EXPECT_STOP", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [ "cgmanager_opts=", "NESTED=no" ], "emits" : [ "cgmanager-ready" ], "cgroups" : [], "respawn" : 1, "process" : [ { "script" : 1, "command" : "\t[ -r /etc/default/cgmanager ] && . /etc/default/cgmanager\n\n\texec /sbin/cgproxy --sigstop $cgmanager_opts\n" }, { "command" : "# check whether we should start\nif [ -e /proc/self/ns/pid ] && [ \"$NESTED\" = \"no\" ]; then\n\tinitctl emit -n cgmanager-ready\n\t{ stop; exit 0; }\nfi\n", "script" : 1 }, { "command" : "initctl emit -n cgmanager-ready", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[06]" ] } ], "debug" : 0, "setgid" : null, "task" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgproxy", "session" : 0 }, { "debug" : 0, "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[016]" ], "type" : "EVENT_MATCH" } ], "setgid" : null, "emits" : [], "process" : [ { "command" : "/usr/sbin/cupsd -f", "script" : 0 }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "command" : " # wait until daemon is ready\n timeout=60\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n", "script" : 1 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 1, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups", "oom_score_adj" : 0, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 3, "jobs" : [ { "respawn_time" : 0, "trace_forks" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "start_env" : [], "pid" : [ 764, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/cups/_", "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "open_errno" : 0, "remote_closed" : 0, "detached" : 0, "io_watch_fd" : 19, "uid" : 0, "fd" : -1, "path" : "/var/log/upstart/cups.log" }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[016]" ] } ] } ], "respawn_interval" : 12, "nice" : -21, "version" : null, "description" : "CUPS printing spooler/server", "author" : "Michael Sweet ", "usage" : null, "cgmanager_wait" : 0, "name" : "cups", "deleted" : 0, "kill_signal" : 15, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "env" : [], "chroot" : null, "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "name" : "filesystem", "value" : 0 }, { "type" : "EVENT_MATCH", "env" : [ "dbus" ], "value" : 0, "name" : "started" }, { "type" : "EVENT_MATCH", "event" : 1, "env" : [ "[2345]" ], "name" : "runlevel", "value" : 1 }, { "type" : "EVENT_OR", "value" : 1 }, { "type" : "EVENT_AND", "value" : 0 } ], "export" : [] }, { "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/pulseaudio", "oom_score_adj" : 0, "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[016]" ] } ], "setgid" : null, "emits" : [], "process" : [ { "script" : 0, "command" : "/usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS" }, { "script" : 0, "command" : "install -d -m755 -o pulse -g pulse /run/pulse" }, { "script" : 1, "command" : "if [ -e /var/run/pulse/.esd_auth ]; then\n\tchown pulse:pulse-access /var/run/pulse/.esd_auth\n\tchmod 640 /var/run/pulse/.esd_auth\nfi\nif [ -e /var/run/pulse/.pulse-cookie ]; then\n\tchown pulse:pulse-access /var/run/pulse/.pulse-cookie\n\tchmod 640 /var/run/pulse/.pulse-cookie\nfi\n" }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 1, "expect" : "EXPECT_DAEMON", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [ "DISALLOW_MODULE_LOADING=1", "PULSEAUDIO_ARGS=" ], "chroot" : null, "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "chdir" : null, "export" : [], "jobs" : [], "respawn_interval" : 5, "nice" : -21, "version" : null, "description" : "System PulseAudio sound server", "author" : "Pali Rohár ", "usage" : null, "cgmanager_wait" : 0, "name" : "pulseaudio", "kill_signal" : 15, "deleted" : 0 }, { "env" : [], "chroot" : null, "expect" : "EXPECT_DAEMON", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "start_on" : [ { "name" : "net-device-up", "value" : 0, "env" : [ "IFACE=lo" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [], "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "respawn_interval" : 5, "jobs" : [ { "goal" : "JOB_START", "stop_on" : [ { "env" : [ "[!2345]" ], "name" : "runlevel", "value" : 0, "type" : "EVENT_MATCH" } ], "trace_state" : "TRACE_NONE", "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "trace_forks" : 2, "stop_env" : [], "state" : "JOB_RUNNING", "pid" : [ 1055, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "respawn_time" : 0 } ], "name" : "upstart-socket-bridge", "usage" : null, "cgmanager_wait" : 0, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : "Bridge socket events into upstart", "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "kill_timeout" : 5, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "task" : 0, "setgid" : null, "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "debug" : 0, "process" : [ { "command" : "upstart-socket-bridge --daemon", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 1, "emits" : [ "socket" ] }, { "jobs" : [], "respawn_interval" : 5, "nice" : -21, "version" : null, "description" : "anac(h)ronistic cron", "author" : null, "cgmanager_wait" : 0, "usage" : null, "name" : "anacron", "kill_signal" : 15, "deleted" : 0, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_FORK", "env" : [], "chroot" : null, "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[2345]" ], "name" : "runlevel", "value" : 0 } ], "export" : [], "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel" } ], "setgid" : null, "emits" : [], "process" : [ { "script" : 0, "command" : "anacron -s" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [], "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/anacron", "oom_score_adj" : 0, "task" : 0, "normalexit" : [ 0 ], "umask" : 18, "respawn_limit" : 10 }, { "emits" : [], "process" : [ { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [], "debug" : 0, "setgid" : null, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "version" : null, "nice" : -21, "author" : null, "description" : "Signal sysvinit that virtual filesystems are mounted", "name" : "mountdevsubfs.sh", "cgmanager_wait" : 0, "usage" : null, "deleted" : 0, "kill_signal" : 15, "jobs" : [ { "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "trace_forks" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "respawn_time" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ] } ], "respawn_interval" : 5, "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "env" : [], "chroot" : null }, { "kill_signal" : 15, "deleted" : 0, "cgmanager_wait" : 0, "usage" : null, "name" : "tty2", "description" : null, "author" : null, "nice" : -21, "version" : null, "respawn_interval" : 5, "jobs" : [ { "path" : "/com/ubuntu/Upstart/jobs/tty2/_", "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "pid" : [ 1214, 0, 0, 0, 0, 0 ], "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "respawn_time" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID" } ], "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[23]" ], "name" : "runlevel", "value" : 0 }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "name" : "container", "value" : 0, "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "type" : "EVENT_MATCH", "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container" }, { "value" : 0, "type" : "EVENT_OR" }, { "type" : "EVENT_AND", "value" : 0 } ], "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "setuid" : null, "reload_signal" : 1, "chroot" : null, "env" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "respawn" : 1, "cgroups" : [], "process" : [ { "command" : "/sbin/getty -8 38400 tty2", "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "emits" : [], "setgid" : null, "debug" : 0, "stop_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "runlevel", "env" : [ "[!23]" ] } ], "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 5 }, { "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "emits" : [], "setgid" : null, "debug" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 1, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/udevtrigger", "kill_timeout" : 5, "name" : "udevtrigger", "usage" : null, "cgmanager_wait" : 0, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : "cold plug devices", "respawn_interval" : 5, "jobs" : [], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "startup", "value" : 0 }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "chdir" : null, "export" : [], "reload_signal" : 1, "setuid" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "env" : [], "chroot" : null, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE" }, { "reload_signal" : 1, "setuid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "chdir" : null, "start_on" : [ { "name" : "filesystem", "value" : 0, "type" : "EVENT_MATCH" } ], "export" : [], "expect" : "EXPECT_DAEMON", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [], "chroot" : null, "nice" : -21, "version" : null, "description" : "Bridge file events into upstart", "author" : null, "usage" : null, "cgmanager_wait" : 0, "name" : "upstart-file-bridge", "kill_signal" : 15, "deleted" : 0, "jobs" : [ { "respawn_time" : 0, "pid" : [ 1050, 0, 0, 0, 0, 0 ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "start_env" : [], "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "trace_forks" : 2, "stop_env" : [], "state" : "JOB_RUNNING", "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "goal" : "JOB_START", "trace_state" : "TRACE_NONE" } ], "respawn_interval" : 5, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "oom_score_adj" : 0, "emits" : [ "file" ], "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn" : 1, "cgroups" : [], "debug" : 0, "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[!2345]" ], "type" : "EVENT_MATCH" } ], "setgid" : null }, { "emits" : [ "container", "not-container" ], "cgroups" : [], "respawn" : 0, "process" : [ { "command" : null, "script" : 0 }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "debug" : 0, "setgid" : null, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/container_2ddetect", "oom_score_adj" : 0, "session" : 0, "description" : "Track if upstart is running in a container", "author" : null, "nice" : -21, "version" : null, "deleted" : 0, "kill_signal" : 15, "usage" : null, "cgmanager_wait" : 0, "name" : "container-detect", "jobs" : [], "respawn_interval" : 5, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "setuid" : null, "reload_signal" : 1, "export" : [], "chdir" : null, "start_on" : [ { "name" : "mounted", "value" : 0, "env" : [ "MOUNTPOINT=/run" ], "type" : "EVENT_MATCH" } ], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ] }, { "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddev", "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 1, "setgid" : null, "debug" : 0, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [], "emits" : [], "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "chroot" : null, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "start_on" : [ { "value" : 0, "name" : "mounted", "env" : [ "MOUNTPOINT=/dev" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [], "setuid" : null, "reload_signal" : 1, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "respawn_interval" : 5, "jobs" : [], "name" : "mounted-dev", "cgmanager_wait" : 0, "usage" : null, "deleted" : 0, "kill_signal" : 15, "version" : null, "nice" : -21, "author" : null, "description" : "Populate /dev filesystem" }, { "emits" : [], "process" : [ { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 0, "debug" : 0, "setgid" : null, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "version" : null, "nice" : -21, "author" : null, "description" : null, "name" : "mtab.sh", "usage" : null, "cgmanager_wait" : 0, "deleted" : 0, "kill_signal" : 15, "jobs" : [ { "trace_forks" : 0, "stop_env" : [], "state" : "JOB_RUNNING", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "respawn_time" : 0, "goal" : "JOB_START", "trace_state" : "TRACE_NONE", "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ] } ], "respawn_interval" : 5, "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "start_on" : [ { "type" : "EVENT_MATCH", "name" : "virtual-filesystems", "value" : 0 } ], "chdir" : null, "export" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null }, { "respawn" : 1, "cgroups" : [], "process" : [ { "command" : "/sbin/getty -8 38400 tty3", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "emits" : [], "setgid" : null, "stop_on" : [ { "value" : 0, "name" : "runlevel", "env" : [ "[!23]" ], "type" : "EVENT_MATCH" } ], "debug" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "session" : 0, "kill_timeout" : 5, "deleted" : 0, "kill_signal" : 15, "name" : "tty3", "cgmanager_wait" : 0, "usage" : null, "author" : null, "description" : null, "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [ { "respawn_time" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3/_", "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "pid" : [ 1215, 0, 0, 0, 0, 0 ], "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "trace_state" : "TRACE_NONE", "stop_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "runlevel", "env" : [ "[!23]" ] } ], "goal" : "JOB_START" } ], "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[23]" ], "value" : 0, "name" : "runlevel" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "name" : "container", "value" : 0, "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "chdir" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "reload_signal" : 1, "setuid" : null, "chroot" : null, "env" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE" }, { "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfinish", "kill_timeout" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n exec /lib/udev/udev-finish\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "emits" : [], "setgid" : null, "debug" : 0, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "startup" }, { "name" : "filesystem", "value" : 0, "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "name" : "started", "value" : 0, "env" : [ "udev" ], "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "type" : "EVENT_AND", "value" : 0 }, { "type" : "EVENT_MATCH", "name" : "stopped", "value" : 0, "env" : [ "udevmonitor" ] }, { "value" : 0, "type" : "EVENT_AND" } ], "chdir" : null, "export" : [], "reload_signal" : 1, "setuid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "env" : [], "chroot" : null, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "name" : "udev-finish", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : "save udev log and update rules", "respawn_interval" : 5, "jobs" : [ { "goal" : "JOB_START", "trace_state" : "TRACE_NONE", "name" : "", "failed_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevmonitor", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=startup filesystem started stopped stopped" ], "path" : "/com/ubuntu/Upstart/jobs/udev_2dfinish/_", "trace_forks" : 0, "stop_env" : [], "state" : "JOB_RUNNING", "respawn_time" : 0 } ] }, { "cgroups" : [], "respawn" : 0, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl -E HOME=\"$ALSACTLHOME\" -s -n 19 -b -c rdaemon" }, { "command" : "if ! test -d $ALSACTLHOME ; then\n mkdir -p $ALSACTLHOME\nfi\nif ! test -f /var/lib/alsa/state-daemon.conf ; then\n stop; exit 0\nfi\n", "script" : 1 }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "/usr/sbin/alsactl -E HOME=\"$ALSACTLHOME\" -s kill save_and_quit\n" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "emits" : [], "setgid" : null, "debug" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dstate", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 5, "deleted" : 0, "kill_signal" : 15, "usage" : null, "cgmanager_wait" : 0, "name" : "alsa-state", "description" : "Restore Sound Card State", "author" : null, "nice" : -21, "version" : null, "respawn_interval" : 5, "jobs" : [], "export" : [], "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "name" : "runlevel", "value" : 0, "type" : "EVENT_MATCH" } ], "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1, "chroot" : null, "env" : [ "ALSACTLHOME=/var/run/alsa" ], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_FORK" }, { "emits" : [], "cgroups" : [], "respawn" : 1, "process" : [ { "command" : "\t[ -r /etc/default/cgmanager ] && . /etc/default/cgmanager\n\n\texec /sbin/cgmanager --sigstop $cgmanager_opts $cgm_extra_mounts\n", "script" : 1 }, { "script" : 1, "command" : "\t# Kill any existing cgproxy. This is required to allow proper\n\t# respawning of cgmanager.\n\tstop cgproxy >/dev/null 2>&1 || true\n\n\t# check whether we should start a cgproxy or a cgmanager\n\tif cgproxy --check-master; then\n\t\tstart cgproxy NESTED=yes || true && { stop; exit 0; }\n\tfi\n" }, { "command" : "/sbin/initctl-12june2014 notify-cgroup-manager-address \"unix:path=/sys/fs/cgroup/cgmanager/sock\"", "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[06]" ], "value" : 0, "name" : "runlevel" } ], "debug" : 0, "setgid" : null, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgmanager", "session" : 0, "author" : "Serge Hallyn ", "description" : "cgroup management daemon", "version" : null, "nice" : -21, "kill_signal" : 15, "deleted" : 0, "name" : "cgmanager", "usage" : null, "cgmanager_wait" : 0, "jobs" : [ { "respawn_time" : 0, "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgmanager/_", "pid" : [ 607, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "cgmanager_opts=", "cgm_extra_mounts=-m name=systemd", "DEVICE=none", "MOUNTPOINT=/sys/fs/cgroup", "TYPE=tmpfs", "OPTIONS=optional,uid=0,gid=0,mode=0755,size=1024", "UPSTART_EVENTS=mounted" ], "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "open_errno" : 9, "detached" : 0, "remote_closed" : 0, "io_watch_fd" : 15, "uid" : 0, "fd" : 17, "path" : "/var/log/upstart/cgmanager.log" }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID", "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[06]" ], "name" : "runlevel", "value" : 0 } ], "goal" : "JOB_START", "trace_state" : "TRACE_NONE" } ], "respawn_interval" : 5, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "MOUNTPOINT=/sys/fs/cgroup" ], "value" : 0, "name" : "mounted" }, { "name" : "virtual-filesystems", "value" : 0, "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chdir" : null, "expect" : "EXPECT_STOP", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [ "cgmanager_opts=", "cgm_extra_mounts=-m name=systemd" ] }, { "path" : "/com/ubuntu/Upstart/jobs/cgroup_2djob1", "oom_score_adj" : 0, "session" : 0, "kill_timeout" : 5, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "task" : 0, "setgid" : null, "debug" : 0, "respawn" : 0, "cgroups" : [ { "names" : [ { "name" : "db", "settings" : [ { "value" : "0-1", "key" : "cpus" } ], "expanded" : null } ], "controller" : "cpuset" }, { "names" : [ { "name" : "db", "expanded" : null, "settings" : [ { "value" : "104857600", "key" : "limit_in_bytes" } ] } ], "controller" : "memory" }, { "controller" : "blkio", "names" : [ { "name" : "db", "settings" : [ { "key" : "throttle.write_bps_device", "value" : "8:16 1048576" } ], "expanded" : null } ] } ], "process" : [ { "command" : "sleep 999", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "emits" : [], "chroot" : null, "env" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "export" : [], "chdir" : null, "start_on" : [ { "name" : "startup", "value" : 0, "type" : "EVENT_MATCH" } ], "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "reload_signal" : 1, "setuid" : null, "respawn_interval" : 5, "jobs" : [], "kill_signal" : 15, "deleted" : 0, "usage" : null, "cgmanager_wait" : 0, "name" : "cgroup-job1", "description" : null, "author" : null, "nice" : -21, "version" : null }, { "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/hostname", "session" : 0, "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 1, "setgid" : null, "debug" : 0, "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "hostname -b -F /etc/hostname", "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "emits" : [], "chroot" : null, "env" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "export" : [], "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "chdir" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "setuid" : null, "reload_signal" : 1, "respawn_interval" : 5, "jobs" : [], "deleted" : 0, "kill_signal" : 15, "name" : "hostname", "usage" : null, "cgmanager_wait" : 0, "author" : null, "description" : "set system hostname", "version" : null, "nice" : -21 }, { "jobs" : [], "respawn_interval" : 5, "description" : "Reboot after filesystems are changed", "author" : null, "nice" : -21, "version" : null, "kill_signal" : 15, "deleted" : 0, "cgmanager_wait" : 0, "usage" : null, "name" : "mountall-reboot", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "chroot" : null, "env" : [], "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "setuid" : null, "reload_signal" : 1, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "stopped", "env" : [ "mountall", "EXIT_STATUS=4" ] } ], "debug" : 0, "setgid" : null, "emits" : [], "cgroups" : [], "respawn" : 0, "process" : [ { "command" : "reboot -f", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dreboot", "oom_score_adj" : 0, "session" : 0, "task" : 1, "umask" : 18, "normalexit" : [], "respawn_limit" : 10 }, { "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/foo", "session" : 0, "emits" : [], "respawn" : 0, "cgroups" : [], "process" : [ { "script" : 1, "command" : "echo \"main: sleeping\"\nsleep 999\necho \"main: slept\"\n" }, { "command" : "sleep 5", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "debug" : 0, "setgid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "setuid" : null, "reload_signal" : 1, "export" : [], "chdir" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "chroot" : null, "env" : [], "author" : null, "description" : null, "version" : null, "nice" : -21, "kill_signal" : 15, "deleted" : 0, "name" : "foo", "cgmanager_wait" : 0, "usage" : null, "jobs" : [], "respawn_interval" : 5 }, { "setgid" : null, "debug" : 0, "stop_on" : [ { "name" : "runlevel", "value" : 0, "env" : [ "[06]" ], "type" : "EVENT_MATCH" } ], "process" : [ { "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n", "script" : 1 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [], "emits" : [], "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dshell", "oom_score_adj" : 0, "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 1, "respawn_interval" : 5, "jobs" : [], "usage" : null, "cgmanager_wait" : 0, "name" : "mountall-shell", "deleted" : 0, "kill_signal" : 15, "nice" : -21, "version" : null, "description" : "Recovery shell for filesystem failure", "author" : null, "env" : [], "chroot" : null, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "name" : "stopped", "value" : 0 }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 } ], "export" : [], "reload_signal" : 1, "setuid" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_OWNER" }, { "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dtmp", "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 1, "setgid" : null, "debug" : 0, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [], "emits" : [], "env" : [ "MOUNTPOINT=/tmp" ], "chroot" : null, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted" }, { "type" : "EVENT_OR", "value" : 0 } ], "chdir" : null, "export" : [], "reload_signal" : 1, "setuid" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "respawn_interval" : 5, "jobs" : [], "name" : "mounted-tmp", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : "Clean /tmp directory" }, { "stop_on" : [ { "name" : "net-device-removed", "value" : 0, "env" : [ "INTERFACE=$INTERFACE" ], "type" : "EVENT_MATCH" } ], "debug" : 0, "setgid" : null, "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "process" : [ { "command" : null, "script" : 0 }, { "script" : 1, "command" : "if [ \"$INTERFACE\" = lo ]; then\n # bring this up even if /etc/network/interfaces is broken\n ifconfig lo 127.0.0.1 up || true\n initctl emit -n net-device-up \\\n IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\nfi\nmkdir -p /run/network\nif ifquery --allow hotplug -l | grep -q \"^${INTERFACE}\\$\"; then\n exec ifup --allow hotplug $INTERFACE\nelse\n exec ifup --allow auto $INTERFACE\nfi\n" }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 1, "command" : "if ifquery --allow hotplug -l | grep -q \"^${INTERFACE}\\$\"; then\n exec ifdown --force --allow hotplug $INTERFACE\nelse\n exec ifdown --force --allow auto $INTERFACE\nfi\n" }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "jobs" : [ { "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "name" : "net-device-removed", "value" : 0, "type" : "EVENT_MATCH" } ], "goal" : "JOB_START", "trace_state" : "TRACE_NONE", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "lo", "failed_process" : "PROCESS_INVALID", "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=1507", "USEC_INITIALIZED=266", "UPSTART_EVENTS=net-device-added" ], "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "respawn_time" : 0 }, { "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "name" : "net-device-removed", "value" : 0, "type" : "EVENT_MATCH" } ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "failed_process" : "PROCESS_INVALID", "name" : "eth0", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "trace_forks" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:03.0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MM_CANDIDATE=1", "ID_MODEL_FROM_DATABASE=82540EM Gigabit Ethernet Controller", "ID_MODEL_ID=0x100e", "ID_NET_NAME_MAC=enx525400123456", "ID_NET_NAME_PATH=enp0s3", "ID_NET_NAME_SLOT=ens3", "ID_PCI_CLASS_FROM_DATABASE=Network controller", "ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller", "ID_VENDOR_FROM_DATABASE=Intel Corporation", "ID_VENDOR_ID=0x8086", "IFINDEX=2", "INTERFACE=eth0", "MATCHDEVID=0x0", "MATCHIFTYPE=1", "SEQNUM=1349", "USEC_INITIALIZED=801", "UPSTART_EVENTS=net-device-added" ], "pid" : [ 0, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "respawn_time" : 0 } ], "respawn_interval" : 5, "version" : null, "nice" : -21, "author" : null, "description" : "configure network device", "name" : "network-interface", "cgmanager_wait" : 0, "usage" : null, "deleted" : 0, "kill_signal" : 15, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [], "chroot" : null, "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "$INTERFACE", "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [ "INTERFACE" ] }, { "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dready", "session" : 0, "task" : 1, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "debug" : 0, "setgid" : null, "emits" : [ "plymouth-ready" ], "cgroups" : [], "respawn" : 0, "process" : [ { "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "$UPSTART_EVENTS", "setuid" : null, "reload_signal" : 1, "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "startup", "value" : 0 }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chdir" : null, "jobs" : [], "respawn_interval" : 5, "author" : null, "description" : "Send an event to indicate plymouth is up", "version" : null, "nice" : -21, "kill_signal" : 15, "deleted" : 0, "name" : "plymouth-ready", "usage" : null, "cgmanager_wait" : 0 }, { "usage" : null, "cgmanager_wait" : 0, "name" : "plymouth-splash", "kill_signal" : 15, "deleted" : 0, "nice" : -21, "version" : null, "description" : "userspace bootsplash", "author" : null, "respawn_interval" : 5, "jobs" : [], "chdir" : null, "start_on" : [ { "value" : 0, "name" : "started", "env" : [ "plymouth" ], "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 1, "name" : "graphics-device-added", "event" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "name" : "drm-device-added", "value" : 0, "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ] }, { "type" : "EVENT_OR", "value" : 1 }, { "env" : [ "udev-fallback-graphics" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 1 }, { "value" : 0, "type" : "EVENT_AND" } ], "export" : [], "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "env" : [], "chroot" : null, "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "process" : [ { "command" : "/bin/plymouth show-splash", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [], "emits" : [], "setgid" : null, "debug" : 0, "respawn_limit" : 10, "umask" : 18, "normalexit" : [], "task" : 0, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dsplash", "oom_score_adj" : 0, "kill_timeout" : 5 }, { "respawn_interval" : 5, "jobs" : [], "kill_signal" : 15, "deleted" : 0, "name" : "plymouth-upstart-bridge", "usage" : null, "cgmanager_wait" : 0, "author" : null, "description" : "bridge from Upstart state changes to Plymouth", "version" : null, "nice" : -21, "chroot" : null, "env" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "startup" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chdir" : null, "apparmor_switch" : null, "console" : "CONSOLE_OUTPUT", "instance" : "", "setuid" : null, "reload_signal" : 1, "setgid" : null, "stop_on" : [ { "name" : "stopping", "value" : 0, "env" : [ "plymouth" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "env" : [ "plymouth-shutdown" ], "name" : "stopping", "value" : 0 }, { "value" : 0, "type" : "EVENT_OR" } ], "debug" : 0, "respawn" : 1, "cgroups" : [], "process" : [ { "script" : 0, "command" : "plymouth-upstart-bridge" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "emits" : [], "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dupstart_2dbridge", "session" : 0, "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0 }, { "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "session" : 0, "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "name" : "runlevel", "value" : 0, "env" : [ "[!2345]" ] } ], "debug" : 0, "respawn" : 1, "cgroups" : [], "process" : [ { "command" : "/sbin/getty -8 38400 tty1", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "emits" : [], "chroot" : null, "env" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "export" : [], "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" }, { "name" : "not-container", "value" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "name" : "container", "value" : 0, "env" : [ "CONTAINER=lxc" ] }, { "type" : "EVENT_OR", "value" : 0 }, { "type" : "EVENT_MATCH", "value" : 0, "name" : "container", "env" : [ "CONTAINER=lxc-libvirt" ] }, { "value" : 0, "type" : "EVENT_OR" }, { "type" : "EVENT_AND", "value" : 0 } ], "chdir" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "reload_signal" : 1, "setuid" : null, "respawn_interval" : 5, "jobs" : [ { "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[!2345]" ], "name" : "runlevel", "value" : 0 } ], "goal" : "JOB_START", "trace_state" : "TRACE_NONE", "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "", "failed_process" : "PROCESS_INVALID", "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1/_", "pid" : [ 2242, 0, 0, 0, 0, 0 ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=stopped not-container" ], "start_env" : [], "respawn_time" : 185 } ], "kill_signal" : 15, "deleted" : 0, "name" : "tty1", "cgmanager_wait" : 0, "usage" : null, "author" : null, "description" : null, "version" : null, "nice" : -21 }, { "chroot" : null, "env" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "export" : [], "start_on" : [ { "type" : "EVENT_MATCH", "name" : "startup", "value" : 0 }, { "value" : 0, "name" : "starting", "env" : [ "udevtrigger" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_AND", "value" : 0 } ], "chdir" : null, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1, "respawn_interval" : 5, "jobs" : [], "deleted" : 0, "kill_signal" : 15, "name" : "udevmonitor", "cgmanager_wait" : 0, "usage" : null, "author" : null, "description" : "log initial device creation", "version" : null, "nice" : -21, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/udevmonitor", "session" : 0, "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped" } ], "debug" : 0, "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "/sbin/udevadm monitor -e >/dev/.udev.log", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "emits" : [] }, { "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/block_2drunlevel", "oom_score_adj" : 0, "emits" : [], "process" : [ { "script" : 1, "command" : "echo \"XXX: `date`: blocking runlevel\" |tee -a /dev/console\nsleep 5\necho \"XXX: `date`: blocked runlevel\" |tee -a /dev/console\n" }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [], "debug" : 0, "setgid" : null, "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "chdir" : null, "export" : [], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null, "nice" : -21, "version" : null, "description" : null, "author" : null, "cgmanager_wait" : 0, "usage" : null, "name" : "block-runlevel", "kill_signal" : 15, "deleted" : 0, "jobs" : [], "respawn_interval" : 5 }, { "kill_timeout" : 5, "path" : "/com/ubuntu/Upstart/jobs/cgroup_2djob3", "oom_score_adj" : 0, "session" : 0, "task" : 0, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "debug" : 0, "setgid" : null, "emits" : [], "cgroups" : [ { "names" : [ { "settings" : [], "expanded" : null, "name" : "db" } ], "controller" : "cpuset" }, { "controller" : "memory", "names" : [ { "expanded" : null, "settings" : [], "name" : "db" } ] } ], "respawn" : 0, "process" : [ { "script" : 0, "command" : "sleep 999" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "setuid" : null, "reload_signal" : 1, "export" : [], "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "cgroup-job1" ], "name" : "started", "value" : 0 } ], "jobs" : [], "respawn_interval" : 5, "description" : null, "author" : null, "nice" : -21, "version" : null, "kill_signal" : 15, "deleted" : 0, "usage" : null, "cgmanager_wait" : 0, "name" : "cgroup-job3" }, { "emits" : [], "respawn" : 0, "cgroups" : [ { "controller" : "memory", "names" : [ { "name" : "james-group1", "expanded" : null, "settings" : [ { "value" : "52428800", "key" : "limit_in_bytes" } ] } ] } ], "process" : [ { "script" : 1, "command" : "echo \"DEBUG: pid $$: main\"\ngrep memory /proc/self/cgroup\n" }, { "script" : 1, "command" : "echo \"DEBUG: pid $$: pre-start\"\ngrep memory /proc/self/cgroup\n" }, { "command" : "echo \"DEBUG: pid $$: post-start\"\ngrep memory /proc/self/cgroup\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "debug" : 0, "setgid" : null, "task" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgroup", "session" : 0, "author" : null, "description" : null, "version" : null, "nice" : -21, "deleted" : 0, "kill_signal" : 15, "name" : "cgroup", "usage" : null, "cgmanager_wait" : 0, "jobs" : [], "respawn_interval" : 5, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "reload_signal" : 1, "setuid" : null, "export" : [], "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "chdir" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "chroot" : null, "env" : [] }, { "task" : 1, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/dmesg", "oom_score_adj" : 0, "emits" : [], "process" : [ { "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [], "debug" : 0, "setgid" : null, "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel" } ], "export" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [], "chroot" : null, "nice" : -21, "version" : null, "description" : "save kernel messages", "author" : null, "cgmanager_wait" : 0, "usage" : null, "name" : "dmesg", "deleted" : 0, "kill_signal" : 15, "jobs" : [], "respawn_interval" : 5 }, { "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "env" : [], "chroot" : null, "setuid" : null, "reload_signal" : 1, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "virtual-filesystems" } ], "export" : [], "jobs" : [ { "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "respawn_time" : 0 } ], "respawn_interval" : 5, "nice" : -21, "version" : null, "description" : null, "author" : null, "cgmanager_wait" : 0, "usage" : null, "name" : "mountall-bootclean.sh", "deleted" : 0, "kill_signal" : 15, "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "oom_score_adj" : 0, "task" : 0, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "debug" : 0, "setgid" : null, "emits" : [], "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [] }, { "version" : null, "nice" : -21, "author" : null, "description" : "configure network device security", "name" : "network-interface-security", "usage" : null, "cgmanager_wait" : 0, "deleted" : 0, "kill_signal" : 15, "jobs" : [ { "respawn_time" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dmanager", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "network-manager", "failed_process" : "PROCESS_INVALID", "process_data" : [ null, null, null, null, null, null ], "exit_status" : 0, "fds" : [], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "type" : "EVENT_MATCH", "env" : [ "networking", "JOB=$JOB" ], "name" : "stopped", "value" : 0 }, { "type" : "EVENT_OR", "value" : 0 } ], "goal" : "JOB_START", "trace_state" : "TRACE_NONE" }, { "process_data" : [ null, null, null, null, null, null ], "fds" : [], "exit_status" : 0, "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "failed" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "name" : "network-interface/eth0", "failed_process" : "PROCESS_INVALID", "goal" : "JOB_START", "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "name" : "stopped", "value" : 0 }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "name" : "stopped", "value" : 0, "env" : [ "networking", "JOB=$JOB" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 } ], "trace_state" : "TRACE_NONE", "respawn_time" : 0, "stop_env" : [], "state" : "JOB_RUNNING", "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ] }, { "respawn_time" : 0, "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "pid" : [ 0, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "trace_forks" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "failed_process" : "PROCESS_INVALID", "name" : "network-interface/lo", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped" }, { "type" : "EVENT_OR", "value" : 0 }, { "type" : "EVENT_MATCH", "name" : "stopped", "value" : 0, "env" : [ "networking", "JOB=$JOB" ] }, { "value" : 0, "type" : "EVENT_OR" } ] }, { "respawn_time" : 0, "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "trace_forks" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "failed_process" : "PROCESS_INVALID", "name" : "networking", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_MATCH", "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped" }, { "value" : 0, "type" : "EVENT_OR" }, { "name" : "stopped", "value" : 0, "env" : [ "networking", "JOB=$JOB" ], "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 } ] } ], "respawn_interval" : 5, "setuid" : null, "reload_signal" : 1, "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "start_on" : [ { "env" : [ "network-interface" ], "name" : "starting", "value" : 0, "type" : "EVENT_MATCH" }, { "name" : "starting", "value" : 0, "env" : [ "network-manager" ], "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 } ], "chdir" : null, "export" : [], "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [], "chroot" : null, "emits" : [], "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "stop_on" : [ { "value" : 0, "name" : "stopped", "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "name" : "stopped", "value" : 0, "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 }, { "type" : "EVENT_MATCH", "name" : "stopped", "value" : 0, "env" : [ "networking", "JOB=$JOB" ] }, { "type" : "EVENT_OR", "value" : 0 } ], "debug" : 0, "setgid" : null, "task" : 0, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "kill_timeout" : 5, "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity" }, { "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "local-filesystems" }, { "type" : "EVENT_MATCH", "env" : [ "udevtrigger" ], "name" : "stopped", "value" : 0 }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "type" : "EVENT_OR", "value" : 0 }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "RESULT=failed", "PROCESS=post-stop", "EXIT_STATUS=100" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chdir" : null, "export" : [], "reload_signal" : 1, "setuid" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "respawn_interval" : 5, "jobs" : [ { "respawn_time" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking/_", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "fds" : [], "exit_status" : 0, "process_data" : [ null, null, null, null, null, null ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "unmounted-remote-filesystems" } ] } ], "name" : "networking", "cgmanager_wait" : 0, "usage" : null, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : "configure virtual network devices", "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "kill_timeout" : 5, "normalexit" : [], "umask" : 18, "respawn_limit" : 10, "task" : 0, "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "unmounted-remote-filesystems" } ], "debug" : 0, "process" : [ { "command" : null, "script" : 0 }, { "command" : " if [ \"$UPSTART_EVENTS\" = \"stopped\" ] && [ \"$UPSTART_JOB\" = \"networking\" ] && [ \"$EXIT_STATUS\" = \"100\" ]; then\n exit 0\n fi\n\n mkdir -p /run/network\n ifup -a\n", "script" : 1 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]; then\n echo \"Stopping or restarting the networking job is not supported.\"\n echo \"Use ifdown & ifup to reconfigure desired interface.\"\n exit 100\n fi\n\n log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n", "script" : 1 }, { "script" : 0, "command" : null } ], "cgroups" : [], "respawn" : 0, "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ] }, { "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/procps", "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "setgid" : null, "debug" : 0, "process" : [ { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [], "emits" : [], "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "start_on" : [ { "value" : 0, "name" : "started", "env" : [ "procps-instance" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "export" : [], "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG", "respawn_interval" : 5, "jobs" : [ { "respawn_time" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "trace_forks" : 0, "path" : "/com/ubuntu/Upstart/jobs/procps/_", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=procps-instance", "INSTANCE=virtual-filesystems", "UPSTART_EVENTS=started" ], "start_env" : [], "pid" : [ 0, 0, 0, 0, 0, 0 ], "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "failed_process" : "PROCESS_INVALID", "name" : "", "trace_state" : "TRACE_NONE", "goal" : "JOB_START" } ], "name" : "procps", "cgmanager_wait" : 0, "usage" : null, "deleted" : 0, "kill_signal" : 15, "version" : null, "nice" : -21, "author" : null, "description" : null }, { "jobs" : [], "respawn_interval" : 5, "nice" : -21, "version" : null, "description" : "restore software rfkill state", "author" : null, "cgmanager_wait" : 0, "usage" : null, "name" : "rfkill-restore", "deleted" : 0, "kill_signal" : 15, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "env" : [], "chroot" : null, "reload_signal" : 1, "setuid" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "chdir" : null, "start_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "local-filesystems" } ], "export" : [], "debug" : 0, "setgid" : null, "emits" : [], "process" : [ { "command" : " if [ ! -f /var/lib/rfkill/saved-state ] ||\n [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n while read line; do\n set -- $line\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n if [ -f $device/soft ] &&\n [ \"$(cat $device/name)\" = \"$1\" ]; then\n echo $2 > $device/soft\n fi\n done\n done < /var/lib/rfkill/saved-state\n", "script" : 1 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 } ], "respawn" : 0, "cgroups" : [], "kill_timeout" : 5, "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2drestore", "oom_score_adj" : 0, "task" : 1, "normalexit" : [], "umask" : 18, "respawn_limit" : 10 }, { "setgid" : null, "stop_on" : [ { "env" : [ "[!23]" ], "name" : "runlevel", "value" : 0, "type" : "EVENT_MATCH" } ], "debug" : 0, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 } ], "cgroups" : [], "respawn" : 1, "emits" : [], "session" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "kill_timeout" : 5, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "task" : 0, "respawn_interval" : 5, "jobs" : [ { "trace_state" : "TRACE_NONE", "goal" : "JOB_START", "stop_on" : [ { "type" : "EVENT_MATCH", "value" : 0, "name" : "runlevel", "env" : [ "[!23]" ] } ], "kill_process" : "PROCESS_INVALID", "respawn_count" : 0, "exit_status" : 0, "fds" : [], "process_data" : [ null, null, null, null, null, null ], "failed_process" : "PROCESS_INVALID", "name" : "", "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "failed" : 0, "trace_forks" : 0, "state" : "JOB_RUNNING", "stop_env" : [], "start_env" : [], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "pid" : [ 1218, 0, 0, 0, 0, 0 ], "path" : "/com/ubuntu/Upstart/jobs/tty6/_", "respawn_time" : 0 } ], "name" : "tty6", "usage" : null, "cgmanager_wait" : 0, "kill_signal" : 15, "deleted" : 0, "version" : null, "nice" : -21, "author" : null, "description" : null, "env" : [], "chroot" : null, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "expect" : "EXPECT_NONE", "start_on" : [ { "type" : "EVENT_MATCH", "env" : [ "[23]" ], "value" : 0, "name" : "runlevel" }, { "type" : "EVENT_MATCH", "name" : "not-container", "value" : 0 }, { "value" : 0, "type" : "EVENT_AND" } ], "chdir" : null, "export" : [], "setuid" : null, "reload_signal" : 1, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "" }, { "setgid" : null, "debug" : 0, "process" : [ { "command" : "sleep 999", "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "respawn" : 0, "cgroups" : [ { "names" : [ { "name" : "db/$UPSTART_CGROUP", "expanded" : null, "settings" : [ { "key" : "cpus", "value" : "1" } ] } ], "controller" : "cpuset" }, { "names" : [ { "name" : "db/$UPSTART_CGROUP", "settings" : [ { "value" : "52428800", "key" : "limit_in_bytes" } ], "expanded" : null } ], "controller" : "memory" }, { "controller" : "blkio", "names" : [ { "settings" : [ { "value" : "8:17 1048576", "key" : "throttle.write_bps_device" } ], "expanded" : null, "name" : "db/$UPSTART_CGROUP" } ] } ], "emits" : [], "session" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgroup_2djob2", "oom_score_adj" : 0, "kill_timeout" : 5, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "task" : 0, "respawn_interval" : 5, "jobs" : [], "usage" : null, "cgmanager_wait" : 0, "name" : "cgroup-job2", "kill_signal" : 15, "deleted" : 0, "nice" : -21, "version" : null, "description" : null, "author" : null, "env" : [], "chroot" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "chdir" : null, "start_on" : [ { "env" : [ "cgroup-job2" ], "name" : "started", "value" : 0, "type" : "EVENT_MATCH" } ], "export" : [], "setuid" : null, "reload_signal" : 1, "apparmor_switch" : null, "instance" : "", "console" : "CONSOLE_LOG" }, { "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/console_2dfont", "session" : 0, "kill_timeout" : 5, "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "task" : 1, "setgid" : null, "debug" : 0, "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "/lib/udev/console-setup-tty fbcon", "script" : 0 }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "emits" : [], "chroot" : null, "env" : [], "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "export" : [], "start_on" : [ { "name" : "starting", "value" : 0, "env" : [ "plymouth-splash" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "apparmor_switch" : null, "console" : "CONSOLE_LOG", "instance" : "", "setuid" : null, "reload_signal" : 1, "respawn_interval" : 5, "jobs" : [], "deleted" : 0, "kill_signal" : 15, "name" : "console-font", "cgmanager_wait" : 0, "usage" : null, "author" : null, "description" : "set console font", "version" : null, "nice" : -21 }, { "task" : 1, "umask" : 18, "normalexit" : [], "respawn_limit" : 10, "kill_timeout" : 5, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dcontainer", "session" : 0, "emits" : [ "net-device-added" ], "cgroups" : [], "respawn" : 0, "process" : [ { "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt|openvz)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "debug" : 0, "setgid" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "reload_signal" : 1, "setuid" : null, "export" : [], "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "chdir" : null, "expect" : "EXPECT_NONE", "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "chroot" : null, "env" : [], "author" : null, "description" : "workaround for missing events in container", "version" : null, "nice" : -21, "kill_signal" : 15, "deleted" : 0, "name" : "network-interface-container", "cgmanager_wait" : 0, "usage" : null, "jobs" : [], "respawn_interval" : 5 }, { "export" : [], "chdir" : null, "instance" : "", "apparmor_switch" : null, "console" : "CONSOLE_LOG", "setuid" : null, "reload_signal" : 1, "chroot" : null, "env" : [ "count_file=/root/rebooter.log", "max=37" ], "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ], "expect" : "EXPECT_NONE", "deleted" : 0, "kill_signal" : 15, "name" : "rebooter", "cgmanager_wait" : 0, "usage" : null, "author" : "James Hunt ", "description" : "reboot in a loop and log some basic timing details", "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [], "umask" : 18, "respawn_limit" : 10, "normalexit" : [], "task" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/rebooter", "session" : 0, "kill_timeout" : 5, "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "\nif [ ! -e \"$count_file\" ]\nthen\n new=1\n echo \"`date '+%s.%N'` $new\" >> \"$count_file\"\nfi\n\ncount=$(tail -1 \"$count_file\" | awk '{print $2}')\necho \"DEBUG: `date`: rebooter: count=$count, max=$max\" |tee -a /dev/console /dev/ttyS0\n\nif [ \"$count\" -eq \"$max\" ]\nthen\n\techo \"DEBUG: `date`: rebooter: count=$count, max=$max: OK - DISABLING (log='$count_file')\" |tee -a /dev/console /dev/ttyS0\n\techo \"manual\" > /etc/init/${UPSTART_JOB}.override\nfi\n\n# update\nnew=$((count + 1))\necho \"`date '+%s.%N'` $new\" >> \"$count_file\"\n\nsync && reboot\n\n", "script" : 1 }, { "command" : null, "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "emits" : [], "setgid" : null, "debug" : 0 }, { "respawn" : 0, "cgroups" : [], "process" : [ { "command" : "/sbin/ureadahead --daemon", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null }, { "command" : "sleep 45", "script" : 0 }, { "command" : null, "script" : 0 }, { "script" : 0, "command" : null } ], "emits" : [], "setgid" : null, "stop_on" : [ { "type" : "EVENT_MATCH", "env" : [ "rc" ], "name" : "stopped", "value" : 0 } ], "debug" : 0, "umask" : 18, "normalexit" : [ 0 ], "respawn_limit" : 10, "task" : 0, "oom_score_adj" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead", "session" : 0, "kill_timeout" : 180, "deleted" : 0, "kill_signal" : 15, "name" : "ureadahead", "cgmanager_wait" : 0, "usage" : null, "author" : null, "description" : "Read required files in advance", "version" : null, "nice" : -21, "respawn_interval" : 5, "jobs" : [], "export" : [], "start_on" : [ { "value" : 0, "name" : "starting", "env" : [ "mountall" ], "type" : "EVENT_MATCH" } ], "chdir" : null, "console" : "CONSOLE_LOG", "apparmor_switch" : null, "instance" : "", "reload_signal" : 1, "setuid" : null, "chroot" : null, "env" : [], "expect" : "EXPECT_FORK", "limits" : [ { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_max" : 0, "rlim_cur" : 0 } ] } ] } upstart-1.13.2/init/tests/data/upstart-1.8+full_serialisation+apparmor.json0000664000175000017500000171036612373101356023662 00000000000000{ "sessions" : [], "conf_sources" : [ { "conf_files" : [], "session" : 0, "flag" : 1, "type" : "CONF_FILE", "path" : "//etc/init.conf" }, { "conf_files" : [ { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "//etc/init/mounted-debugfs.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "//etc/init/mountnfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "pulseaudio" }, "flag" : 1, "path" : "//etc/init/pulseaudio.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc-sysinit" }, "flag" : 1, "path" : "//etc/init/rc-sysinit.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "setvtrgb" }, "flag" : 1, "path" : "//etc/init/setvtrgb.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lightdm" }, "flag" : 1, "path" : "//etc/init/lightdm.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "//etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-proc" }, "flag" : 1, "path" : "//etc/init/mounted-proc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface" }, "flag" : 1, "path" : "//etc/init/network-interface.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-log" }, "flag" : 1, "path" : "//etc/init/plymouth-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "atd" }, "flag" : 1, "path" : "//etc/init/atd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "control-alt-delete" }, "flag" : 1, "path" : "//etc/init/control-alt-delete.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe" }, "flag" : 1, "path" : "//etc/init/failsafe.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock-save" }, "flag" : 1, "path" : "//etc/init/hwclock-save.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "irqbalance" }, "flag" : 1, "path" : "//etc/init/irqbalance.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "networking" }, "flag" : 1, "path" : "//etc/init/networking.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ufw" }, "flag" : 1, "path" : "//etc/init/ufw.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-cups-reload" }, "flag" : 1, "path" : "//etc/init/avahi-cups-reload.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-font" }, "flag" : 1, "path" : "//etc/init/console-font.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "modemmanager" }, "flag" : 1, "path" : "//etc/init/modemmanager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-run" }, "flag" : 1, "path" : "//etc/init/mounted-run.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-tmp" }, "flag" : 1, "path" : "//etc/init/mounted-tmp.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc" }, "flag" : 1, "path" : "//etc/init/rc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rsyslog" }, "flag" : 1, "path" : "//etc/init/rsyslog.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "shutdown" }, "flag" : 1, "path" : "//etc/init/shutdown.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "jamespage" }, "flag" : 1, "path" : "//etc/init/jamespage.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth" }, "flag" : 1, "path" : "//etc/init/plymouth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "anacron" }, "flag" : 1, "path" : "//etc/init/anacron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-shell" }, "flag" : 1, "path" : "//etc/init/mountall-shell.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-var" }, "flag" : 1, "path" : "//etc/init/mounted-var.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "//etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty1" }, "flag" : 1, "path" : "//etc/init/tty1.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "//etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-finish" }, "flag" : 1, "path" : "//etc/init/udev-finish.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "wait-for-state" }, "flag" : 1, "path" : "//etc/init/wait-for-state.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "acpid" }, "flag" : 1, "path" : "//etc/init/acpid.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-restore" }, "flag" : 1, "path" : "//etc/init/alsa-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-store" }, "flag" : 1, "path" : "//etc/init/alsa-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "apport" }, "flag" : 1, "path" : "//etc/init/apport.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cron" }, "flag" : 1, "path" : "//etc/init/cron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-stop" }, "flag" : 1, "path" : "//etc/init/plymouth-stop.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "procps" }, "flag" : 1, "path" : "//etc/init/procps.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock" }, "flag" : 1, "path" : "//etc/init/hwclock.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "james" }, "flag" : 1, "path" : "//etc/init/james.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "james_daemon" }, "flag" : 1, "path" : "//etc/init/james_daemon.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "container-detect" }, "flag" : 1, "path" : "//etc/init/container-detect.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups-browsed" }, "flag" : 1, "path" : "//etc/init/cups-browsed.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall" }, "flag" : 1, "path" : "//etc/init/mountall.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mtab.sh" }, "flag" : 1, "path" : "//etc/init/mtab.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rcS" }, "flag" : 1, "path" : "//etc/init/rcS.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "whoopsie" }, "flag" : 1, "path" : "//etc/init/whoopsie.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall.sh" }, "flag" : 1, "path" : "//etc/init/mountall.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-security" }, "flag" : 1, "path" : "//etc/init/network-interface-security.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty5" }, "flag" : 1, "path" : "//etc/init/tty5.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "friendly-recovery" }, "flag" : 1, "path" : "//etc/init/friendly-recovery.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-reboot" }, "flag" : 1, "path" : "//etc/init/mountall-reboot.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-dev" }, "flag" : 1, "path" : "//etc/init/mounted-dev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty4" }, "flag" : 1, "path" : "//etc/init/tty4.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead-other" }, "flag" : 1, "path" : "//etc/init/ureadahead-other.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-daemon" }, "flag" : 1, "path" : "//etc/init/avahi-daemon.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe-x" }, "flag" : 1, "path" : "//etc/init/failsafe-x.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "//etc/init/mountkernfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-restore" }, "flag" : 1, "path" : "//etc/init/rfkill-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-store" }, "flag" : 1, "path" : "//etc/init/rfkill-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "systemd-logind" }, "flag" : 1, "path" : "//etc/init/systemd-logind.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevtrigger" }, "flag" : 1, "path" : "//etc/init/udevtrigger.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead" }, "flag" : 1, "path" : "//etc/init/ureadahead.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "false" }, "flag" : 1, "path" : "//etc/init/false.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "j" }, "flag" : 1, "path" : "//etc/init/j.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "passwd" }, "flag" : 1, "path" : "//etc/init/passwd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "startpar-bridge" }, "flag" : 1, "path" : "//etc/init/startpar-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-net" }, "flag" : 1, "path" : "//etc/init/mountall-net.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-manager" }, "flag" : 1, "path" : "//etc/init/network-manager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "resolvconf" }, "flag" : 1, "path" : "//etc/init/resolvconf.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty3" }, "flag" : 1, "path" : "//etc/init/tty3.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkfs.sh" }, "flag" : 1, "path" : "//etc/init/checkfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dbus" }, "flag" : 1, "path" : "//etc/init/dbus.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "//etc/init/flush-early-job-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-container" }, "flag" : 1, "path" : "//etc/init/network-interface-container.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-ready" }, "flag" : 1, "path" : "//etc/init/plymouth-ready.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-splash" }, "flag" : 1, "path" : "//etc/init/plymouth-splash.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot.sh" }, "flag" : 1, "path" : "//etc/init/checkroot.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-setup" }, "flag" : 1, "path" : "//etc/init/console-setup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console" }, "flag" : 1, "path" : "//etc/init/console.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups" }, "flag" : 1, "path" : "//etc/init/cups.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dmesg" }, "flag" : 1, "path" : "//etc/init/dmesg.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty2" }, "flag" : 1, "path" : "//etc/init/tty2.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev" }, "flag" : 1, "path" : "//etc/init/udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bluetooth" }, "flag" : 1, "path" : "//etc/init/bluetooth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "//etc/init/bootmisc.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hostname" }, "flag" : 1, "path" : "//etc/init/hostname.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hybrid-gfx" }, "flag" : 1, "path" : "//etc/init/hybrid-gfx.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "kmod" }, "flag" : 1, "path" : "//etc/init/kmod.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty6" }, "flag" : 1, "path" : "//etc/init/tty6.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevmonitor" }, "flag" : 1, "path" : "//etc/init/udevmonitor.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-file-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-udev-bridge.conf" } ], "session" : 0, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "//etc/init" } ], "job_classes" : [ { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-cups-reload", "instance" : "", "description" : "Reload cups, upon starting avahi-daemon to make sure remote queues are populated", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reload cups" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dmitrijs Ledkovs ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/avahi_2dcups_2dreload", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 681, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-daemon", "instance" : "", "description" : "mDNS/DNS-SD daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 0, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 673, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1039, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty4/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 574, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 557, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead-other", "instance" : "", "description" : "Read required files in advance (for other mountpoints)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon $MOUNTPOINT" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 4 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead_2dother", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "DEVICE=[/UL]*", "MOUNTPOINT=/?*" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1158, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "CRASH_DB_URL=https://daisy.ubuntu.com", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/whoopsie/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "enabled=1", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/apport/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-setup", "instance" : "", "description" : "set console keymap", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock-save", "instance" : "", "description" : "save system clock to hardware clock", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock_2dsave", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "irqbalance", "instance" : "", "description" : "CPU interrupts balancing daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\ttest -f /etc/default/irqbalance && . /etc/default/irqbalance\n\n\ttest \"$ENABLED\" != \"0\" || exit 0\n\n\tif test \"$ONESHOT\" != \"0\"; then\n\t\tDOPTIONS=\"--oneshot\"\n\tfi\n\n\texec /usr/sbin/irqbalance $DOPTIONS\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/irqbalance", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 640, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/systemd-logind.log", "io_watch_fd" : 16, "fd" : 15 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "SYSTEMD_LOG_TARGET=syslog", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "systemd-logind", "instance" : "", "description" : "SystemD login management service", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-logind" }, { "script" : 1, "command" : " # only start if PAM module is actually available, not if libpam-systemd is\n # removed but not purged\n [ -e /lib/*/security/pam_systemd.so ] || { stop; exit 0; }\n\n # this is being done by systemd or mountall usually, but not during\n # upgrades from earlier distro releases\n if ! mountpoint -q /sys/fs/cgroup; then\n mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup\n fi\n mkdir -p /run/systemd\n if ! mountpoint -q /sys/fs/cgroup/systemd; then\n mkdir -p /sys/fs/cgroup/systemd\n mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 16384, "rlim_max" : 16384 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "SYSTEMD_LOG_TARGET=syslog" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1048, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty5/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/failsafe", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hybrid-gfx", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hybrid-detect" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hybrid_2dgfx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 828, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/modemmanager.log", "io_watch_fd" : 19, "fd" : 17 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/modemmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "modemmanager", "instance" : "", "description" : "modem connection manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/modem-manager" }, { "script" : 1, "command" : "[ -x /usr/sbin/modem-manager ] || stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/modemmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-store", "instance" : "", "description" : "store software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n mkdir -p /var/lib/rfkill\n > /var/lib/rfkill/saved-state\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n entry=\"$(cat $device/name) $(cat $device/soft)\"\n echo $entry >> /var/lib/rfkill/saved-state\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1153, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/atd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "atd", "instance" : "", "description" : "deferred execution scheduler", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/atd", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 575, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/dbus/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/dbus", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "failsafe-x", "instance" : "", "description" : "Recovery options if display manager fails to start", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/share/xdiagnose/failsafeXServer \"$JOB\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/failsafe_2dx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "gdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 1, "name" : "graphics-device-added", "type" : "EVENT_MATCH", "event" : 0 }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 866, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=local-filesystems started static-network-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-manager", "instance" : "", "description" : "network connection manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-store", "instance" : "", "description" : "save sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl store" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 847, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/cups-browsed.log", "io_watch_fd" : 21, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=cups", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups-browsed", "instance" : "", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cups-browsed" }, { "script" : 1, "command" : "[ -x /usr/sbin/cups-browsed ]\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Till Kamppeter ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "cups" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 1, "name" : "runlevel", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "setvtrgb", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "setvtrgb /etc/vtrgb" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/setvtrgb", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "tty1" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-restore", "instance" : "", "description" : "restore sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl restore" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1150, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cron/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "j", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/tmp/james_daemon -c" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/j", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1188, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/lightdm.log", "io_watch_fd" : 44, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem runlevel started plymouth-ready" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lightdm/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lightdm", "instance" : "", "description" : "LightDM Display Manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Robert Ancell ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "[!06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "plymouth-ready", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "PREVLEVEL=S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/console", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 3 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1148, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/acpid/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 641, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bluetooth/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bluetooth", "instance" : "", "description" : "bluetooth daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/bluetoothd" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dstop", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rcS", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "recovery", "startup", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "friendly-recovery", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Only start friendly-recovery when booting in recovery mode\n if ! grep -q \"recovery\" /proc/cmdline; then\n exit 0\n fi\n\n if [ -x /lib/recovery-mode/recovery-menu ]; then\n exec /lib/recovery-mode/recovery-menu\n else\n exec /sbin/sulogin\n fi\n" }, { "script" : 1, "command" : " if plymouth --ping; then\n plymouth hide-splash || true\n fi\n\n # Try to set the hostname and initialize the console\n start hostname || true\n start console-setup || true\n start setvtrgb || true\n\n # Make sure /run contains the required directories for the\n # recovery menu options\n mkdir -p /run/lock /run/shm || true\n\n # Emit the mounted event to trigger resolvconf and mounted-run\n initctl emit mounted MOUNTPOINT=/run || true\n\n # Finally start udev\n start udev || true\n udevadm trigger --action=add || true\n udevadm settle || true\n\n # And turn off kernel messages (to avoid corrupting the menu)\n dmesg --console-off || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if plymouth --ping; then\n plymouth show-splash\nfi\ninitctl emit startup\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/friendly_2drecovery", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "recovery", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "jamespage", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "echo hello\nifconfig -a\nprocenv\nset\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/jamespage", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc_2dsysinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 716, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups", "instance" : "", "description" : "CUPS printing spooler/server", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cupsd -F" }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "script" : 1, "command" : " # wait until daemon is ready\n timeout=6\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Michael Sweet ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 1, "name" : "runlevel", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "pulseaudio", "instance" : "", "description" : "System PulseAudio sound server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS" }, { "script" : 0, "command" : "install -d -m755 -o pulse -g pulse /run/pulse" }, { "script" : 1, "command" : "if [ -e /var/run/pulse/.esd_auth ]; then\n\tchown pulse:pulse-access /var/run/pulse/.esd_auth\n\tchmod 640 /var/run/pulse/.esd_auth\nfi\nif [ -e /var/run/pulse/.pulse-cookie ]; then\n\tchown pulse:pulse-access /var/run/pulse/.pulse-cookie\n\tchmod 640 /var/run/pulse/.pulse-cookie\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Pali Rohár ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DISALLOW_MODULE_LOADING=1", "PULSEAUDIO_ARGS=" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/pulseaudio", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1013, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "socket" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "anacron", "instance" : "", "description" : "anac(h)ronistic cron", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "anacron -s" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/anacron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1069, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty2/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 530, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=proc", "MOUNTPOINT=/proc", "TYPE=proc", "OPTIONS=nodev,noexec,nosuid", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "file" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1073, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty3/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dshell", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=1400", "USEC_INITIALIZED=4437", "UPSTART_EVENTS=net-device-added" ], "name" : "lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:03.0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MM_CANDIDATE=1", "ID_MODEL_ID=0x100e", "ID_NET_NAME_MAC=enx525400123456", "ID_NET_NAME_PATH=enp0s3", "ID_NET_NAME_SLOT=ens3", "ID_VENDOR_ID=0x8086", "IFINDEX=2", "INTERFACE=eth0", "MATCHDEVID=0x0", "MATCHIFTYPE=1", "SEQNUM=1254", "USEC_INITIALIZED=6439", "UPSTART_EVENTS=net-device-added" ], "name" : "eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 0, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 1 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/data/testing/bin/plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dupstart_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1180, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=stopped not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty1/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udevmonitor", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dmesg", "instance" : "", "description" : "save kernel messages", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/dmesg", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "james", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "sleep 999" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/james", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "network-manager", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dmanager", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "networking", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/networking/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-restore", "instance" : "", "description" : "restore software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -f /var/lib/rfkill/saved-state ] ||\n [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n while read line; do\n set -- $line\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n if [ -f $device/soft ] &&\n [ \"$(cat $device/name)\" = \"$1\" ]; then\n echo $2 > $device/soft\n fi\n done\n done < /var/lib/rfkill/saved-state\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1080, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty6/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-font", "instance" : "", "description" : "set console font", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/udev/console-setup-tty fbcon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dfont", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "false", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/false" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/false", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "james_daemon", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/tmp/james_daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/james_5fdaemon", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "rc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead", "instance" : "", "description" : "Read required files in advance", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "sleep 45" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 180, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null } ], "events" : [ { "progress" : "EVENT_HANDLING", "env" : [ "KERNEL=fb0", "DEVPATH=/devices/pci0000:00/0000:00:02.0/graphics/fb0", "DEVNAME=/dev/fb0", "SUBSYSTEM=graphics", "ACTION=add", "ID_FOR_SEAT=graphics-pci-0000_00_02_0", "ID_PATH=pci-0000:00:02.0", "ID_PATH_TAG=pci-0000_00_02_0", "MAJOR=29", "MINOR=0", "PRIMARY_DEVICE_FOR_DISPLAY=1", "SEQNUM=1533", "TAGS=:master-of-seat:seat:", "USEC_INITIALIZED=7747" ], "session" : 0, "name" : "graphics-device-added", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=udev-fallback-graphics", "INSTANCE=", "RESULT=failed", "PROCESS=main", "EXIT_STATUS=1" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "runlevel", "blockers" : 2, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 } ] } upstart-1.13.2/init/tests/data/upstart-1.11.json0000664000175000017500000172433312373101356016232 00000000000000{ "sessions" : [], "conf_sources" : [ { "conf_files" : [], "session" : 0, "flag" : 1, "type" : "CONF_FILE", "path" : "//etc/init.conf" }, { "conf_files" : [ { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "//etc/init/mounted-debugfs.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "//etc/init/mountnfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "pulseaudio" }, "flag" : 1, "path" : "//etc/init/pulseaudio.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc-sysinit" }, "flag" : 1, "path" : "//etc/init/rc-sysinit.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "setvtrgb" }, "flag" : 1, "path" : "//etc/init/setvtrgb.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lightdm" }, "flag" : 1, "path" : "//etc/init/lightdm.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "//etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-proc" }, "flag" : 1, "path" : "//etc/init/mounted-proc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface" }, "flag" : 1, "path" : "//etc/init/network-interface.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-log" }, "flag" : 1, "path" : "//etc/init/plymouth-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-state" }, "flag" : 1, "path" : "//etc/init/alsa-state.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "control-alt-delete" }, "flag" : 1, "path" : "//etc/init/control-alt-delete.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe" }, "flag" : 1, "path" : "//etc/init/failsafe.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock-save" }, "flag" : 1, "path" : "//etc/init/hwclock-save.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "irqbalance" }, "flag" : 1, "path" : "//etc/init/irqbalance.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "networking" }, "flag" : 1, "path" : "//etc/init/networking.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ufw" }, "flag" : 1, "path" : "//etc/init/ufw.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-cups-reload" }, "flag" : 1, "path" : "//etc/init/avahi-cups-reload.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-font" }, "flag" : 1, "path" : "//etc/init/console-font.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "modemmanager" }, "flag" : 1, "path" : "//etc/init/modemmanager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-run" }, "flag" : 1, "path" : "//etc/init/mounted-run.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-tmp" }, "flag" : 1, "path" : "//etc/init/mounted-tmp.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc" }, "flag" : 1, "path" : "//etc/init/rc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rsyslog" }, "flag" : 1, "path" : "//etc/init/rsyslog.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "shutdown" }, "flag" : 1, "path" : "//etc/init/shutdown.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth" }, "flag" : 1, "path" : "//etc/init/plymouth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "anacron" }, "flag" : 1, "path" : "//etc/init/anacron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-shell" }, "flag" : 1, "path" : "//etc/init/mountall-shell.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-var" }, "flag" : 1, "path" : "//etc/init/mounted-var.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "//etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ssh" }, "flag" : 1, "path" : "//etc/init/ssh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty1" }, "flag" : 1, "path" : "//etc/init/tty1.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "//etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-finish" }, "flag" : 1, "path" : "//etc/init/udev-finish.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "wait-for-state" }, "flag" : 1, "path" : "//etc/init/wait-for-state.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "acpid" }, "flag" : 1, "path" : "//etc/init/acpid.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-restore" }, "flag" : 1, "path" : "//etc/init/alsa-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-store" }, "flag" : 1, "path" : "//etc/init/alsa-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "apport" }, "flag" : 1, "path" : "//etc/init/apport.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cron" }, "flag" : 1, "path" : "//etc/init/cron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-stop" }, "flag" : 1, "path" : "//etc/init/plymouth-stop.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "procps" }, "flag" : 1, "path" : "//etc/init/procps.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock" }, "flag" : 1, "path" : "//etc/init/hwclock.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "james" }, "flag" : 1, "path" : "//etc/init/james.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "container-detect" }, "flag" : 1, "path" : "//etc/init/container-detect.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups-browsed" }, "flag" : 1, "path" : "//etc/init/cups-browsed.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall" }, "flag" : 1, "path" : "//etc/init/mountall.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mtab.sh" }, "flag" : 1, "path" : "//etc/init/mtab.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rcS" }, "flag" : 1, "path" : "//etc/init/rcS.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "whoopsie" }, "flag" : 1, "path" : "//etc/init/whoopsie.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall.sh" }, "flag" : 1, "path" : "//etc/init/mountall.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-security" }, "flag" : 1, "path" : "//etc/init/network-interface-security.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty5" }, "flag" : 1, "path" : "//etc/init/tty5.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "friendly-recovery" }, "flag" : 1, "path" : "//etc/init/friendly-recovery.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-reboot" }, "flag" : 1, "path" : "//etc/init/mountall-reboot.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-dev" }, "flag" : 1, "path" : "//etc/init/mounted-dev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty4" }, "flag" : 1, "path" : "//etc/init/tty4.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead-other" }, "flag" : 1, "path" : "//etc/init/ureadahead-other.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-daemon" }, "flag" : 1, "path" : "//etc/init/avahi-daemon.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "emergency-console" }, "flag" : 1, "path" : "//etc/init/emergency-console.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe-x" }, "flag" : 1, "path" : "//etc/init/failsafe-x.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "//etc/init/mountkernfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-restore" }, "flag" : 1, "path" : "//etc/init/rfkill-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-store" }, "flag" : 1, "path" : "//etc/init/rfkill-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "systemd-logind" }, "flag" : 1, "path" : "//etc/init/systemd-logind.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevtrigger" }, "flag" : 1, "path" : "//etc/init/udevtrigger.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead" }, "flag" : 1, "path" : "//etc/init/ureadahead.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "passwd" }, "flag" : 1, "path" : "//etc/init/passwd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "startpar-bridge" }, "flag" : 1, "path" : "//etc/init/startpar-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-net" }, "flag" : 1, "path" : "//etc/init/mountall-net.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-manager" }, "flag" : 1, "path" : "//etc/init/network-manager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "resolvconf" }, "flag" : 1, "path" : "//etc/init/resolvconf.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty3" }, "flag" : 1, "path" : "//etc/init/tty3.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkfs.sh" }, "flag" : 1, "path" : "//etc/init/checkfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dbus" }, "flag" : 1, "path" : "//etc/init/dbus.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "//etc/init/flush-early-job-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-container" }, "flag" : 1, "path" : "//etc/init/network-interface-container.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-ready" }, "flag" : 1, "path" : "//etc/init/plymouth-ready.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-splash" }, "flag" : 1, "path" : "//etc/init/plymouth-splash.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "test-upstart-monitor" }, "flag" : 1, "path" : "//etc/init/test-upstart-monitor.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot.sh" }, "flag" : 1, "path" : "//etc/init/checkroot.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-setup" }, "flag" : 1, "path" : "//etc/init/console-setup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console" }, "flag" : 1, "path" : "//etc/init/console.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups" }, "flag" : 1, "path" : "//etc/init/cups.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dmesg" }, "flag" : 1, "path" : "//etc/init/dmesg.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "screen-cleanup" }, "flag" : 1, "path" : "//etc/init/screen-cleanup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty2" }, "flag" : 1, "path" : "//etc/init/tty2.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev" }, "flag" : 1, "path" : "//etc/init/udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bluetooth" }, "flag" : 1, "path" : "//etc/init/bluetooth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "//etc/init/bootmisc.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hostname" }, "flag" : 1, "path" : "//etc/init/hostname.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hybrid-gfx" }, "flag" : 1, "path" : "//etc/init/hybrid-gfx.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "kmod" }, "flag" : 1, "path" : "//etc/init/kmod.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty6" }, "flag" : 1, "path" : "//etc/init/tty6.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevmonitor" }, "flag" : 1, "path" : "//etc/init/udevmonitor.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-file-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-udev-bridge.conf" } ], "session" : 0, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "//etc/init" } ], "job_classes" : [ { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-cups-reload", "instance" : "", "description" : "Reload cups, upon starting avahi-daemon to make sure remote queues are populated", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reload cups" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dmitrijs Ledkovs ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/avahi_2dcups_2dreload", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 553, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-daemon", "instance" : "", "description" : "mDNS/DNS-SD daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 0, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc", "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 538, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "screen-cleanup", "instance" : "", "description" : "GNU Screen Cleanup", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "SCREENDIR=/var/run/screen\nif [ -L $SCREENDIR ] || [ ! -d $SCREENDIR ]; then\n\trm -f $SCREENDIR\n\tmkdir $SCREENDIR\n\tchown root:utmp $SCREENDIR\nfi\nfind $SCREENDIR -type p -delete\n# If the local admin has used dpkg-statoverride to install the screen\n# binary with different set[ug]id bits, change the permissions of\n# $SCREENDIR accordingly\nBINARYPERM=`stat -c%a /usr/bin/screen`\nif [ \"$BINARYPERM\" -ge 4000 ]; then\n\tchmod 0755 $SCREENDIR\nelif [ \"$BINARYPERM\" -ge 2000 ]; then\n\tchmod 0775 $SCREENDIR\nelse\n\tchmod 0777 $SCREENDIR\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/screen_2dcleanup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 933, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty4/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 446, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 440, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead-other", "instance" : "", "description" : "Read required files in advance (for other mountpoints)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon $MOUNTPOINT" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 4 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead_2dother", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "DEVICE=[/UL]*", "MOUNTPOINT=/?*" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1057, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "CRASH_DB_URL=https://daisy.ubuntu.com", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/whoopsie/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "enabled=1", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/apport/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n echo 2 > /proc/sys/fs/suid_dumpable\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo 0 > /proc/sys/fs/suid_dumpable\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-setup", "instance" : "", "description" : "set console keymap", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock-save", "instance" : "", "description" : "save system clock to hardware clock", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock_2dsave", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "irqbalance", "instance" : "", "description" : "CPU interrupts balancing daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\ttest -f /etc/default/irqbalance && . /etc/default/irqbalance\n\n\ttest \"$ENABLED\" != \"0\" || exit 0\n\n\tif test \"$ONESHOT\" != \"0\"; then\n\t\tDOPTIONS=\"--oneshot\"\n\tfi\n\n\texec /usr/sbin/irqbalance $DOPTIONS\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/irqbalance", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 520, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/systemd-logind.log", "io_watch_fd" : 19, "fd" : 11 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "SYSTEMD_LOG_TARGET=syslog", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "systemd-logind", "instance" : "", "description" : "SystemD login management service", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-logind" }, { "script" : 1, "command" : " # only start if PAM module is actually available, not if libpam-systemd is\n # removed but not purged\n [ -e /lib/*/security/pam_systemd.so ] || { stop; exit 0; }\n\n # this is being done by systemd or mountall usually, but not during\n # upgrades from earlier distro releases\n if ! mountpoint -q /sys/fs/cgroup; then\n mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup\n fi\n mkdir -p /run/systemd\n if ! mountpoint -q /sys/fs/cgroup/systemd; then\n mkdir -p /sys/fs/cgroup/systemd\n mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 16384, "rlim_max" : 16384 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "SYSTEMD_LOG_TARGET=syslog" ], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind", "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 941, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty5/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5", "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/failsafe", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hybrid-gfx", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hybrid-detect" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hybrid_2dgfx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 732, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/modemmanager.log", "io_watch_fd" : 23, "fd" : 9 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/modemmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "modemmanager", "instance" : "", "description" : "modem connection manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/modem-manager" }, { "script" : 1, "command" : "[ -x /usr/sbin/modem-manager ] || stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/modemmanager", "chdir" : null, "start_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-store", "instance" : "", "description" : "store software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n mkdir -p /var/lib/rfkill\n > /var/lib/rfkill/saved-state\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n entry=\"$(cat $device/name) $(cat $device/soft)\"\n echo $entry >> /var/lib/rfkill/saved-state\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 485, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/dbus/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/dbus", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "failsafe-x", "instance" : "", "description" : "Recovery options if display manager fails to start", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/share/xdiagnose/failsafeXServer \"$JOB\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/failsafe_2dx", "chdir" : null, "start_on" : [ { "env" : [ "lightdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "gdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1028, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ssh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_NONE", "kill_signal" : 15, "name" : "ssh", "instance" : "", "description" : "OpenSSH server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/sshd -D" }, { "script" : 1, "command" : " test -x /usr/sbin/sshd || { stop; exit 0; }\n test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }\n test -c /dev/null || { stop; exit 0; }\n\n mkdir -p -m0755 /var/run/sshd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ssh", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/mapper/ubuntu--vg-root", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 769, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=local-filesystems started static-network-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-manager", "instance" : "", "description" : "network connection manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-store", "instance" : "", "description" : "Store Sound Card State", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl store" }, { "script" : 1, "command" : "if test -f /var/lib/alsa/state-daemon.conf ; then\n stop; exit 0\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 759, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/cups-browsed.log", "io_watch_fd" : 21, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=cups", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups-browsed", "instance" : "", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "respawn_interval" : 240, "process" : [ { "script" : 0, "command" : "/usr/sbin/cups-browsed" }, { "script" : 1, "command" : "[ -x /usr/sbin/cups-browsed ]\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Till Kamppeter ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "cups" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 1, "name" : "runlevel", "type" : "EVENT_MATCH", "event" : 3 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "setvtrgb", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "setvtrgb /etc/vtrgb" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/setvtrgb", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "tty1" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-restore", "instance" : "", "description" : "Restore Sound Card State", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl restore" }, { "script" : 1, "command" : "if test -f /var/lib/alsa/state-daemon.conf ; then\n stop; exit 0\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1041, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cron/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cron", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1073, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/lightdm.log", "io_watch_fd" : 38, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem runlevel started plymouth-ready" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lightdm/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lightdm", "instance" : "", "description" : "LightDM Display Manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Robert Ancell ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "[!06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "plymouth-ready", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "PREVLEVEL=S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 297, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "blocking" : [ { "type" : "BLOCKED_EVENT", "data" : { "index" : 0 } } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=startup" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS || true\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # Doesn't work so well if mountall is responsible for mounting /proc, heh.\n if [ -e /proc/cmdline ]; then\n for arg in $(cat /proc/cmdline); do\n case $arg in\n -q|--quiet|-v|--verbose|--debug)\n debug_arg=$arg\n ;;\n esac\n done\n fi\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale || true\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix $debug_arg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/console", "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 4 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1039, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/acpid/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 521, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bluetooth/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bluetooth", "instance" : "", "description" : "bluetooth daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/bluetoothd" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth", "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/mapper/ubuntu--vg-root", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/mapper/ubuntu--vg-root", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dstop", "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rcS", "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "recovery", "startup", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "friendly-recovery", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Only start friendly-recovery when booting in recovery mode\n if ! grep -q \"recovery\" /proc/cmdline; then\n exit 0\n fi\n\n if [ -x /lib/recovery-mode/recovery-menu ]; then\n exec /lib/recovery-mode/recovery-menu\n else\n exec /sbin/sulogin\n fi\n" }, { "script" : 1, "command" : " if plymouth --ping; then\n plymouth hide-splash || true\n fi\n\n # Try to set the hostname and initialize the console\n start hostname || true\n start console-setup || true\n start setvtrgb || true\n\n # Make sure /run contains the required directories for the\n # recovery menu options\n mkdir -p /run/lock /run/shm || true\n\n # Emit the mounted event to trigger resolvconf and mounted-run\n initctl emit mounted MOUNTPOINT=/run || true\n\n # Finally start udev\n start udev || true\n udevadm trigger --action=add || true\n udevadm settle || true\n\n # And turn off kernel messages (to avoid corrupting the menu)\n dmesg --console-off || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if plymouth --ping; then\n plymouth show-splash\nfi\ninitctl emit startup\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/friendly_2drecovery", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "recovery", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc_2dsysinit", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 583, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups", "instance" : "", "description" : "CUPS printing spooler/server", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cupsd -F" }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "script" : 1, "command" : " # wait until daemon is ready\n timeout=60\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Michael Sweet ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 1, "name" : "runlevel", "type" : "EVENT_MATCH", "event" : 3 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "pulseaudio", "instance" : "", "description" : "System PulseAudio sound server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS" }, { "script" : 0, "command" : "install -d -m755 -o pulse -g pulse /run/pulse" }, { "script" : 1, "command" : "if [ -e /var/run/pulse/.esd_auth ]; then\n\tchown pulse:pulse-access /var/run/pulse/.esd_auth\n\tchmod 640 /var/run/pulse/.esd_auth\nfi\nif [ -e /var/run/pulse/.pulse-cookie ]; then\n\tchown pulse:pulse-access /var/run/pulse/.pulse-cookie\n\tchmod 640 /var/run/pulse/.pulse-cookie\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Pali Rohár ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DISALLOW_MODULE_LOADING=1", "PULSEAUDIO_ARGS=" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/pulseaudio", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 878, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "socket" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "anacron", "instance" : "", "description" : "anac(h)ronistic cron", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "anacron -s" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/anacron", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 957, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty2/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 875, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "file" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 962, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty3/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-state", "instance" : "", "description" : "Restore Sound Card State", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl -s -n 19 -b -c rdaemon" }, { "script" : 1, "command" : "if ! test -f /var/lib/alsa/state-daemon.conf ; then\n stop; exit 0\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "/usr/sbin/alsactl -s kill save_and_quit\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dstate", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "test-upstart-monitor", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-monitor -n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/test_2dupstart_2dmonitor", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dshell", "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=1470", "USEC_INITIALIZED=95916", "UPSTART_EVENTS=net-device-added" ], "name" : "lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:03.0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MM_CANDIDATE=1", "ID_MODEL_FROM_DATABASE=82540EM Gigabit Ethernet Controller", "ID_MODEL_ID=0x100e", "ID_NET_NAME_MAC=enx525400123456", "ID_NET_NAME_PATH=enp0s3", "ID_NET_NAME_SLOT=ens3", "ID_PCI_CLASS_FROM_DATABASE=Network controller", "ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller", "ID_VENDOR_FROM_DATABASE=Intel Corporation", "ID_VENDOR_ID=0x8086", "IFINDEX=2", "INTERFACE=eth0", "MATCHDEVID=0x0", "MATCHIFTYPE=1", "SEQNUM=1317", "USEC_INITIALIZED=55300", "UPSTART_EVENTS=net-device-added" ], "name" : "eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 0, "debug" : 0, "export" : [ "INTERFACE" ], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 1 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dupstart_2dbridge", "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1090, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=stopped not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty1/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udevmonitor", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dmesg", "instance" : "", "description" : "save kernel messages", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/dmesg", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "emergency-console", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 1, "command" : "stop plymouth || :\nchvt 6 || :\necho \"XXX: hello\"\nset\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/emergency_2dconsole", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "james", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "echo hello\nset || :\n#/sbin/initctl reload-configuration || :\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/james", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "network-manager", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dmanager", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "networking", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity", "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/networking/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-restore", "instance" : "", "description" : "restore software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -f /var/lib/rfkill/saved-state ] ||\n [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n while read line; do\n set -- $line\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n if [ -f $device/soft ] &&\n [ \"$(cat $device/name)\" = \"$1\" ]; then\n echo $2 > $device/soft\n fi\n done\n done < /var/lib/rfkill/saved-state\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 277, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=startup" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty6/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-font", "instance" : "", "description" : "set console font", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/udev/console-setup-tty fbcon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dfont", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "rc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead", "instance" : "", "description" : "Read required files in advance", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/home/james/ureadahead/src/ureadahead --daemon --debug --packdir /run/ureadahead /var/lib/ureadahead/pack" }, { "script" : 0, "command" : "mkdir -p /run/ureadahead" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "sleep 45" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 180, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead", "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null } ], "events" : [ { "progress" : "EVENT_HANDLING", "session" : 0, "name" : "startup", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=udev-fallback-graphics", "INSTANCE=", "RESULT=ok" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=udevtrigger", "INSTANCE=", "RESULT=ok" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "runlevel", "blockers" : 2, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 } ], "job_environment" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux" ] } upstart-1.13.2/init/tests/data/upstart-1.9.json0000664000175000017500000152623112373101356016156 00000000000000{ "sessions" : [], "conf_sources" : [ { "conf_files" : [], "session" : 0, "flag" : 0, "type" : "CONF_FILE", "path" : "/etc/init.conf" }, { "conf_files" : [ { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "setvtrgb" }, "flag" : 0, "path" : "/etc/init/setvtrgb.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "startpar-bridge" }, "flag" : 0, "path" : "/etc/init/startpar-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty5" }, "flag" : 0, "path" : "/etc/init/tty5.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dmesg" }, "flag" : 0, "path" : "/etc/init/dmesg.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "friendly-recovery" }, "flag" : 0, "path" : "/etc/init/friendly-recovery.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface" }, "flag" : 0, "path" : "/etc/init/network-interface.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-stop" }, "flag" : 0, "path" : "/etc/init/plymouth-stop.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "procps" }, "flag" : 0, "path" : "/etc/init/procps.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rsyslog" }, "flag" : 0, "path" : "/etc/init/rsyslog.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "systemd-logind" }, "flag" : 0, "path" : "/etc/init/systemd-logind.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev" }, "flag" : 0, "path" : "/etc/init/udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "atd" }, "flag" : 0, "path" : "/etc/init/atd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-upstart-bridge" }, "flag" : 0, "path" : "/etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty2" }, "flag" : 0, "path" : "/etc/init/tty2.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty6" }, "flag" : 0, "path" : "/etc/init/tty6.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cloud-init-nonet" }, "flag" : 0, "path" : "/etc/init/cloud-init-nonet.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-reboot" }, "flag" : 0, "path" : "/etc/init/mountall-reboot.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ssh" }, "flag" : 0, "path" : "/etc/init/ssh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-fallback-graphics" }, "flag" : 0, "path" : "/etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead-other" }, "flag" : 0, "path" : "/etc/init/ureadahead-other.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cryptdisks-enable" }, "flag" : 0, "path" : "/etc/init/cryptdisks-enable.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-bootclean.sh" }, "flag" : 0, "path" : "/etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall.sh" }, "flag" : 0, "path" : "/etc/init/mountall.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-dev" }, "flag" : 0, "path" : "/etc/init/mounted-dev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-var" }, "flag" : 0, "path" : "/etc/init/mounted-var.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-container" }, "flag" : 0, "path" : "/etc/init/network-interface-container.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "passwd" }, "flag" : 0, "path" : "/etc/init/passwd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cloud-init-local" }, "flag" : 0, "path" : "/etc/init/cloud-init-local.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe" }, "flag" : 0, "path" : "/etc/init/failsafe.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountkernfs.sh" }, "flag" : 0, "path" : "/etc/init/mountkernfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc-sysinit" }, "flag" : 0, "path" : "/etc/init/rc-sysinit.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty1" }, "flag" : 0, "path" : "/etc/init/tty1.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty3" }, "flag" : 0, "path" : "/etc/init/tty3.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "container-detect" }, "flag" : 0, "path" : "/etc/init/container-detect.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hostname" }, "flag" : 0, "path" : "/etc/init/hostname.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock-save" }, "flag" : 0, "path" : "/etc/init/hwclock-save.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "shutdown" }, "flag" : 0, "path" : "/etc/init/shutdown.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-file-bridge" }, "flag" : 0, "path" : "/etc/init/upstart-file-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bootmisc.sh" }, "flag" : 0, "path" : "/etc/init/bootmisc.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cloud-init" }, "flag" : 0, "path" : "/etc/init/cloud-init.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "flush-early-job-log" }, "flag" : 0, "path" : "/etc/init/flush-early-job-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock" }, "flag" : 0, "path" : "/etc/init/hwclock.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot-bootclean.sh" }, "flag" : 0, "path" : "/etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-font" }, "flag" : 0, "path" : "/etc/init/console-font.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console" }, "flag" : 0, "path" : "/etc/init/console.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "irqbalance" }, "flag" : 0, "path" : "/etc/init/irqbalance.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-security" }, "flag" : 0, "path" : "/etc/init/network-interface-security.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "resolvconf" }, "flag" : 0, "path" : "/etc/init/resolvconf.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "apport" }, "flag" : 0, "path" : "/etc/init/apport.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot.sh" }, "flag" : 0, "path" : "/etc/init/checkroot.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cloud-config" }, "flag" : 0, "path" : "/etc/init/cloud-config.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-tmp" }, "flag" : 0, "path" : "/etc/init/mounted-tmp.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cryptdisks-udev" }, "flag" : 0, "path" : "/etc/init/cryptdisks-udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-run" }, "flag" : 0, "path" : "/etc/init/mounted-run.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty4" }, "flag" : 0, "path" : "/etc/init/tty4.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevmonitor" }, "flag" : 0, "path" : "/etc/init/udevmonitor.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevtrigger" }, "flag" : 0, "path" : "/etc/init/udevtrigger.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkfs.sh" }, "flag" : 0, "path" : "/etc/init/checkfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cloud-init-container" }, "flag" : 0, "path" : "/etc/init/cloud-init-container.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-finish" }, "flag" : 0, "path" : "/etc/init/udev-finish.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cloud-final" }, "flag" : 0, "path" : "/etc/init/cloud-final.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cron" }, "flag" : 0, "path" : "/etc/init/cron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "kmod" }, "flag" : 0, "path" : "/etc/init/kmod.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-proc" }, "flag" : 0, "path" : "/etc/init/mounted-proc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "screen-cleanup" }, "flag" : 0, "path" : "/etc/init/screen-cleanup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "wait-for-state" }, "flag" : 0, "path" : "/etc/init/wait-for-state.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "control-alt-delete" }, "flag" : 0, "path" : "/etc/init/control-alt-delete.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-net" }, "flag" : 0, "path" : "/etc/init/mountall-net.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountdevsubfs.sh" }, "flag" : 0, "path" : "/etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-splash" }, "flag" : 0, "path" : "/etc/init/plymouth-splash.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc" }, "flag" : 0, "path" : "/etc/init/rc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ufw" }, "flag" : 0, "path" : "/etc/init/ufw.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs-bootclean.sh" }, "flag" : 0, "path" : "/etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-log" }, "flag" : 0, "path" : "/etc/init/plymouth-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-ready" }, "flag" : 0, "path" : "/etc/init/plymouth-ready.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth" }, "flag" : 0, "path" : "/etc/init/plymouth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-socket-bridge" }, "flag" : 0, "path" : "/etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "acpid" }, "flag" : 0, "path" : "/etc/init/acpid.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cloud-log-shutdown" }, "flag" : 0, "path" : "/etc/init/cloud-log-shutdown.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-setup" }, "flag" : 0, "path" : "/etc/init/console-setup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-debugfs" }, "flag" : 0, "path" : "/etc/init/mounted-debugfs.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs.sh" }, "flag" : 0, "path" : "/etc/init/mountnfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "networking" }, "flag" : 0, "path" : "/etc/init/networking.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-udev-bridge" }, "flag" : 0, "path" : "/etc/init/upstart-udev-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dbus" }, "flag" : 0, "path" : "/etc/init/dbus.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-shell" }, "flag" : 0, "path" : "/etc/init/mountall-shell.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall" }, "flag" : 0, "path" : "/etc/init/mountall.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mtab.sh" }, "flag" : 0, "path" : "/etc/init/mtab.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rcS" }, "flag" : 0, "path" : "/etc/init/rcS.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "whoopsie" }, "flag" : 0, "path" : "/etc/init/whoopsie.conf" } ], "session" : 0, "flag" : 0, "type" : "CONF_JOB_DIR", "path" : "/etc/init" } ], "job_classes" : [ { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 823, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 866, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty4/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 321, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 314, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 0, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc", "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "screen-cleanup", "instance" : "", "description" : "GNU Screen Cleanup", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "SCREENDIR=/var/run/screen\nif [ -L $SCREENDIR ] || [ ! -d $SCREENDIR ]; then\n\trm -f $SCREENDIR\n\tmkdir $SCREENDIR\n\tchown root:utmp $SCREENDIR\nfi\nfind $SCREENDIR -type p -delete\n# If the local admin has used dpkg-statoverride to install the screen\n# binary with different set[ug]id bits, change the permissions of\n# $SCREENDIR accordingly\nBINARYPERM=`stat -c%a /usr/bin/screen`\nif [ \"$BINARYPERM\" -ge 4000 ]; then\n\tchmod 0755 $SCREENDIR\nelif [ \"$BINARYPERM\" -ge 2000 ]; then\n\tchmod 0775 $SCREENDIR\nelse\n\tchmod 0777 $SCREENDIR\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/screen_2dcleanup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead-other", "instance" : "", "description" : "Read required files in advance (for other mountpoints)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon $MOUNTPOINT" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 4 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead_2dother", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "DEVICE=[/UL]*", "MOUNTPOINT=/?*" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 10, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "enabled=1", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/apport/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n echo 2 > /proc/sys/fs/suid_dumpable\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo 0 > /proc/sys/fs/suid_dumpable\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 796, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/systemd-logind.log", "io_watch_fd" : 14, "fd" : 8 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "SYSTEMD_LOG_TARGET=syslog", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "systemd-logind", "instance" : "", "description" : "SystemD login management service", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-logind" }, { "script" : 1, "command" : " # only start if PAM module is actually available, not if libpam-systemd is\n # removed but not purged\n [ -e /lib/*/security/pam_systemd.so ] || { stop; exit 0; }\n\n # this is being done by systemd or mountall usually, but not during\n # upgrades from earlier distro releases\n if ! mountpoint -q /sys/fs/cgroup; then\n mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup\n fi\n mkdir -p /run/systemd\n if ! mountpoint -q /sys/fs/cgroup/systemd; then\n mkdir -p /sys/fs/cgroup/systemd\n mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 16384, "rlim_max" : 16384 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "SYSTEMD_LOG_TARGET=syslog" ], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind", "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 873, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty5/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5", "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-setup", "instance" : "", "description" : "set console keymap", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock-save", "instance" : "", "description" : "save system clock to hardware clock", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock_2dsave", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "irqbalance", "instance" : "", "description" : "CPU interrupts balancing daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\ttest -f /etc/default/irqbalance && . /etc/default/irqbalance\n\n\ttest \"$ENABLED\" != \"0\" || exit 0\n\n\tif test \"$ONESHOT\" != \"0\"; then\n\t\tDOPTIONS=\"--oneshot\"\n\tfi\n\n\texec /usr/sbin/irqbalance $DOPTIONS\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/irqbalance", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/failsafe", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 950, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/atd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "atd", "instance" : "", "description" : "deferred execution scheduler", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/atd", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 758, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/dbus/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/dbus", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 918, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ssh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_NONE", "kill_signal" : 15, "name" : "ssh", "instance" : "", "description" : "OpenSSH server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/sshd -D" }, { "script" : 1, "command" : " test -x /usr/sbin/sshd || { stop; exit 0; }\n test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }\n test -c /dev/null || { stop; exit 0; }\n\n mkdir -p -m0755 /var/run/sshd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ssh", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-label/cloudimg-rootfs", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=defaults", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "setvtrgb", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "setvtrgb /etc/vtrgb" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/setvtrgb", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "tty1" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 949, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cron/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cron", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "cloud-init-container", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # if we are inside a container, then we may have to emit the ifup\n # events for 'auto' network devices.\n set -f\n\n # from /etc/network/if-up.d/upstart\n MARK_DEV_PREFIX=\"/run/network/ifup.\"\n MARK_STATIC_NETWORK_EMITTED=\"/run/network/static-network-up-emitted\"\n # if the all static network interfaces are already up, nothing to do\n [ -f \"$MARK_STATIC_NETWORK_EMITTED\" ] && exit 0\n\n # ifquery will exit failure if there is no /run/network directory.\n # normally that would get created by one of network-interface.conf\n # or networking.conf. But, it is possible that we're running\n # before either of those have.\n mkdir -p /run/network\n\n # get list of all 'auto' interfaces. if there are none, nothing to do.\n auto_list=$(ifquery --list --allow auto 2>/dev/null) || :\n [ -z \"$auto_list\" ] && exit 0\n set -- ${auto_list}\n [ \"$*\" = \"lo\" ] && exit 0\n\n # we only want to emit for interfaces that do not exist, so filter\n # out anything that does not exist.\n for iface in \"$@\"; do\n [ \"$iface\" = \"lo\" ] && continue\n # skip interfaces that are already up\n [ -f \"${MARK_DEV_PREFIX}${iface}\" ] && continue\n\n if [ -d /sys/net ]; then\n # if /sys is mounted, and there is no /sys/net/iface, then no device\n [ -e \"/sys/net/$iface\" ] && continue\n else\n # sys wasn't mounted, so just check via 'ifconfig'\n ifconfig \"$iface\" >/dev/null 2>&1 || continue\n fi\n initctl emit --no-wait net-device-added \"INTERFACE=$iface\" &&\n emitted=\"$emitted $iface\" ||\n echo \"warn: ${UPSTART_JOB} failed to emit net-device-added INTERFACE=$iface\"\n done\n\n [ -z \"${emitted# }\" ] ||\n echo \"${UPSTART_JOB}: emitted ifup for ${emitted# }\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cloud_2dinit_2dcontainer", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS || true\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale || true\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "cloud-config" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "cloud-config", "instance" : "", "description" : "Handle applying cloud-config", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cloud-init modules --mode=config" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cloud_2dconfig", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "rsyslog" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "cloud-log-shutdown", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "# runlevel(7) says INIT_HALT will be set to HALT or POWEROFF\ndate=$(date --utc)\ncase \"$RUNLEVEL:$INIT_HALT\" in\n 6:*) mode=\"reboot\";;\n 0:HALT) mode=\"halt\";;\n 0:POWEROFF) mode=\"poweroff\";;\n 0:*) mode=\"shutdown-unknown\";;\nesac\n{ read seconds idle < /proc/uptime; } 2>/dev/null || :\necho \"$date: shutting down for $mode${seconds:+ [up ${seconds%.*}s]}.\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cloud_2dlog_2dshutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "PREVLEVEL=2" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/console", "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 0 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 926, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/acpid/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-label/cloudimg-rootfs", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=defaults", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-label/cloudimg-rootfs", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=defaults", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dstop", "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rcS", "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "recovery", "startup", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "friendly-recovery", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Only start friendly-recovery when booting in recovery mode\n if ! grep -q \"recovery\" /proc/cmdline; then\n exit 0\n fi\n\n if [ -x /lib/recovery-mode/recovery-menu ]; then\n exec /lib/recovery-mode/recovery-menu\n else\n exec /sbin/sulogin\n fi\n" }, { "script" : 1, "command" : " if plymouth --ping; then\n plymouth hide-splash || true\n fi\n\n # Try to set the hostname and initialize the console\n start hostname || true\n start console-setup || true\n start setvtrgb || true\n\n # Make sure /run contains the required directories for the\n # recovery menu options\n mkdir -p /run/lock /run/shm || true\n\n # Emit the mounted event to trigger resolvconf and mounted-run\n initctl emit mounted MOUNTPOINT=/run || true\n\n # Finally start udev\n start udev || true\n udevadm trigger --action=add || true\n udevadm settle || true\n\n # And turn off kernel messages (to avoid corrupting the menu)\n dmesg --console-off || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if plymouth --ping; then\n plymouth show-splash\nfi\ninitctl emit startup\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/friendly_2drecovery", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "recovery", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc_2dsysinit", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 449, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "socket" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 893, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty2/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 223, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=proc", "MOUNTPOINT=/proc", "TYPE=proc", "OPTIONS=nodev,noexec,nosuid", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "file" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "cloud-final", "instance" : "", "description" : "execute cloud user/final scripts", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cloud-init modules --mode=final" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cloud_2dfinal", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "cloud-config" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "cloud-init", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/bin/cloud-init init" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cloud_2dinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "cloud-init-nonet" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 894, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty3/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "cloud-init-nonet", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " set +e # you cannot trap TERM reliably with 'set -e'\n SLEEP_CHILD=\"\"\n\n static_network_up() {\n\t local emitted=\"/run/network/static-network-up-emitted\"\n # /run/network/static-network-up-emitted is written by\n # upstart (via /etc/network/if-up.d/upstart). its presense would\n # indicate that static-network-up has already fired.\n [ -e \"$emitted\" -o -e \"/var/$emitted\" ]\n }\n msg() {\n local uptime=\"\" idle=\"\"\n if [ -r /proc/uptime ]; then\n read uptime idle < /proc/uptime\n fi\n echo \"$UPSTART_JOB${uptime:+[${uptime}]}:\" \"$1\"\n }\n\n handle_sigterm() {\n # if we received sigterm and static networking is up then it probably\n # came from upstart as a result of 'stop on static-network-up'\n if [ -n \"$SLEEP_CHILD\" ]; then\n if ! kill $SLEEP_CHILD 2>/dev/null; then\n [ ! -d \"/proc/$SLEEP_CHILD\" ] ||\n msg \"hm.. failed to kill sleep pid $SLEEP_CHILD\"\n fi\n fi\n if static_network_up; then\n msg \"static networking is now up\"\n exit 0\n fi\n msg \"recieved SIGTERM, networking not up\"\n exit 2\n }\n\n dowait() {\n msg \"waiting $1 seconds for network device\"\n sleep \"$1\" &\n SLEEP_CHILD=$!\n wait $SLEEP_CHILD\n SLEEP_CHILD=\"\"\n }\n\n trap handle_sigterm TERM\n\n # static_network_up already occurred\n static_network_up && exit 0\n\n # obj.pkl comes from cloud-init-local (or previous boot and\n # manual_cache_clean)\n [ -f /var/lib/cloud/instance/obj.pkl ] && exit 0\n\n dowait 10\n dowait 120\n msg \"gave up waiting for a network device.\"\n : > /var/lib/cloud/data/no-net\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cloud_2dinit_2dnonet", "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "cloud-init-local" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cryptdisks-udev", "instance" : "$DEVNAME", "description" : "enable encrypted block devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -r /lib/cryptsetup/cryptdisks.functions ] || { stop; exit 0; }\n\n . /lib/cryptsetup/cryptdisks.functions\n\n case \"$CRYPTDISKS_ENABLE\" in\n [Nn]*)\n exit 1\n ;;\n esac\n\n INITSTATE=udev\n crypttab_start_one_disk \"$DEVNAME\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cryptdisks_2dudev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "ID_FS_USAGE=crypto" ], "value" : 0, "name" : "block-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=1522", "USEC_INITIALIZED=440", "UPSTART_EVENTS=net-device-added" ], "name" : "lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:03.0/virtio0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MODEL_FROM_DATABASE=Virtio network device", "ID_MODEL_ID=0x1000", "ID_NET_NAME_MAC=enxfa163e61ab51", "ID_PCI_CLASS_FROM_DATABASE=Network controller", "ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller", "ID_VENDOR_FROM_DATABASE=Red Hat, Inc", "ID_VENDOR_ID=0x1af4", "IFINDEX=2", "INTERFACE=eth0", "MATCHDEVID=0x0", "MATCHIFTYPE=1", "SEQNUM=1370", "USEC_INITIALIZED=896", "UPSTART_EVENTS=net-device-added" ], "name" : "eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 0, "debug" : 0, "export" : [ "INTERFACE" ], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 964, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=stopped not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty1/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dshell", "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dupstart_2dbridge", "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 0, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udevmonitor", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "deleted" : 1, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "networking", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity", "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/networking/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 897, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty6/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "deleted" : 1, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cryptdisks-enable", "instance" : "", "description" : "enable remaining boot-time encrypted block devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -r /lib/cryptsetup/cryptdisks.functions ] || { stop; exit 0; }\n\n . /lib/cryptsetup/cryptdisks.functions\n\n case \"$CRYPTDISKS_ENABLE\" in\n [Nn]*)\n exit 1\n ;;\n esac\n\n INITSTATE=\"init\"\n do_start\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cryptdisks_2denable", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dmesg", "instance" : "", "description" : "save kernel messages", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/dmesg", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "cloud-init-local", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/bin/cloud-init init --local" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/cloud_2dinit_2dlocal", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-font", "instance" : "", "description" : "set console font", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/udev/console-setup-tty fbcon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dfont", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 0, "debug" : 0, "export" : [], "reload_signal" : 1, "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null } ], "events" : [ { "progress" : "EVENT_HANDLING", "env" : [ "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 1, "fd" : -1 } ] } upstart-1.13.2/init/tests/data/upstart-1.8+apparmor.json0000664000175000017500000064743212373101356020000 00000000000000{ "sessions" : [], "job_classes" : [ { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 669, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopping dbus", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : "stopping dbus", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-daemon", "instance" : "", "description" : "mDNS/DNS-SD daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon", "deleted" : 0, "chdir" : null, "start_on" : "(filesystem and started dbus)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 659, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [06]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [06]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "deleted" : 0, "chdir" : null, "start_on" : "filesystem", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1023, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty4/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and ((not-container or container CONTAINER=lxc) or container CONTAINER=lxc-libvirt))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 562, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [06]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [06]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 545, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopped udev", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : "stopped udev", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : "starting udev", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1143, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "CRASH_DB_URL=https://daisy.ubuntu.com", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/whoopsie/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "enabled=1", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/apport/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 628, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/systemd-logind.log", "io_watch_fd" : 17, "fd" : 15 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopping dbus", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "SYSTEMD_LOG_TARGET=syslog", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "stopping dbus", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "systemd-logind", "instance" : "", "description" : "SystemD login management service", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-logind" }, { "script" : 1, "command" : " # only start if PAM module is actually available, not if libpam-systemd is\n # removed but not purged\n [ -e /lib/*/security/pam_systemd.so ] || { stop; exit 0; }\n\n # this is being done by systemd or mountall usually, but not during\n # upgrades from earlier distro releases\n if ! mountpoint -q /sys/fs/cgroup; then\n mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup\n fi\n mkdir -p /run/systemd\n if ! mountpoint -q /sys/fs/cgroup/systemd; then\n mkdir -p /sys/fs/cgroup/systemd\n mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 16384, "rlim_max" : 16384 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "SYSTEMD_LOG_TARGET=syslog" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind", "deleted" : 0, "chdir" : null, "start_on" : "started dbus", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1032, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty5/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and not-container)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 819, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/modemmanager.log", "io_watch_fd" : 21, "fd" : 14 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopped network-manager", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/modemmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "stopped network-manager", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "modemmanager", "instance" : "", "description" : "modem connection manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/modem-manager" }, { "script" : 1, "command" : "[ -x /usr/sbin/modem-manager ] || stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/modemmanager", "deleted" : 0, "chdir" : null, "start_on" : "starting network-manager", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : "local-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1136, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/atd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "atd", "instance" : "", "description" : "deferred execution scheduler", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/atd", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 565, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "deconfiguring-networking", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/dbus/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "deconfiguring-networking", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/dbus", "deleted" : 0, "chdir" : null, "start_on" : "local-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [06]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [06]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "deleted" : 0, "chdir" : null, "start_on" : "mounted MOUNTPOINT=/run", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : "mounted MOUNTPOINT=/", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 898, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopping dbus", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=local-filesystems started static-network-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "stopping dbus", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-manager", "instance" : "", "description" : "network connection manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager", "deleted" : 0, "chdir" : null, "start_on" : "((local-filesystems and started dbus) and static-network-up)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 817, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/cups-browsed.log", "io_watch_fd" : 20, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [016]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=cups", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [016]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups-browsed", "instance" : "", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cups-browsed" }, { "script" : 1, "command" : "[ -x /usr/sbin/cups-browsed ]\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Till Kamppeter ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed", "deleted" : 0, "chdir" : null, "start_on" : "((filesystem and started avahi-daemon) and (started cups or runlevel [2345]))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1135, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cron/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cron", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1173, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/lightdm.log", "io_watch_fd" : 46, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [016]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem runlevel started plymouth-ready" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lightdm/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [016]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lightdm", "instance" : "", "description" : "LightDM Display Manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Robert Ancell ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm", "deleted" : 0, "chdir" : null, "start_on" : "((((filesystem and runlevel [!06]) and started dbus) and plymouth-ready) or runlevel PREVLEVEL=S)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1134, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/acpid/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "deleted" : 0, "chdir" : null, "start_on" : "runlevel [2345]", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 629, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopping dbus", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bluetooth/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "stopping dbus", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bluetooth", "instance" : "", "description" : "bluetooth daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/bluetoothd" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth", "deleted" : 0, "chdir" : null, "start_on" : "started dbus", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : "mounted MOUNTPOINT=/", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : "mounted MOUNTPOINT=/", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : "remote-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!023456]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!023456]", "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "deleted" : 0, "chdir" : null, "start_on" : "((starting network-interface or starting network-manager) or starting networking)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 704, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [016]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [016]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups", "instance" : "", "description" : "CUPS printing spooler/server", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cupsd -F" }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "script" : 1, "command" : " # wait until daemon is ready\n timeout=6\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Michael Sweet ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups", "deleted" : 0, "chdir" : null, "start_on" : "((filesystem and started avahi-daemon) and (started dbus or runlevel [2345]))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1196, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "socket" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : "net-device-up IFACE=lo", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1052, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty2/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and ((not-container or container CONTAINER=lxc) or container CONTAINER=lxc-libvirt))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 518, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=proc", "MOUNTPOINT=/proc", "TYPE=proc", "OPTIONS=nodev,noexec,nosuid", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "file" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : "mounted", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1055, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty3/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and ((not-container or container CONTAINER=lxc) or container CONTAINER=lxc-libvirt))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "net-device-removed INTERFACE=$INTERFACE", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=1399", "USEC_INITIALIZED=7177", "UPSTART_EVENTS=net-device-added" ], "name" : "lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "net-device-removed INTERFACE=$INTERFACE", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:03.0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MM_CANDIDATE=1", "ID_MODEL_ID=0x100e", "ID_NET_NAME_MAC=enx525400123456", "ID_NET_NAME_PATH=enp0s3", "ID_NET_NAME_SLOT=ens3", "ID_VENDOR_ID=0x8086", "IFINDEX=2", "INTERFACE=eth0", "MATCHDEVID=0x0", "MATCHIFTYPE=1", "SEQNUM=1253", "USEC_INITIALIZED=234", "UPSTART_EVENTS=net-device-added" ], "name" : "eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 0, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : "net-device-removed INTERFACE=$INTERFACE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : "net-device-added", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1165, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!2345]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=stopped not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty1/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!2345]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "deleted" : 0, "chdir" : null, "start_on" : "(stopped rc RUNLEVEL=[2345] and ((not-container or container CONTAINER=lxc) or container CONTAINER=lxc-libvirt))", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : "virtual-filesystems", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "network-manager", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dmanager", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "networking", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "((stopped network-interface JOB=$JOB INTERFACE=$INTERFACE or stopped network-manager JOB=$JOB) or stopped networking JOB=$JOB)", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : "((starting network-interface or starting network-manager) or starting networking)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "unmounted-remote-filesystems", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/networking/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "unmounted-remote-filesystems", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "deleted" : 0, "chdir" : null, "start_on" : "((local-filesystems and (stopped udevtrigger or container)) or runlevel [2345])", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1062, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "runlevel [!23]", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty6/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : "runlevel [!23]", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "deleted" : 0, "chdir" : null, "start_on" : "(runlevel [23] and not-container)", "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_PRE_STOP", "failed_process" : "PROCESS_INVALID", "pid" : [ 302, 0, 0, 1150, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/ureadahead.log", "io_watch_fd" : 16, "fd" : 13 }, { "path" : null }, { "path" : null }, { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/ureadahead.log", "io_watch_fd" : 26, "fd" : -1 }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : "stopped rc", "blocking" : [ { "type" : "BLOCKED_EVENT", "data" : { "index" : 2 } } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=mountall", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ureadahead/_", "exit_status" : 0, "goal" : "JOB_STOP", "stop_env" : [ "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_STOP_EVENTS=stopped" ], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : "stopped rc", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead", "instance" : "", "description" : "Read required files in advance", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "sleep 45" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 180, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead", "deleted" : 0, "chdir" : null, "start_on" : "starting mountall", "umask" : 18, "setgid" : null } ], "events" : [ { "progress" : "EVENT_HANDLING", "env" : [ "KERNEL=fb0", "DEVPATH=/devices/pci0000:00/0000:00:02.0/graphics/fb0", "DEVNAME=/dev/fb0", "SUBSYSTEM=graphics", "ACTION=add", "ID_FOR_SEAT=graphics-pci-0000_00_02_0", "ID_PATH=pci-0000:00:02.0", "ID_PATH_TAG=pci-0000_00_02_0", "MAJOR=29", "MINOR=0", "PRIMARY_DEVICE_FOR_DISPLAY=1", "SEQNUM=1533", "TAGS=:master-of-seat:seat:", "USEC_INITIALIZED=1762" ], "session" : 0, "name" : "graphics-device-added", "blockers" : 2, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "runlevel", "blockers" : 2, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "stopped", "blockers" : 2, "failed" : 0, "fd" : -1 } ] } upstart-1.13.2/init/tests/data/upstart-session2.json0000664000175000017500000317110512373101356017412 00000000000000{ "sessions" : [ { "chroot" : "@CHROOT_PATH@", "conf_path" : "@CHROOT_PATH@//etc/init" } ], "conf_sources" : [ { "conf_files" : [], "session" : 0, "flag" : 1, "type" : "CONF_FILE", "path" : "//etc/init.conf" }, { "conf_files" : [ { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "//etc/init/mounted-debugfs.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "//etc/init/mountnfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "pulseaudio" }, "flag" : 1, "path" : "//etc/init/pulseaudio.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc-sysinit" }, "flag" : 1, "path" : "//etc/init/rc-sysinit.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "setvtrgb" }, "flag" : 1, "path" : "//etc/init/setvtrgb.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lightdm" }, "flag" : 1, "path" : "//etc/init/lightdm.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "//etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-proc" }, "flag" : 1, "path" : "//etc/init/mounted-proc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface" }, "flag" : 1, "path" : "//etc/init/network-interface.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-log" }, "flag" : 1, "path" : "//etc/init/plymouth-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "atd" }, "flag" : 1, "path" : "//etc/init/atd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "control-alt-delete" }, "flag" : 1, "path" : "//etc/init/control-alt-delete.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe" }, "flag" : 1, "path" : "//etc/init/failsafe.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock-save" }, "flag" : 1, "path" : "//etc/init/hwclock-save.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "irqbalance" }, "flag" : 1, "path" : "//etc/init/irqbalance.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "networking" }, "flag" : 1, "path" : "//etc/init/networking.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ufw" }, "flag" : 1, "path" : "//etc/init/ufw.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-cups-reload" }, "flag" : 1, "path" : "//etc/init/avahi-cups-reload.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-font" }, "flag" : 1, "path" : "//etc/init/console-font.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lxc-instance" }, "flag" : 1, "path" : "//etc/init/lxc-instance.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "modemmanager" }, "flag" : 1, "path" : "//etc/init/modemmanager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-run" }, "flag" : 1, "path" : "//etc/init/mounted-run.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-tmp" }, "flag" : 1, "path" : "//etc/init/mounted-tmp.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc" }, "flag" : 1, "path" : "//etc/init/rc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rsyslog" }, "flag" : 1, "path" : "//etc/init/rsyslog.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "shutdown" }, "flag" : 1, "path" : "//etc/init/shutdown.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "jamespage" }, "flag" : 1, "path" : "//etc/init/jamespage.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth" }, "flag" : 1, "path" : "//etc/init/plymouth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "anacron" }, "flag" : 1, "path" : "//etc/init/anacron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-shell" }, "flag" : 1, "path" : "//etc/init/mountall-shell.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-var" }, "flag" : 1, "path" : "//etc/init/mounted-var.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "//etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty1" }, "flag" : 1, "path" : "//etc/init/tty1.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "//etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-finish" }, "flag" : 1, "path" : "//etc/init/udev-finish.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "wait-for-state" }, "flag" : 1, "path" : "//etc/init/wait-for-state.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "workers" }, "flag" : 1, "path" : "//etc/init/workers.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "acpid" }, "flag" : 1, "path" : "//etc/init/acpid.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-restore" }, "flag" : 1, "path" : "//etc/init/alsa-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-store" }, "flag" : 1, "path" : "//etc/init/alsa-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "apport" }, "flag" : 1, "path" : "//etc/init/apport.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cgroup-lite" }, "flag" : 1, "path" : "//etc/init/cgroup-lite.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cron" }, "flag" : 1, "path" : "//etc/init/cron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-stop" }, "flag" : 1, "path" : "//etc/init/plymouth-stop.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "procps" }, "flag" : 1, "path" : "//etc/init/procps.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "worker" }, "flag" : 1, "path" : "//etc/init/worker.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock" }, "flag" : 1, "path" : "//etc/init/hwclock.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "james" }, "flag" : 1, "path" : "//etc/init/james.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "james_daemon" }, "flag" : 1, "path" : "//etc/init/james_daemon.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "container-detect" }, "flag" : 1, "path" : "//etc/init/container-detect.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups-browsed" }, "flag" : 1, "path" : "//etc/init/cups-browsed.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "inst" }, "flag" : 1, "path" : "//etc/init/inst.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall" }, "flag" : 1, "path" : "//etc/init/mountall.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mtab.sh" }, "flag" : 1, "path" : "//etc/init/mtab.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rcS" }, "flag" : 1, "path" : "//etc/init/rcS.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "whoopsie" }, "flag" : 1, "path" : "//etc/init/whoopsie.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall.sh" }, "flag" : 1, "path" : "//etc/init/mountall.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-security" }, "flag" : 1, "path" : "//etc/init/network-interface-security.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty5" }, "flag" : 1, "path" : "//etc/init/tty5.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-dbus-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-dbus-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "friendly-recovery" }, "flag" : 1, "path" : "//etc/init/friendly-recovery.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-reboot" }, "flag" : 1, "path" : "//etc/init/mountall-reboot.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-dev" }, "flag" : 1, "path" : "//etc/init/mounted-dev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty4" }, "flag" : 1, "path" : "//etc/init/tty4.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead-other" }, "flag" : 1, "path" : "//etc/init/ureadahead-other.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-daemon" }, "flag" : 1, "path" : "//etc/init/avahi-daemon.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe-x" }, "flag" : 1, "path" : "//etc/init/failsafe-x.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "//etc/init/mountkernfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-restore" }, "flag" : 1, "path" : "//etc/init/rfkill-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-store" }, "flag" : 1, "path" : "//etc/init/rfkill-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "session_init_setup" }, "flag" : 1, "path" : "//etc/init/session_init_setup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "systemd-logind" }, "flag" : 1, "path" : "//etc/init/systemd-logind.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevtrigger" }, "flag" : 1, "path" : "//etc/init/udevtrigger.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead" }, "flag" : 1, "path" : "//etc/init/ureadahead.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "false" }, "flag" : 1, "path" : "//etc/init/false.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "j" }, "flag" : 1, "path" : "//etc/init/j.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lxc-net" }, "flag" : 1, "path" : "//etc/init/lxc-net.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "passwd" }, "flag" : 1, "path" : "//etc/init/passwd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "startpar-bridge" }, "flag" : 1, "path" : "//etc/init/startpar-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-net" }, "flag" : 1, "path" : "//etc/init/mountall-net.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-manager" }, "flag" : 1, "path" : "//etc/init/network-manager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "resolvconf" }, "flag" : 1, "path" : "//etc/init/resolvconf.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "session_init" }, "flag" : 1, "path" : "//etc/init/session_init.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty3" }, "flag" : 1, "path" : "//etc/init/tty3.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkfs.sh" }, "flag" : 1, "path" : "//etc/init/checkfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dbus" }, "flag" : 1, "path" : "//etc/init/dbus.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "//etc/init/flush-early-job-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-container" }, "flag" : 1, "path" : "//etc/init/network-interface-container.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-ready" }, "flag" : 1, "path" : "//etc/init/plymouth-ready.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-splash" }, "flag" : 1, "path" : "//etc/init/plymouth-splash.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot.sh" }, "flag" : 1, "path" : "//etc/init/checkroot.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-setup" }, "flag" : 1, "path" : "//etc/init/console-setup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console" }, "flag" : 1, "path" : "//etc/init/console.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups" }, "flag" : 1, "path" : "//etc/init/cups.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dmesg" }, "flag" : 1, "path" : "//etc/init/dmesg.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lxc" }, "flag" : 1, "path" : "//etc/init/lxc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty2" }, "flag" : 1, "path" : "//etc/init/tty2.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev" }, "flag" : 1, "path" : "//etc/init/udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bluetooth" }, "flag" : 1, "path" : "//etc/init/bluetooth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "//etc/init/bootmisc.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hostname" }, "flag" : 1, "path" : "//etc/init/hostname.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hybrid-gfx" }, "flag" : 1, "path" : "//etc/init/hybrid-gfx.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "kmod" }, "flag" : 1, "path" : "//etc/init/kmod.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty6" }, "flag" : 1, "path" : "//etc/init/tty6.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevmonitor" }, "flag" : 1, "path" : "//etc/init/udevmonitor.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-file-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-udev-bridge.conf" } ], "session" : 0, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "//etc/init" }, { "conf_files" : [ { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "dmesg" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/dmesg.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-shell" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountall-shell.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-ready" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/plymouth-ready.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rsyslog" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/rsyslog.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udev" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/udev.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-proc" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mounted-proc.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountkernfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-interface-security" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/network-interface-security.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-interface" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/network-interface.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "passwd" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/passwd.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "shutdown" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/shutdown.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "checkfs.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/checkfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "ssh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/ssh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/flush-early-job-log.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-net" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountall-net.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "startpar-bridge" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/startpar-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-dbus-bridge" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/upstart-dbus-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rc-sysinit" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/rc-sysinit.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "setvtrgb" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/setvtrgb.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty4" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/tty4.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "ureadahead-other" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/ureadahead-other.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "checkroot.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/checkroot.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty2" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/tty2.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-log" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/plymouth-log.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udevmonitor" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/udevmonitor.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udevtrigger" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/udevtrigger.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/bootmisc.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "console-setup" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/console-setup.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/plymouth.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty6" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/tty6.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountnfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "networking" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/networking.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty3" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/tty3.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "hwclock-save" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/hwclock-save.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-splash" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/plymouth-splash.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "resolvconf" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/resolvconf.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "network-interface-container" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/network-interface-container.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty5" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/tty5.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-reboot" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountall-reboot.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountall.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mtab.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mtab.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/upstart-udev-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "container-detect" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/container-detect.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "cron" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/cron.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "hwclock" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/hwclock.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "plymouth-stop" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/plymouth-stop.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/upstart-file-bridge.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "ureadahead" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/ureadahead.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "wait-for-state" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/wait-for-state.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "console-font" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/console-font.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "kmod" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/kmod.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mounted-debugfs.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rcS" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/rcS.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "udev-finish" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/udev-finish.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "control-alt-delete" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/control-alt-delete.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountall" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountall.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-run" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mounted-run.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-var" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mounted-var.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "procps" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/procps.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "console" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/console.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-dev" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mounted-dev.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mounted-tmp" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mounted-tmp.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "tty1" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/tty1.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "failsafe" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/failsafe.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "hostname" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/hostname.conf" }, { "conf_source" : 2, "job_class" : { "session" : 1, "name" : "rc" }, "flag" : 1, "path" : "@CHROOT_PATH@//etc/init/rc.conf" } ], "session" : 1, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "@CHROOT_PATH@//etc/init" } ], "job_classes" : [ { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-cups-reload", "instance" : "", "description" : "Reload cups, upon starting avahi-daemon to make sure remote queues are populated", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reload cups" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dmitrijs Ledkovs ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/avahi_2dcups_2dreload", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 814, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-daemon", "instance" : "", "description" : "mDNS/DNS-SD daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=none", "MOUNTPOINT=/sys/fs/cgroup", "TYPE=tmpfs", "OPTIONS=optional,uid=0,gid=0,mode=0755,size=1024", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cgroup_2dlite/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cgroup-lite", "instance" : "", "description" : "mount available cgroup filesystems", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "test -x /bin/cgroups-mount || { stop; exit 0; }\ntest -d /sys/fs/cgroup || { stop; exit 0; }\n/bin/cgroups-mount\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ -x /bin/cgroups-umount ]\nthen\n\t/bin/cgroups-umount\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Serge Hallyn ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cgroup_2dlite", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/fs/cgroup" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "inst", "instance" : "$foo", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "sleep 999" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/inst", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "a", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "b", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "c", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 0, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 807, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1158, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty4/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 726, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 714, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead-other", "instance" : "", "description" : "Read required files in advance (for other mountpoints)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon $MOUNTPOINT" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 4 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead_2dother", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "DEVICE=[/UL]*", "MOUNTPOINT=/?*" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1304, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "CRASH_DB_URL=https://daisy.ubuntu.com", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/whoopsie/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 1, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/rc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/rsyslog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/tty4", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/udev", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead-other", "instance" : "", "description" : "Read required files in advance (for other mountpoints)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon $MOUNTPOINT" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 4 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/ureadahead_2dother", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "DEVICE=[/UL]*", "MOUNTPOINT=/?*" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "enabled=1", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/apport/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n echo 2 > /proc/sys/fs/suid_dumpable\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo 0 > /proc/sys/fs/suid_dumpable\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-setup", "instance" : "", "description" : "set console keymap", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock-save", "instance" : "", "description" : "save system clock to hardware clock", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock_2dsave", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "irqbalance", "instance" : "", "description" : "CPU interrupts balancing daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\ttest -f /etc/default/irqbalance && . /etc/default/irqbalance\n\n\ttest \"$ENABLED\" != \"0\" || exit 0\n\n\tif test \"$ONESHOT\" != \"0\"; then\n\t\tDOPTIONS=\"--oneshot\"\n\tfi\n\n\texec /usr/sbin/irqbalance $DOPTIONS\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/irqbalance", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 780, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/systemd-logind.log", "io_watch_fd" : 16, "fd" : 15 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "SYSTEMD_LOG_TARGET=syslog", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "systemd-logind", "instance" : "", "description" : "SystemD login management service", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-logind" }, { "script" : 1, "command" : " # only start if PAM module is actually available, not if libpam-systemd is\n # removed but not purged\n [ -e /lib/*/security/pam_systemd.so ] || { stop; exit 0; }\n\n # this is being done by systemd or mountall usually, but not during\n # upgrades from earlier distro releases\n if ! mountpoint -q /sys/fs/cgroup; then\n mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup\n fi\n mkdir -p /run/systemd\n if ! mountpoint -q /sys/fs/cgroup/systemd; then\n mkdir -p /sys/fs/cgroup/systemd\n mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 16384, "rlim_max" : 16384 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "SYSTEMD_LOG_TARGET=syslog" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1167, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty5/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-setup", "instance" : "", "description" : "set console keymap", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/console_2dsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock-save", "instance" : "", "description" : "save system clock to hardware clock", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/hwclock_2dsave", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/tty5", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/failsafe", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hybrid-gfx", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hybrid-detect" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hybrid_2dgfx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 954, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/modemmanager.log", "io_watch_fd" : 18, "fd" : 28 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/modemmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "modemmanager", "instance" : "", "description" : "modem connection manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/modem-manager" }, { "script" : 1, "command" : "[ -x /usr/sbin/modem-manager ] || stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/modemmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-store", "instance" : "", "description" : "store software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n mkdir -p /var/lib/rfkill\n > /var/lib/rfkill/saved-state\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n entry=\"$(cat $device/name) $(cat $device/soft)\"\n echo $entry >> /var/lib/rfkill/saved-state\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/failsafe", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1289, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/atd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "atd", "instance" : "", "description" : "deferred execution scheduler", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/atd", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 727, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/dbus/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/dbus", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "failsafe-x", "instance" : "", "description" : "Recovery options if display manager fails to start", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/share/xdiagnose/failsafeXServer \"$JOB\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/failsafe_2dx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "gdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 1, "name" : "graphics-device-added", "type" : "EVENT_MATCH", "event" : 0 }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/resolvconf", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_NONE", "kill_signal" : 15, "name" : "ssh", "instance" : "", "description" : "OpenSSH server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/sshd -D" }, { "script" : 1, "command" : " test -x /usr/sbin/sshd || { stop; exit 0; }\n test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }\n test -c /dev/null || { stop; exit 0; }\n\n mkdir -p -m0755 /var/run/sshd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/ssh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "rc", "RUNLEVEL=[016]" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "LXC_AUTO=false", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lxc/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "rc", "RUNLEVEL=[016]" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lxc", "instance" : "", "description" : "lxc", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -f /etc/default/lxc ] && . /etc/default/lxc\n\n\t[ \"x$LXC_AUTO\" = \"xtrue\" ] || { stop; exit 0; }\n\n\t# don't load profiles if mount mediation is not supported\n\tSYSF=/sys/kernel/security/apparmor/features/mount/mask\n\tif [ -f $SYSF ]; then\n\t\tif [ -x /lib/init/apparmor-profile-load ]; then\n\t\t\t/lib/init/apparmor-profile-load usr.bin.lxc-start\n\t\t\t/lib/init/apparmor-profile-load lxc-containers\n\t\tfi\n\tfi\n\n\tls /etc/lxc/auto/* > /dev/null 2>&1 || exit 0;\n\tfor f in /etc/lxc/auto/*; do\n\t\tc=\"$(basename $f .conf)\"\n\t\tstart lxc-instance NAME=$c CONFIG=$f\n\tdone\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Serge Hallyn ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "LXC_AUTO=false" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lxc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 981, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=local-filesystems started static-network-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-manager", "instance" : "", "description" : "network connection manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "worker", "kill_signal" : 15, "instance" : "$id", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "sleep 999" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/worker", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-store", "instance" : "", "description" : "save sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl store" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 979, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/cups-browsed.log", "io_watch_fd" : 20, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=cups", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups-browsed", "instance" : "", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "respawn_interval" : 240, "process" : [ { "script" : 0, "command" : "/usr/sbin/cups-browsed" }, { "script" : 1, "command" : "[ -x /usr/sbin/cups-browsed ]\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Till Kamppeter ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "cups" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 1, "name" : "runlevel", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "setvtrgb", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "setvtrgb /etc/vtrgb" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/setvtrgb", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "tty1" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "setvtrgb", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "setvtrgb /etc/vtrgb" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/setvtrgb", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "tty1" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-restore", "instance" : "", "description" : "restore sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl restore" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1288, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cron/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "j", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/tmp/james_daemon -c" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/j", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1321, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/lightdm.log", "io_watch_fd" : 46, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem runlevel started plymouth-ready" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lightdm/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lightdm", "instance" : "", "description" : "LightDM Display Manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Robert Ancell ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "[!06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "plymouth-ready", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "PREVLEVEL=S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS || true\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale || true\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/cron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS || true\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale || true\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountall", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/console", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 3 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/console", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1286, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/acpid/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 781, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bluetooth/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bluetooth", "instance" : "", "description" : "bluetooth daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/bluetoothd" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dstop", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rcS", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/plymouth_2dstop", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/sulogin" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/rcS", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "recovery", "startup", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "friendly-recovery", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Only start friendly-recovery when booting in recovery mode\n if ! grep -q \"recovery\" /proc/cmdline; then\n exit 0\n fi\n\n if [ -x /lib/recovery-mode/recovery-menu ]; then\n exec /lib/recovery-mode/recovery-menu\n else\n exec /sbin/sulogin\n fi\n" }, { "script" : 1, "command" : " if plymouth --ping; then\n plymouth hide-splash || true\n fi\n\n # Try to set the hostname and initialize the console\n start hostname || true\n start console-setup || true\n start setvtrgb || true\n\n # Make sure /run contains the required directories for the\n # recovery menu options\n mkdir -p /run/lock /run/shm || true\n\n # Emit the mounted event to trigger resolvconf and mounted-run\n initctl emit mounted MOUNTPOINT=/run || true\n\n # Finally start udev\n start udev || true\n udevadm trigger --action=add || true\n udevadm settle || true\n\n # And turn off kernel messages (to avoid corrupting the menu)\n dmesg --console-off || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if plymouth --ping; then\n plymouth show-splash\nfi\ninitctl emit startup\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/friendly_2drecovery", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "recovery", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "jamespage", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "echo hello\nifconfig -a\nprocenv\nset\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/jamespage", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "network-interface" ], "value" : 1, "name" : "starting", "type" : "EVENT_MATCH", "event" : 5 }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "lxc" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 30, "name" : "lxc-instance", "instance" : "$NAME", "description" : "lxc instance", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "lxc-start -n $NAME -f $CONFIG" }, { "script" : 1, "command" : "\n\tlxc-info -n $NAME 2>/dev/null | grep state | grep -q \"RUNNING\" && {stop; exit 0; }\n\t[ -f $CONFIG ] || {stop; exit 0; }\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Christian Kampka ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 120, "usage" : "NAME=name of LXC instance, CONFIG=full path to configuration file", "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lxc_2dinstance", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc_2dsysinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [ "user" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "session_init_setup", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " uid=$(getent passwd \"$user\"|cut -d: -f3)\n gid=$(getent passwd \"$user\"|cut -d: -f4)\n\n # This directory would normally be created by PAM when a user logs in.\n\n # create the directory\n export XDG_RUNTIME_DIR=\"/run/user/$uid\"\n mkdir -p \"$XDG_RUNTIME_DIR\"\n chmod 0700 \"$XDG_RUNTIME_DIR\"\n chown \"$uid:$gid\" \"$XDG_RUNTIME_DIR\"\n\n start session_init USER=\"$user\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "user=james" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/session_5finit_5fsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/rc_2dsysinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 844, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups", "instance" : "", "description" : "CUPS printing spooler/server", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cupsd -F" }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "script" : 1, "command" : " # wait until daemon is ready\n timeout=6\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 3, "author" : "Michael Sweet ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 1, "name" : "runlevel", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "pulseaudio", "instance" : "", "description" : "System PulseAudio sound server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS" }, { "script" : 0, "command" : "install -d -m755 -o pulse -g pulse /run/pulse" }, { "script" : 1, "command" : "if [ -e /var/run/pulse/.esd_auth ]; then\n\tchown pulse:pulse-access /var/run/pulse/.esd_auth\n\tchmod 640 /var/run/pulse/.esd_auth\nfi\nif [ -e /var/run/pulse/.pulse-cookie ]; then\n\tchown pulse:pulse-access /var/run/pulse/.pulse-cookie\n\tchmod 640 /var/run/pulse/.pulse-cookie\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Pali Rohár ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DISALLOW_MODULE_LOADING=1", "PULSEAUDIO_ARGS=" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/pulseaudio", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1105, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "socket" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "socket" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "anacron", "instance" : "", "description" : "anac(h)ronistic cron", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "anacron -s" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/anacron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1194, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty2/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NORMAL", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 1, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=startup" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2ddbus_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "dbus" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-dbus-bridge", "instance" : "", "description" : "Bridge D-Bus signal events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-dbus-bridge --daemon --system" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2ddbus_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 696, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=proc", "MOUNTPOINT=/proc", "TYPE=proc", "OPTIONS=nodev,noexec,nosuid", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "file" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "workers", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "for inst in a b c\ndo\n start worker id=$id\ndone\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "for inst in `initctl list|grep \"^worker \"|awk '{print $2}'|tr -d ')'|tr -d '('`\ndo\n stop worker id=$inst\ndone\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/workers", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/tty2", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "dbus" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-dbus-bridge", "instance" : "", "description" : "Bridge D-Bus signal events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-dbus-bridge --daemon --system" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/upstart_2ddbus_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "file" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1197, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty3/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/tty3", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "lxc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "USE_LXC_BRIDGE=false", "LXC_BRIDGE=lxcbr0", "LXC_ADDR=10.0.3.1", "LXC_NETMASK=255.255.255.0", "LXC_NETWORK=10.0.3.0/24", "LXC_DHCP_RANGE=10.0.3.2,10.0.3.254", "LXC_DHCP_MAX=253", "LXC_DHCP_CONFILE=", "varrun=/var/run/lxc", "JOB=lxc", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lxc_2dnet/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "lxc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lxc-net", "instance" : "", "description" : "lxc network", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -f /etc/default/lxc ] && . /etc/default/lxc\n\n\t[ \"x$USE_LXC_BRIDGE\" = \"xtrue\" ] || { stop; exit 0; }\n\n\tcleanup() {\n\t\t# dnsmasq failed to start, clean up the bridge\n\t\tiptables -t nat -D POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE || true\n\t\tifconfig ${LXC_BRIDGE} down || true\n\t\tbrctl delbr ${LXC_BRIDGE} || true\n\t}\n\n\tif [ -d /sys/class/net/${LXC_BRIDGE} ]; then\n\t\tif [ ! -f ${varrun}/network_up ]; then\n\t\t\t# bridge exists, but we didn't start it\n\t\t\tstop;\n\t\tfi\n\t\texit 0;\n\tfi\n\n\t# set up the lxc network\n\tbrctl addbr ${LXC_BRIDGE} || { echo \"Missing bridge support in kernel\"; stop; exit 0; }\n\techo 1 > /proc/sys/net/ipv4/ip_forward\n\tmkdir -p ${varrun}\n\tifconfig ${LXC_BRIDGE} ${LXC_ADDR} netmask ${LXC_NETMASK} up\n\tiptables -t nat -A POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE\n\tdnsmasq -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file=${varrun}/dnsmasq.pid --conf-file=${LXC_DHCP_CONFILE} --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override --except-interface=lo --interface=${LXC_BRIDGE} --dhcp-leasefile=/var/lib/misc/dnsmasq.${LXC_BRIDGE}.leases --dhcp-authoritative || cleanup\n\ttouch ${varrun}/network_up\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t[ -f /etc/default/lxc ] && . /etc/default/lxc\n\t[ -f \"${varrun}/network_up\" ] || exit 0;\n\t# if $LXC_BRIDGE has attached interfaces, don't shut it down\n\tls /sys/class/net/${LXC_BRIDGE}/brif/* > /dev/null 2>&1 && exit 0;\n\n\tif [ -d /sys/class/net/${LXC_BRIDGE} ]; then\n\t\tifconfig ${LXC_BRIDGE} down\n\t\tiptables -t nat -D POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE || true\n\t\tpid=`cat ${varrun}/dnsmasq.pid 2>/dev/null` && kill -9 $pid || true\n\t\trm -f ${varrun}/dnsmasq.pid\n\t\tbrctl delbr ${LXC_BRIDGE}\n\tfi\n\trm -f ${varrun}/network_up\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : "Serge Hallyn ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "USE_LXC_BRIDGE=false", "LXC_BRIDGE=lxcbr0", "LXC_ADDR=10.0.3.1", "LXC_NETMASK=255.255.255.0", "LXC_NETWORK=10.0.3.0/24", "LXC_DHCP_RANGE=10.0.3.2,10.0.3.254", "LXC_DHCP_MAX=253", "LXC_DHCP_CONFILE=", "varrun=/var/run/lxc" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lxc_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lxc" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1357, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/session_init-james.log", "io_watch_fd" : 25, "fd" : 9 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "USER=james" ], "name" : "james", "path" : "/com/ubuntu/Upstart/jobs/session_5finit/james", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "session_init", "kill_signal" : 15, "instance" : "$USER", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " uid=$(getent passwd \"$USER\"|cut -d: -f3)\n HOME=$(getent passwd \"$USER\"|cut -d: -f6)\n\n export XDG_RUNTIME_DIR=\"/run/user/$uid\"\n export HOME\n\n exec su -s /bin/sh -c 'exec \"$0\" \"$@\"' $USER -- init --user\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/session_5finit", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dshell", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_STARTING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "blocker" : 5, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "blocking" : [ { "type" : "BLOCKED_EVENT", "data" : { "index" : 4 } } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lxcbr0", "DEVPATH=/devices/virtual/net/lxcbr0", "SUBSYSTEM=net", "ACTION=add", "DEVTYPE=bridge", "ID_MM_CANDIDATE=1", "IFINDEX=3", "INTERFACE=lxcbr0", "SEQNUM=1597", "USEC_INITIALIZED=8599", "UPSTART_EVENTS=net-device-added" ], "name" : "lxcbr0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lxcbr0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=1441", "USEC_INITIALIZED=918", "UPSTART_EVENTS=net-device-added" ], "name" : "lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:03.0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MM_CANDIDATE=1", "ID_MODEL_FROM_DATABASE=82540EM Gigabit Ethernet Controller", "ID_MODEL_ID=0x100e", "ID_NET_NAME_MAC=enx525400123456", "ID_NET_NAME_PATH=enp0s3", "ID_NET_NAME_SLOT=ens3", "ID_PCI_CLASS_FROM_DATABASE=Network controller", "ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller", "ID_VENDOR_FROM_DATABASE=Intel Corporation", "ID_VENDOR_ID=0x8086", "IFINDEX=2", "INTERFACE=eth0", "MATCHDEVID=0x0", "MATCHIFTYPE=1", "SEQNUM=1294", "USEC_INITIALIZED=606", "UPSTART_EVENTS=net-device-added" ], "name" : "eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 0, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 1 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/data/testing/bin/plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dupstart_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1316, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=stopped not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty1/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udevmonitor", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountall_2dshell", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 1, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/plymouth_2dupstart_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/tty1", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/udevmonitor", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dmesg", "instance" : "", "description" : "save kernel messages", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/dmesg", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "james", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "sleep 999" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/james", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "network-manager", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dmanager", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lxcbr0", "INTERFACE=lxcbr0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lxcbr0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flxcbr0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "networking", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/networking/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-restore", "instance" : "", "description" : "restore software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -f /var/lib/rfkill/saved-state ] ||\n [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n while read line; do\n set -- $line\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n if [ -f $device/soft ] &&\n [ \"$(cat $device/name)\" = \"$1\" ]; then\n echo $2 > $device/soft\n fi\n done\n done < /var/lib/rfkill/saved-state\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1203, 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty6/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dmesg", "instance" : "", "description" : "save kernel messages", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/dmesg", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/networking", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/tty6", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-font", "instance" : "", "description" : "set console font", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/udev/console-setup-tty fbcon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dfont", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "false", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/false" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/false", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "james_daemon", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/tmp/james_daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/james_5fdaemon", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "rc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead", "instance" : "", "description" : "Read required files in advance", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "sleep 45" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 180, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-font", "instance" : "", "description" : "set console font", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/udev/console-setup-tty fbcon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/console_2dfont", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 1, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "rc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead", "instance" : "", "description" : "Read required files in advance", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "sleep 45" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "apparmor_switch" : null, "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 180, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/_2fvar_2flib_2flxc_2fsaucy_2frootfs/ureadahead", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null } ], "events" : [ { "progress" : "EVENT_HANDLING", "env" : [ "KERNEL=fb0", "DEVPATH=/devices/pci0000:00/0000:00:02.0/graphics/fb0", "DEVNAME=/dev/fb0", "SUBSYSTEM=graphics", "ACTION=add", "ID_FOR_SEAT=graphics-pci-0000_00_02_0", "ID_PATH=pci-0000:00:02.0", "ID_PATH_TAG=pci-0000_00_02_0", "MAJOR=29", "MINOR=0", "PRIMARY_DEVICE_FOR_DISPLAY=1", "SEQNUM=1576", "TAGS=:master-of-seat:seat:", "USEC_INITIALIZED=508" ], "session" : 0, "name" : "graphics-device-added", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=udev-fallback-graphics", "INSTANCE=", "RESULT=failed", "PROCESS=main", "EXIT_STATUS=1" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "runlevel", "blockers" : 2, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "KERNEL=lxcbr0", "DEVPATH=/devices/virtual/net/lxcbr0", "SUBSYSTEM=net", "ACTION=add", "DEVTYPE=bridge", "ID_MM_CANDIDATE=1", "IFINDEX=3", "INTERFACE=lxcbr0", "SEQNUM=1597", "USEC_INITIALIZED=8599" ], "session" : 0, "name" : "net-device-added", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "blocking" : [ { "type" : "BLOCKED_JOB", "data" : { "session" : 0, "name" : "lxcbr0", "class" : "network-interface" } } ], "progress" : "EVENT_HANDLING", "env" : [ "JOB=network-interface", "INSTANCE=lxcbr0", "INTERFACE=lxcbr0" ], "name" : "starting", "blockers" : 1, "failed" : 0, "session" : 0, "fd" : -1 } ] } upstart-1.13.2/init/tests/data/upstart-1.8+full_serialisation-apparmor.json0000664000175000017500000164721512373101356023666 00000000000000{ "sessions" : [], "conf_sources" : [ { "conf_files" : [], "session" : 0, "flag" : 1, "type" : "CONF_FILE", "path" : "//etc/init.conf" }, { "conf_files" : [ { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-debugfs" }, "flag" : 1, "path" : "//etc/init/mounted-debugfs.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs.sh" }, "flag" : 1, "path" : "//etc/init/mountnfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "pulseaudio" }, "flag" : 1, "path" : "//etc/init/pulseaudio.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc-sysinit" }, "flag" : 1, "path" : "//etc/init/rc-sysinit.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "setvtrgb" }, "flag" : 1, "path" : "//etc/init/setvtrgb.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "lightdm" }, "flag" : 1, "path" : "//etc/init/lightdm.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountdevsubfs.sh" }, "flag" : 1, "path" : "//etc/init/mountdevsubfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-proc" }, "flag" : 1, "path" : "//etc/init/mounted-proc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface" }, "flag" : 1, "path" : "//etc/init/network-interface.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-log" }, "flag" : 1, "path" : "//etc/init/plymouth-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "atd" }, "flag" : 1, "path" : "//etc/init/atd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "control-alt-delete" }, "flag" : 1, "path" : "//etc/init/control-alt-delete.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe" }, "flag" : 1, "path" : "//etc/init/failsafe.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock-save" }, "flag" : 1, "path" : "//etc/init/hwclock-save.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "irqbalance" }, "flag" : 1, "path" : "//etc/init/irqbalance.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "networking" }, "flag" : 1, "path" : "//etc/init/networking.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ufw" }, "flag" : 1, "path" : "//etc/init/ufw.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-cups-reload" }, "flag" : 1, "path" : "//etc/init/avahi-cups-reload.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-font" }, "flag" : 1, "path" : "//etc/init/console-font.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "modemmanager" }, "flag" : 1, "path" : "//etc/init/modemmanager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-run" }, "flag" : 1, "path" : "//etc/init/mounted-run.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-tmp" }, "flag" : 1, "path" : "//etc/init/mounted-tmp.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rc" }, "flag" : 1, "path" : "//etc/init/rc.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rsyslog" }, "flag" : 1, "path" : "//etc/init/rsyslog.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "shutdown" }, "flag" : 1, "path" : "//etc/init/shutdown.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "jamespage" }, "flag" : 1, "path" : "//etc/init/jamespage.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth" }, "flag" : 1, "path" : "//etc/init/plymouth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "anacron" }, "flag" : 1, "path" : "//etc/init/anacron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-shell" }, "flag" : 1, "path" : "//etc/init/mountall-shell.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-var" }, "flag" : 1, "path" : "//etc/init/mounted-var.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-upstart-bridge" }, "flag" : 1, "path" : "//etc/init/plymouth-upstart-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty1" }, "flag" : 1, "path" : "//etc/init/tty1.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-fallback-graphics" }, "flag" : 1, "path" : "//etc/init/udev-fallback-graphics.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev-finish" }, "flag" : 1, "path" : "//etc/init/udev-finish.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "wait-for-state" }, "flag" : 1, "path" : "//etc/init/wait-for-state.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "acpid" }, "flag" : 1, "path" : "//etc/init/acpid.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-restore" }, "flag" : 1, "path" : "//etc/init/alsa-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "alsa-store" }, "flag" : 1, "path" : "//etc/init/alsa-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "apport" }, "flag" : 1, "path" : "//etc/init/apport.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cron" }, "flag" : 1, "path" : "//etc/init/cron.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/mountall-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-stop" }, "flag" : 1, "path" : "//etc/init/plymouth-stop.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "procps" }, "flag" : 1, "path" : "//etc/init/procps.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hwclock" }, "flag" : 1, "path" : "//etc/init/hwclock.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "james" }, "flag" : 1, "path" : "//etc/init/james.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "james_daemon" }, "flag" : 1, "path" : "//etc/init/james_daemon.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "container-detect" }, "flag" : 1, "path" : "//etc/init/container-detect.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups-browsed" }, "flag" : 1, "path" : "//etc/init/cups-browsed.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall" }, "flag" : 1, "path" : "//etc/init/mountall.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mtab.sh" }, "flag" : 1, "path" : "//etc/init/mtab.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rcS" }, "flag" : 1, "path" : "//etc/init/rcS.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "whoopsie" }, "flag" : 1, "path" : "//etc/init/whoopsie.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall.sh" }, "flag" : 1, "path" : "//etc/init/mountall.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-security" }, "flag" : 1, "path" : "//etc/init/network-interface-security.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty5" }, "flag" : 1, "path" : "//etc/init/tty5.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "friendly-recovery" }, "flag" : 1, "path" : "//etc/init/friendly-recovery.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-reboot" }, "flag" : 1, "path" : "//etc/init/mountall-reboot.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mounted-dev" }, "flag" : 1, "path" : "//etc/init/mounted-dev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty4" }, "flag" : 1, "path" : "//etc/init/tty4.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead-other" }, "flag" : 1, "path" : "//etc/init/ureadahead-other.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "avahi-daemon" }, "flag" : 1, "path" : "//etc/init/avahi-daemon.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "failsafe-x" }, "flag" : 1, "path" : "//etc/init/failsafe-x.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountkernfs.sh" }, "flag" : 1, "path" : "//etc/init/mountkernfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-restore" }, "flag" : 1, "path" : "//etc/init/rfkill-restore.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "rfkill-store" }, "flag" : 1, "path" : "//etc/init/rfkill-store.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "systemd-logind" }, "flag" : 1, "path" : "//etc/init/systemd-logind.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevtrigger" }, "flag" : 1, "path" : "//etc/init/udevtrigger.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-socket-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-socket-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "ureadahead" }, "flag" : 1, "path" : "//etc/init/ureadahead.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "false" }, "flag" : 1, "path" : "//etc/init/false.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "j" }, "flag" : 1, "path" : "//etc/init/j.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "passwd" }, "flag" : 1, "path" : "//etc/init/passwd.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "startpar-bridge" }, "flag" : 1, "path" : "//etc/init/startpar-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountall-net" }, "flag" : 1, "path" : "//etc/init/mountall-net.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "mountnfs-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/mountnfs-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-manager" }, "flag" : 1, "path" : "//etc/init/network-manager.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "resolvconf" }, "flag" : 1, "path" : "//etc/init/resolvconf.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty3" }, "flag" : 1, "path" : "//etc/init/tty3.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkfs.sh" }, "flag" : 1, "path" : "//etc/init/checkfs.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dbus" }, "flag" : 1, "path" : "//etc/init/dbus.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "flush-early-job-log" }, "flag" : 1, "path" : "//etc/init/flush-early-job-log.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "network-interface-container" }, "flag" : 1, "path" : "//etc/init/network-interface-container.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-ready" }, "flag" : 1, "path" : "//etc/init/plymouth-ready.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "plymouth-splash" }, "flag" : 1, "path" : "//etc/init/plymouth-splash.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot-bootclean.sh" }, "flag" : 1, "path" : "//etc/init/checkroot-bootclean.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "checkroot.sh" }, "flag" : 1, "path" : "//etc/init/checkroot.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console-setup" }, "flag" : 1, "path" : "//etc/init/console-setup.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "console" }, "flag" : 1, "path" : "//etc/init/console.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "cups" }, "flag" : 1, "path" : "//etc/init/cups.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "dmesg" }, "flag" : 1, "path" : "//etc/init/dmesg.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty2" }, "flag" : 1, "path" : "//etc/init/tty2.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udev" }, "flag" : 1, "path" : "//etc/init/udev.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bluetooth" }, "flag" : 1, "path" : "//etc/init/bluetooth.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "bootmisc.sh" }, "flag" : 1, "path" : "//etc/init/bootmisc.sh.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hostname" }, "flag" : 1, "path" : "//etc/init/hostname.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "hybrid-gfx" }, "flag" : 1, "path" : "//etc/init/hybrid-gfx.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "kmod" }, "flag" : 1, "path" : "//etc/init/kmod.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "tty6" }, "flag" : 1, "path" : "//etc/init/tty6.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "udevmonitor" }, "flag" : 1, "path" : "//etc/init/udevmonitor.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-file-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-file-bridge.conf" }, { "conf_source" : 1, "job_class" : { "session" : 0, "name" : "upstart-udev-bridge" }, "flag" : 1, "path" : "//etc/init/upstart-udev-bridge.conf" } ], "session" : 0, "flag" : 1, "type" : "CONF_JOB_DIR", "path" : "//etc/init" } ], "job_classes" : [ { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-cups-reload", "instance" : "", "description" : "Reload cups, upon starting avahi-daemon to make sure remote queues are populated", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reload cups" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Dmitrijs Ledkovs ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/avahi_2dcups_2dreload", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 681, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "avahi-daemon", "instance" : "", "description" : "mDNS/DNS-SD daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "opts=\"-D\"\n[ -e \"/etc/eucalyptus/avahi-daemon.conf\" ] && opts=\"${opts} -f /etc/eucalyptus/avahi-daemon.conf\"\nexec avahi-daemon ${opts}\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.avahi-daemon\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/avahi_2ddaemon", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-net", "instance" : "", "description" : "Mount network filesystems", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "PID=$(status mountall 2>/dev/null | sed -e '/start\\/running,/{s/.*,[^0-9]*//;q};d')\n[ -n \"$PID\" ] && kill -USR1 $PID || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dnet", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "passwd", "instance" : "", "description" : "Clear passwd locks", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/passwd", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "deconfiguring-networking", "unmounted-remote-filesystems" ], "session" : 0, "debug" : 0, "export" : [ "RUNLEVEL", "PREVLEVEL" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!$RUNLEVEL]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc", "instance" : "", "description" : "System V runlevel compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "/etc/init.d/rc $RUNLEVEL" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[0123456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 673, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=filesystem" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/rsyslog/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rsyslog", "instance" : "", "description" : "system logging daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rsyslog\nexec rsyslogd $RSYSLOGD_OPTIONS\n" }, { "script" : 1, "command" : "/lib/init/apparmor-profile-load usr.sbin.rsyslogd\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rsyslog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "startpar-bridge", "instance" : "$JOB-$INSTANCE-$UPSTART_EVENTS", "description" : "startpar bridge for notification of upstart job start/stop", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "startpar-upstart-inject \"$JOB\" \"$INSTANCE\" \"$UPSTART_EVENTS\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Steve Langasek ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/startpar_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "JOB!=startpar-bridge" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1039, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty4/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty4", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty4" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty4", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 574, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/udev/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev", "instance" : "", "description" : "device node and kernel event manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-udevd --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udev", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 557, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udev", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "*-device-added", "*-device-removed", "*-device-changed", "*-device-online", "*-device-offline" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-udev-bridge", "instance" : "", "description" : "Bridge udev events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-udev-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dudev_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "udev" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead-other", "instance" : "", "description" : "Read required files in advance (for other mountpoints)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon $MOUNTPOINT" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0, 4 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead_2dother", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "DEVICE=[/UL]*", "MOUNTPOINT=/?*" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1158, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "CRASH_DB_URL=https://daisy.ubuntu.com", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/whoopsie/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "whoopsie", "instance" : "", "description" : "crash report submission daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "whoopsie" }, { "script" : 1, "command" : " [ -x /usr/bin/ubiquity-dm ] && { stop; exit 0; }\n\n if ! grep report_crashes=true /etc/default/whoopsie -sqi; then\n stop; exit 0\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "CRASH_DB_URL=https://daisy.ubuntu.com" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/whoopsie", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "enabled=1", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/apport/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "apport", "instance" : "", "description" : "automatic crash report generation", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " . /etc/default/apport\n [ \"$enabled\" = \"1\" ] || [ \"$force_start\" = \"1\" ] || exit 0\n\n mkdir -p -m 1777 /var/crash\n\n # check for kernel crash dump, convert it to apport report\n if [ -e /var/crash/vmcore ] || [ -n \"`ls /var/crash | egrep ^[0-9]{12}$`\" ]\n then\n\t/usr/share/apport/kernel_crashdump || true\n fi\n\n # check for incomplete suspend/resume or hibernate\n if [ -e /var/lib/pm-utils/status ]\n then\n /usr/share/apport/apportcheckresume || true\n rm -f /var/lib/pm-utils/status\n rm -f /var/lib/pm-utils/resume-hang.log\n fi\n\n echo \"|/usr/share/apport/apport %p %s %c\" > /proc/sys/kernel/core_pattern\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Check for a hung resume. If we find one try and grab everything\n # we can to aid in its discovery\n if [ -e /var/lib/pm-utils/status ]\n then\n\tps -wwef > /var/lib/pm-utils/resume-hang.log\n fi\n\n if [ \"`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`\" != \"|\" ]\n then\n\texit 1\n else\n\techo \"core\" > /proc/sys/kernel/core_pattern\n fi\n" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "enabled=1" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/apport", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-setup", "instance" : "", "description" : "set console keymap", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "loadkeys /etc/console-setup/cached.kmap.gz" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dsetup", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock-save", "instance" : "", "description" : "save system clock to hardware clock", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock_2dsave", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "irqbalance", "instance" : "", "description" : "CPU interrupts balancing daemon", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\ttest -f /etc/default/irqbalance && . /etc/default/irqbalance\n\n\ttest \"$ENABLED\" != \"0\" || exit 0\n\n\tif test \"$ONESHOT\" != \"0\"; then\n\t\tDOPTIONS=\"--oneshot\"\n\tfi\n\n\texec /usr/sbin/irqbalance $DOPTIONS\n\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Chuck Short ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/irqbalance", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-log", "instance" : "", "description" : "Flush boot log to disk", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth update-root-fs --read-write" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 640, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/systemd-logind.log", "io_watch_fd" : 16, "fd" : 15 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "SYSTEMD_LOG_TARGET=syslog", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "systemd-logind", "instance" : "", "description" : "SystemD login management service", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/systemd/systemd-logind" }, { "script" : 1, "command" : " # only start if PAM module is actually available, not if libpam-systemd is\n # removed but not purged\n [ -e /lib/*/security/pam_systemd.so ] || { stop; exit 0; }\n\n # this is being done by systemd or mountall usually, but not during\n # upgrades from earlier distro releases\n if ! mountpoint -q /sys/fs/cgroup; then\n mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup\n fi\n mkdir -p /run/systemd\n if ! mountpoint -q /sys/fs/cgroup/systemd; then\n mkdir -p /sys/fs/cgroup/systemd\n mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 16384, "rlim_max" : 16384 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "SYSTEMD_LOG_TARGET=syslog" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/systemd_2dlogind", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1048, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty5/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty5", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty5" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty5", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "failsafe-boot" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "env" : [ "rc-sysinit" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "failsafe", "instance" : "", "description" : "Failsafe Boot Delay", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# Determine if plymouth is available\n\tif [ -x /bin/plymouth ] && /bin/plymouth --ping ; then\n\t\tPLYMOUTH=/bin/plymouth\n\telse\n\t\tPLYMOUTH=\":\"\n\tfi\n\n # The point here is to wait for 2 minutes before forcibly booting \n # the system. Anything that is in an \"or\" condition with 'started \n # failsafe' in rc-sysinit deserves consideration for mentioning in\n # these messages. currently only static-network-up counts for that.\n\n\tsleep 20\n\n # Plymouth errors should not stop the script because we *must* reach\n # the end of this script to avoid letting the system spin forever\n # waiting on it to start.\n\t$PLYMOUTH message --text=\"Waiting for network configuration...\" || :\n\tsleep 40\n\n\t$PLYMOUTH message --text=\"Waiting up to 60 more seconds for network configuration...\" || :\n\tsleep 59\n\t$PLYMOUTH message --text=\"Booting system without full network configuration...\" || :\n\n # give user 1 second to see this message since plymouth will go\n # away as soon as failsafe starts.\n\tsleep 1\n exec initctl emit --no-wait failsafe-boot\n" }, { "script" : 1, "command" : "logger -t 'failsafe' -p daemon.warning \"Failsafe of 120 seconds reached.\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/failsafe", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hybrid-gfx", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hybrid-detect" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hybrid_2dgfx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 828, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 9, "path" : "/var/log/upstart/modemmanager.log", "io_watch_fd" : 19, "fd" : 17 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/modemmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "modemmanager", "instance" : "", "description" : "modem connection manager", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/modem-manager" }, { "script" : 1, "command" : "[ -x /usr/sbin/modem-manager ] || stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/modemmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall.sh", "instance" : "", "description" : "Signal sysvinit that local filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-store", "instance" : "", "description" : "store software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n mkdir -p /var/lib/rfkill\n > /var/lib/rfkill/saved-state\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n entry=\"$(cat $device/name) $(cat $device/soft)\"\n echo $entry >> /var/lib/rfkill/saved-state\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1153, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/atd/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "atd", "instance" : "", "description" : "deferred execution scheduler", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "atd" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/atd", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 575, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=local-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/dbus/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "value" : 0, "name" : "deconfiguring-networking", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dbus", "instance" : "", "description" : "D-Bus system message bus", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "dbus-daemon --system --fork" }, { "script" : 1, "command" : " mkdir -p /var/run/dbus\n chown messagebus:messagebus /var/run/dbus\n\n exec dbus-uuidgen --ensure\n" }, { "script" : 0, "command" : "kill -USR1 1" }, { "script" : 0, "command" : "rm -f /var/run/dbus/pid" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/dbus", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "failsafe-x", "instance" : "", "description" : "Recovery options if display manager fails to start", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/share/xdiagnose/failsafeXServer \"$JOB\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/failsafe_2dx", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "lightdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "gdm", "EXIT_STATUS=[!0]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-var", "instance" : "", "description" : "Populate /var filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Duplicated from mounted-run to handle the case of a separate /var.\n\n run_migrate () {\n\tOLD=\"$1\"\n\tRUN=\"$2\"\n\n\tif [ -L \"$OLD\" ]; then\n\t if [ \"$(readlink \"$OLD\")\" != \"$RUN\" ]; then\n\t\t# Remove any old (relative?) symlinks.\n\t\trm -f \"$OLD\"\n\t fi\n\telif [ -d \"$OLD\" ]; then\n\t # Remove old directories. This is safe because they are\n\t # explicitly ephemeral, and nothing is allowed to use them yet\n\t # at this point in the boot.\n\t rm -rf \"$OLD\" 2>/dev/null || true\n\tfi\n\n\tif [ ! -L \"$OLD\" ]; then\n\t ln -fs \"$RUN\" \"$OLD\"\n\t [ -x /sbin/restorecon ] && /sbin/restorecon \"$OLD\"\n\tfi\n\n\treturn 0\n }\n\n run_migrate /var/run /run\n run_migrate /var/lock /run/lock\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dvar", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/var" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth", "instance" : "", "description" : "userspace bootsplash utility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n exec /sbin/plymouthd --mode=shutdown\nelse\n exec /sbin/plymouthd --mode=boot --attach-to-session\nfi\n" }, { "script" : 1, "command" : " if [ \"$RUNLEVEL\" = \"0\" -o \"$RUNLEVEL\" = \"1\" -o \"$RUNLEVEL\" = \"6\" ]; then\n\texec /bin/plymouth show-splash\n fi\n" }, { "script" : 0, "command" : "/bin/plymouth quit" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 60, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "desktop-shutdown", "type" : "EVENT_MATCH" }, { "env" : [ "xdm" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=tmpfs", "MOUNTPOINT=/run", "TYPE=tmpfs", "OPTIONS=noexec,nosuid,size=10%,mode=0755", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/resolvconf/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "resolvconf", "instance" : "", "description" : "Initialize or finalize resolvconf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "mkdir -p /run/resolvconf/interface\n# Request a postponed update (needed in case the base file has content).\ntouch /run/resolvconf/postponed-update\n# Enable updates and perform the postponed update.\nresolvconf --enable-updates\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "resolvconf --disable-updates\n" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/resolvconf", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-fallback-graphics", "instance" : "", "description" : "load fallback graphics devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$PRIMARY_DEVICE_FOR_DISPLAY\" = \"\" ]; then\n modprobe -q -b vesafb\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfallback_2dgraphics", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 1, "name" : "graphics-device-added", "type" : "EVENT_MATCH", "event" : 0 }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot.sh", "instance" : "", "description" : "Signal sysvinit that the rootfs is mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "control-alt-delete", "instance" : "", "description" : "emergency keypress handling", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -r now \"Control-Alt-Delete pressed\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/control_2dalt_2ddelete", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "control-alt-delete", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hwclock", "instance" : "", "description" : "adjust system clock and timezone", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : ". /etc/default/rcS\n[ \"$UTC\" = \"yes\" ] && tz=\"--utc\" || tz=\"--localtime\"\n[ \"$BADYEAR\" = \"yes\" ] && badyear=\"--badyear\"\nexec hwclock --systz $tz --noadjfile $badyear\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hwclock", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-proc", "instance" : "", "description" : "Fix-up sensitive /proc filesystem entries", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0400 \"${MOUNTPOINT}\"/slabinfo\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/proc" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dproc", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/proc", "TYPE=proc" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 866, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=local-filesystems started static-network-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-manager", "instance" : "", "description" : "network connection manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "\t# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017\n\tif [ -r /etc/default/locale ]; then\n\t\t. /etc/default/locale\n\t\texport LANG LANGUAGE LC_MESSAGES LC_ALL\n\tfi\n\n\texec NetworkManager\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dmanager", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-store", "instance" : "", "description" : "save sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl store" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2dstore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 847, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/cups-browsed.log", "io_watch_fd" : 21, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=cups", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups-browsed", "instance" : "", "description" : "cups-browsed - Bonjour remote printer browsing daemon", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cups-browsed" }, { "script" : 1, "command" : "[ -x /usr/sbin/cups-browsed ]\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 3, "author" : "Till Kamppeter ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups_2dbrowsed", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "cups" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 1, "name" : "runlevel", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "setvtrgb", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "setvtrgb /etc/vtrgb" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Dustin Kirkland ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/setvtrgb", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "tty1" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "shutdown", "instance" : "", "description" : "Trigger an immediate shutdown on SIGPWR", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "shutdown -h now \"SIGPWR received\"" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/shutdown", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "power-status-changed", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "alsa-restore", "instance" : "", "description" : "restore sound card(s') mixer state(s)", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/alsactl restore" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/alsa_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1150, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cron/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cron", "instance" : "", "description" : "regular background program processing daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "cron" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "j", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/tmp/james_daemon -c" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/j", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1188, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "remote_closed" : 0, "detached" : 0, "uid" : 0, "open_errno" : 0, "path" : "/var/log/upstart/lightdm.log", "io_watch_fd" : 44, "fd" : -1 }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem runlevel started plymouth-ready" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/lightdm/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "login-session-start", "desktop-session-start", "desktop-shutdown" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "lightdm", "instance" : "", "description" : "LightDM Display Manager", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ -n \"$UPSTART_EVENTS\" ]\n then\n # Check kernel command-line for inhibitors, unless we are being called\n # manually\n for ARG in $(cat /proc/cmdline); do\n if [ \"$ARG\" = \"text\" ]; then\n\t\tplymouth quit || : \n stop\n\t\texit 0\n fi\n done\n\n\t[ ! -f /etc/X11/default-display-manager -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/bin/lightdm\" -o \"$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/lightdm\" ] || { stop; exit 0; }\n\n\tif [ \"$RUNLEVEL\" = S -o \"$RUNLEVEL\" = 1 ]\n\tthen\n\t # Single-user mode\n\t plymouth quit || :\n\t exit 0\n\tfi\n fi\n\n exec lightdm\n" }, { "script" : 1, "command" : "sleep 5\nclear > /dev/tty7\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if [ \"$UPSTART_STOP_EVENTS\" = runlevel ]; then\n\tinitctl emit desktop-shutdown\nfi\n" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Robert Ancell ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/lightdm", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "[!06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "plymouth-ready", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "PREVLEVEL=S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "virtual-filesystems", "local-filesystems", "remote-filesystems", "all-swaps", "filesystem", "mounting", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "mountall", "instance" : "", "description" : "Mount filesystems on boot", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " . /etc/default/rcS\n [ -f /forcefsck ] && force_fsck=\"--force-fsck\"\n [ \"$FSCKFIX\" = \"yes\" ] && fsck_fix=\"--fsck-fix\"\n\n # set $LANG so that messages appearing in plymouth are translated\n if [ -r /etc/default/locale ]; then\n . /etc/default/locale\n export LANG LANGUAGE LC_MESSAGES LC_ALL\n fi\n\n exec mountall --daemon $force_fsck $fsck_fix\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "rm -f /forcefsck 2>dev/null || true\n" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-debugfs", "instance" : "", "description" : "Fix-up /sys/kernel/debug filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "chmod 0700 \"${MOUNTPOINT}\" || true\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/sys/kernel/debug" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddebugfs", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/sys/kernel/debug", "TYPE=debugfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountkernfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountkernfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 console" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/console", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 3 }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-run", "instance" : "", "description" : "Populate and link to /run filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " : > \"/run/utmp\"\n chmod 664 \"/run/utmp\"\n chgrp utmp \"/run/utmp\"\n\n # compatibility; should go away soon\n [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true\n\n mkdir -p /run/sendsigs.omit.d\n\n # Background the initial motd seeding\n [ -d \"/etc/update-motd.d\" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd &\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2drun", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run", "TYPE=tmpfs" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1148, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 1, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/acpid/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "acpid", "instance" : "", "description" : "ACPI daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "acpid -c /etc/acpi/events -s /var/run/acpid.socket" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/acpid", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 641, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bluetooth/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bluetooth", "instance" : "", "description" : "bluetooth daemon", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/sbin/bluetoothd" }, { "script" : 1, "command" : "\t[ \"$VERBOSE\" = no ] && redirect='>/dev/null 2>&1' || redirect=\n\n\t# start_uarts()\n\tif [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];\n\tthen\n\t\tgrep -v '^#' $UART_CONF | while read i; do\n\t\t eval \"/usr/sbin/hciattach $i $redirect\" || :\n\t\tdone\n\tfi\n\n\t# start_rfcomm()\n\tif [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;\n\tthen\n\t\t# rfcomm must always succeed for now: users\n\t\t# may not yet have an rfcomm-enabled kernel\n\t\teval \"/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "\t# stop_uarts()\n\tlogger -t bluez \"Stopping uarts\"\n\tkillall hciattach >/dev/null 2>&1 || :\n\n\t# stop_rfcomm()\n\tlogger -t bluez \"Stopping rfcomm\"\n\tif [ -x /usr/bin/rfcomm ];\n\tthen\n\t\teval \"/usr/bin/rfcomm unbind all $redirect\" || :\n\tfi\n" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UART_CONF=/etc/bluetooth/uart", "RFCOMM_CONF=/etc/bluetooth/rfcomm.conf" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bluetooth", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkfs.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=/dev/disk/by-uuid/a981fe0c-d7c7-483f-9777-1b50286a99ce", "MOUNTPOINT=/", "TYPE=ext4", "OPTIONS=errors=remount-ro", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "checkroot-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/checkroot_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "kmod", "instance" : "", "description" : "load modules from /etc/modules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " [ -f /etc/modules ] || exit 0\n hash=\"#\"\n while read module args; do\n\t[ -n \"$module\" ] && [ \"${module#${hash}}\" = \"${module}\" ] || continue\n\tmodprobe $module $args || :\n done < /etc/modules\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/kmod", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=remote-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountnfs.sh", "instance" : "", "description" : "Signal sysvinit that remote filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountnfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "remote-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-stop", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$JOB\" in\n gdm|kdm|lightdm|ubiquity|oem-config)\n\texit 0\n\t;;\n *)\n\texec /bin/plymouth quit\n\t;;\n esac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dstop", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "gdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "kdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "xdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lxdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "lightdm" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "uxlaunch" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "ubiquity" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "oem-config" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "rcS" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "mountall-shell" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!S]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "rcS", "instance" : "", "description" : "System V single-user mode compatibility", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " # Don't switch runlevels if we were stopped by an event, since that\n # means we're already switching runlevels\n if [ -n \"${UPSTART_STOP_EVENTS}\" ]\n then\n\texit 0\n fi\n\n # Switch, passing a magic flag\n start --no-wait rc-sysinit FROM_SINGLE_USER_MODE=y\n" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/rcS", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "S" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/ufw/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!023456]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "ufw", "instance" : "", "description" : "Uncomplicated firewall", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/ufw/ufw-init start quiet" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "/lib/ufw/ufw-init stop" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ufw", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "$WAIT_FOR" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "wait-for-state", "instance" : "$WAITER$WAIT_FOR", "description" : "Waiting for state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " test -n \"$WAIT_FOR\" || exit 1\n test -n \"$WAITER\" || exit 1\n\n # We don't want to override the manual stanza\n # XXX: initctl show-config should share manual w/ us too\n case $MANUAL_OVERRIDE in\n N|n|0)\n if grep -q \"^\\s*manual\\s*$\" /etc/init/$WAIT_FOR.conf ; then\n exit 0\n fi\n ;;\n esac\n\n if [ \"$WAIT_STATE\" = \"stopped\" ] ; then\n TARGET_GOAL=\"stop\"\n fi\n\n # Already running/stopped?\n status $WAIT_FOR | grep -q \"$TARGET_GOAL/$WAIT_STATE\" && exit 0\n\n # Give it a push\n $TARGET_GOAL $WAIT_FOR || :\n\n # upstart will kill this shell on started/stopped $WAIT_FOR\n while sleep $TIMEOUT ; do\n case $WAIT_FOREVER in\n N|n|0)\n exit 100\n ;;\n Y|y|1)\n ;;\n *)\n exit 1\n ;;\n esac\n done\n # Very strange, sleep returned non-zero?\n exit 1\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Clint Byrum ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 2 ], "kill_timeout" : 5, "usage" : null, "env" : [ "TIMEOUT=30", "MANUAL_OVERRIDE=N", "WAIT_FOREVER=N", "WAIT_STATE=started", "TARGET_GOAL=start" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/wait_2dfor_2dstate", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "bootmisc.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/bootmisc_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "flush-early-job-log", "instance" : "", "description" : "flush early job output to logs", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "initctl notify-disk-writeable" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/flush_2dearly_2djob_2dlog", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "recovery", "startup", "mounted" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "friendly-recovery", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Only start friendly-recovery when booting in recovery mode\n if ! grep -q \"recovery\" /proc/cmdline; then\n exit 0\n fi\n\n if [ -x /lib/recovery-mode/recovery-menu ]; then\n exec /lib/recovery-mode/recovery-menu\n else\n exec /sbin/sulogin\n fi\n" }, { "script" : 1, "command" : " if plymouth --ping; then\n plymouth hide-splash || true\n fi\n\n # Try to set the hostname and initialize the console\n start hostname || true\n start console-setup || true\n start setvtrgb || true\n\n # Make sure /run contains the required directories for the\n # recovery menu options\n mkdir -p /run/lock /run/shm || true\n\n # Emit the mounted event to trigger resolvconf and mounted-run\n initctl emit mounted MOUNTPOINT=/run || true\n\n # Finally start udev\n start udev || true\n udevadm trigger --action=add || true\n udevadm settle || true\n\n # And turn off kernel messages (to avoid corrupting the menu)\n dmesg --console-off || true\n" }, { "script" : 0, "command" : null }, { "script" : 1, "command" : "if plymouth --ping; then\n plymouth show-splash\nfi\ninitctl emit startup\n" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/friendly_2drecovery", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "recovery", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "jamespage", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "echo hello\nifconfig -a\nprocenv\nset\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/jamespage", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "runlevel" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "rc-sysinit", "instance" : "", "description" : "System V initialisation compatibility", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Check for default runlevel in /etc/inittab\n if [ -r /etc/inittab ]\n then\n\teval \"$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL=\"\\1\";/p' /etc/inittab || true)\"\n fi\n\n # Check kernel command-line for typical arguments\n for ARG in $(cat /proc/cmdline)\n do\n\tcase \"${ARG}\" in\n\t-b|emergency)\n\t # Emergency shell\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || sulogin\n\t ;;\n\t[0123456sS])\n\t # Override runlevel\n\t DEFAULT_RUNLEVEL=\"${ARG}\"\n\t ;;\n\t-s|single)\n\t # Single user mode\n\t [ -n \"${FROM_SINGLE_USER_MODE}\" ] || DEFAULT_RUNLEVEL=S\n\t ;;\n\tesac\n done\n\n # Run the system initialisation scripts\n [ -n \"${FROM_SINGLE_USER_MODE}\" ] || /etc/init.d/rcS\n\n # Switch into the default runlevel\n telinit \"${DEFAULT_RUNLEVEL}\"\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Scott James Remnant ", "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DEFAULT_RUNLEVEL=2", "RUNLEVEL=", "PREVLEVEL=", "INIT_VERBOSE" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rc_2dsysinit", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "failsafe-boot", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 716, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=dbus", "INSTANCE=", "UPSTART_EVENTS=filesystem started started" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/cups/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "cups", "instance" : "", "description" : "CUPS printing spooler/server", "respawn_interval" : 12, "process" : [ { "script" : 0, "command" : "/usr/sbin/cupsd -F" }, { "script" : 1, "command" : " [ -x /usr/sbin/cupsd ]\n \n # load modules for parallel port support\n if [ -r /etc/default/cups ]; then\n\t. /etc/default/cups\n fi\n if [ \"$LOAD_LP_MODULE\" = \"yes\" -a -f /usr/lib/cups/backend/parallel \\\n\t -a -f /proc/modules -a -x /sbin/modprobe ]; then\n\tmodprobe -q -b lp || true\n\tmodprobe -q -b ppdev || true\n\tmodprobe -q -b parport_pc || true\n fi\n \n mkdir -p /var/run/cups/certs\n if [ -x /lib/init/apparmor-profile-load ]; then\n\t/lib/init/apparmor-profile-load usr.sbin.cupsd\n fi\n" }, { "script" : 1, "command" : " # wait until daemon is ready\n timeout=6\n while [ ! -e /var/run/cups/cups.sock ]; do \n sleep 0.5\n\ttimeout=$((timeout-1))\n\tif [ \"$timeout\" -eq 0 ]; then\n\t echo \"cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration\" >&2\n\t exit 0\n\tfi\n done\n \n # coldplug USB printers\n if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then\n if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then\n for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \\\n udevadm trigger --verbose --dry-run --subsystem-match=usb \\\n --sysname-match='lp[0-9]*' 2>/dev/null || true`; do\n /lib/udev/udev-configure-printer add \"${printer#/sys}\"\n done\n fi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 3, "author" : "Michael Sweet ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/cups", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "env" : [ "avahi-daemon" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[2345]" ], "value" : 1, "name" : "runlevel", "type" : "EVENT_MATCH", "event" : 2 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[016]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "pulseaudio", "instance" : "", "description" : "System PulseAudio sound server", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS" }, { "script" : 0, "command" : "install -d -m755 -o pulse -g pulse /run/pulse" }, { "script" : 1, "command" : "if [ -e /var/run/pulse/.esd_auth ]; then\n\tchown pulse:pulse-access /var/run/pulse/.esd_auth\n\tchmod 640 /var/run/pulse/.esd_auth\nfi\nif [ -e /var/run/pulse/.pulse-cookie ]; then\n\tchown pulse:pulse-access /var/run/pulse/.pulse-cookie\n\tchmod 640 /var/run/pulse/.pulse-cookie\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : "Pali Rohár ", "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "DISALLOW_MODULE_LOADING=1", "PULSEAUDIO_ARGS=" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/pulseaudio", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1013, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "IFACE=lo", "LOGICAL=lo", "ADDRFAM=inet", "METHOD=loopback", "UPSTART_EVENTS=net-device-up" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "socket" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-socket-bridge", "instance" : "", "description" : "Bridge socket events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-socket-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dsocket_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "IFACE=lo" ], "value" : 0, "name" : "net-device-up", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "anacron", "instance" : "", "description" : "anac(h)ronistic cron", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "anacron -s" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/anacron", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountdevsubfs.sh", "instance" : "", "description" : "Signal sysvinit that virtual filesystems are mounted", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountdevsubfs_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1069, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty2/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty2", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty2" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty2", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevtrigger", "instance" : "", "description" : "cold plug devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "udevadm trigger --action=add" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "udevadm settle" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udevtrigger", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 530, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 2, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "DEVICE=proc", "MOUNTPOINT=/proc", "TYPE=proc", "OPTIONS=nodev,noexec,nosuid", "UPSTART_EVENTS=mounted" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "file" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "upstart-file-bridge", "instance" : "", "description" : "Bridge file events into upstart", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "upstart-file-bridge --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/upstart_2dfile_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "container", "not-container" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "container-detect", "instance" : "", "description" : "Track if upstart is running in a container", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 1, "command" : " # The \"standard\" way of telling if we are in a container\n # is to check for \"container\" in init's environment.\n # The code below is for cases where it's not set.\n\n # Detect old-style libvirt\n if [ -z \"$container\" ]; then\n [ -n \"$LIBVIRT_LXC_UUID\" ] && container=lxc-libvirt\n fi\n\n # Detect OpenVZ containers\n if [ -z \"$container\" ]; then\n [ -d /proc/vz ] && [ ! -d /proc/bc ] && container=openvz\n fi\n\n # Detect Vserver containers\n if [ -z \"$container\" ]; then\n VXID=\"$(cat /proc/self/status | grep ^VxID | cut -f2)\" || true\n [ \"${VXID:-0}\" -gt 1 ] && container=vserver\n fi\n\n if [ -n \"$container\" ]; then\n echo \"$container\" > /run/container_type || true\n initctl emit --no-wait container CONTAINER=$container\n exit 0\n fi\n\n # If not a container, stop there\n rm -f /run/container_type\n initctl emit --no-wait not-container\n stop\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/container_2ddetect", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/run" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-dev", "instance" : "", "description" : "Populate /dev filesystem", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # With the /run transition, shm lives there now, but eglibc still looks in\n # /dev/shm. So create a symlink there\n [ -e /dev/shm ] || ln -s /run/shm /dev/shm\n \n if [ \"${TYPE}\" != \"devtmpfs\" ]\n then\n\tcd \"${MOUNTPOINT}\"\n\t/sbin/MAKEDEV std fd ppp tun\n\t# lxc and libvirt containers have set up their own console and ttys\n\tif [ -z \"$container\" -a -z \"$LIBVIRT_LXC_UUID\" ]; then\n\t\t/sbin/MAKEDEV console\n\tfi\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/dev", "container", "LIBVIRT_LXC_UUID" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2ddev", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/dev" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mtab.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mtab_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1073, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty3/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty3", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty3" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty3", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udev-finish", "instance" : "", "description" : "save udev log and update rules", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " # Save udev log in /var/log/udev\n if [ -e /dev/.udev.log ]\n then\n\tmv -f /dev/.udev.log /var/log/udev || :\n fi\n\n # Copy any rules generated while the root filesystem was read-only\n for file in /run/udev/tmp-rules--*\n do\n\t[ -e \"$file\" ] || continue\n\tcat \"$file\" >> \"/etc/udev/rules.d/${file##*tmp-rules--}\"\n\trm -f \"$file\"\n done\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/udev_2dfinish", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "filesystem", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udev" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "udevmonitor" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "hostname", "instance" : "", "description" : "set system hostname", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "hostname -b -F /etc/hostname" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/hostname", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-reboot", "instance" : "", "description" : "Reboot after filesystems are changed", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "reboot -f" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dreboot", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=4" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OWNER", "kill_signal" : 15, "name" : "mountall-shell", "instance" : "", "description" : "Recovery shell for filesystem failure", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " case \"$EXIT_STATUS\" in\n \"\"|1)\n\techo \"General error mounting filesystems.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n 2)\n\techo \"Filesystem check or mount failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and continue booting after re-trying\"\n\techo \"filesystems. Any further errors will be ignored\"\n\t;;\n 3)\n\techo \"Root filesystem check failed.\"\n\techo \"A maintenance shell will now be started.\"\n\techo \"CONTROL-D will terminate this shell and reboot the system.\"\n\t;;\n esac\n\n /sbin/sulogin\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " if [ -z \"$UPSTART_STOP_EVENTS\" ]\n then\n\tif [ \"$EXIT_STATUS\" = \"2\" ]\n\tthen\n\t exec start --no-wait mountall\n\telse\n\t umount -a || :\n\t exec reboot -f\n\tfi\n fi\n" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dshell", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall", "EXIT_STATUS=[!4]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "mountall", "EXIT_SIGNAL=?*" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mounted-tmp", "instance" : "", "description" : "Clean /tmp directory", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ x$MOUNTPOINT = x/tmp ] && [ ! -x /usr/bin/find ] ; then\n touch /tmp/.delayed_mounted_tmp_clean\n exit 0\n elif [ x$MOUNTPOINT = x/usr ] ; then\n [ -f /tmp/.delayed_mounted_tmp_clean ] || exit 0\n rm /tmp/.delayed_mounted_tmp_clean\n MOUNTPOINT=/tmp\n fi\n\n . /etc/default/rcS\n\n cd \"${MOUNTPOINT}\" || exit 1\n rm -f .X*-lock\n\n case \"${TMPTIME}\" in\n -*|infinite|infinity)\n\t exit 0\n\t ;;\n esac\n\n if [ \"${TMPTIME}\" = \"0\" -o -z \"${TMPTIME}\" ]\n then\n\tTEXPR=\"\"\n\tDEXPR=\"\"\n else\n\tTEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}\"\n\tDEXPR=\"-mtime +${TMPTIME} -ctime +${TMPTIME}\"\n fi\n\n EXCEPT='! -name .\n ! ( -path ./lost+found -uid 0 )\n ! ( -path ./quota.user -uid 0 )\n ! ( -path ./aquota.user -uid 0 )\n ! ( -path ./quota.group -uid 0 )\n ! ( -path ./aquota.group -uid 0 )\n ! ( -path ./.journal -uid 0 )\n ! ( -path ./.clean -uid 0 )\n ! ( -path \"./...security*\" -uid 0 )'\n\n # Remove all old files, then all empty directories\n find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete\n find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete\n\n # Check if we have enough space in /tmp, and if not, mount a tmpfs there\n avail=`df -kP /tmp | awk 'NR==2 { print $4 }'`\n if [ \"$avail\" -lt 1000 ]; then\n\tmount -t tmpfs -o size=1048576,mode=1777 overflow /tmp\n fi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "MOUNTPOINT=/tmp" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/mounted_2dtmp", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "MOUNTPOINT=/tmp" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "env" : [ "MOUNTPOINT=/usr" ], "value" : 0, "name" : "mounted", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=lo", "DEVPATH=/devices/virtual/net/lo", "SUBSYSTEM=net", "ACTION=add", "ID_MM_CANDIDATE=1", "IFINDEX=1", "INTERFACE=lo", "SEQNUM=1400", "USEC_INITIALIZED=4437", "UPSTART_EVENTS=net-device-added" ], "name" : "lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/lo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "KERNEL=eth0", "DEVPATH=/devices/pci0000:00/0000:00:03.0/net/eth0", "SUBSYSTEM=net", "ACTION=add", "ID_BUS=pci", "ID_MM_CANDIDATE=1", "ID_MODEL_ID=0x100e", "ID_NET_NAME_MAC=enx525400123456", "ID_NET_NAME_PATH=enp0s3", "ID_NET_NAME_SLOT=ens3", "ID_VENDOR_ID=0x8086", "IFINDEX=2", "INTERFACE=eth0", "MATCHDEVID=0x0", "MATCHIFTYPE=1", "SEQNUM=1254", "USEC_INITIALIZED=6439", "UPSTART_EVENTS=net-device-added" ], "name" : "eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface/eth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "net-device-up", "net-device-down", "static-network-up" ], "session" : 0, "debug" : 0, "export" : [ "INTERFACE" ], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "net-device-removed", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface", "instance" : "$INTERFACE", "description" : "configure network device", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ \"$INTERFACE\" = lo ]; then\n\t# bring this up even if /etc/network/interfaces is broken\n\tifconfig lo 127.0.0.1 up || true\n\tinitctl emit -n net-device-up \\\n\t IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true\n fi\n mkdir -p /run/network\n exec ifup --allow auto $INTERFACE\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "ifdown --allow auto $INTERFACE" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "net-device-added", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "plymouth-ready" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-ready", "instance" : "$UPSTART_EVENTS", "description" : "Send an event to indicate plymouth is up", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "if [ \"$UPSTART_EVENTS\" = started ] || \\\n status plymouth-splash | grep -q \"start/started\" || \\\n plymouth --ping\nthen\n initctl emit plymouth-ready\nfi\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dready", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "plymouth-splash", "instance" : "", "description" : "userspace bootsplash", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/plymouth show-splash" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dsplash", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "graphics-device-added", "type" : "EVENT_MATCH" }, { "env" : [ "PRIMARY_DEVICE_FOR_DISPLAY=1" ], "value" : 0, "name" : "drm-device-added", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "udev-fallback-graphics" ], "value" : 1, "name" : "stopped", "type" : "EVENT_MATCH", "event" : 1 }, { "value" : 1, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "plymouth" ], "value" : 0, "name" : "stopping", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_OUTPUT", "kill_signal" : 15, "name" : "plymouth-upstart-bridge", "instance" : "", "description" : "bridge from Upstart state changes to Plymouth", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/data/testing/bin/plymouth-upstart-bridge" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/plymouth_2dupstart_2dbridge", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "dbus" ], "value" : 0, "name" : "started", "type" : "EVENT_MATCH" }, { "env" : [ "[06]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1180, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=stopped not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty1/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty1", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty1" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty1", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "rc", "RUNLEVEL=[2345]" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "env" : [ "CONTAINER=lxc" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "CONTAINER=lxc-libvirt" ], "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "udevmonitor", "instance" : "", "description" : "log initial device creation", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "/bin/udevadm monitor -e >/dev/.udev.log" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/udevmonitor", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "startup", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "dmesg", "instance" : "", "description" : "save kernel messages", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "savelog -q -p -c 5 /var/log/dmesg\ndmesg -s 524288 > /var/log/dmesg\nchgrp adm /var/log/dmesg\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/dmesg", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "james", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "sleep 999" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/james", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "UPSTART_EVENTS=virtual-filesystems" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "mountall-bootclean.sh", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/mountall_2dbootclean_2esh", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-manager", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "network-manager", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dmanager", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=eth0", "INTERFACE=eth0", "UPSTART_EVENTS=starting" ], "name" : "network-interface/eth0", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2feth0", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=network-interface", "INSTANCE=lo", "INTERFACE=lo", "UPSTART_EVENTS=starting" ], "name" : "network-interface/lo", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/network_2dinterface_2flo", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] }, { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=networking", "INSTANCE=", "UPSTART_EVENTS=starting" ], "name" : "networking", "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity/networking", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "network-interface", "JOB=$JOB", "INTERFACE=$INTERFACE" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking", "JOB=$JOB" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-security", "instance" : "$JOB${INTERFACE:+/}${INTERFACE:-}", "description" : "configure network device security", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "[ -f /run/network-interface-security ] && exit 0 # already ran\n[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD\n[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor\n[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser\nfor link in /etc/apparmor/init/network-interface-security/* ; do\n [ -L $link ] && /sbin/apparmor_parser -r -W $link || true\ndone\n> /run/network-interface-security\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dsecurity", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "network-interface" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "env" : [ "network-manager" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "env" : [ "networking" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 0, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "JOB=udevtrigger", "INSTANCE=", "RESULT=ok", "UPSTART_EVENTS=local-filesystems stopped" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/networking/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [ "static-network-up", "net-device-up", "deconfiguring-networking" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "value" : 0, "name" : "unmounted-remote-filesystems", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "networking", "instance" : "", "description" : "configure virtual network devices", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "mkdir -p /run/network\nifup -a\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 1, "command" : " log_warning_msg() {\n echo $*\n }\n\n # These checks were taken from the Debian ifupdown.networking.init script\n check_network_file_systems() {\n [ -e /proc/mounts ] || return 0\n\n if [ -e /etc/iscsi/iscsi.initramfs ]; then\n log_warning_msg \"not deconfiguring network interfaces: iSCSI root is mounted.\"\n exit 0\n fi\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network devices still mounted.\"\n exit 0\n ;;\n esac\n case $FSTYPE in\n nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)\n log_warning_msg \"not deconfiguring network interfaces: network file systems still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/mounts\n }\n\n check_network_swap() {\n [ -e /proc/swaps ] || return 0\n\n while read DEV MTPT FSTYPE REST; do\n case $DEV in\n /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)\n log_warning_msg \"not deconfiguring network interfaces: network swap still mounted.\"\n exit 0\n ;;\n esac\n done < /proc/swaps\n }\n\n check_network_file_systems\n check_network_swap\n\n # Anything that manages network interfaces *MUST* wait for this event\n initctl emit deconfiguring-networking\n ifdown -a --exclude=lo\n" }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/networking", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" }, { "env" : [ "udevtrigger" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" }, { "value" : 0, "type" : "EVENT_AND" }, { "env" : [ "[2345]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "procps", "instance" : "$UPSTART_EVENTS", "description" : "set sysctls from /etc/sysctl.conf", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [ "UPSTART_EVENTS=" ], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/procps", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "virtual-filesystems", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "static-network-up", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_OR" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "rfkill-restore", "instance" : "", "description" : "restore software rfkill state", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : " if [ ! -f /var/lib/rfkill/saved-state ] ||\n [ ! -d /sys/class/rfkill ]; then\n exit 0\n fi\n\n while read line; do\n set -- $line\n\n for device in /sys/class/rfkill/*; do\n [ ! -d $device ] && continue\n\n if [ -f $device/soft ] &&\n [ \"$(cat $device/name)\" = \"$1\" ]; then\n echo $2 > $device/soft\n fi\n done\n done < /var/lib/rfkill/saved-state\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/rfkill_2drestore", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "local-filesystems", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [ { "trace_state" : "TRACE_NONE", "failed" : 0, "state" : "JOB_RUNNING", "failed_process" : "PROCESS_INVALID", "pid" : [ 1080, 0, 0, 0, 0 ], "start_env" : [], "trace_forks" : 0, "respawn_time" : 0, "log" : [ { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null }, { "path" : null } ], "respawn_count" : 0, "kill_process" : "PROCESS_INVALID", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin", "TERM=linux", "RUNLEVEL=2", "PREVLEVEL=N", "UPSTART_EVENTS=runlevel not-container" ], "name" : "", "path" : "/com/ubuntu/Upstart/jobs/tty6/_", "exit_status" : 0, "goal" : "JOB_START", "stop_env" : [], "fds" : [] } ], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "stop_on" : [ { "env" : [ "[!23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "tty6", "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/getty -8 38400 tty6" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/tty6", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "[23]" ], "value" : 0, "name" : "runlevel", "type" : "EVENT_MATCH" }, { "value" : 0, "name" : "not-container", "type" : "EVENT_MATCH" }, { "value" : 0, "type" : "EVENT_AND" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "console-font", "instance" : "", "description" : "set console font", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/lib/udev/console-setup-tty fbcon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/console_2dfont", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "plymouth-splash" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_DAEMON", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "false", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/bin/false" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 1, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/false", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "chroot" : null, "console" : "CONSOLE_LOG", "name" : "james_daemon", "kill_signal" : 15, "instance" : "", "description" : null, "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/tmp/james_daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/james_5fdaemon", "deleted" : 0, "chdir" : null, "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [ "net-device-added" ], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_NONE", "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "network-interface-container", "instance" : "", "description" : "workaround for missing events in container", "respawn_interval" : 5, "process" : [ { "script" : 1, "command" : "case \"$CONTAINER\" in\n lxc|lxc-libvirt)\n initctl emit --no-wait net-device-added INTERFACE=lo || true\n ;;\nesac\n" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [], "kill_timeout" : 5, "usage" : null, "env" : [], "version" : null, "task" : 1, "path" : "/com/ubuntu/Upstart/jobs/network_2dinterface_2dcontainer", "deleted" : 0, "chdir" : null, "start_on" : [ { "value" : 0, "name" : "container", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null }, { "setuid" : null, "jobs" : [], "emits" : [], "session" : 0, "debug" : 0, "export" : [], "expect" : "EXPECT_FORK", "stop_on" : [ { "env" : [ "rc" ], "value" : 0, "name" : "stopped", "type" : "EVENT_MATCH" } ], "chroot" : null, "console" : "CONSOLE_LOG", "kill_signal" : 15, "name" : "ureadahead", "instance" : "", "description" : "Read required files in advance", "respawn_interval" : 5, "process" : [ { "script" : 0, "command" : "/sbin/ureadahead --daemon" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : "sleep 45" }, { "script" : 0, "command" : null }, { "script" : 0, "command" : null } ], "respawn_limit" : 10, "author" : null, "respawn" : 0, "nice" : -21, "limits" : [ { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 }, { "rlim_cur" : 0, "rlim_max" : 0 } ], "oom_score_adj" : 0, "normalexit" : [ 0 ], "kill_timeout" : 180, "usage" : null, "env" : [], "version" : null, "task" : 0, "path" : "/com/ubuntu/Upstart/jobs/ureadahead", "deleted" : 0, "chdir" : null, "start_on" : [ { "env" : [ "mountall" ], "value" : 0, "name" : "starting", "type" : "EVENT_MATCH" } ], "umask" : 18, "setgid" : null } ], "events" : [ { "progress" : "EVENT_HANDLING", "env" : [ "KERNEL=fb0", "DEVPATH=/devices/pci0000:00/0000:00:02.0/graphics/fb0", "DEVNAME=/dev/fb0", "SUBSYSTEM=graphics", "ACTION=add", "ID_FOR_SEAT=graphics-pci-0000_00_02_0", "ID_PATH=pci-0000:00:02.0", "ID_PATH_TAG=pci-0000_00_02_0", "MAJOR=29", "MINOR=0", "PRIMARY_DEVICE_FOR_DISPLAY=1", "SEQNUM=1533", "TAGS=:master-of-seat:seat:", "USEC_INITIALIZED=7747" ], "session" : 0, "name" : "graphics-device-added", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=udev-fallback-graphics", "INSTANCE=", "RESULT=failed", "PROCESS=main", "EXIT_STATUS=1" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "runlevel", "blockers" : 2, "failed" : 0, "fd" : -1 }, { "progress" : "EVENT_HANDLING", "env" : [ "JOB=rc", "INSTANCE=", "RESULT=ok", "RUNLEVEL=2", "PREVLEVEL=N" ], "session" : 0, "name" : "stopped", "blockers" : 1, "failed" : 0, "fd" : -1 } ] } upstart-1.13.2/init/tests/libwrap_inotify.la0000664000175000017500000000177612402042411016050 00000000000000# libwrap_inotify.la - a libtool library file # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='libwrap_inotify.so.0' # Names of this library. library_names='libwrap_inotify.so.0.0.0 libwrap_inotify.so.0 libwrap_inotify.so' # The name of the static archive. old_library='' # Linker flags that can not go in dependency_libs. inherited_linker_flags='' # Libraries that this one depends upon. dependency_libs=' -lrt -ldl -lcgmanager -lnih -lnih-dbus -ldbus-1' # Names of additional weak libraries provided by this library weak_library_names='' # Version information for libwrap_inotify. current=0 age=0 revision=0 # Is this an already installed library? installed=no # Should we warn about portability when linking against -modules? shouldnotlink=yes # Files to dlopen/dlpreopen dlopen='' dlpreopen='' # Directory that this library needs to be installed in: libdir='/nowhere' upstart-1.13.2/init/tests/test_parse_job.c0000664000175000017500000066613012373101356015514 00000000000000/* upstart * * test_parse_job.c - test suite for init/parse_job.c * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include "job_class.h" #include "conf.h" #include "parse_job.h" #include "errors.h" #include "apparmor.h" #ifdef ENABLE_CGROUPS #include "cgroup.h" #endif /* ENABLE_CGROUPS */ #include "test_util_common.h" void test_parse_job (void) { JobClass *job = NULL; Process *process; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("parse_job"); nih_error_init (); job_class_init (); conf_init (); /* Check that a simple job file can be parsed, with all of the * information given filled into the job structure. */ TEST_FEATURE ("with simple job file"); strcpy (buf, "exec /sbin/daemon -d\n"); strcat (buf, "pre-start script\n"); strcat (buf, " rm /var/lock/daemon\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ_P (job->start_on, NULL); TEST_EQ_P (job->stop_on, NULL); process = job->process[PROCESS_MAIN]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/sbin/daemon -d"); process = job->process[PROCESS_PRE_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "rm /var/lock/daemon\n"); nih_free (job); } /* Check that a job may have both exec and script missing. */ TEST_FEATURE ("with missing exec and script"); strcpy (buf, "description state\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ_P (job->process[PROCESS_MAIN], NULL); nih_free (job); } TEST_FEATURE ("with non-NULL update parameter (override)"); { JobClass *tmp = NULL; strcpy (buf, "start on starting\n"); strcat (buf, "author \"me\"\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_NE_P (job, NULL); TEST_EQ_STR (job->author, "me"); TEST_NE_P (job->start_on, NULL); strcat (buf, "author \"you\"\n"); strcat (buf, "manual\n"); strcat (buf, "description \"my description\"\n"); pos = 0; lineno = 1; tmp = parse_job (NULL, NULL, job, "test", buf, strlen (buf), &pos, &lineno); TEST_NE_P (tmp, NULL); /* if passed a job, the same object should be returned. */ TEST_EQ_P (tmp, job); TEST_EQ_STR (tmp->author, "you"); TEST_EQ_P (tmp->start_on, NULL); TEST_NE_P (tmp->description, NULL); TEST_EQ_STR (tmp->description, "my description"); nih_free (job); } } void test_stanza_exec (void) { JobClass *job; Process *process; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_exec"); /* Check that an exec stanza sets the process of the job as a single * string. */ TEST_FEATURE ("with arguments"); strcpy (buf, "exec /sbin/daemon -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_MAIN]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/sbin/daemon -d \"foo\""); nih_free (job); } /* Check that the last of duplicate exec stanzas is used. */ TEST_FEATURE ("with duplicates"); strcpy (buf, "exec /sbin/daemon -d\n"); strcpy (buf, "exec /sbin/daemon -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_MAIN]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/sbin/daemon -d \"foo\""); nih_free (job); } /* Check that an exec stanza overrides a previous script stanza. */ TEST_FEATURE ("with exec following script"); strcpy (buf, "script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); strcpy (buf, "exec /sbin/daemon -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_MAIN]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/sbin/daemon -d \"foo\""); nih_free (job); } /* Check that an exec stanza without any arguments results in a * syntax error. */ TEST_FEATURE ("with no arguments"); strcpy (buf, "exec\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 4); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_script (void) { JobClass *job; Process *process; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_script"); /* Check that a script stanza begins a block which is stored in * the script member of the job. */ TEST_FEATURE ("with block"); strcpy (buf, "script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_MAIN]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that the last of multiple script stanzas is used. */ TEST_FEATURE ("with multiple blocks"); strcpy (buf, "script\n"); strcat (buf, " ls\n"); strcat (buf, "end script\n"); strcat (buf, "script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 7); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_MAIN]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that a script stanza overrides a previous exec stanza. */ TEST_FEATURE ("with script following exec"); strcpy (buf, "exec /sbin/daemon -d \"foo\"\n"); strcat (buf, "script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_MAIN]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that a script stanza with an extra argument results * in a syntax error. */ TEST_FEATURE ("with argument"); strcpy (buf, "script foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 7); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_apparmor (void) { JobClass *job; Process *process; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_apparmor"); /* Check that an apparmor load stanza sets the process of the * job as a single string. */ TEST_FEATURE ("with load and profile"); strcpy (buf, "apparmor load /etc/apparmor.d/usr.sbin.cupsd\n"); /* TODO: investigate why we can't use TEST_ALLOC_FAIL here. * It fails when nih_sprintf() is used. */ pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_SECURITY]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); strcpy (buf, APPARMOR_PARSER); strcat (buf, " "); strcat (buf, APPARMOR_PARSER_OPTS); strcat (buf, " /etc/apparmor.d/usr.sbin.cupsd"); TEST_EQ_STR (process->command, buf); nih_free (job); /* Check that the last of multiple apparmor load stanzas is used. */ TEST_FEATURE ("with multiple load"); strcpy (buf, "apparmor load /etc/apparmor.d/usr.sbin.rsyslogd\n"); strcat (buf, "apparmor load /etc/apparmor.d/usr.sbin.cupsd\n"); /* TODO: investigate why we can't use TEST_ALLOC_FAIL here. * It fails when nih_sprintf() is used. */ pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_SECURITY]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); strcpy (buf, APPARMOR_PARSER); strcat (buf, " "); strcat (buf, APPARMOR_PARSER_OPTS); strcat (buf, " /etc/apparmor.d/usr.sbin.cupsd"); TEST_EQ_STR (process->command, buf); nih_free (job); /* Check that an apparmor load stanza without any arguments results * in a syntax error. */ TEST_FEATURE ("with load but no profile"); strcpy (buf, "apparmor load\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that an apparmor load stanza with an extra argument * results in a syntax error. */ TEST_FEATURE ("with extra argument to load"); strcpy (buf, "apparmor load /etc/apparmor.d/usr.sbin.cupsd extra\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 45); TEST_EQ (lineno, 1); nih_free (err); /* Check that an apparmor stanza with an unknown second argument * results in a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "apparmor foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 9); TEST_EQ (lineno, 1); nih_free (err); /* Check that an apparmor stanza with no second argument * results in a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "apparmor\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 8); TEST_EQ (lineno, 1); nih_free (err); /* Check that an apparmor switch stanza results in it * being stored in the job. */ TEST_FEATURE ("with switch and profile"); strcpy (buf, "apparmor switch /usr/sbin/cupsd\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->apparmor_switch, job); TEST_EQ_STR (job->apparmor_switch, "/usr/sbin/cupsd"); nih_free (job); } /* Check that the last of multiple apparmor switch stanzas is used. */ TEST_FEATURE ("with multiple apparmor switch stanzas"); strcpy (buf, "apparmor switch /usr/sbin/rsyslogd\n"); strcat (buf, "apparmor switch /usr/sbin/cupsd\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->apparmor_switch, job); TEST_EQ_STR (job->apparmor_switch, "/usr/sbin/cupsd"); nih_free (job); } /* Check that an apparmor switch stanza without a profile results in * a syntax error. */ TEST_FEATURE ("with switch and no profile"); strcpy (buf, "apparmor switch\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 15); TEST_EQ (lineno, 1); nih_free (err); /* Check that an apparmor switch stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument to switch"); strcpy (buf, "apparmor switch /usr/sbin/cupsd extra\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 32); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_pre_start (void) { JobClass *job; Process *process; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_pre_start"); /* Check that a pre-start exec stanza sets the process of the * job as a single string. */ TEST_FEATURE ("with exec and command"); strcpy (buf, "pre-start exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that the last of multiple pre-start exec stanzas is used. */ TEST_FEATURE ("with multiple exec"); strcpy (buf, "pre-start exec /bin/tool -d\n"); strcat (buf, "pre-start exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that a pre-start script stanza begins a block which * is stored in the process. */ TEST_FEATURE ("with script and block"); strcpy (buf, "pre-start script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that the last of multiple pre-start script stanzas is used. */ TEST_FEATURE ("with multiple script"); strcpy (buf, "pre-start script\n"); strcat (buf, " ls\n"); strcat (buf, "end script\n"); strcat (buf, "pre-start script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 7); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that a script stanza overrides any previous exec stanza. */ TEST_FEATURE ("with script following exec"); strcpy (buf, "pre-start exec /bin/tool -d \"foo\"\n"); strcat (buf, "pre-start script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that an exec stanza overrides any previous script stanza. */ TEST_FEATURE ("with exec following script"); strcpy (buf, "pre-start script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); strcat (buf, "pre-start exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that a pre-start exec stanza without any arguments results * in a syntax error. */ TEST_FEATURE ("with exec but no command"); strcpy (buf, "pre-start exec\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a pre-start script stanza with an extra argument * results in a syntax error. */ TEST_FEATURE ("with argument to script"); strcpy (buf, "pre-start script foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 17); TEST_EQ (lineno, 1); nih_free (err); /* Check that a pre-start stanza with an unknown second argument * results in a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "pre-start foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 10); TEST_EQ (lineno, 1); nih_free (err); /* Check that a pre-start stanza with no second argument * results in a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "pre-start\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 9); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_post_start (void) { JobClass *job; Process *process; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_post_start"); /* Check that a post-start exec stanza sets the process of the * job as a single string. */ TEST_FEATURE ("with exec and command"); strcpy (buf, "post-start exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that the last of multiple post-start exec stanzas is used. */ TEST_FEATURE ("with multiple exec"); strcpy (buf, "post-start exec /bin/tool -d\n"); strcat (buf, "post-start exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that a post-start script stanza begins a block which * is stored in the process. */ TEST_FEATURE ("with script and block"); strcpy (buf, "post-start script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that the last of multiple post-start script stanzas is used. */ TEST_FEATURE ("with multiple script"); strcpy (buf, "post-start script\n"); strcat (buf, " ls\n"); strcat (buf, "end script\n"); strcat (buf, "post-start script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 7); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that a script stanza overrides any previous exec stanza. */ TEST_FEATURE ("with script following exec"); strcpy (buf, "post-start exec /bin/tool -d \"foo\"\n"); strcat (buf, "post-start script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that an exec stanza overrides any previous script stanza. */ TEST_FEATURE ("with exec following script"); strcpy (buf, "post-start script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); strcat (buf, "post-start exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_START]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that a post-start exec stanza without any arguments results * in a syntax error. */ TEST_FEATURE ("with exec but no command"); strcpy (buf, "post-start exec\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 15); TEST_EQ (lineno, 1); nih_free (err); /* Check that a post-start script stanza with an extra argument * results in a syntax error. */ TEST_FEATURE ("with argument to script"); strcpy (buf, "post-start script foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 18); TEST_EQ (lineno, 1); nih_free (err); /* Check that a post-start stanza with an unknown second argument * results in a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "post-start foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 11); TEST_EQ (lineno, 1); nih_free (err); /* Check that a post-start stanza with no second argument * results in a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "post-start\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 10); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_pre_stop (void) { JobClass *job; Process *process; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_pre_stop"); /* Check that a pre-stop exec stanza sets the process of the * job as a single string. */ TEST_FEATURE ("with exec and command"); strcpy (buf, "pre-stop exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that the last of multiple pre-stop exec stanzas is used. */ TEST_FEATURE ("with multiple exec"); strcpy (buf, "pre-stop exec /bin/tool -d\n"); strcat (buf, "pre-stop exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that a pre-stop script stanza begins a block which * is stored in the process. */ TEST_FEATURE ("with script and block"); strcpy (buf, "pre-stop script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that the last of multiple pre-stop script stanzas is used. */ TEST_FEATURE ("with multiple script"); strcpy (buf, "pre-stop script\n"); strcat (buf, " ls\n"); strcat (buf, "end script\n"); strcat (buf, "pre-stop script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 7); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that a script stanza overrides any previous exec stanza. */ TEST_FEATURE ("with script following exec"); strcpy (buf, "pre-stop exec /bin/tool -d \"foo\"\n"); strcat (buf, "pre-stop script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that an exec stanza overrides any previous script stanza. */ TEST_FEATURE ("with exec following script"); strcpy (buf, "pre-stop script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); strcat (buf, "pre-stop exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_PRE_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that a pre-stop exec stanza without any arguments results * in a syntax error. */ TEST_FEATURE ("with exec but no command"); strcpy (buf, "pre-stop exec\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that a pre-stop script stanza with an extra argument * results in a syntax error. */ TEST_FEATURE ("with argument to script"); strcpy (buf, "pre-stop script foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 16); TEST_EQ (lineno, 1); nih_free (err); /* Check that a pre-stop stanza with an unknown second argument * results in a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "pre-stop foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 9); TEST_EQ (lineno, 1); nih_free (err); /* Check that a pre-stop stanza with no second argument * results in a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "pre-stop\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 8); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_post_stop (void) { JobClass *job; Process *process; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_post_stop"); /* Check that a post-stop exec stanza sets the process of the * job as a single string. */ TEST_FEATURE ("with exec and command"); strcpy (buf, "post-stop exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that the last of multiple post-stop exec stanzas is used. */ TEST_FEATURE ("with multiple exec"); strcpy (buf, "post-stop exec /bin/tool -d\n"); strcat (buf, "post-stop exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that a post-stop script stanza begins a block which * is stored in the process. */ TEST_FEATURE ("with script and block"); strcpy (buf, "post-stop script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that the last of multiple post-stop script stanzas is used. */ TEST_FEATURE ("with multiple script"); strcpy (buf, "post-stop script\n"); strcat (buf, " ls\n"); strcat (buf, "end script\n"); strcat (buf, "post-stop script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 7); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that a script stanza overrides any previous exec stanza. */ TEST_FEATURE ("with script following exec"); strcpy (buf, "post-stop exec /bin/tool -d \"foo\"\n"); strcat (buf, "post-stop script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, TRUE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "echo\n"); nih_free (job); } /* Check that an exec stanza overrides any previous script stanza. */ TEST_FEATURE ("with exec following script"); strcpy (buf, "post-stop script\n"); strcat (buf, " echo\n"); strcat (buf, "end script\n"); strcat (buf, "post-stop exec /bin/tool -d \"foo\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); process = job->process[PROCESS_POST_STOP]; TEST_ALLOC_PARENT (process, job->process); TEST_ALLOC_SIZE (process, sizeof (Process)); TEST_EQ (process->script, FALSE); TEST_ALLOC_PARENT (process->command, process); TEST_EQ_STR (process->command, "/bin/tool -d \"foo\""); nih_free (job); } /* Check that a post-stop exec stanza without any arguments results * in a syntax error. */ TEST_FEATURE ("with exec but no command"); strcpy (buf, "post-stop exec\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a post-stop script stanza with an extra argument * results in a syntax error. */ TEST_FEATURE ("with argument to script"); strcpy (buf, "post-stop script foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 17); TEST_EQ (lineno, 1); nih_free (err); /* Check that a post-stop stanza with an unknown second argument * results in a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "post-stop foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 10); TEST_EQ (lineno, 1); nih_free (err); /* Check that a post-stop stanza with no second argument * results in a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "post-stop\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 9); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_start (void) { JobClass *job; EventOperator *oper; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_start"); /* Check that a start on stanza may have a single event name, * which will be the sole operator in the expression. */ TEST_FEATURE ("with event name"); strcpy (buf, "start on wibble\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a start on stanza may have an event name followed * by multiple arguments,the event will be the sole operator in * the expression, and have the additional arguments as arguments * to the event. */ TEST_FEATURE ("with event name and arguments"); strcpy (buf, "start on wibble foo bar b?z*\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_ALLOC_SIZE (oper->env, sizeof (char *) * 4); TEST_EQ_STR (oper->env[0], "foo"); TEST_EQ_STR (oper->env[1], "bar"); TEST_EQ_STR (oper->env[2], "b?z*"); TEST_EQ_P (oper->env[3], NULL); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a start on stanza may have an event name followed * by arguments matched by position and then arguments matched by * name. Various rules of quoting should be allowed for both; * this is all tested elsewhere, but I want to make sure I don't * break something I'm going to document. */ TEST_FEATURE ("with event name and various arguments"); strcpy (buf, "start on wibble foo bar KEY=b?z* \"FRODO=foo bar\" " "BILBO=\"foo bar\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_ALLOC_SIZE (oper->env, sizeof (char *) * 6); TEST_EQ_STR (oper->env[0], "foo"); TEST_EQ_STR (oper->env[1], "bar"); TEST_EQ_STR (oper->env[2], "KEY=b?z*"); TEST_EQ_STR (oper->env[3], "FRODO=foo bar"); TEST_EQ_STR (oper->env[4], "BILBO=foo bar"); TEST_EQ_P (oper->env[5], NULL); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a start on stanza may have a multiple events seperated * by an operator; the operator will be the root of the expression, * with the two events as its children. */ TEST_FEATURE ("with operator and two events"); strcpy (buf, "start on wibble or wobble\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->start_on->node.left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->start_on->node.right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a start on stanza may have a multiple events seperated * by an operator, and that those events may have arguments; the * operator will be the root of the expression, with the two events * as its children. */ TEST_FEATURE ("with operator and two events with arguments"); strcpy (buf, "start on wibble foo bar and wobble frodo bilbo\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_AND); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->start_on->node.left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_ALLOC_SIZE (oper->env, sizeof (char *) * 3); TEST_EQ_STR (oper->env[0], "foo"); TEST_EQ_STR (oper->env[1], "bar"); TEST_EQ_P (oper->env[2], NULL); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->start_on->node.right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_ALLOC_SIZE (oper->env, sizeof (char *) * 3); TEST_EQ_STR (oper->env[0], "frodo"); TEST_EQ_STR (oper->env[1], "bilbo"); TEST_EQ_P (oper->env[2], NULL); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a start on stanza may have a multiple events seperated * by multiple operators; the operators should be left-associative, * and stack up. */ TEST_FEATURE ("with multiple operators"); strcpy (buf, "start on wibble or wobble or wiggle\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->start_on->node.left; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->start_on->node.left->left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->start_on->node.left); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->start_on->node.left->right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->start_on->node.left); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->start_on->node.right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wiggle"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a start on stanza may have groups of operators * placed with parentheses, altering the expression structure. */ TEST_FEATURE ("with parentheses"); strcpy (buf, "start on wibble or (wobble or wiggle)\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->start_on->node.left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->start_on->node.right; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->start_on->node.right->left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->start_on->node.right); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->start_on->node.right->right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wiggle"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->start_on->node.right); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a start on stanza may have nested groups of parentheses, * and that newlines are treated as whitespace within them. */ TEST_FEATURE ("with nested parentheses"); strcpy (buf, "start on (wibble\n"); strcat (buf, " or (wobble or wiggle))\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->start_on->node.left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->start_on->node.right; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, &job->start_on->node); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->start_on->node.right->left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->start_on->node.right); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->start_on->node.right->right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wiggle"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->start_on->node.right); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that the last of repeated start on stanzas is used. */ TEST_FEATURE ("with multiple on stanzas"); strcpy (buf, "start on wibble or wiggle\n"); strcat (buf, "start on wobble and wave\n"); strcat (buf, "start on waggle\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "waggle"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a start stanza without a second-level argument results * in a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "start\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a start stanza with an unknown second-level argument * results in a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "start foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a start on stanza without an argument results in a * syntax error. */ TEST_FEATURE ("with on and missing argument"); strcpy (buf, "start on\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 8); TEST_EQ (lineno, 1); nih_free (err); /* Check that starting the expression with an operator results in * a syntax error. */ TEST_FEATURE ("with operator at start of expression"); strcpy (buf, "start on or foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 9); TEST_EQ (lineno, 1); nih_free (err); /* Check that ending the expression with an operator results in * a syntax error. */ TEST_FEATURE ("with operator at end of expression"); strcpy (buf, "start on foo or\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that two operators in a row result in a syntax error. */ TEST_FEATURE ("with consecutive operators"); strcpy (buf, "start on foo or and bar\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 16); TEST_EQ (lineno, 1); nih_free (err); /* Check that starting a group expression with an operator results in * a syntax error. */ TEST_FEATURE ("with operator at start of group"); strcpy (buf, "start on foo or (or foo)\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 17); TEST_EQ (lineno, 1); nih_free (err); /* Check that ending a group expression with an operator results in * a syntax error. */ TEST_FEATURE ("with operator at end of group"); strcpy (buf, "start on foo or (bar or)\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 23); TEST_EQ (lineno, 1); nih_free (err); /* Check that failing to start a group expression results in * a syntax error. */ TEST_FEATURE ("with missing open paren"); strcpy (buf, "start on foo or bar or foo)\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_MISMATCHED_PARENS); TEST_EQ (pos, 26); TEST_EQ (lineno, 1); nih_free (err); /* Check that failing to end a group expression results in * a syntax error. */ TEST_FEATURE ("with missing close paren"); strcpy (buf, "start on foo or (bar or foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_MISMATCHED_PARENS); TEST_EQ (pos, 28); TEST_EQ (lineno, 2); nih_free (err); /* Check that a group expression following an event name results in * a syntax error. */ TEST_FEATURE ("with group immediately after event"); strcpy (buf, "start on frodo (foo or bar)\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_OPERATOR); TEST_EQ (pos, 15); TEST_EQ (lineno, 1); nih_free (err); /* Check that an event name following a group expression results in * a syntax error. */ TEST_FEATURE ("with event immediately after group"); strcpy (buf, "start on (foo or bar) frodo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_OPERATOR); TEST_EQ (pos, 22); TEST_EQ (lineno, 1); nih_free (err); /* Check that positional arguments to events may not follow * named-based ones, resulting in a syntax error. */ TEST_FEATURE ("with positional arguments after name-based ones"); strcpy (buf, "start on wibble foo KEY=bar baz\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_VARIABLE); TEST_EQ (pos, 31); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_manual (void) { char buf[1024]; size_t pos, lineno; JobClass *job; NihError *err; EventOperator *oper; TEST_FUNCTION ("stanza_manual"); /* manual only ignores *previously specified* start on * events. */ TEST_FEATURE ("manual_stanza before start on"); strcpy (buf, "manual\nstart on wibble\n"); /* ensure we haven't broken a basic start on event by introducing the * manual stanza into a config */ TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->start_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->start_on, job); oper = job->start_on; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } TEST_FEATURE ("manual stanza after start on"); strcpy (buf, "start on wibble\nmanual\n"); job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_NE_P (job, NULL); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ_P (job->start_on, NULL); nih_free (job); } void test_stanza_stop (void) { JobClass *job; EventOperator *oper; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_stop"); /* Check that a stop on stanza may have a single event name, * which will be the sole operator in the expression. */ TEST_FEATURE ("with event name"); strcpy (buf, "stop on wibble\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->stop_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->stop_on, job); oper = job->stop_on; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a stop on stanza may have an event name followed * by multiple arguments,the event will be the sole operator in * the expression, and have the additional arguments as arguments * to the event. */ TEST_FEATURE ("with event name and arguments"); strcpy (buf, "stop on wibble foo bar b?z*\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->stop_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->stop_on, job); oper = job->stop_on; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_ALLOC_SIZE (oper->env, sizeof (char *) * 4); TEST_EQ_STR (oper->env[0], "foo"); TEST_EQ_STR (oper->env[1], "bar"); TEST_EQ_STR (oper->env[2], "b?z*"); TEST_EQ_P (oper->env[3], NULL); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a stop on stanza may have an event name followed * by arguments matched by position and then arguments matched by * name. Various rules of quoting should be allowed for both; * this is all tested elsewhere, but I want to make sure I don't * break something I'm going to document. */ TEST_FEATURE ("with event name and various arguments"); strcpy (buf, "stop on wibble foo bar KEY=b?z* \"FRODO=foo bar\" " "BILBO=\"foo bar\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->stop_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->stop_on, job); oper = job->stop_on; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_ALLOC_SIZE (oper->env, sizeof (char *) * 6); TEST_EQ_STR (oper->env[0], "foo"); TEST_EQ_STR (oper->env[1], "bar"); TEST_EQ_STR (oper->env[2], "KEY=b?z*"); TEST_EQ_STR (oper->env[3], "FRODO=foo bar"); TEST_EQ_STR (oper->env[4], "BILBO=foo bar"); TEST_EQ_P (oper->env[5], NULL); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a stop on stanza may have a multiple events seperated * by an operator; the operator will be the root of the expression, * with the two events as its children. */ TEST_FEATURE ("with operator and two events"); strcpy (buf, "stop on wibble or wobble\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->stop_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->stop_on, job); oper = job->stop_on; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->stop_on->node.left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->stop_on->node.right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a stop on stanza may have a multiple events seperated * by an operator, and that those events may have arguments; the * operator will be the root of the expression, with the two events * as its children. */ TEST_FEATURE ("with operator and two events with arguments"); strcpy (buf, "stop on wibble foo bar and wobble frodo bilbo\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->stop_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->stop_on, job); oper = job->stop_on; TEST_EQ (oper->type, EVENT_AND); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->stop_on->node.left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_ALLOC_SIZE (oper->env, sizeof (char *) * 3); TEST_EQ_STR (oper->env[0], "foo"); TEST_EQ_STR (oper->env[1], "bar"); TEST_EQ_P (oper->env[2], NULL); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->stop_on->node.right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_ALLOC_SIZE (oper->env, sizeof (char *) * 3); TEST_EQ_STR (oper->env[0], "frodo"); TEST_EQ_STR (oper->env[1], "bilbo"); TEST_EQ_P (oper->env[2], NULL); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a stop on stanza may have a multiple events seperated * by multiple operators; the operators should be left-associative, * and stack up. */ TEST_FEATURE ("with multiple operators"); strcpy (buf, "stop on wibble or wobble or wiggle\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->stop_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->stop_on, job); oper = job->stop_on; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->stop_on->node.left; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->stop_on->node.left->left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->stop_on->node.left); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->stop_on->node.left->right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->stop_on->node.left); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->stop_on->node.right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wiggle"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a stop on stanza may have groups of operators * placed with parentheses, altering the expression structure. */ TEST_FEATURE ("with parentheses"); strcpy (buf, "stop on wibble or (wobble or wiggle)\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->stop_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->stop_on, job); oper = job->stop_on; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->stop_on->node.left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->stop_on->node.right; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->stop_on->node.right->left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->stop_on->node.right); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->stop_on->node.right->right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wiggle"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->stop_on->node.right); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a stop on stanza may have nested groups of parentheses, * and that newlines are treated as whitespace within them. */ TEST_FEATURE ("with nested parentheses"); strcpy (buf, "stop on (wibble\n"); strcat (buf, " or (wobble or wiggle))\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->stop_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->stop_on, job); oper = job->stop_on; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, NULL); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->stop_on->node.left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wibble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->stop_on->node.right; TEST_EQ (oper->type, EVENT_OR); TEST_EQ_P (oper->node.parent, &job->stop_on->node); TEST_ALLOC_SIZE (oper->node.left, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.left, oper); TEST_ALLOC_SIZE (oper->node.right, sizeof (EventOperator)); TEST_ALLOC_PARENT (oper->node.right, oper); oper = (EventOperator *)job->stop_on->node.right->left; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wobble"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->stop_on->node.right); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); oper = (EventOperator *)job->stop_on->node.right->right; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "wiggle"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, job->stop_on->node.right); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that the last of repeated stop on stanzas is used. */ TEST_FEATURE ("with multiple on stanzas"); strcpy (buf, "stop on wibble or wiggle\n"); strcat (buf, "stop on wobble and wave\n"); strcat (buf, "stop on waggle\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_SIZE (job->stop_on, sizeof (EventOperator)); TEST_ALLOC_PARENT (job->stop_on, job); oper = job->stop_on; TEST_EQ (oper->type, EVENT_MATCH); TEST_EQ_STR (oper->name, "waggle"); TEST_EQ_P (oper->env, NULL); TEST_EQ_P (oper->node.parent, NULL); TEST_EQ_P (oper->node.left, NULL); TEST_EQ_P (oper->node.right, NULL); nih_free (job); } /* Check that a stop stanza without a second-level argument results * in a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "stop\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 4); TEST_EQ (lineno, 1); nih_free (err); /* Check that a stop stanza with an unknown second-level argument * results in a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "stop foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a stop on stanza without an argument results in a * syntax error. */ TEST_FEATURE ("with on and missing argument"); strcpy (buf, "stop on\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 7); TEST_EQ (lineno, 1); nih_free (err); /* Check that starting the expression with an operator results in * a syntax error. */ TEST_FEATURE ("with operator at start of expression"); strcpy (buf, "stop on or foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 8); TEST_EQ (lineno, 1); nih_free (err); /* Check that ending the expression with an operator results in * a syntax error. */ TEST_FEATURE ("with operator at end of expression"); strcpy (buf, "stop on foo or\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 12); TEST_EQ (lineno, 1); nih_free (err); /* Check that two operators in a row result in a syntax error. */ TEST_FEATURE ("with consecutive operators"); strcpy (buf, "stop on foo or and bar\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 15); TEST_EQ (lineno, 1); nih_free (err); /* Check that starting a group expression with an operator results in * a syntax error. */ TEST_FEATURE ("with operator at start of group"); strcpy (buf, "stop on foo or (or foo)\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 16); TEST_EQ (lineno, 1); nih_free (err); /* Check that ending a group expression with an operator results in * a syntax error. */ TEST_FEATURE ("with operator at end of group"); strcpy (buf, "stop on foo or (bar or)\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_EVENT); TEST_EQ (pos, 22); TEST_EQ (lineno, 1); nih_free (err); /* Check that failing to start a group expression results in * a syntax error. */ TEST_FEATURE ("with missing open paren"); strcpy (buf, "stop on foo or bar or foo)\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_MISMATCHED_PARENS); TEST_EQ (pos, 25); TEST_EQ (lineno, 1); nih_free (err); /* Check that failing to end a group expression results in * a syntax error. */ TEST_FEATURE ("with missing close paren"); strcpy (buf, "stop on foo or (bar or foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_MISMATCHED_PARENS); TEST_EQ (pos, 27); TEST_EQ (lineno, 2); nih_free (err); /* Check that a group expression following an event name results in * a syntax error. */ TEST_FEATURE ("with group immediately after event"); strcpy (buf, "stop on frodo (foo or bar)\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_OPERATOR); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that an event name following a group expression results in * a syntax error. */ TEST_FEATURE ("with event immediately after group"); strcpy (buf, "stop on (foo or bar) frodo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_OPERATOR); TEST_EQ (pos, 21); TEST_EQ (lineno, 1); nih_free (err); /* Check that positional arguments to events may not follow * named-based ones, resulting in a syntax error. */ TEST_FEATURE ("with positional arguments after name-based ones"); strcpy (buf, "stop on wibble foo KEY=bar baz\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_EXPECTED_VARIABLE); TEST_EQ (pos, 30); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_description (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_description"); /* Check that a description stanza with an argument results in it * being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "description \"a test job\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->description, job); TEST_EQ_STR (job->description, "a test job"); nih_free (job); } /* Check that the last of duplicate description stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "description \"an example job\"\n"); strcat (buf, "description \"a test job\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->description, job); TEST_EQ_STR (job->description, "a test job"); nih_free (job); } /* Check that a description stanza without an argument results in * a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "description\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 11); TEST_EQ (lineno, 1); nih_free (err); /* Check that a description stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "description \"a test job\" \"ya ya\"\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 25); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_author (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_author"); /* Check that a author stanza with an argument results in it * being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "author \"joe bloggs\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->author, job); TEST_EQ_STR (job->author, "joe bloggs"); nih_free (job); } /* Check that the last of multiple author stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "author \"john doe\"\n"); strcat (buf, "author \"joe bloggs\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->author, job); TEST_EQ_STR (job->author, "joe bloggs"); nih_free (job); } /* Check that a author stanza without an argument results in * a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "author\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a author stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "author \"joe bloggs\" \"john doe\"\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 20); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_version (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_version"); /* Check that a version stanza with an argument results in it * being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "version \"1.0\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->version, job); TEST_EQ_STR (job->version, "1.0"); nih_free (job); } /* Check that the last of multiple version stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "version \"0.8\"\n"); strcat (buf, "version \"1.0\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->version, job); TEST_EQ_STR (job->version, "1.0"); nih_free (job); } /* Check that a version stanza without an argument results in * a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "version\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 7); TEST_EQ (lineno, 1); nih_free (err); /* Check that a version stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "version \"1.0\" \"0.8\"\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_emits (void) { JobClass *job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_emits"); /* Check that an emits stanza with a single argument results in * the named event being added to the emits list. */ TEST_FEATURE ("with single argument"); strcpy (buf, "emits wibble\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->emits, job); TEST_ALLOC_SIZE (job->emits, sizeof (char *) * 2); TEST_ALLOC_PARENT (job->emits[0], job->emits); TEST_EQ_STR (job->emits[0], "wibble"); TEST_EQ_P (job->emits[1], NULL); nih_free (job); } /* Check that an emits stanza with multiple arguments results in * all of the named events being added to the emits list. */ TEST_FEATURE ("with multiple arguments"); strcpy (buf, "emits wibble wobble waggle\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->emits, job); TEST_ALLOC_SIZE (job->emits, sizeof (char *) * 4); TEST_ALLOC_PARENT (job->emits[0], job->emits); TEST_EQ_STR (job->emits[0], "wibble"); TEST_ALLOC_PARENT (job->emits[1], job->emits); TEST_EQ_STR (job->emits[1], "wobble"); TEST_ALLOC_PARENT (job->emits[2], job->emits); TEST_EQ_STR (job->emits[2], "waggle"); TEST_EQ_P (job->emits[3], NULL); nih_free (job); } /* Check that repeated emits stanzas are permitted, each appending * to the last. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "emits wibble\n"); strcat (buf, "emits wobble waggle\n"); strcat (buf, "emits wuggle\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->emits, job); TEST_ALLOC_SIZE (job->emits, sizeof (char *) * 5); TEST_ALLOC_PARENT (job->emits[0], job->emits); TEST_EQ_STR (job->emits[0], "wibble"); TEST_ALLOC_PARENT (job->emits[1], job->emits); TEST_EQ_STR (job->emits[1], "wobble"); TEST_ALLOC_PARENT (job->emits[2], job->emits); TEST_EQ_STR (job->emits[2], "waggle"); TEST_ALLOC_PARENT (job->emits[3], job->emits); TEST_EQ_STR (job->emits[3], "wuggle"); TEST_EQ_P (job->emits[4], NULL); nih_free (job); } /* Check that an emits stanza without an argument results in a * syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "emits\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_expect (void) { JobClass *job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_expect"); /* Check that expect stop sets the job's expect member to * EXPECT_STOP. */ TEST_FEATURE ("with stop argument"); strcpy (buf, "expect stop\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->expect, EXPECT_STOP); nih_free (job); } /* Check that expect daemon sets the job's expect member to * EXPECT_DAEMON. */ TEST_FEATURE ("with daemon argument"); strcpy (buf, "expect daemon\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->expect, EXPECT_DAEMON); nih_free (job); } /* Check that expect fork sets the job's expect member to * EXPECT_FORK. */ TEST_FEATURE ("with fork argument"); strcpy (buf, "expect fork\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->expect, EXPECT_FORK); nih_free (job); } /* Check that expect none sets the job's expect member to * EXPECT_NONE. */ TEST_FEATURE ("with none argument"); strcpy (buf, "expect none\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->expect, EXPECT_NONE); nih_free (job); } /* Check that the last of multiple expect stanzas is used. */ TEST_FEATURE ("with multiple for stanzas"); strcpy (buf, "expect stop\n"); strcat (buf, "expect none\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->expect, EXPECT_NONE); nih_free (job); } /* Check that a expect stanza without an argument results in a * syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "expect\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a expect stanza with an unknown argument results * in a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "expect foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 7); TEST_EQ (lineno, 1); nih_free (err); /* Check that a expect stanza with an extra argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "expect daemon foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_respawn (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_respawn"); /* Check that a respawn stanza sets the job's respawn flag */ TEST_FEATURE ("with no argument"); strcpy (buf, "respawn\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_TRUE (job->respawn); nih_free (job); } /* Check that a respawn stanza with no arguments can be used multiple * times. */ TEST_FEATURE ("with multiple no argument stanzas"); strcpy (buf, "respawn\n"); strcat (buf, "respawn\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_TRUE (job->respawn); nih_free (job); } /* Check that a respawn stanza with the limit argument and numeric * rate and timeout results in it being stored in the job. */ TEST_FEATURE ("with limit and two arguments"); strcpy (buf, "respawn limit 10 120\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->respawn_limit, 10); TEST_EQ (job->respawn_interval, 120); nih_free (job); } /* Check that a respawn stanza with the limit argument can have * the single word unlimited after it. */ TEST_FEATURE ("with limit and unlimited"); strcpy (buf, "respawn limit unlimited\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->respawn_limit, 0); TEST_EQ (job->respawn_interval, 0); nih_free (job); } /* Check that the most recent of multiple respawn stanzas is used. */ TEST_FEATURE ("with multiple limit and two argument stanzas"); strcpy (buf, "respawn limit 5 60\n"); strcat (buf, "respawn limit 10 120\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->respawn_limit, 10); TEST_EQ (job->respawn_interval, 120); nih_free (job); } /* Check that a respawn stanza with the limit argument but no * interval results in a syntax error. */ TEST_FEATURE ("with limit and missing second argument"); strcpy (buf, "respawn limit 10\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 16); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn stanza with the limit argument but no * arguments results in a syntax error. */ TEST_FEATURE ("with limit and missing arguments"); strcpy (buf, "respawn limit\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn limit stanza with a non-integer interval * argument results in a syntax error. */ TEST_FEATURE ("with limit and non-integer interval argument"); strcpy (buf, "respawn limit 10 foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_INTERVAL); TEST_EQ (pos, 17); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn limit stanza with a too-large interval * argument results in a syntax error. */ TEST_FEATURE ("with limit and too-large interval argument"); strcpy (buf, "respawn limit 10 10000000000000000000\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_INTERVAL); TEST_EQ (pos, 17); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn limit stanza with a non-integer limit * argument results in a syntax error. */ TEST_FEATURE ("with limit and non-integer limit argument"); strcpy (buf, "respawn limit foo 120\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn limit stanza with a too-large limit * argument results in a syntax error. */ TEST_FEATURE ("with limit and too-large limit argument"); strcpy (buf, "respawn limit 10000000000000000000 120\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn limit stanza with a partially numeric * interval argument results in a syntax error. */ TEST_FEATURE ("with limit and alphanumeric interval argument"); strcpy (buf, "respawn limit 10 99foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_INTERVAL); TEST_EQ (pos, 17); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn limit stanza with a partially numeric * limit argument results in a syntax error. */ TEST_FEATURE ("with limit and alphanumeric limit argument"); strcpy (buf, "respawn limit 99foo 120\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn limit stanza with a negative interval * value results in a syntax error. */ TEST_FEATURE ("with limit and negative interval argument"); strcpy (buf, "respawn limit 10 -1\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_INTERVAL); TEST_EQ (pos, 17); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn limit stanza with a negative limit * value results in a syntax error. */ TEST_FEATURE ("with limit and negative interval argument"); strcpy (buf, "respawn limit -1 120\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn limit stanza with an extra argument results * in a syntax error. */ TEST_FEATURE ("with extra argument to limit"); strcpy (buf, "respawn limit 0 1 foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 18); TEST_EQ (lineno, 1); nih_free (err); /* Check that a respawn stanza with an unknown second argument * results in a syntax error. */ TEST_FEATURE ("with unknown argument to limit"); strcpy (buf, "respawn foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 8); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_task (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_task"); /* Check that a task stanza without any arguments sets the job's * task flag. */ TEST_FEATURE ("with no arguments"); strcpy (buf, "task\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_TRUE (job->task); nih_free (job); } /* Check that multiple task stanzas are permitted. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "task\n"); strcat (buf, "task\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_TRUE (job->task); nih_free (job); } /* Check that a task stanza with arguments results in a syntax * error. */ TEST_FEATURE ("with arguments"); strcpy (buf, "task foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_instance (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_instance"); /* Check that an instance stanza with an argument sets both the * job's instance name. */ TEST_FEATURE ("with argument"); strcpy (buf, "instance $FOO\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->instance, job); TEST_EQ_STR (job->instance, "$FOO"); nih_free (job); } /* Check that the last of multiple instance stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "instance $FOO\n"); strcpy (buf, "instance $BAR\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->instance, job); TEST_EQ_STR (job->instance, "$BAR"); nih_free (job); } /* Check that extra arguments to the instance stanza results in * a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "instance $FOO foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that no argument to the instance stanza results in a * syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "instance\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 8); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_kill (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_kill"); /* Check that a kill stanza with the timeout argument and a numeric * timeout results in it being stored in the job. */ TEST_FEATURE ("with timeout and single argument"); strcpy (buf, "kill timeout 10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->kill_timeout, 10); nih_free (job); } /* Check that a kill stanza with the signal argument and signal, * sets the right signal on the jobs class. */ TEST_FEATURE ("with signal and single argument"); strcpy (buf, "kill signal INT\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->kill_signal, SIGINT); nih_free (job); } /* Check that a kill stanza with the signal argument and numeric signal, * sets the right signal on the jobs class. */ TEST_FEATURE ("with signal and single numeric argument"); strcpy (buf, "kill signal 30\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); /* Don't check symbolic here since different * architectures have different mappings. */ TEST_EQ (job->kill_signal, 30); nih_free (job); } /* Check that the last of multiple kill stanzas is used. */ TEST_FEATURE ("with multiple timeout and single argument stanzas"); strcpy (buf, "kill timeout 5\n"); strcat (buf, "kill timeout 10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->kill_timeout, 10); nih_free (job); } TEST_FEATURE ("with multiple signal and single argument stanzas"); strcpy (buf, "kill signal INT\n"); strcat (buf, "kill signal TERM\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->kill_signal, SIGTERM); nih_free (job); } /* Check that a kill stanza without an argument results in a syntax * error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "kill\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 4); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill stanza with an invalid second-level stanza * results in a syntax error. */ TEST_FEATURE ("with unknown second argument"); strcpy (buf, "kill foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill stanza with the timeout argument but no timeout * results in a syntax error. */ TEST_FEATURE ("with timeout and missing argument"); strcpy (buf, "kill timeout\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 12); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill stanza with the timeout argument but no timeout * results in a syntax error. */ TEST_FEATURE ("with signal and missing argument"); strcpy (buf, "kill signal\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 11); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill timeout stanza with a non-integer argument * results in a syntax error. */ TEST_FEATURE ("with timeout and non-integer argument"); strcpy (buf, "kill timeout foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_INTERVAL); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill timeout stanza with a too-large argument * results in a syntax error. */ TEST_FEATURE ("with timeout and too-large argument"); strcpy (buf, "kill timeout 10000000000000000000\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_INTERVAL); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill timeout stanza with a partially numeric argument * results in a syntax error. */ TEST_FEATURE ("with timeout and alphanumeric argument"); strcpy (buf, "kill timeout 99foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_INTERVAL); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill timeout stanza with a negative value results * in a syntax error. */ TEST_FEATURE ("with timeout and negative argument"); strcpy (buf, "kill timeout -1\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_INTERVAL); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill signal stanza with an unknown signal argument * results in a syntax error. */ TEST_FEATURE ("with signal and unknown signal argument"); strcpy (buf, "kill signal foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_SIGNAL); TEST_EQ (pos, 12); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill stanza with the timeout argument and timeout, * but with an extra argument afterwards results in a syntax * error. */ TEST_FEATURE ("with timeout and extra argument"); strcpy (buf, "kill timeout 99 foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 16); TEST_EQ (lineno, 1); nih_free (err); /* Check that a kill stanza with the signal argument and signal, * but with an extra argument afterwards results in a syntax * error. */ TEST_FEATURE ("with signal and extra argument"); strcpy (buf, "kill signal INT foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 16); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_reload (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_reload"); /* Check that a reload stanza with the signal argument and signal, * sets the right signal on the jobs class. */ TEST_FEATURE ("with signal and single argument"); strcpy (buf, "reload signal USR2\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->reload_signal, SIGUSR2); nih_free (job); } /* Check that a reload stanza with the signal argument and numeric signal, * sets the right signal on the jobs class. */ TEST_FEATURE ("with signal and single numeric argument"); strcpy (buf, "reload signal 31\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); /* Don't check symbolic here since different * architectures have different mappings. */ TEST_EQ (job->reload_signal, 31); nih_free (job); } /* Check that the last of multiple reload stanzas is used. */ TEST_FEATURE ("with multiple signal and single argument stanzas"); strcpy (buf, "reload signal USR2\n"); strcat (buf, "reload signal HUP\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->reload_signal, SIGHUP); nih_free (job); } /* Check that a reload stanza without an argument results in a syntax * error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "reload\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a reload stanza with an invalid second-level stanza * results in a syntax error. */ TEST_FEATURE ("with unknown second argument"); strcpy (buf, "reload foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 7); TEST_EQ (lineno, 1); nih_free (err); /* Check that a reload stanza with the timeout argument but no timeout * results in a syntax error. */ TEST_FEATURE ("with signal and missing argument"); strcpy (buf, "reload signal\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that a reload signal stanza with an unknown signal argument * results in a syntax error. */ TEST_FEATURE ("with signal and unknown signal argument"); strcpy (buf, "reload signal foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_SIGNAL); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a reload stanza with the signal argument and signal, * but with an extra argument afterwards results in a syntax * error. */ TEST_FEATURE ("with signal and extra argument"); strcpy (buf, "reload signal INT foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 18); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_normal (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_normal"); /* Check that a normal exit stanza with a single argument results in * the exit code given being added to the normalexit array, which * should be allocated. */ TEST_FEATURE ("with single argument"); strcpy (buf, "normal exit 99\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->normalexit_len, 1); TEST_ALLOC_SIZE (job->normalexit, sizeof (int) * job->normalexit_len); TEST_ALLOC_PARENT (job->normalexit, job); TEST_EQ (job->normalexit[0], 99); nih_free (job); } /* Check that an argument in a normal exit stanza may be a signal name, * in which case the signal number is shifted left and then added * to the normalexit array. */ TEST_FEATURE ("with single argument containing signal name"); strcpy (buf, "normal exit INT\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->normalexit_len, 1); TEST_ALLOC_SIZE (job->normalexit, sizeof (int) * job->normalexit_len); TEST_ALLOC_PARENT (job->normalexit, job); TEST_EQ (job->normalexit[0], SIGINT << 8); nih_free (job); } /* Check that a normal exit stanza with multiple arguments results in * all of the given exit codes being added to the array, which should * have been increased in size. */ TEST_FEATURE ("with multiple arguments"); strcpy (buf, "normal exit 99 100 101 SIGTERM\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->normalexit_len, 4); TEST_ALLOC_SIZE (job->normalexit, sizeof (int) * job->normalexit_len); TEST_ALLOC_PARENT (job->normalexit, job); TEST_EQ (job->normalexit[0], 99); TEST_EQ (job->normalexit[1], 100); TEST_EQ (job->normalexit[2], 101); TEST_EQ (job->normalexit[3], SIGTERM << 8); nih_free (job); } /* Check that repeated normal exit stanzas are permitted, each * appending to the array. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "normal exit 99\n"); strcat (buf, "normal exit 100 101\n"); strcat (buf, "normal exit QUIT\n"); strcat (buf, "normal exit 900\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 5); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->normalexit_len, 5); TEST_ALLOC_SIZE (job->normalexit, sizeof (int) * job->normalexit_len); TEST_ALLOC_PARENT (job->normalexit, job); TEST_EQ (job->normalexit[0], 99); TEST_EQ (job->normalexit[1], 100); TEST_EQ (job->normalexit[2], 101); TEST_EQ (job->normalexit[3], SIGQUIT << 8); TEST_EQ (job->normalexit[4], 900); nih_free (job); } /* Check that a normal exit stanza without an argument results in a * syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "normal exit\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 11); TEST_EQ (lineno, 1); nih_free (err); /* Check that a normal exit stanza with a non-integer argument results * in a syntax error. */ TEST_FEATURE ("with non-integer argument"); strcpy (buf, "normal exit foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_EXIT); TEST_EQ (pos, 12); TEST_EQ (lineno, 1); nih_free (err); /* Check that a normal exit stanza with a partially numeric argument * results in a syntax error. */ TEST_FEATURE ("with alphanumeric argument"); strcpy (buf, "normal exit 99foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_EXIT); TEST_EQ (pos, 12); TEST_EQ (lineno, 1); nih_free (err); /* Check that a normal exit stanza with a negative value results in * a syntax error. */ TEST_FEATURE ("with negative argument"); strcpy (buf, "normal exit -1\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_EXIT); TEST_EQ (pos, 12); TEST_EQ (lineno, 1); nih_free (err); /* Check that a normal stanza with something other than "exit" * results in a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "normal wibble\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 7); TEST_EQ (lineno, 1); nih_free (err); /* Check that a normal stanza without an argument results in a * syntax error. */ TEST_FEATURE ("with missing exit"); strcpy (buf, "normal\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_console (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_console"); /* Check that console none sets the job's console to * CONSOLE_NONE. */ TEST_FEATURE ("with none argument"); strcpy (buf, "console none\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->console, CONSOLE_NONE); nih_free (job); } /* Check that console output sets the job's console to * CONSOLE_OUTPUT. */ TEST_FEATURE ("with output argument"); strcpy (buf, "console output\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->console, CONSOLE_OUTPUT); nih_free (job); } /* Check that console owner sets the job's console to * CONSOLE_OWNER. */ TEST_FEATURE ("with owner argument"); strcpy (buf, "console owner\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->console, CONSOLE_OWNER); nih_free (job); } /* Check that console log sets the job's console to * CONSOLE_LOG. */ TEST_FEATURE ("with log argument"); strcpy (buf, "console log\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->console, CONSOLE_LOG); nih_free (job); } /* Check that the last of multiple console stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "console output\n"); strcat (buf, "console owner\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->console, CONSOLE_OWNER); nih_free (job); } /* Check that an unknown argument raises a syntax error. */ TEST_FEATURE ("with unknown argument"); strcpy (buf, "console wibble\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 8); TEST_EQ (lineno, 1); nih_free (err); /* Check that additional arguments to the stanza results in * a syntax error. */ TEST_FEATURE ("with argument"); strcpy (buf, "console owner foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a missing argument raises a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "console\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 7); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_env (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_env"); /* Check that a env stanza with an argument results in it * being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "env FOO=BAR\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->env, job); TEST_ALLOC_SIZE (job->env, sizeof (char *) * 2); TEST_EQ_STR (job->env[0], "FOO=BAR"); TEST_EQ_P (job->env[1], NULL); nih_free (job); } /* Check that repeated env stanzas are appended to those stored in * the job. */ TEST_FEATURE ("with repeated stanzas"); strcpy (buf, "env FOO=BAR\n"); strcat (buf, "env BAZ=QUUX\n"); strcat (buf, "env FRODO=BILBO\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->env, job); TEST_ALLOC_SIZE (job->env, sizeof (char *) * 4); TEST_EQ_STR (job->env[0], "FOO=BAR"); TEST_EQ_STR (job->env[1], "BAZ=QUUX"); TEST_EQ_STR (job->env[2], "FRODO=BILBO"); TEST_EQ_P (job->env[3], NULL); nih_free (job); } /* Check that a env stanza without an argument results in * a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "env\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 3); TEST_EQ (lineno, 1); nih_free (err); /* Check that a env stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "env FOO=BAR oops\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 12); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_export (void) { JobClass *job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_export"); /* Check that an export stanza with a single argument results in * the argument being added to the export array. */ TEST_FEATURE ("with single argument"); strcpy (buf, "export FOO\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->export, job); TEST_ALLOC_SIZE (job->export, sizeof (char *) * 2); TEST_ALLOC_PARENT (job->export[0], job->export); TEST_EQ_STR (job->export[0], "FOO"); TEST_EQ_P (job->export[1], NULL); nih_free (job); } /* Check that an export stanza with multiple arguments results in * all of the arguments being added to the export array. */ TEST_FEATURE ("with multiple arguments"); strcpy (buf, "export FOO BAR BAZ\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->export, job); TEST_ALLOC_SIZE (job->export, sizeof (char *) * 4); TEST_ALLOC_PARENT (job->export[0], job->export); TEST_EQ_STR (job->export[0], "FOO"); TEST_ALLOC_PARENT (job->export[1], job->export); TEST_EQ_STR (job->export[1], "BAR"); TEST_ALLOC_PARENT (job->export[2], job->export); TEST_EQ_STR (job->export[2], "BAZ"); TEST_EQ_P (job->export[3], NULL); nih_free (job); } /* Check that repeated export stanzas are permitted, each appending * to the last. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "export FOO\n"); strcat (buf, "export BAR BAZ\n"); strcat (buf, "export QUUX\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 4); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->export, job); TEST_ALLOC_SIZE (job->export, sizeof (char *) * 5); TEST_ALLOC_PARENT (job->export[0], job->export); TEST_EQ_STR (job->export[0], "FOO"); TEST_ALLOC_PARENT (job->export[1], job->export); TEST_EQ_STR (job->export[1], "BAR"); TEST_ALLOC_PARENT (job->export[2], job->export); TEST_EQ_STR (job->export[2], "BAZ"); TEST_ALLOC_PARENT (job->export[3], job->export); TEST_EQ_STR (job->export[3], "QUUX"); TEST_EQ_P (job->export[4], NULL); nih_free (job); } /* Check that an export stanza without an argument results in a * syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "export\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_umask (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_umask"); /* Check that a umask stanza with an octal timeout results * in it being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "umask 0755\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->umask, 0755); nih_free (job); } /* Check that the last of multiple umask stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "umask 0644\n"); strcat (buf, "umask 0755\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->umask, 0755); nih_free (job); } /* Check that a umask stanza without an argument results in a syntax * error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "umask\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a umask stanza with a non-octal argument results * in a syntax error. */ TEST_FEATURE ("with non-octal argument"); strcpy (buf, "umask 999\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_UMASK); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a umask stanza with a non-integer argument results * in a syntax error. */ TEST_FEATURE ("with non-integer argument"); strcpy (buf, "umask foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_UMASK); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a umask stanza with a partially numeric argument * results in a syntax error. */ TEST_FEATURE ("with alphanumeric argument"); strcpy (buf, "umask 99foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_UMASK); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a umask stanza with a negative value results * in a syntax error. */ TEST_FEATURE ("with negative argument"); strcpy (buf, "umask -1\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_UMASK); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a umask stanza with a creation mask * but with an extra argument afterwards results in a syntax * error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "umask 0755 foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 11); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_nice (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_nice"); /* Check that a nice stanza with an positive timeout results * in it being stored in the job. */ TEST_FEATURE ("with positive argument"); strcpy (buf, "nice 10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->nice, 10); nih_free (job); } /* Check that a nice stanza with a negative timeout results * in it being stored in the job. */ TEST_FEATURE ("with negative argument"); strcpy (buf, "nice -10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->nice, -10); nih_free (job); } /* Check that the last of multiple nice stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "nice -10\n"); strcat (buf, "nice 10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->nice, 10); nih_free (job); } /* Check that a nice stanza without an argument results in a syntax * error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "nice\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 4); TEST_EQ (lineno, 1); nih_free (err); /* Check that a nice stanza with an overly large argument results * in a syntax error. */ TEST_FEATURE ("with overly large argument"); strcpy (buf, "nice 20\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_NICE); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a nice stanza with an overly small argument results * in a syntax error. */ TEST_FEATURE ("with overly small argument"); strcpy (buf, "nice -21\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_NICE); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a nice stanza with a non-integer argument results * in a syntax error. */ TEST_FEATURE ("with non-integer argument"); strcpy (buf, "nice foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_NICE); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a nice stanza with a partially numeric argument * results in a syntax error. */ TEST_FEATURE ("with alphanumeric argument"); strcpy (buf, "nice 12foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_NICE); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a nice stanza with a priority but with an extra * argument afterwards results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "nice 10 foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 8); TEST_EQ (lineno, 1); nih_free (err); } #define ADJ_TO_SCORE(x) ((x * 1000) / ((x < 0) ? 17 : 15)) void test_stanza_oom (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_oom"); /* Check that an oom stanza with an positive timeout results * in it being stored in the job. */ TEST_FEATURE ("with positive argument"); strcpy (buf, "oom 10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, ADJ_TO_SCORE(10)); nih_free (job); } TEST_FEATURE ("with positive score argument"); strcpy (buf, "oom score 100\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, 100); nih_free (job); } /* Check that an oom stanza with a negative timeout results * in it being stored in the job. */ TEST_FEATURE ("with negative argument"); strcpy (buf, "oom -10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, ADJ_TO_SCORE(-10)); nih_free (job); } TEST_FEATURE ("with negative score argument"); strcpy (buf, "oom score -100\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, -100); nih_free (job); } /* Check that an oom stanza may have the special never argument * which stores -17 in the job. */ TEST_FEATURE ("with never argument"); strcpy (buf, "oom never\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, ADJ_TO_SCORE(-17)); nih_free (job); } /* Check that an oom score stanza may have the special never * argument which stores -1000 in the job. */ TEST_FEATURE ("with never score argument"); strcpy (buf, "oom score never\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, -1000); nih_free (job); } /* Check that the last of multiple oom stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "oom -10\n"); strcat (buf, "oom 10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, ADJ_TO_SCORE(10)); nih_free (job); } TEST_FEATURE ("with multiple score stanzas"); strcpy (buf, "oom score -500\n"); strcat (buf, "oom score 500\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, 500); nih_free (job); } /* Check that the last of multiple distinct oom stanzas is * used. */ TEST_FEATURE ("with an oom overriding an oom score stanza"); strcpy (buf, "oom score -10\n"); strcat (buf, "oom 10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, ADJ_TO_SCORE(10)); nih_free (job); } TEST_FEATURE ("with an oom score overriding an oom stanza"); strcpy (buf, "oom -10\n"); strcat (buf, "oom score 10\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_EQ (job->oom_score_adj, 10); nih_free (job); } /* Check that an oom stanza without an argument results in a syntax * error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "oom\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 3); TEST_EQ (lineno, 1); nih_free (err); /* Check that an oom score stanza without an argument results in a * syntax error. */ TEST_FEATURE ("with missing score argument"); strcpy (buf, "oom score\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 9); TEST_EQ (lineno, 1); nih_free (err); /* Check that an oom stanza with an overly large argument results * in a syntax error. */ TEST_FEATURE ("with overly large argument"); strcpy (buf, "oom 20\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_OOM); TEST_EQ (pos, 4); TEST_EQ (lineno, 1); nih_free (err); TEST_FEATURE ("with overly large score argument"); strcpy (buf, "oom score 1200\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_OOM); TEST_EQ (pos, 10); TEST_EQ (lineno, 1); nih_free (err); /* Check that an oom stanza with an overly small argument results * in a syntax error. */ TEST_FEATURE ("with overly small argument"); strcpy (buf, "oom -21\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_OOM); TEST_EQ (pos, 4); TEST_EQ (lineno, 1); nih_free (err); TEST_FEATURE ("with overly small score argument"); strcpy (buf, "oom score -1200\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_OOM); TEST_EQ (pos, 10); TEST_EQ (lineno, 1); nih_free (err); /* Check that an oom stanza with a non-integer argument results * in a syntax error. */ TEST_FEATURE ("with non-integer argument"); strcpy (buf, "oom foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_OOM); TEST_EQ (pos, 4); TEST_EQ (lineno, 1); nih_free (err); TEST_FEATURE ("with non-integer score argument"); strcpy (buf, "oom score foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_OOM); TEST_EQ (pos, 10); TEST_EQ (lineno, 1); nih_free (err); /* Check that an oom stanza with a partially numeric argument * results in a syntax error. */ TEST_FEATURE ("with alphanumeric argument"); strcpy (buf, "oom 12foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_OOM); TEST_EQ (pos, 4); TEST_EQ (lineno, 1); nih_free (err); TEST_FEATURE ("with alphanumeric score argument"); strcpy (buf, "oom score 12foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_OOM); TEST_EQ (pos, 10); TEST_EQ (lineno, 1); nih_free (err); /* Check that an oom stanza with a priority but with an extra * argument afterwards results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "oom 10 foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 7); TEST_EQ (lineno, 1); nih_free (err); TEST_FEATURE ("with extra score argument"); strcpy (buf, "oom score 500 foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_limit (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_limit"); /* Check that the limit as stanza sets the RLIMIT_AS resource. */ TEST_FEATURE ("with as limit"); strcpy (buf, "limit as 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_AS], job); TEST_EQ (job->limits[RLIMIT_AS]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_AS]->rlim_max, 20); nih_free (job); } /* Check that the limit core stanza sets the RLIMIT_CORE resource. */ TEST_FEATURE ("with core limit"); strcpy (buf, "limit core 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_CORE], job); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_max, 20); nih_free (job); } /* Check that the limit as stanza sets the RLIMIT_CPU resource. */ TEST_FEATURE ("with cpu limit"); strcpy (buf, "limit cpu 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_CPU], job); TEST_EQ (job->limits[RLIMIT_CPU]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_CPU]->rlim_max, 20); nih_free (job); } /* Check that the limit data stanza sets the RLIMIT_DATA resource. */ TEST_FEATURE ("with data limit"); strcpy (buf, "limit data 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_DATA], job); TEST_EQ (job->limits[RLIMIT_DATA]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_DATA]->rlim_max, 20); nih_free (job); } /* Check that the limit fsize stanza sets the RLIMIT_FSIZE resource. */ TEST_FEATURE ("with fsize limit"); strcpy (buf, "limit fsize 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_FSIZE], job); TEST_EQ (job->limits[RLIMIT_FSIZE]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_FSIZE]->rlim_max, 20); nih_free (job); } /* Check that the limit memlock stanza sets the RLIMIT_MEMLOCK * resource. */ TEST_FEATURE ("with memlock limit"); strcpy (buf, "limit memlock 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_MEMLOCK], job); TEST_EQ (job->limits[RLIMIT_MEMLOCK]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_MEMLOCK]->rlim_max, 20); nih_free (job); } /* Check that the limit msgqueue stanza sets the RLIMIT_MSGQUEUE * resource. */ TEST_FEATURE ("with msgqueue limit"); strcpy (buf, "limit msgqueue 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_MSGQUEUE], job); TEST_EQ (job->limits[RLIMIT_MSGQUEUE]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_MSGQUEUE]->rlim_max, 20); nih_free (job); } /* Check that the limit nice stanza sets the RLIMIT_NICE resource. */ TEST_FEATURE ("with nice limit"); strcpy (buf, "limit nice 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_NICE], job); TEST_EQ (job->limits[RLIMIT_NICE]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_NICE]->rlim_max, 20); nih_free (job); } /* Check that the limit nofile stanza sets the RLIMIT_NOFILE * resource. */ TEST_FEATURE ("with nofile limit"); strcpy (buf, "limit nofile 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_NOFILE], job); TEST_EQ (job->limits[RLIMIT_NOFILE]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_NOFILE]->rlim_max, 20); nih_free (job); } /* Check that the limit nproc stanza sets the RLIMIT_NPROC resource. */ TEST_FEATURE ("with nproc limit"); strcpy (buf, "limit nproc 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_NPROC], job); TEST_EQ (job->limits[RLIMIT_NPROC]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_NPROC]->rlim_max, 20); nih_free (job); } /* Check that the limit rss stanza sets the RLIMIT_RSS resource. */ TEST_FEATURE ("with rss limit"); strcpy (buf, "limit rss 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_RSS], job); TEST_EQ (job->limits[RLIMIT_RSS]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_RSS]->rlim_max, 20); nih_free (job); } /* Check that the limit rtprio stanza sets the RLIMIT_RTPRIO resource. */ TEST_FEATURE ("with rtprio limit"); strcpy (buf, "limit rtprio 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_RTPRIO], job); TEST_EQ (job->limits[RLIMIT_RTPRIO]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_RTPRIO]->rlim_max, 20); nih_free (job); } /* Check that the limit sigpending stanza sets the RLIMIT_SIGPENDING * resource. */ TEST_FEATURE ("with sigpending limit"); strcpy (buf, "limit sigpending 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_SIGPENDING], job); TEST_EQ (job->limits[RLIMIT_SIGPENDING]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_SIGPENDING]->rlim_max, 20); nih_free (job); } /* Check that the limit stack stanza sets the RLIMIT_STACK resource. */ TEST_FEATURE ("with stack limit"); strcpy (buf, "limit stack 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_STACK], job); TEST_EQ (job->limits[RLIMIT_STACK]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_STACK]->rlim_max, 20); nih_free (job); } /* Check that multiple limit stanzas are permitted provided they * refer to different resources, all are set. */ TEST_FEATURE ("with multiple limits"); strcpy (buf, "limit core 10 20\n"); strcat (buf, "limit cpu 15 30\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_CORE], job); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_max, 20); TEST_ALLOC_PARENT (job->limits[RLIMIT_CPU], job); TEST_EQ (job->limits[RLIMIT_CPU]->rlim_cur, 15); TEST_EQ (job->limits[RLIMIT_CPU]->rlim_max, 30); nih_free (job); } /* Check that the last of multiple stanzas for the same limit is used. */ TEST_FEATURE ("with multiple of a single limit"); strcpy (buf, "limit core 5 10\n"); strcat (buf, "limit core 10 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_CORE], job); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_max, 20); nih_free (job); } /* Check that the hard resource limit can be set to unlimited with * a special argument of that name */ TEST_FEATURE ("with unlimited hard limit"); strcpy (buf, "limit core 10 unlimited\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_CORE], job); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_cur, 10); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_max, RLIM_INFINITY); nih_free (job); } /* Check that the soft resource limit can be set to unlimited with * a special argument of that name */ TEST_FEATURE ("with unlimited soft limit"); strcpy (buf, "limit core unlimited 20\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->limits[RLIMIT_CORE], job); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_cur, RLIM_INFINITY); TEST_EQ (job->limits[RLIMIT_CORE]->rlim_max, 20); nih_free (job); } /* Check that a limit stanza with the soft argument but no hard value * results in a syntax error. */ TEST_FEATURE ("with missing hard limit"); strcpy (buf, "limit core 10\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with no soft value results in a * syntax error. */ TEST_FEATURE ("with missing soft limit"); strcpy (buf, "limit core\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 10); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with an unknown resource name results * in a syntax error. */ TEST_FEATURE ("with unknown resource type"); strcpy (buf, "limit foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNKNOWN_STANZA); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with no resource name results in a * syntax error. */ TEST_FEATURE ("with missing resource type"); strcpy (buf, "limit\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with a non-integer hard value * argument results in a syntax error. */ TEST_FEATURE ("with non-integer hard value argument"); strcpy (buf, "limit core 10 foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with a non-integer soft value * argument results in a syntax error. */ TEST_FEATURE ("with non-integer soft value argument"); strcpy (buf, "limit core foo 20\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 11); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with a too-large hard value * argument results in a syntax error. */ TEST_FEATURE ("with too-large hard value argument"); strcpy (buf, "limit core 10 20000000000000000000\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with a too-large soft value * argument results in a syntax error. */ TEST_FEATURE ("with too-large soft value argument"); strcpy (buf, "limit core 20000000000000000000 20\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 11); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with a partially numeric hard value * argument results in a syntax error. */ TEST_FEATURE ("with alphanumeric hard value argument"); strcpy (buf, "limit core 10 99foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 14); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with a partially numeric soft value * argument results in a syntax error. */ TEST_FEATURE ("with alphanumeric soft value argument"); strcpy (buf, "limit core 99foo 20\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, PARSE_ILLEGAL_LIMIT); TEST_EQ (pos, 11); TEST_EQ (lineno, 1); nih_free (err); /* Check that a limit stanza with an extra argument results * in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "limit core 10 20 foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 17); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_chroot (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_chroot"); /* Check that a chroot stanza with an argument results in it * being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "chroot /chroot/daemon\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->chroot, job); TEST_EQ_STR (job->chroot, "/chroot/daemon"); nih_free (job); } /* Check that the last of multiple chroot stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "chroot /var/daemon\n"); strcat (buf, "chroot /chroot/daemon\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->chroot, job); TEST_EQ_STR (job->chroot, "/chroot/daemon"); nih_free (job); } /* Check that a chroot stanza without an argument results in * a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "chroot\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a chroot stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "chroot /chroot/daemon foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 22); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_chdir (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_chdir"); /* Check that a chdir stanza with an argument results in it * being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "chdir /var/lib/daemon\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->chdir, job); TEST_EQ_STR (job->chdir, "/var/lib/daemon"); nih_free (job); } /* Check that the last of multiple chdir stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "chdir /var/daemon\n"); strcat (buf, "chdir /var/lib/daemon\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->chdir, job); TEST_EQ_STR (job->chdir, "/var/lib/daemon"); nih_free (job); } /* Check that a chdir stanza without an argument results in * a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "chdir\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a chdir stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "chdir /var/lib/daemon foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 22); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_setuid (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_setuid"); /* Check that a setuid stanza with an argument results in it * being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "setuid www-data\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->setuid, job); TEST_EQ_STR (job->setuid, "www-data"); nih_free (job); } /* Check that the last of multiple setuid stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "setuid www-data\n"); strcat (buf, "setuid pulse\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->setuid, job); TEST_EQ_STR (job->setuid, "pulse"); nih_free (job); } /* Check that a setuid stanza without an argument results in * a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "setuid\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a setuid stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "setuid www-data foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 16); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_setgid (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_setgid"); /* Check that a setgid stanza with an argument results in it * being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "setgid kvm\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->setgid, job); TEST_EQ_STR (job->setgid, "kvm"); nih_free (job); } /* Check that the last of multiple setgid stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "setgid kvm\n"); strcat (buf, "setgid fuse\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->setgid, job); TEST_EQ_STR (job->setgid, "fuse"); nih_free (job); } /* Check that a setgid stanza without an argument results in * a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "setgid\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 6); TEST_EQ (lineno, 1); nih_free (err); /* Check that a setgid stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "setgid kvm foo\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 11); TEST_EQ (lineno, 1); nih_free (err); } void test_stanza_usage (void) { JobClass*job; NihError *err; size_t pos, lineno; char buf[1024]; TEST_FUNCTION ("stanza_usage"); /* Check that a usage stanza with an argument results in it * being stored in the job. */ TEST_FEATURE ("with single argument"); strcpy (buf, "usage \"stanza usage test message\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 2); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->usage, job); TEST_EQ_STR (job->usage, "stanza usage test message"); nih_free (job); } /* Check that the last of multiple usage stanzas is used. */ TEST_FEATURE ("with multiple stanzas"); strcpy (buf, "usage \"stanza usage original\"\n"); strcat (buf, "usage \"stanza usage test message\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_EQ (pos, strlen (buf)); TEST_EQ (lineno, 3); TEST_ALLOC_SIZE (job, sizeof (JobClass)); TEST_ALLOC_PARENT (job->usage, job); TEST_EQ_STR (job->usage, "stanza usage test message"); nih_free (job); } /* Check that a usage stanza without an argument results in * a syntax error. */ TEST_FEATURE ("with missing argument"); strcpy (buf, "usage\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); TEST_EQ (pos, 5); TEST_EQ (lineno, 1); nih_free (err); /* Check that a usage stanza with an extra second argument * results in a syntax error. */ TEST_FEATURE ("with extra argument"); strcpy (buf, "usage stanza usage test message\n"); pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, strlen (buf), &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_UNEXPECTED_TOKEN); TEST_EQ (pos, 13); TEST_EQ (lineno, 1); nih_free (err); } #ifdef ENABLE_CGROUPS void test_stanza_cgroup (void) { JobClass *job; NihError *err; CGroup *cgroup; CGroupName *cgname; CGroupSetting *setting; size_t pos; size_t lineno; char buf[1024]; int len; size_t count; TEST_FUNCTION ("stanza_cgroup"); TEST_FEATURE ("no arguments rejected"); pos = 0; lineno = 1; len = sprintf (buf, "cgroup\n"); job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, NIH_CONFIG_EXPECTED_TOKEN); /* Don't count NL */ TEST_EQ (pos, (size_t)len-1); TEST_EQ (lineno, 1); nih_free (err); TEST_FEATURE ("single argument (controller) accepted"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; len = sprintf (buf, "cgroup perf_event\n"); job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "$UPSTART_CGROUP"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("$UPSTART_CGROUP")); TEST_LIST_EMPTY (&cgname->settings); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 2); nih_free (job); } TEST_FEATURE ("2 arguments (controller + unquoted name) accepted"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; len = sprintf (buf, "cgroup perf_event foo\n"); job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "foo"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo")); TEST_LIST_EMPTY (&cgname->settings); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 2); nih_free (job); } TEST_FEATURE ("2 arguments (controller + quoted name) accepted"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; len = sprintf (buf, "cgroup perf_event \"foo bar\"\n"); job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "foo bar"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo bar")); TEST_LIST_EMPTY (&cgname->settings); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 2); nih_free (job); } TEST_FEATURE ("3 arguments (controller, key and value) accepted"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; len = sprintf (buf, "cgroup perf_event key1 value1\n"); job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "$UPSTART_CGROUP"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("$UPSTART_CGROUP")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 1); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key1"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key1")); TEST_EQ_STR (setting->value, "value1"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("value1")); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 2); nih_free (job); } TEST_FEATURE ("4 arguments (controller + unquoted name, key and value) accepted"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; len = sprintf (buf, "cgroup perf_event foo key1 value1\n"); job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "foo"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 1); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key1"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key1")); TEST_EQ_STR (setting->value, "value1"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("value1")); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 2); nih_free (job); } TEST_FEATURE ("4 arguments (controller + quoted name, unquoted key and quoted value) accepted"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; len = sprintf (buf, "cgroup perf_event \"a silly name\" key1 \"hello world\"\n"); job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "a silly name"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 1); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key1"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key1")); TEST_EQ_STR (setting->value, "hello world"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("hello world")); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 2); nih_free (job); } /* FIXME: variables are only expanded on job start so cannot * validate. */ TEST_FEATURE ("name with embedded variable is accepted"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; len = sprintf (buf, "cgroup perf_event \"$VARIABLE\" key value\n"); job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "$VARIABLE"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("$VARIABLE")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 1); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key")); TEST_EQ_STR (setting->value, "value"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("value")); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 2); nih_free (job); } TEST_FEATURE ("duplicate stanza is ignored"); len = sprintf (buf, "cgroup perf_event foo key1 value1\n" "cgroup perf_event foo key1 value1\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "foo"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 1); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key1"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key1")); TEST_EQ_STR (setting->value, "value1"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("value1")); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 3); nih_free (job); } TEST_FEATURE ("duplicate equivalent stanza is ignored"); len = sprintf (buf, "cgroup perf_event foo \"key1\" value1\n" "cgroup perf_event foo key1 \"value1\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "foo"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 1); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key1"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key1")); TEST_EQ_STR (setting->value, "value1"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("value1")); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 3); nih_free (job); } TEST_FEATURE ("multiple names per controller are accepted"); len = sprintf (buf, "cgroup perf_event foo key1 value1\n" "cgroup perf_event bar key2 value2\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 2); /* first */ cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "foo"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 1); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key1"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key1")); TEST_EQ_STR (setting->value, "value1"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("value1")); /* second */ cgname = (CGroupName *)test_list_get_index (&cgroup->names, 1); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "bar"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("bar")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 1); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key2"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key2")); TEST_EQ_STR (setting->value, "value2"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("value2")); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 3); nih_free (job); } TEST_FEATURE ("multiple keys per controller name are accepted"); len = sprintf (buf, "cgroup perf_event foo key1 value1\n" "cgroup perf_event foo key2 \"value2\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "foo"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 2); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key1"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key1")); TEST_EQ_STR (setting->value, "value1"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("value1")); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 1); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key2"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key2")); TEST_EQ_STR (setting->value, "value2"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("value2")); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 3); nih_free (job); } TEST_FEATURE ("new stanza overrides old arguments"); /* value saved for key1 should be "hello world", not "bar" */ len = sprintf (buf, "cgroup perf_event foo key1 bar\n" "cgroup perf_event foo key1 \"hello world\"\n"); TEST_ALLOC_FAIL { pos = 0; lineno = 1; job = parse_job (NULL, NULL, NULL, "test", buf, len, &pos, &lineno); if (test_alloc_failed) { TEST_EQ_P (job, NULL); err = nih_error_get (); TEST_EQ (err->number, ENOMEM); nih_free (err); continue; } TEST_NE_P (job, NULL); TEST_LIST_NOT_EMPTY (&job->cgroups); count = test_list_count (&job->cgroups); TEST_EQ (count, 1); cgroup = (CGroup *)test_list_get_index (&job->cgroups, 0); TEST_NE_P (cgroup, NULL); TEST_ALLOC_PARENT (cgroup, job); TEST_ALLOC_SIZE (cgroup, sizeof (CGroup)); TEST_EQ_STR (cgroup->controller, "perf_event"); TEST_ALLOC_PARENT (cgroup->controller, cgroup); TEST_ALLOC_SIZE (cgroup->controller, 1+strlen ("perf_event")); count = test_list_count (&cgroup->names); TEST_EQ (count, 1); cgname = (CGroupName *)test_list_get_index (&cgroup->names, 0); TEST_NE_P (cgname, NULL); TEST_ALLOC_PARENT (cgname, cgroup); TEST_ALLOC_SIZE (cgname, sizeof (CGroupName)); TEST_EQ_STR (cgname->name, "foo"); TEST_ALLOC_PARENT (cgname->name, cgname); TEST_ALLOC_SIZE (cgname->name, 1+strlen ("foo")); TEST_LIST_NOT_EMPTY (&cgname->settings); count = test_list_count (&cgname->settings); TEST_EQ (count, 1); setting = (CGroupSetting *)test_list_get_index (&cgname->settings, 0); TEST_NE_P (setting, NULL); TEST_ALLOC_PARENT (setting, cgname); TEST_ALLOC_SIZE (setting, sizeof (CGroupSetting)); TEST_EQ_STR (setting->key, "key1"); TEST_ALLOC_PARENT (setting->key, setting); TEST_ALLOC_SIZE (setting->key, 1+strlen ("key1")); TEST_EQ_STR (setting->value, "hello world"); TEST_ALLOC_PARENT (setting->value, setting); TEST_ALLOC_SIZE (setting->value, 1+strlen ("hello world")); TEST_EQ (pos, (size_t)len); TEST_EQ (lineno, 3); nih_free (job); } } #endif /* ENABLE_CGROUPS */ int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); test_parse_job (); test_stanza_instance (); test_stanza_description (); test_stanza_version (); test_stanza_author (); test_stanza_env (); test_stanza_export (); test_stanza_start (); test_stanza_stop (); test_stanza_emits (); test_stanza_manual (); test_stanza_exec (); test_stanza_script (); test_stanza_apparmor (); test_stanza_pre_start (); test_stanza_post_start (); test_stanza_pre_stop (); test_stanza_post_stop (); test_stanza_expect (); test_stanza_task (); test_stanza_kill (); test_stanza_reload (); test_stanza_respawn (); test_stanza_normal (); test_stanza_console (); test_stanza_umask (); test_stanza_nice (); test_stanza_oom (); test_stanza_limit (); test_stanza_chroot (); test_stanza_chdir (); test_stanza_setuid (); test_stanza_setgid (); test_stanza_usage (); #ifdef ENABLE_CGROUPS test_stanza_cgroup (); #endif /* ENABLE_CGROUPS */ return 0; } upstart-1.13.2/init/tests/test_state.c0000664000175000017500000035445212373101356014671 00000000000000/* upstart * * test_state.c - test suite for init/state.c and other * associated serialisation and deserialisation routines. * * Copyright © 2012-2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "state.h" #include "session.h" #include "process.h" #include "event.h" #include "event_operator.h" #include "environ.h" #include "conf.h" #include "job_class.h" #include "job.h" #include "log.h" #include "blocked.h" #include "control.h" #include "test_util_common.h" #include "test_util.h" #ifdef ENABLE_CGROUPS #include "cgroup.h" extern char *cgroup_manager_address; #endif /* ENABLE_CGROUPS */ #ifndef TEST_DATA_DIR #error ERROR: TEST_DATA_DIR not defined #endif /* These functions are 'protected'. * * The test code needs access, but they cannot be public due to * header-file complications. */ json_object * state_serialise_blocked (const Blocked *blocked) __attribute__ ((warn_unused_result)); Blocked * state_deserialise_blocked (void *parent, json_object *json, NihList *list) __attribute__ ((warn_unused_result)); /** * AlreadySeen: * * Used to allow objects that directly or indirectly reference * another to be inspected and compared without causing infinite * recursion. * * For example, an Event can reference a Job via its event->blocking list. * But the Job referenced by the Blocked object will have its job->blocker * set to the original event. If inspecting the original Event, we can * pass ALREADY_SEEN_EVENT such that we can detect that no further * operations are required at the point we consider job->blocker. * * If ALREADY_SEEN_SET is specified, the first function that understands * this type will _change_ the value to one of the other values based on * the action the function performs (for example, job_diff() changes * ALREADY_SEEN_SET to ALREADY_SEEN_JOB and conf_source_diff() changes * ALREADY_SEEN_SET to ALREADY_SEEN_SOURCE). **/ typedef enum { ALREADY_SEEN_SET, ALREADY_SEEN_EVENT, ALREADY_SEEN_SOURCE, ALREADY_SEEN_FILE, ALREADY_SEEN_BLOCKED, ALREADY_SEEN_JOB, ALREADY_SEEN_LAST } AlreadySeen; /** * Foo: * * Test structure containing simple, opaque and * known aggregate types. **/ typedef struct foo { int32_t int32; int64_t int64; char *str; pid_t pid; struct rlimit limit; struct rlimit *limits[RLIMIT_NLIMITS]; char **env; char **array; Process **process; } Foo; int session_diff (const Session *a, const Session *b) __attribute__ ((warn_unused_result)); int process_diff (const Process *a, const Process *b) __attribute__ ((warn_unused_result)); int event_diff (const Event *a, const Event *b, AlreadySeen seen) __attribute__ ((warn_unused_result)); int nih_timer_diff (const NihTimer *a, const NihTimer *b) __attribute__ ((warn_unused_result)); int log_diff (const Log *a, const Log *b) __attribute__ ((warn_unused_result)); int rlimit_diff (const struct rlimit *a, const struct rlimit *b) __attribute__ ((warn_unused_result)); int job_class_diff (const JobClass *a, const JobClass *b, AlreadySeen seen, int check_jobs) __attribute__ ((warn_unused_result)); int job_diff (const Job *a, const Job *b, AlreadySeen seen, int check_class) __attribute__ ((warn_unused_result)); int blocking_diff (const NihList *a, const NihList *b, AlreadySeen seen) __attribute__ ((warn_unused_result)); int blocked_diff (const Blocked *a, const Blocked *b, AlreadySeen seen) __attribute__ ((warn_unused_result)); void test_upstart1_6_upgrade (const char *path); void test_session_upgrade_midflight (const char *path); void test_session_upgrade_exists (const char *original_path); void test_session_upgrade_stale (const char *path); void test_upstart1_8_upgrade (const char *path); void test_upstart_pre_security_upgrade (const char *path); void test_upstart_with_apparmor_upgrade (const char *path); void test_upstart_full_serialise_without_apparmor_upgrade (const char *path); void test_upstart_full_serialise_with_apparmor_upgrade (const char *path); void test_reload_signal_state (const char *path); void test_job_environ_upgrade (const char *path); void test_cgroup_and_process_data_state (const char *path); ConfSource * conf_source_from_path (const char *path, ConfSourceType type, const Session *session) __attribute__ ((warn_unused_result)); int conf_source_diff (const ConfSource *a, const ConfSource *b, AlreadySeen seen) __attribute__ ((warn_unused_result)); int conf_file_diff (const ConfFile *a, const ConfFile *b, AlreadySeen seen) __attribute__ ((warn_unused_result)); /** * TestDataFile: * * @filename: basename of data file, * @func: function to run to test @filename. * * Representation of a JSON data file used for ensuring that the current * version of Upstart is able to deserialise all previous JSON data file * format versions. * * @func returns nothing so is expected to assert on any error. **/ typedef struct test_data_file { char *filename; void (*func) (const char *path); } TestDataFile; /** * test_data_files: * * Array of data files to test. **/ TestDataFile test_data_files[] = { { "upstart-1.6.json", test_upstart1_6_upgrade }, { "upstart-1.8.json", test_upstart1_8_upgrade }, { "upstart-pre-security.json", test_upstart_pre_security_upgrade }, { "upstart-1.8+apparmor.json", test_upstart_with_apparmor_upgrade }, { "upstart-1.8+full_serialisation-apparmor.json", test_upstart_full_serialise_without_apparmor_upgrade }, { "upstart-1.8+full_serialisation+apparmor.json", test_upstart_full_serialise_with_apparmor_upgrade }, { "upstart-session.json", test_session_upgrade_midflight }, { "upstart-session2.json", test_session_upgrade_exists }, { "upstart-session-infinity.json", test_session_upgrade_stale }, { "upstart-1.9.json", test_reload_signal_state }, { "upstart-1.11.json", test_job_environ_upgrade }, { "upstart-1.13.json", test_cgroup_and_process_data_state }, { NULL, NULL } }; /* Data with some embedded nulls */ const char test_data[] = { 'h', 'e', 'l', 'l', 'o', 0x0, 0x0, 0x0, ' ', 'w', 'o', 'r', 'l', 'd', '\n', '\r', '\0' }; char *strings[] = { "", NULL, "a", "123", "FOO=BAR", "hello\n\t\aworld", "foo bar", "\\\a\b\f\n\r\t\v", "\"'$*&()[]{}-_=+/?@':;>.<,~#" }; int32_t values32[] = {INT32_MIN, -1, 0, 1, INT32_MAX}; int64_t values64[] = {INT64_MIN, -1, 0, 1, INT64_MAX}; const Process test_procs[] = { { 0, "echo hello" }, { 1, "echo hello" } }; rlim_t rlimit_values[] = { 0, 1, 2, 3, 7, RLIM_INFINITY }; /** * session_diff: * @a: first Session, * @b: second Session. * * Compare two Session objects for equivalence. * * Returns: 0 if @a and @b are identical (may be NULL), * else 1. **/ int session_diff (const Session *a, const Session *b) { if ((a == b) && !a) return 0; if (!a || !b) goto fail; if (obj_string_check (a, b, chroot)) goto fail; if (obj_string_check (a, b, conf_path)) goto fail; return 0; fail: return 1; } /** * process_diff: * @a: first Process, * @b: second Process. * * Compare two Process objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int process_diff (const Process *a, const Process *b) { if ((a == b) && !a) return 0; if (!a || !b) goto fail; if (obj_num_check (a, b, script)) goto fail; if (obj_string_check (a, b, command)) goto fail; return 0; fail: return 1; } /** * event_diff: * @a: first Event, * @b: second Event, * @seen: object type that has already been seen. * * Compare two Event objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int event_diff (const Event *a, const Event *b, AlreadySeen seen) { nih_local char *env_a = NULL; nih_local char *env_b = NULL; if (seen == ALREADY_SEEN_EVENT) return 0; if (seen == ALREADY_SEEN_SET) seen = ALREADY_SEEN_EVENT; if ((a == b) && !a) return 0; if (!a || !b) goto fail; if (session_diff (a->session, b->session)) goto fail; if (obj_string_check (a, b, name)) goto fail; env_a = state_collapse_env ((const char **)a->env); env_b = state_collapse_env ((const char **)b->env); if (string_check (env_a, env_b)) goto fail; if (obj_num_check (a, b, fd)) goto fail; if (obj_num_check (a, b, progress)) goto fail; if (obj_num_check (a, b, failed)) goto fail; if (obj_num_check (a, b, blockers)) goto fail; if (blocking_diff (&a->blocking, &b->blocking, seen)) goto fail; return 0; fail: return 1; } /** * nih_timer_diff: * @a: first NihTimer, * @b: second NihTimer. * * Compare two NihTimer objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int nih_timer_diff (const NihTimer *a, const NihTimer *b) { if ((a == b) && !a) return 0; if (!a || !b) goto fail; if (obj_num_check (a, b, timeout)) goto fail; if (obj_num_check (a, b, due)) goto fail; return 0; fail: return 1; } /** * log_diff: * @a: first Log, * @b: second Log. * * Compare two Log objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int log_diff (const Log *a, const Log *b) { if (!a || !b) goto fail; if (obj_num_check (a, b, fd)) goto fail; if (obj_string_check (a, b, path)) goto fail; if (a->io && b->io) { if (a->io->watch && b->io->watch) { if (obj_num_check ((a->io->watch), (b->io->watch), fd)) goto fail; } else if (a->io->watch || b->io->watch) goto fail; } else if (a->io || b->io) goto fail; if (a->unflushed && b->unflushed) { if (obj_num_check (a->unflushed, b->unflushed, len)) goto fail; if (obj_string_check (a->unflushed, b->unflushed, buf)) goto fail; } else if (a->unflushed || b->unflushed) goto fail; if (obj_num_check (a, b, uid)) goto fail; if (obj_num_check (a, b, detached)) goto fail; if (obj_num_check (a, b, remote_closed)) goto fail; if (obj_num_check (a, b, open_errno)) goto fail; return 0; fail: return 1; } /** * rlimit_diff: * @a: first rlimit, * @b: second rlimit. * * Compare two rlimit structs for equivalence. * * Returns: 0 if @a and @b are identical (may be NULL), * else 1. **/ int rlimit_diff (const struct rlimit *a, const struct rlimit *b) { if ((a == b) && !a) return 0; if (!a || !b) goto fail; if (obj_num_check (a, b, rlim_cur)) goto fail; if (obj_num_check (a, b, rlim_max)) goto fail; return 0; fail: return 1; } /** * job_class_diff: * @a: first Job, * @b: second Job, * @seen: object type that has already been seen, * @check_jobs: if TRUE, consider job instances. * * Compare two JobClass objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int job_class_diff (const JobClass *a, const JobClass *b, AlreadySeen seen, int check_jobs) { size_t i; nih_local char *env_a = NULL; nih_local char *env_b = NULL; nih_local char *export_a = NULL; nih_local char *export_b = NULL; nih_local char *condition_a = NULL; nih_local char *condition_b = NULL; nih_local char *emits_a = NULL; nih_local char *emits_b = NULL; if ((a == b) && !a) return 0; if (!a || !b) goto fail; if (obj_string_check (a, b, name)) goto fail; if (obj_string_check (a, b, path)) goto fail; if (session_diff (a->session, b->session)) goto fail; if (obj_string_check (a, b, instance)) goto fail; if (obj_num_check (a->instances, b->instances, size)) goto fail; if (check_jobs) { TEST_TWO_HASHES_FOREACH (a->instances, b->instances, iter1, iter2) { Job *job1 = (Job *)iter1; Job *job2 = (Job *)iter2; if (job_diff (job1, job2, seen, FALSE)) goto fail; } } if (obj_string_check (a, b, description)) goto fail; if (obj_string_check (a, b, author)) goto fail; if (obj_string_check (a, b, version)) goto fail; env_a = state_collapse_env ((const char **)a->env); env_b = state_collapse_env ((const char **)b->env); if (string_check (env_a, env_b)) goto fail; export_a = state_collapse_env ((const char **)a->export); export_b = state_collapse_env ((const char **)b->export); if (string_check (export_a, export_b)) goto fail; if (event_operator_diff (a->start_on, b->start_on)) goto fail; /* Check string values too for complete overkill :) */ if (a->start_on) condition_a = event_operator_collapse (a->start_on); if (b->start_on) condition_b = event_operator_collapse (b->start_on); if (string_check (condition_a, condition_b)) goto fail; if (a->stop_on) condition_a = event_operator_collapse (a->stop_on); if (b->stop_on) condition_b = event_operator_collapse (b->stop_on); if (string_check (condition_a, condition_b)) goto fail; emits_a = state_collapse_env ((const char **)a->emits); emits_b = state_collapse_env ((const char **)b->emits); if (string_check (emits_a, emits_b)) goto fail; for (i = 0; i < PROCESS_LAST; i++) { if (a->process[i] && b->process[i]) assert0 (process_diff (a->process[i], b->process[i])); else if (a->process[i] || b->process[i]) goto fail; } if (obj_num_check (a, b, expect)) goto fail; if (obj_num_check (a, b, task)) goto fail; if (obj_num_check (a, b, kill_timeout)) goto fail; if (obj_num_check (a, b, kill_signal)) goto fail; if (obj_num_check (a, b, reload_signal)) goto fail; if (obj_num_check (a, b, respawn)) goto fail; if (obj_num_check (a, b, respawn_limit)) goto fail; if (obj_num_check (a, b, respawn_interval)) goto fail; if (obj_num_check (a, b, normalexit_len)) goto fail; if (a->normalexit_len) { for (i = 0; i < a->normalexit_len; i++) { if (a->normalexit[i] != b->normalexit[i]) goto fail; } } if (obj_num_check (a, b, console)) goto fail; if (obj_num_check (a, b, umask)) goto fail; if (obj_num_check (a, b, nice)) goto fail; if (obj_num_check (a, b, oom_score_adj)) goto fail; for (i = 0; i < RLIMIT_NLIMITS; i++) { if (! a->limits[i] && ! b->limits[i]) continue; if (rlimit_diff (a->limits[i], b->limits[i])) goto fail; } if (obj_string_check (a, b, chroot)) goto fail; if (obj_string_check (a, b, chdir)) goto fail; if (obj_string_check (a, b, setuid)) goto fail; if (obj_string_check (a, b, setgid)) goto fail; if (obj_num_check (a, b, deleted)) goto fail; if (obj_num_check (a, b, debug)) goto fail; if (obj_string_check (a, b, usage)) goto fail; if (obj_string_check (a, b, apparmor_switch)) goto fail; return 0; fail: return 1; } /** * job_diff: * @a: first Job, * @b: second Job, * @seen: object type that has already been seen, * @check_class: if TRUE, consider parent_class. * * Compare two Job objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int job_diff (const Job *a, const Job *b, AlreadySeen seen, int check_class) { size_t i; nih_local char *env_a = NULL; nih_local char *env_b = NULL; nih_local char *condition_a = NULL; nih_local char *condition_b = NULL; if (seen == ALREADY_SEEN_JOB) return 0; if (seen == ALREADY_SEEN_SET) seen = ALREADY_SEEN_JOB; if ((a == b) && !a) return 0; if (!a || !b) goto fail; if (obj_string_check (a, b, name)) goto fail; if (check_class) { if (job_class_diff (a->class, b->class, seen, FALSE)) goto fail; } if (obj_string_check (a, b, path)) goto fail; if (obj_num_check (a, b, goal)) goto fail; if (obj_num_check (a, b, state)) goto fail; env_a = state_collapse_env ((const char **)a->env); env_b = state_collapse_env ((const char **)b->env); if (string_check (env_a, env_b)) goto fail; env_a = state_collapse_env ((const char **)a->start_env); env_b = state_collapse_env ((const char **)b->start_env); if (string_check (env_a, env_b)) goto fail; env_a = state_collapse_env ((const char **)a->stop_env); env_b = state_collapse_env ((const char **)b->stop_env); if (string_check (env_a, env_b)) goto fail; if (a->stop_on) condition_a = event_operator_collapse (a->stop_on); if (b->stop_on) condition_b = event_operator_collapse (b->stop_on); if (string_check (condition_a, condition_b)) goto fail; if (obj_num_check (a, b, num_fds)) goto fail; for (i = 0; i < a->num_fds; i++) { if (a->fds[i] != b->fds[i]) goto fail; } for (i = 0; i < PROCESS_LAST; i++) { if (a->pid[i] != b->pid[i]) goto fail; } assert0 (event_diff (a->blocker, b->blocker, TRUE)); if (blocking_diff (&a->blocking, &b->blocking, seen)) goto fail; if (nih_timer_diff (a->kill_timer, b->kill_timer)) goto fail; if (obj_num_check (a, b, kill_process)) goto fail; if (obj_num_check (a, b, failed)) goto fail; if (obj_num_check (a, b, failed_process)) goto fail; if (obj_num_check (a, b, exit_status)) goto fail; if (obj_num_check (a, b, respawn_time)) goto fail; if (obj_num_check (a, b, respawn_count)) goto fail; if (obj_num_check (a, b, trace_forks)) goto fail; if (obj_num_check (a, b, trace_state)) goto fail; for (i = 0; i < PROCESS_LAST; i++) { if (! a->log[i] && ! b->log[i]) continue; if (log_diff (a->log[i], b->log[i])) goto fail; } return 0; fail: return 1; } /** * blocking_diff: * @a: first list of Blocked objects, * @b: second list of Blocked objects, * @seen: object type that has already been seen. * * Compare two lists of Blocked objects. * * Returns: 0 if @a and @b are identical, else 1. **/ int blocking_diff (const NihList *a, const NihList *b, AlreadySeen seen) { if ((a == b) && !a) return 0; if (!a || !b) goto fail; /* walk both lists together */ TEST_TWO_LISTS_FOREACH (a, b, iter_a, iter_b) { Blocked *blocked_a = (Blocked *)iter_a; Blocked *blocked_b = (Blocked *)iter_b; if (blocked_diff (blocked_a, blocked_b, seen)) goto fail; } return 0; fail: return 1; } /** * blocked_diff: * @a: first Blocked, * @b: second Blocked, * @seen: object type that has already been seen. * * Compare two Blocked objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int blocked_diff (const Blocked *a, const Blocked *b, AlreadySeen seen) { const char *enum_str_a; const char *enum_str_b; int ret = 0; if (seen == ALREADY_SEEN_BLOCKED) return 0; if (seen == ALREADY_SEEN_SET) seen = ALREADY_SEEN_BLOCKED; if ((a == b) && !a) return 0; if (!a || !b) goto fail; if (obj_num_check (a, b, type)) goto fail; enum_str_a = blocked_type_enum_to_str (a->type); enum_str_b = blocked_type_enum_to_str (b->type); if (string_check (enum_str_a, enum_str_b)) goto fail; switch (a->type) { case BLOCKED_JOB: ret = job_diff (a->job, b->job, seen, TRUE); break; case BLOCKED_EVENT: ret = event_diff (a->event, b->event, seen); break; default: /* FIXME: cannot handle D-Bus types yet */ nih_assert_not_reached (); } return ret; fail: return 1; } /** * conf_source_diff: * @a: first ConfSource, * @b: second ConfSource, * @seen: object type that has already been seen. * * Compare two ConfSource objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int conf_source_diff (const ConfSource *a, const ConfSource *b, AlreadySeen seen) { if (seen == ALREADY_SEEN_SOURCE) return 0; if (seen == ALREADY_SEEN_SET) seen = ALREADY_SEEN_SOURCE; if (! a && ! b) return 0; if ((! a && b) || (a && ! b)) goto fail; if (session_diff (a->session, b->session)) goto fail; if (obj_string_check (a, b, path)) goto fail; if (obj_num_check (a, b, type)) goto fail; if (obj_num_check (a, b, flag)) goto fail; TEST_TWO_HASHES_FOREACH (a->files, b->files, iter1, iter2) { ConfFile *file1 = (ConfFile *)iter1; ConfFile *file2 = (ConfFile *)iter2; if (conf_file_diff (file1, file2, seen)) goto fail; } return 0; fail: return 1; } /** * conf_file_diff: * @a: first ConfFile, * @b: second ConfFile, * @seen: object type that has already been seen. * * Compare two ConfFile objects for equivalence. * * Returns: 0 if @a and @b are identical, else 1. **/ int conf_file_diff (const ConfFile *a, const ConfFile *b, AlreadySeen seen) { if (seen == ALREADY_SEEN_FILE) return 0; if (seen == ALREADY_SEEN_SET) seen = ALREADY_SEEN_FILE; if (! a && ! b) return 0; if ((! a && b) || (a && ! b)) goto fail; if (obj_string_check (a, b, path)) goto fail; if (conf_source_diff (a->source, b->source, seen)) goto fail; if (obj_num_check (a, b, flag)) goto fail; if (job_class_diff (a->job, b->job, seen, TRUE)) goto fail; return 0; fail: return 1; } void test_session_serialise (void) { json_object *json; json_object *json_sessions; Session *session1; Session *session2; Session *new_session1; Session *new_session2; int ret; char chroot_path[PATH_MAX]; mode_t old_perms; nih_local char *path = NULL; session_init (); TEST_GROUP ("Session serialisation and deserialisation"); /*******************************/ TEST_FEATURE ("Session deserialisation"); TEST_LIST_EMPTY (sessions); json = json_object_new_object (); TEST_NE_P (json, NULL); /* Create a couple of sessions */ session1 = session_new (NULL, "/abc"); TEST_NE_P (session1, NULL); session1->conf_path = NIH_MUST (nih_strdup (session1, "/def/ghi")); TEST_LIST_NOT_EMPTY (sessions); session2 = session_new (NULL, "/foo"); TEST_NE_P (session2, NULL); session2->conf_path = NIH_MUST (nih_strdup (session2, "/bar/baz")); TEST_FEATURE ("Session serialisation"); /* Convert them to JSON */ json_sessions = session_serialise_all (); TEST_NE_P (json_sessions, NULL); json_object_object_add (json, "sessions", json_sessions); /* Remove the original sessions from the master list (but don't * free them) */ nih_list_remove (&session1->entry); nih_list_remove (&session2->entry); TEST_LIST_EMPTY (sessions); /* Convert the JSON back into Session objects */ ret = session_deserialise_all (json); assert0 (ret); /* free the JSON */ json_object_put (json); TEST_LIST_NOT_EMPTY (sessions); /* Remove the newly-de-serialised Session objects from the * master list. */ new_session1 = (Session *)nih_list_remove (sessions->next); TEST_NE_P (new_session1, NULL); new_session2 = (Session *)nih_list_remove (sessions->next); TEST_NE_P (new_session2, NULL); TEST_LIST_EMPTY (sessions); /* Compare original and new session objects for equivalence */ assert0 (session_diff (session1, new_session1)); assert0 (session_diff (session2, new_session2)); /* Clean up */ nih_free (session1); nih_free (session2); nih_free (new_session1); nih_free (new_session2); /*******************************/ TEST_FEATURE ("Ensure session deserialisation does not create JobClasses"); clean_env (); TEST_LIST_EMPTY (sessions); TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (conf_sources); old_perms = umask (0); TEST_FILENAME (chroot_path); assert0 (mkdir (chroot_path, 0755)); path = NIH_MUST (nih_sprintf (NULL, "%s/etc", chroot_path)); assert0 (mkdir (path, 0755)); path = NIH_MUST (nih_sprintf (NULL, "%s/etc/init", chroot_path)); assert0 (mkdir (path, 0755)); CREATE_FILE (path, "foo.conf", "manual"); session1 = session_new (NULL, chroot_path); TEST_NE_P (session1, NULL); session1->conf_path = NIH_MUST (nih_sprintf (session1, "%s//etc/init", chroot_path)); TEST_LIST_NOT_EMPTY (sessions); TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (conf_sources); json = json_object_new_object (); TEST_NE_P (json, NULL); json_sessions = session_serialise_all (); TEST_NE_P (json_sessions, NULL); json_object_object_add (json, "sessions", json_sessions); /* Remove the session from the master list (but don't free it) */ nih_list_remove (&session1->entry); TEST_LIST_EMPTY (sessions); clean_env (); /* Convert the JSON back into Session objects */ ret = session_deserialise_all (json); assert0 (ret); TEST_LIST_NOT_EMPTY (sessions); /* Ensure no ConfSources, ConfFiles or JobClasses were created * as part of the session deserialisation. */ TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (conf_sources); session2 = (Session *)nih_list_remove (sessions->next); assert0 (session_diff (session1, session2)); /* Clean up */ /* free the JSON */ json_object_put (json); DELETE_FILE (path, "foo.conf"); path = NIH_MUST (nih_sprintf (NULL, "%s/etc/init", chroot_path)); assert0 (rmdir (path)); path = NIH_MUST (nih_sprintf (NULL, "%s/etc", chroot_path)); assert0 (rmdir (path)); assert0 (rmdir (chroot_path)); /* Restore */ umask (old_perms); } void run_process_test (const Process *proc) { json_object *json; nih_local Process *process = NULL; nih_local Process *new_process = NULL; nih_local char *feature = NULL; nih_assert (proc); process = process_new (NULL); TEST_NE_P (process, NULL); process->script = proc->script; process->command = NIH_MUST (nih_strdup (process, proc->command)); feature = nih_sprintf (NULL, "Process serialisation with %sscript and %scommand", proc->script ? "" : "no ", proc->command ? "" : "no "); TEST_FEATURE (feature); json = process_serialise (process); TEST_NE_P (json, NULL); feature = nih_sprintf (NULL, "Process deserialisation with %sscript and %scommand", proc->script ? "" : "no ", proc->command ? "" : "no "); TEST_FEATURE (feature); new_process = process_deserialise (json, NULL); TEST_NE_P (new_process, NULL); /* Compare original and new objects */ assert0 (process_diff (process, new_process)); /* free the JSON */ json_object_put (json); } void test_process_serialise (void) { int i; int num; nih_local Foo *foo = NULL; nih_local Foo *new_foo = NULL; json_object *json; json_object *json_processes; TEST_GROUP ("Process serialisation and deserialisation"); /*******************************/ TEST_FEATURE ("single Process serialisation and deserialisation"); num = TEST_ARRAY_SIZE (test_procs); for (i = 0; i < num; i++) run_process_test (&test_procs[i]); /*******************************/ TEST_FEATURE ("array of Processes serialisation and deserialisation"); json = json_object_new_object (); TEST_NE_P (json, NULL); foo = nih_new (NULL, Foo); TEST_NE_P (foo, NULL); new_foo = nih_new (NULL, Foo); TEST_NE_P (new_foo, NULL); foo->process = nih_alloc (foo, sizeof (Process *) * PROCESS_LAST); TEST_NE_P (foo->process, NULL); new_foo->process = nih_alloc (new_foo, sizeof (Process *) * PROCESS_LAST); TEST_NE_P (new_foo->process, NULL); for (i = 0; i < PROCESS_LAST; i++) { foo->process[i] = NULL; new_foo->process[i] = NULL; } foo->process[PROCESS_MAIN] = process_new (foo->process); TEST_NE_P (foo->process[PROCESS_MAIN], NULL); foo->process[PROCESS_MAIN]->script = 1; foo->process[PROCESS_MAIN]->command = NIH_MUST (nih_strdup (foo->process[PROCESS_MAIN], "echo hello !£$%^&*()_+-={}:@~;'#<>?,./")); foo->process[PROCESS_SECURITY] = process_new (foo->process); TEST_NE_P (foo->process[PROCESS_SECURITY], NULL); foo->process[PROCESS_SECURITY]->script = 0; foo->process[PROCESS_SECURITY]->command = NIH_MUST (nih_strdup (foo->process[PROCESS_SECURITY], "/bin/true")); foo->process[PROCESS_PRE_START] = process_new (foo->process); TEST_NE_P (foo->process[PROCESS_PRE_START], NULL); foo->process[PROCESS_PRE_START]->script = 0; foo->process[PROCESS_PRE_START]->command = NIH_MUST (nih_strdup (foo->process[PROCESS_PRE_START], "/bin/echo \"\\\a\b''''''\f\n\r\t\v\"")); foo->process[PROCESS_POST_STOP] = process_new (foo->process); TEST_NE_P (foo->process[PROCESS_POST_STOP], NULL); foo->process[PROCESS_POST_STOP]->script = 0; foo->process[PROCESS_POST_STOP]->command = NIH_MUST (nih_strdup (foo->process[PROCESS_POST_STOP], "/bin/true")); json_processes = process_serialise_all ((const Process const * const * const)foo->process); TEST_NE_P (json_processes, NULL); json_object_object_add (json, "process", json_processes); assert0 (process_deserialise_all (json, new_foo->process, new_foo->process)); for (i = 0; i < PROCESS_LAST; i++) assert0 (process_diff (foo->process[i], new_foo->process[i])); json_object_put (json); /*******************************/ } void test_blocking (void) { nih_local char *json_string = NULL; nih_local char *parent_str = NULL; ConfSource *source = NULL; ConfSource *new_source = NULL; ConfFile *file; ConfFile *new_file; JobClass *class; JobClass *new_class; Job *job; Job *new_job; Event *event; Event *new_event; Blocked *blocked; Blocked *new_blocked; NihList blocked_list; size_t len; json_object *json_blocked; Session *session; Session *new_session; conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_GROUP ("Blocked serialisation and deserialisation"); /*******************************/ TEST_FEATURE ("BLOCKED_JOB serialisation and deserialisation"); nih_list_init (&blocked_list); TEST_LIST_EMPTY (&blocked_list); TEST_LIST_EMPTY (conf_sources); source = conf_source_new (NULL, "/tmp/foo", CONF_JOB_DIR); TEST_NE_P (source, NULL); TEST_LIST_NOT_EMPTY (conf_sources); file = conf_file_new (source, "/tmp/foo/bar.conf"); TEST_NE_P (file, NULL); class = file->job = job_class_new (file, "bar", NULL); TEST_NE_P (class, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); job = job_new (class, ""); TEST_NE_P (job, NULL); parent_str = nih_strdup (NULL, "parent"); TEST_NE_P (parent_str, NULL); blocked = blocked_new (NULL, BLOCKED_JOB, job); TEST_NE_P (blocked, NULL); json_blocked = state_serialise_blocked (blocked); TEST_NE_P (json_blocked, NULL); new_blocked = state_deserialise_blocked (parent_str, json_blocked, &blocked_list); TEST_NE_P (new_blocked, NULL); TEST_LIST_NOT_EMPTY (&blocked_list); assert0 (blocked_diff (blocked, new_blocked, ALREADY_SEEN_SET)); json_object_put (json_blocked); nih_free (source); /*******************************/ TEST_FEATURE ("BLOCKED_EVENT serialisation and deserialisation"); event = event_new (NULL, "event", NULL); TEST_NE_P (event, NULL); nih_list_init (&blocked_list); TEST_LIST_EMPTY (conf_sources); source = conf_source_new (NULL, "/tmp/foo", CONF_JOB_DIR); TEST_NE_P (source, NULL); TEST_LIST_NOT_EMPTY (conf_sources); file = conf_file_new (source, "/tmp/foo/bar.conf"); TEST_NE_P (file, NULL); class = file->job = job_class_new (file, "bar", NULL); TEST_NE_P (class, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); job = job_new (class, ""); TEST_NE_P (job, NULL); TEST_LIST_EMPTY (&job->blocking); blocked = blocked_new (NULL, BLOCKED_EVENT, event); TEST_NE_P (blocked, NULL); nih_list_add (&job->blocking, &blocked->entry); TEST_LIST_NOT_EMPTY (&job->blocking); event->blockers = 1; parent_str = nih_strdup (NULL, "parent"); TEST_NE_P (parent_str, NULL); json_blocked = state_serialise_blocked (blocked); TEST_NE_P (json_blocked, NULL); TEST_LIST_EMPTY (&blocked_list); new_blocked = state_deserialise_blocked (parent_str, json_blocked, &blocked_list); TEST_NE_P (new_blocked, NULL); TEST_LIST_NOT_EMPTY (&blocked_list); assert0 (blocked_diff (blocked, new_blocked, ALREADY_SEEN_SET)); json_object_put (json_blocked); nih_free (source); nih_free (event); /*******************************/ /* Test Upstart 1.6+ behaviour * * The data serialisation format for this version now includes * a "session" entry in the JSON for the blocked job. * * Note that this test is NOT testing whether a JobClass with an * associated Upstart session is handled correctly, it is merely * testing that a JobClass with the NULL session is handled * correctly! */ TEST_FEATURE ("BLOCKED_JOB with JSON session object"); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); event = event_new (NULL, "Christmas", NULL); TEST_NE_P (event, NULL); TEST_LIST_EMPTY (&event->blocking); TEST_LIST_EMPTY (conf_sources); source = conf_source_new (NULL, "/tmp/foo", CONF_JOB_DIR); TEST_NE_P (source, NULL); TEST_LIST_NOT_EMPTY (conf_sources); file = conf_file_new (source, "/tmp/foo/bar.conf"); TEST_NE_P (file, NULL); /* Create class with NULL session */ class = file->job = job_class_new (NULL, "bar", NULL); TEST_NE_P (class, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); job = job_new (class, ""); TEST_NE_P (job, NULL); TEST_HASH_NOT_EMPTY (class->instances); blocked = blocked_new (event, BLOCKED_JOB, job); TEST_NE_P (blocked, NULL); nih_list_add (&event->blocking, &blocked->entry); job->blocker = event; TEST_LIST_NOT_EMPTY (&event->blocking); assert0 (state_to_string (&json_string, &len)); TEST_GT (len, 0); /* ConfSources are now recreated on re-exec, so remove the * original. */ nih_free (source); TEST_LIST_EMPTY (conf_sources); nih_list_remove (&class->entry); nih_list_remove (&event->entry); /* destroying the ConfSource will mark the JobClass as deleted, * so undo that to allow comparison. */ nih_assert (class->deleted); class->deleted = FALSE; TEST_LIST_EMPTY (events); TEST_HASH_EMPTY (job_classes); job_class_environment_clear (); assert0 (state_from_string (json_string)); TEST_LIST_NOT_EMPTY (conf_sources); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_EMPTY (sessions); new_class = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_NE_P (new_class, NULL); nih_list_remove (&new_class->entry); /* Upstart 1.6 can only deserialise the NULL session */ TEST_EQ_P (class->session, NULL); new_event = (Event *)nih_list_remove (events->next); TEST_LIST_EMPTY (events); TEST_LIST_NOT_EMPTY (&new_event->blocking); assert0 (event_diff (event, new_event, ALREADY_SEEN_SET)); nih_free (event); nih_free (new_event); /* Check ConfSource got recreated, and then destroy it */ source = NULL; NIH_LIST_FOREACH (conf_sources, iter) { source = (ConfSource *)iter; if (! strcmp (source->path, "/tmp/foo") && source->type == CONF_JOB_DIR) break; } TEST_NE_P (source, NULL); TEST_FREE_TAG (new_class); /* This will remove new_class too */ nih_free (source); TEST_FREE (new_class); TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /*******************************/ TEST_FEATURE ("ensure BLOCKED_JOB with non-NULL session is ignored"); TEST_LIST_EMPTY (sessions); session = session_new (NULL, "/my/session"); TEST_NE_P (session, NULL); session->conf_path = NIH_MUST (nih_strdup (session, "/lives/here")); TEST_LIST_NOT_EMPTY (sessions); /* We simulate a user job being blocked by a system event, hence * the session is not associated with the event. */ TEST_LIST_EMPTY (events); event = event_new (NULL, "Christmas", NULL); TEST_NE_P (event, NULL); TEST_LIST_EMPTY (&event->blocking); TEST_LIST_EMPTY (conf_sources); source = conf_source_new (NULL, "/tmp/foo", CONF_JOB_DIR); source->session = session; TEST_NE_P (source, NULL); TEST_LIST_NOT_EMPTY (conf_sources); file = conf_file_new (source, "/tmp/foo/bar.conf"); TEST_NE_P (file, NULL); /* Create class with non-NULL session, simulating a user job */ class = file->job = job_class_new (NULL, "bar", session); TEST_NE_P (class, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); job = job_new (class, ""); TEST_NE_P (job, NULL); TEST_HASH_NOT_EMPTY (class->instances); blocked = blocked_new (event, BLOCKED_JOB, job); TEST_NE_P (blocked, NULL); nih_list_add (&event->blocking, &blocked->entry); job->blocker = event; TEST_LIST_NOT_EMPTY (&event->blocking); assert0 (state_to_string (&json_string, &len)); TEST_GT (len, 0); /* ConfSources are now recreated on re-exec, so remove the * original from the list. */ nih_list_remove (&source->entry); TEST_LIST_EMPTY (conf_sources); nih_list_remove (&class->entry); nih_free (event); nih_list_remove (&session->entry); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_HASH_EMPTY (job_classes); job_class_environment_clear (); assert0 (state_from_string (json_string)); TEST_LIST_NOT_EMPTY (conf_sources); TEST_LIST_NOT_EMPTY (events); TEST_LIST_NOT_EMPTY (sessions); new_session = session_from_chroot ("/my/session"); TEST_NE_P (new_session, NULL); assert0 (session_diff (session, new_session)); /* We don't expect any job_classes since the serialised one * related to a user session. */ TEST_HASH_EMPTY (job_classes); new_source = conf_source_from_path ("/tmp/foo", CONF_JOB_DIR, new_session); TEST_NE_P (new_source, NULL); new_file = (ConfFile *)nih_hash_lookup (new_source->files, "/tmp/foo/bar.conf"); TEST_NE_P (new_file, NULL); /* We don't expect the original JobClass to have been * deserialised since it has a non-NULL session. */ TEST_EQ_P (new_file->job, NULL); /* Disassociate the old JobClass from its ConfFile to allow a * diff. */ file->job = NULL; assert0 (conf_source_diff (source, new_source, ALREADY_SEEN_SET)); new_session = (Session *)nih_list_remove (sessions->next); nih_free (session); nih_free (new_session); nih_free (source); nih_free (new_source); nih_free (class); event = (Event *)nih_list_remove (events->next); nih_free (event); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /*******************************/ TEST_FEATURE ("event blocking a job"); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); event = event_new (NULL, "Christmas", NULL); TEST_NE_P (event, NULL); TEST_LIST_EMPTY (&event->blocking); TEST_LIST_NOT_EMPTY (events); TEST_LIST_EMPTY (conf_sources); source = conf_source_new (NULL, "/tmp/foo", CONF_JOB_DIR); TEST_NE_P (source, NULL); TEST_LIST_NOT_EMPTY (conf_sources); file = conf_file_new (source, "/tmp/foo/bar.conf"); TEST_NE_P (file, NULL); class = file->job = job_class_new (NULL, "bar", NULL); TEST_NE_P (class, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); job = job_new (class, ""); TEST_NE_P (job, NULL); TEST_HASH_NOT_EMPTY (class->instances); blocked = blocked_new (NULL, BLOCKED_JOB, job); TEST_NE_P (blocked, NULL); nih_list_add (&event->blocking, &blocked->entry); job->blocker = event; assert0 (state_to_string (&json_string, &len)); TEST_GT (len, 0); /* remove the source as these are now recreated on re-exec */ nih_list_remove (&source->entry); nih_list_remove (&event->entry); nih_list_remove (&class->entry); TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (conf_sources); job_class_environment_clear (); assert0 (state_from_string (json_string)); TEST_LIST_NOT_EMPTY (conf_sources); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_EMPTY (sessions); new_class = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_NE_P (new_class, NULL); nih_list_remove (&new_class->entry); new_event = (Event *)nih_list_remove (events->next); TEST_LIST_EMPTY (events); TEST_LIST_NOT_EMPTY (&new_event->blocking); assert0 (event_diff (event, new_event, ALREADY_SEEN_SET)); new_source = conf_source_from_path ("/tmp/foo", CONF_JOB_DIR, NULL); TEST_NE_P (new_source, NULL); assert0 (conf_source_diff (source, new_source, ALREADY_SEEN_SET)); nih_free (event); nih_free (new_event); nih_free (source); nih_free (new_source); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /*******************************/ TEST_FEATURE ("job blocking an event"); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); event = event_new (NULL, "bingo", NULL); TEST_NE_P (event, NULL); TEST_LIST_EMPTY (&event->blocking); TEST_LIST_EMPTY (conf_sources); source = conf_source_new (NULL, "/tmp/foo", CONF_JOB_DIR); TEST_NE_P (source, NULL); TEST_LIST_NOT_EMPTY (conf_sources); file = conf_file_new (source, "/tmp/foo/bar.conf"); TEST_NE_P (file, NULL); class = file->job = job_class_new (NULL, "bar", NULL); TEST_NE_P (class, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); job = job_new (class, ""); TEST_NE_P (job, NULL); TEST_HASH_NOT_EMPTY (class->instances); /* Simulate event_operator_events() */ blocked = blocked_new (NULL, BLOCKED_EVENT, event); TEST_NE_P (blocked, NULL); nih_list_add (&job->blocking, &blocked->entry); event_block (event); TEST_EQ (event->blockers, 1); assert0 (state_to_string (&json_string, &len)); TEST_GT (len, 0); nih_list_remove (&event->entry); nih_list_remove (&class->entry); nih_list_remove (&source->entry); TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (conf_sources); job_class_environment_clear (); assert0 (state_from_string (json_string)); TEST_LIST_NOT_EMPTY (conf_sources); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_EMPTY (sessions); new_source = conf_source_from_path ("/tmp/foo", CONF_JOB_DIR, NULL); TEST_NE_P (new_source, NULL); new_class = (JobClass *)nih_hash_lookup (job_classes, "bar"); TEST_NE_P (new_class, NULL); nih_list_remove (&new_class->entry); new_event = (Event *)nih_list_remove (events->next); TEST_LIST_EMPTY (events); new_job = (Job *)nih_hash_lookup (new_class->instances, ""); TEST_NE_P (new_job, NULL); TEST_EQ (event->blockers, 1); TEST_EQ (new_event->blockers, 1); assert0 (job_diff (job, new_job, ALREADY_SEEN_SET, TRUE)); assert0 (job_class_diff (class, new_class, ALREADY_SEEN_SET, TRUE)); nih_free (event); nih_free (new_event); nih_free (source); nih_free (new_source); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /*******************************/ } void test_event_serialise (void) { json_object *json; Event *event = NULL; Event *new_event = NULL; nih_local char **env = NULL; Session *session; Session *new_session; size_t len = 0; nih_local char *json_string = NULL; event_init (); session_init (); job_class_init (); TEST_GROUP ("Event serialisation and deserialisation"); /*******************************/ TEST_FEATURE ("without event environment"); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); event = event_new (NULL, "foo", NULL); TEST_NE_P (event, NULL); TEST_LIST_NOT_EMPTY (events); json = event_serialise (event); TEST_NE_P (json, NULL); nih_list_remove (&event->entry); TEST_LIST_EMPTY (events); new_event = event_deserialise (json); TEST_NE_P (json, NULL); TEST_LIST_NOT_EMPTY (events); assert0 (event_diff (event, new_event, ALREADY_SEEN_SET)); nih_free (event); nih_free (new_event); json_object_put (json); /*******************************/ TEST_FEATURE ("with event environment"); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (sessions); env = nih_str_array_new (NULL); TEST_NE_P (env, NULL); TEST_NE_P (environ_add (&env, NULL, &len, TRUE, "FOO=BAR"), NULL); TEST_NE_P (environ_add (&env, NULL, &len, TRUE, "a="), NULL); TEST_NE_P (environ_add (&env, NULL, &len, TRUE, "HELLO=world"), NULL); event = event_new (NULL, "foo", env); TEST_NE_P (event, NULL); TEST_LIST_NOT_EMPTY (events); json = event_serialise (event); TEST_NE_P (json, NULL); nih_list_remove (&event->entry); new_event = event_deserialise (json); TEST_NE_P (json, NULL); assert0 (event_diff (event, new_event, ALREADY_SEEN_SET)); nih_free (event); nih_free (new_event); json_object_put (json); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (sessions); /*******************************/ TEST_FEATURE ("with progress values"); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (sessions); /* Advance beyond last legitimate value to test failure behaviour */ for (int progress = 0; progress <= EVENT_FINISHED+1; progress++) { TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (sessions); event = event_new (NULL, "foo", NULL); TEST_NE_P (event, NULL); event->progress = progress; TEST_LIST_NOT_EMPTY (events); json = event_serialise (event); if (progress > EVENT_FINISHED) { TEST_EQ_P (json, NULL); nih_free (event); continue; } TEST_NE_P (json, NULL); nih_list_remove (&event->entry); new_event = event_deserialise (json); TEST_NE_P (json, NULL); assert0 (event_diff (event, new_event, ALREADY_SEEN_SET)); nih_free (event); nih_free (new_event); json_object_put (json); } /*******************************/ TEST_FEATURE ("with various fd values"); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (sessions); for (int fd = -1; fd < 4; fd++) { TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (sessions); event = event_new (NULL, "foo", NULL); TEST_NE_P (event, NULL); event->fd = fd; TEST_LIST_NOT_EMPTY (events); json = event_serialise (event); TEST_NE_P (json, NULL); nih_list_remove (&event->entry); new_event = event_deserialise (json); TEST_NE_P (json, NULL); assert0 (event_diff (event, new_event, ALREADY_SEEN_SET)); nih_free (event); nih_free (new_event); json_object_put (json); } /*******************************/ TEST_FEATURE ("with env+session"); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_HASH_EMPTY (job_classes); env = nih_str_array_new (NULL); TEST_NE_P (env, NULL); TEST_NE_P (environ_add (&env, NULL, &len, TRUE, "FOO=BAR"), NULL); session = session_new (NULL, "/abc"); TEST_NE_P (session, NULL); session->conf_path = NIH_MUST (nih_strdup (session, "/def/ghi")); TEST_LIST_NOT_EMPTY (sessions); event = event_new (NULL, "foo", env); TEST_NE_P (event, NULL); TEST_LIST_NOT_EMPTY (events); event->session = session; assert0 (state_to_string (&json_string, &len)); TEST_GT (len, 0); nih_list_remove (&event->entry); nih_list_remove (&session->entry); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); job_class_environment_clear (); assert0 (state_from_string (json_string)); TEST_LIST_NOT_EMPTY (sessions); TEST_LIST_NOT_EMPTY (events); new_event = (Event *)nih_list_remove (events->next); assert0 (event_diff (event, new_event, ALREADY_SEEN_SET)); nih_free (event); nih_free (session); new_session = (Session *)nih_list_remove (sessions->next); TEST_NE_P (new_session, NULL); nih_free (new_event); nih_free (new_session); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); /*******************************/ TEST_FEATURE ("with failed"); TEST_LIST_EMPTY (events); TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (sessions); event = event_new (NULL, "foo", NULL); TEST_NE_P (event, NULL); TEST_LIST_NOT_EMPTY (events); /* Force failed */ event->failed = TRUE; json = event_serialise (event); TEST_NE_P (json, NULL); nih_list_remove (&event->entry); new_event = event_deserialise (json); TEST_NE_P (json, NULL); assert0 (event_diff (event, new_event, ALREADY_SEEN_SET)); TEST_EQ (new_event->failed, TRUE); nih_free (event); nih_free (new_event); /*******************************/ TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_HASH_EMPTY (job_classes); TEST_LIST_EMPTY (sessions); /*******************************/ } void test_log_serialise (void) { json_object *json; json_object *json_unflushed = NULL; Log *log; Log *new_log; int pty_master; int pty_slave; size_t len; ssize_t ret; char filename[PATH_MAX]; pid_t pid; int wait_fd; int fd; int status; conf_init (); nih_io_init (); log_unflushed_init (); TEST_TRUE (NIH_LIST_EMPTY (conf_sources)); TEST_TRUE (NIH_LIST_EMPTY (log_unflushed_files)); TEST_TRUE (NIH_LIST_EMPTY (nih_io_watches)); TEST_GROUP ("Log serialisation and deserialisation"); /*******************************/ /* XXX: No test for uid > 0 since user logging not currently * XXX: available. */ TEST_FEATURE ("with uid 0"); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); log = log_new (NULL, "/foo", pty_master, 0); TEST_NE_P (log, NULL); TEST_FALSE (NIH_LIST_EMPTY (nih_io_watches)); json = log_serialise (log); TEST_NE_P (json, NULL); new_log = log_deserialise (NULL, json); TEST_NE_P (new_log, NULL); assert0 (log_diff (log, new_log)); close (pty_master); close (pty_slave); nih_free (log); nih_free (new_log); /*******************************/ TEST_FEATURE ("with unflushed data"); TEST_FILENAME (filename); TEST_TRUE (NIH_LIST_EMPTY (nih_io_watches)); TEST_EQ (openpty (&pty_master, &pty_slave, NULL, NULL, NULL), 0); /* Make file inaccessible to ensure data cannot be written * and will thus be added to the unflushed buffer. */ fd = open (filename, O_CREAT | O_EXCL, 0); TEST_NE (fd, -1); close (fd); /* Set up logging that we know won't go anywhere yet */ log = log_new (NULL, filename, pty_master, 0); TEST_NE_P (log, NULL); TEST_FALSE (NIH_LIST_EMPTY (nih_io_watches)); TEST_CHILD_WAIT (pid, wait_fd) { close (pty_master); len = TEST_ARRAY_SIZE (test_data); errno = 0; /* Now write some data with embedded nulls */ ret = write (pty_slave, test_data, len); TEST_EQ ((size_t)ret, len); /* let parent continue */ TEST_CHILD_RELEASE (wait_fd); /* keep child running until the parent is ready (to * simulate a job which continues to run across * a re-exec). */ pause (); } close (pty_slave); /* Ensure that unflushed buffer contains data */ TEST_WATCH_UPDATE (); TEST_GT (log->unflushed->len, 0); /* Serialise the log which will now contain the unflushed data */ json = log_serialise (log); TEST_NE_P (json, NULL); /* Sanity check */ ret = json_object_object_get_ex (json, "unflushed", &json_unflushed); TEST_EQ (ret, TRUE); TEST_NE_P (json_unflushed, NULL); new_log = log_deserialise (NULL, json); TEST_NE_P (new_log, NULL); assert0 (log_diff (log, new_log)); /* Wait for child to finish */ assert0 (kill (pid, SIGTERM)); TEST_EQ (waitpid (pid, &status, 0), pid); /* Restore access to allow log to be written on destruction */ TEST_EQ (chmod (filename, 0644), 0); nih_free (log); nih_free (new_log); TEST_TRUE (NIH_LIST_EMPTY (nih_io_watches)); TEST_EQ (unlink (filename), 0); /*******************************/ } void test_job_class_serialise (void) { ConfSource *source; ConfFile *file; JobClass *class; JobClass *new_class; Job *job1; Job *job2; Job *job3; json_object *json; TEST_GROUP ("JobClass serialisation and deserialisation"); /*******************************/ TEST_FEATURE ("JobClass with no Jobs"); TEST_HASH_EMPTY (job_classes); source = conf_source_new (NULL, "/tmp/foo", CONF_JOB_DIR); TEST_NE_P (source, NULL); file = conf_file_new (source, "/tmp/foo/bar.conf"); TEST_NE_P (file, NULL); class = file->job = job_class_new (NULL, "bar", NULL); TEST_NE_P (class, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); /* BEHAVIOURAL CHANGE: * * Previously, a JobClass with no associated Jobs would * not be serialised (since, as there were no "running" jobs * associated with it, it was considered unnecessary). * * However, we now serialise *all* JobClasses regardless since * in the case of a stateful re-exec, we need as much state as * possible, particularly since Events have always been fully * serialised, and if Event->blockers is non-zero, it is * necessary to manipulate the 'start on' EventOperator tree for * non-running jobs post-reexec to correspond to the * Event->blockers value. */ json = job_class_serialise (class); TEST_NE_P (json, NULL); nih_free (source); /*******************************/ TEST_FEATURE ("JobClass with 1 Job"); TEST_HASH_EMPTY (job_classes); source = conf_source_new (NULL, "/tmp/foo", CONF_JOB_DIR); TEST_NE_P (source, NULL); file = conf_file_new (source, "/tmp/foo/bar.conf"); TEST_NE_P (file, NULL); class = file->job = job_class_new (NULL, "bar", NULL); TEST_NE_P (class, NULL); TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); job1 = job_new (class, ""); TEST_NE_P (job1, NULL); TEST_HASH_NOT_EMPTY (class->instances); class->process[PROCESS_MAIN] = process_new (class); TEST_NE_P (class->process[PROCESS_MAIN], NULL); class->process[PROCESS_MAIN]->command = "echo"; class->process[PROCESS_PRE_STOP] = process_new (class); TEST_NE_P (class->process[PROCESS_PRE_STOP], NULL); class->process[PROCESS_PRE_STOP]->command = "echo"; job1->goal = JOB_START; job1->state = JOB_PRE_STOP; job1->pid[PROCESS_MAIN] = 1234; job1->pid[PROCESS_PRE_STOP] = 5678; json = job_class_serialise (class); TEST_NE_P (json, NULL); nih_list_remove (&class->entry); TEST_HASH_EMPTY (job_classes); new_class = job_class_deserialise (json); TEST_NE_P (new_class, NULL); assert0 (job_class_diff (class, new_class, ALREADY_SEEN_SET, TRUE)); nih_free (source); nih_free (new_class); json_object_put (json); /*******************************/ TEST_FEATURE ("JobClass with >1 Jobs"); TEST_HASH_EMPTY (job_classes); source = conf_source_new (NULL, "/tmp/foo", CONF_JOB_DIR); TEST_NE_P (source, NULL); file = conf_file_new (source, "/tmp/foo/bar.conf"); TEST_NE_P (file, NULL); class = file->job = job_class_new (NULL, "bar", NULL); TEST_NE_P (class, NULL); class->reload_signal = SIGUSR1; TEST_HASH_EMPTY (job_classes); TEST_TRUE (job_class_consider (class)); TEST_HASH_NOT_EMPTY (job_classes); job1 = job_new (class, "a"); TEST_NE_P (job1, NULL); job2 = job_new (class, "b"); TEST_NE_P (job1, NULL); job3 = job_new (class, "c"); TEST_NE_P (job1, NULL); TEST_HASH_NOT_EMPTY (class->instances); class->process[PROCESS_MAIN] = process_new (class); TEST_NE_P (class->process[PROCESS_MAIN], NULL); class->process[PROCESS_MAIN]->command = "echo"; class->process[PROCESS_PRE_STOP] = process_new (class); TEST_NE_P (class->process[PROCESS_PRE_STOP], NULL); class->process[PROCESS_PRE_STOP]->command = "echo"; job1->goal = JOB_START; job1->state = JOB_PRE_STOP; job1->pid[PROCESS_MAIN] = 1234; job1->pid[PROCESS_PRE_STOP] = 5678; job2->goal = JOB_STOP; job2->state = JOB_WAITING; job3->goal = JOB_START; job3->state = JOB_RUNNING; job3->pid[PROCESS_MAIN] = 1; json = job_class_serialise (class); TEST_NE_P (json, NULL); nih_list_remove (&class->entry); TEST_HASH_EMPTY (job_classes); new_class = job_class_deserialise (json); TEST_NE_P (new_class, NULL); assert0 (job_class_diff (class, new_class, ALREADY_SEEN_SET, TRUE)); nih_free (source); nih_free (new_class); json_object_put (json); /*******************************/ } void test_job_serialise (void) { nih_local JobClass *class = NULL; Job *job; Job *new_job; json_object *json; TEST_GROUP ("Job serialisation and deserialisation"); TEST_HASH_EMPTY (job_classes); class = job_class_new (NULL, "class", NULL); TEST_NE_P (class, NULL); TEST_HASH_EMPTY (class->instances); /*******************************/ TEST_FEATURE ("basic job"); job = job_new (class, ""); TEST_NE_P (job, NULL); TEST_HASH_NOT_EMPTY (class->instances); json = json_object_new_object (); TEST_NE_P (json, NULL); json = job_serialise (job); TEST_NE_P (json, NULL); nih_list_remove (&job->entry); TEST_HASH_EMPTY (class->instances); new_job = job_deserialise (class, json); TEST_NE_P (new_job, NULL); TEST_HASH_NOT_EMPTY (class->instances); assert0 (job_diff (job, new_job, ALREADY_SEEN_SET, TRUE)); nih_free (job); json_object_put (json); /*******************************/ } void test_enums (void) { int blocked_value; const char *string_value; int i; TEST_GROUP ("stateful re-exec enums"); /*******************************/ TEST_FEATURE ("BlockedType"); for (i = -3; i < BLOCKED_INSTANCE_RESTART_METHOD+3; i++) { /* convert to string value */ string_value = blocked_type_enum_to_str (i); if (i < 0 || i > BLOCKED_INSTANCE_RESTART_METHOD) { TEST_EQ_P (string_value, NULL); continue; } else { TEST_NE_P (string_value, NULL); } /* convert back to enum */ blocked_value = blocked_type_str_to_enum (string_value); if (i < 0 || i > BLOCKED_INSTANCE_RESTART_METHOD) { TEST_EQ (blocked_value, -1); } else { TEST_NE (blocked_value, -1); TEST_EQ (blocked_value, i); } } TEST_EQ ((int)blocked_type_str_to_enum (""), -1); TEST_EQ ((int)blocked_type_str_to_enum ("foo"), -1); /*******************************/ TEST_FEATURE ("ProcessType"); for (i = PROCESS_INVALID-1; i < PROCESS_LAST+3; i++) { /* convert to string value */ string_value = process_type_enum_to_str (i); if ((i < 0 && i != -2) || (i+1) > PROCESS_LAST) { TEST_EQ_P (string_value, NULL); continue; } else { TEST_NE_P (string_value, NULL); } /* convert back to enum */ blocked_value = process_type_str_to_enum (string_value); if ((i < 0 && i != -2) || (i+1) > PROCESS_LAST) { TEST_EQ (blocked_value, -1); } else { TEST_NE (blocked_value, -1); TEST_EQ (blocked_value, i); } } TEST_EQ ((int)process_type_str_to_enum (""), -1); TEST_EQ ((int)process_type_str_to_enum ("foo"), -1); /*******************************/ TEST_FEATURE ("ConsoleType"); for (i = -3; i < CONSOLE_LOG+3; i++) { /* convert to string value */ string_value = job_class_console_type_enum_to_str (i); if (i < 0 || i > CONSOLE_LOG) { TEST_EQ_P (string_value, NULL); continue; } else { TEST_NE_P (string_value, NULL); } /* convert back to enum */ blocked_value = job_class_console_type_str_to_enum (string_value); if (i < 0 || i > CONSOLE_LOG) { TEST_EQ (blocked_value, -1); } else { TEST_NE (blocked_value, -1); TEST_EQ (blocked_value, i); } } TEST_EQ ((int)job_class_console_type_str_to_enum (""), -1); TEST_EQ ((int)job_class_console_type_str_to_enum ("foo"), -1); /*******************************/ TEST_FEATURE ("ExpectType"); for (i = -3; i < EXPECT_FORK+3; i++) { /* convert to string value */ string_value = job_class_expect_type_enum_to_str (i); if (i < 0 || i > EXPECT_FORK) { TEST_EQ_P (string_value, NULL); continue; } else { TEST_NE_P (string_value, NULL); } /* convert back to enum */ blocked_value = job_class_expect_type_str_to_enum (string_value); if (i < 0 || i > EXPECT_FORK) { TEST_EQ (blocked_value, -1); } else { TEST_NE (blocked_value, -1); TEST_EQ (blocked_value, i); } } TEST_EQ ((int)job_class_expect_type_str_to_enum (""), -1); TEST_EQ ((int)job_class_expect_type_str_to_enum ("foo"), -1); /*******************************/ } void test_int_arrays (void) { int ret; size_t size32 = 7; size_t size64 = 9; size_t i; size_t new_size; char *parent = NULL; json_object *json; nih_local int32_t *array32 = NULL; nih_local int64_t *array64 = NULL; int32_t *new_array32 = NULL; int64_t *new_array64 = NULL; array32 = nih_alloc (NULL, size32 * sizeof (int32_t)); TEST_NE_P (array32, NULL); i = 0; array32[i++] = INT32_MIN; array32[i++] = -254; array32[i++] = -1; array32[i++] = 0; array32[i++] = 1; array32[i++] = 123456; array32[i++] = INT32_MAX; assert (size32 == i); array64 = nih_alloc (NULL, size64 * sizeof (int64_t)); TEST_NE_P (array64, NULL); i = 0; array64[i++] = INT64_MIN; array64[i++] = -255; array64[i++] = -1; array64[i++] = 0; array64[i++] = 1; array64[i++] = 7; array64[i++] = 99; array64[i++] = 123456; array64[i++] = INT64_MAX; assert (size64 == i); TEST_GROUP ("integer array serialisation and deserialisation"); parent = nih_strdup (NULL, ""); TEST_NE_P (parent, NULL); /*******************************/ TEST_FEATURE ("explicit 32-bit integer array"); json = state_serialise_int32_array (array32, size32); TEST_NE_P (json, NULL); ret = state_deserialise_int32_array (parent, json, &new_array32, &new_size); TEST_EQ (ret, 0); ret = TEST_CMP_INT_ARRAYS (array32, new_array32, size32, new_size); TEST_EQ (ret, 0); json_object_put (json); /*******************************/ TEST_FEATURE ("implicit 32-bit integer array"); json = state_serialise_int_array (int32_t, array32, size32); TEST_NE_P (json, NULL); ret = state_deserialise_int_array (parent, json, int32_t, &new_array32, &new_size); TEST_EQ (ret, 0); ret = TEST_CMP_INT_ARRAYS (array32, new_array32, size32, new_size); TEST_EQ (ret, 0); json_object_put (json); /*******************************/ TEST_FEATURE ("explicit 64-bit integer array"); json = state_serialise_int64_array (array64, size64); TEST_NE_P (json, NULL); ret = state_deserialise_int64_array (parent, json, &new_array64, &new_size); TEST_EQ (ret, 0); ret = TEST_CMP_INT_ARRAYS (array64, new_array64, size64, new_size); TEST_EQ (ret, 0); json_object_put (json); /*******************************/ TEST_FEATURE ("implicit 64-bit integer array"); json = state_serialise_int_array (int64_t, array64, size64); TEST_NE_P (json, NULL); ret = state_deserialise_int_array (parent, json, int64_t, &new_array64, &new_size); TEST_EQ (ret, 0); ret = TEST_CMP_INT_ARRAYS (array64, new_array64, size64, new_size); TEST_EQ (ret, 0); json_object_put (json); /*******************************/ TEST_FEATURE ("implicit native integer array"); if (sizeof (int) == 4) { json = state_serialise_int_array (int, array32, size32); TEST_NE_P (json, NULL); ret = state_deserialise_int_array (parent, json, int32_t, &new_array32, &new_size); TEST_EQ (ret, 0); ret = TEST_CMP_INT_ARRAYS (array32, new_array32, size32, new_size); TEST_EQ (ret, 0); } else if (sizeof (int) == 8) { json = state_serialise_int_array (int, array64, size64); TEST_NE_P (json, NULL); ret = state_deserialise_int_array (parent, json, int64_t, &new_array64, &new_size); TEST_EQ (ret, 0); ret = TEST_CMP_INT_ARRAYS (array64, new_array64, size64, new_size); TEST_EQ (ret, 0); } else { /* How long before this fires? ;-) */ nih_assert_not_reached (); } json_object_put (json); /*******************************/ /* parent frees the new arrays */ nih_free (parent); } void test_string_arrays (void) { json_object *json; nih_local char **array = NULL; char **new_array; int ret; size_t len = 0; size_t new_len = 0; TEST_GROUP ("string array serialisation and deserialisation"); /*******************************/ TEST_FEATURE ("serialisation of empty array"); len = 0; array = nih_str_array_new (NULL); TEST_NE_P (array, NULL); json = state_serialise_str_array (array); TEST_NE_P (json, NULL); /*******************************/ TEST_FEATURE ("deserialisation of empty array"); ret = state_deserialise_str_array (NULL, json, &new_array); TEST_TRUE (ret); /* count elements */ new_len = 0; for (char **p = new_array; p && *p; p++, new_len++) ; ret = TEST_CMP_STR_ARRAYS (array, new_array, len, new_len); TEST_EQ (ret, 0); TEST_EQ_P (new_array, NULL); json_object_put (json); /*******************************/ TEST_FEATURE ("serialisation of array with single nul string"); len = 0; array = nih_str_array_new (NULL); TEST_NE_P (array, NULL); NIH_MUST (nih_str_array_add (&array, NULL, &len, "")); json = state_serialise_str_array (array); TEST_NE_P (json, NULL); /*******************************/ TEST_FEATURE ("deserialisation of array with single nul string"); ret = state_deserialise_str_array (NULL, json, &new_array); TEST_TRUE (ret); /* count elements */ new_len = 0; for (char **p = new_array; p && *p; p++, new_len++) ; ret = TEST_CMP_STR_ARRAYS (array, new_array, len, new_len); TEST_EQ (ret, 0); TEST_NE_P (new_array, NULL); nih_free (new_array); json_object_put (json); /*******************************/ TEST_FEATURE ("serialisation of non-empty array"); len = 0; array = nih_str_array_new (NULL); TEST_NE_P (array, NULL); NIH_MUST (nih_str_array_add (&array, NULL, &len, "")); NIH_MUST (nih_str_array_add (&array, NULL, &len, "")); NIH_MUST (nih_str_array_add (&array, NULL, &len, "hello=")); NIH_MUST (nih_str_array_add (&array, NULL, &len, "FOO=BAR")); NIH_MUST (nih_str_array_add (&array, NULL, &len, "wibble")); NIH_MUST (nih_str_array_add (&array, NULL, &len, "\n")); NIH_MUST (nih_str_array_add (&array, NULL, &len, "\t \n")); NIH_MUST (nih_str_array_add (&array, NULL, &len, "\"'$*&()[]{}-_=+/?@':;>.<,~#")); NIH_MUST (nih_str_array_add (&array, NULL, &len, "")); json = state_serialise_str_array (array); TEST_NE_P (json, NULL); /*******************************/ TEST_FEATURE ("deserialisation of non-empty array"); ret = state_deserialise_str_array (NULL, json, &new_array); TEST_TRUE (ret); /* count elements */ new_len = 0; for (char **p = new_array; p && *p; p++, new_len++) ; ret = TEST_CMP_STR_ARRAYS (array, new_array, len, new_len); TEST_EQ (ret, 0); TEST_NE_P (new_array, NULL); nih_free (new_array); json_object_put (json); /*******************************/ /* XXX: No point in checking an empty environment array as * its the same as a string array. */ TEST_FEATURE ("serialisation of non-empty environment array"); len = 0; array = nih_str_array_new (NULL); TEST_NE_P (array, NULL); TEST_NE_P (environ_add (&array, NULL, &len, TRUE, "foo=bar"), NULL); TEST_NE_P (environ_add (&array, NULL, &len, TRUE, "hello="), NULL); TEST_NE_P (environ_add (&array, NULL, &len, TRUE, "\"'$*&()[]{}-_=+/?@':;>.<,~#"), NULL); json = state_serialise_str_array (array); TEST_NE_P (json, NULL); /*******************************/ TEST_FEATURE ("deserialisation of non-empty environment array"); ret = state_deserialise_env_array (NULL, json, &new_array); TEST_TRUE (ret); /* count elements */ new_len = 0; for (char **p = new_array; p && *p; p++, new_len++) ; ret = TEST_CMP_STR_ARRAYS (array, new_array, len, new_len); TEST_EQ (ret, 0); TEST_NE_P (new_array, NULL); nih_free (new_array); json_object_put (json); /*******************************/ } void test_hex_encoding (void) { int ret; nih_local char *hex_data = NULL; size_t hex_data_len; size_t test_data_len; nih_local char *new_data = NULL; size_t new_data_len; test_data_len = TEST_ARRAY_SIZE (test_data); TEST_GROUP ("hex data encoding"); /*******************************/ TEST_FEATURE ("serialisation"); hex_data = state_data_to_hex (NULL, test_data, test_data_len); TEST_NE_P (hex_data, NULL); hex_data_len = strlen (hex_data); /*******************************/ TEST_FEATURE ("deserialisation"); ret = state_hex_to_data (NULL, hex_data, hex_data_len, &new_data, &new_data_len); TEST_EQ (ret, 0); ret = TEST_CMP_INT_ARRAYS (test_data, new_data, test_data_len, new_data_len); TEST_EQ (ret, 0); } void test_rlimit_encoding (void) { int ret; nih_local Foo *foo = NULL; nih_local Foo *new_foo = NULL; json_object *json; json_object *json_limits; struct rlimit limit; nih_local struct rlimit *new_limit = NULL; int len; int i; TEST_GROUP ("rlimit encoding"); /*******************************/ TEST_FEATURE ("single rlimit serialisation and deserialisation"); len = TEST_ARRAY_SIZE (rlimit_values); for (int i = 0; i < len; i++) { limit.rlim_cur = rlimit_values[i]; limit.rlim_max = RLIM_INFINITY - rlimit_values[i]; json = state_rlimit_serialise (&limit); TEST_NE_P (json, NULL); new_limit = state_rlimit_deserialise (json); TEST_NE_P (new_limit, NULL); TEST_EQ (limit.rlim_cur, new_limit->rlim_cur); TEST_EQ (limit.rlim_max, new_limit->rlim_max); } json_object_put (json); /*******************************/ TEST_FEATURE ("rlimits array serialisation and deserialisation"); len = TEST_ARRAY_SIZE (rlimit_values); foo = nih_new (NULL, Foo); TEST_NE_P (foo, NULL); new_foo = nih_new (NULL, Foo); TEST_NE_P (new_foo, NULL); for (i = 0; i < RLIMIT_NLIMITS; i++) foo->limits[i] = new_foo->limits[i] = NULL; for (i = 0; i < len; i++) { json = json_object_new_object (); TEST_NE_P (json, NULL); foo->limits[i] = nih_new (foo, struct rlimit); TEST_NE_P (foo->limits[i], NULL); foo->limits[i]->rlim_cur = RLIM_INFINITY - rlimit_values[i]; foo->limits[i]->rlim_max = rlimit_values[i]; json_limits = state_rlimit_serialise_all (foo->limits); TEST_NE_P (json_limits, NULL); json_object_object_add (json, "limits", json_limits); ret = state_rlimit_deserialise_all (json, new_foo, &new_foo->limits); TEST_EQ (ret, 0); json_object_put (json); } } void test_basic_types (void) { int ret; int32_t int32 = -1; int64_t int64 = -1; size_t i; size_t size32; size_t size64; size_t sizestr; char *str = NULL; size_t len; size_t new_len; json_object *json; nih_local Foo *foo = NULL; nih_local Foo *new_foo = NULL; nih_local char **array = NULL; nih_local char **new_array = NULL; size32 = TEST_ARRAY_SIZE (values32); size64 = TEST_ARRAY_SIZE (values64); sizestr = TEST_ARRAY_SIZE (strings); TEST_GROUP ("basic types"); json = json_object_new_object (); TEST_NE_P (json, NULL); foo = nih_new (NULL, Foo); TEST_NE_P (foo, NULL); new_foo = nih_new (NULL, Foo); TEST_NE_P (new_foo, NULL); memset (foo, '\0', sizeof (Foo)); memset (new_foo, '\0', sizeof (Foo)); /*******************************/ TEST_FEATURE ("32-bit integer serialisation and deserialisation"); for (i = 0; i < size32; i++) { TEST_TRUE (state_set_json_int_var (json, "foo", values32[i])); TEST_TRUE (state_get_json_int_var (json, "foo", int32)); TEST_EQ (int32, values32[i]); } /*******************************/ TEST_FEATURE ("64-bit integer serialisation and deserialisation"); for (i = 0; i < size64; i++) { TEST_TRUE (state_set_json_int_var (json, "foo", values64[i])); TEST_TRUE (state_get_json_int_var (json, "foo", int64)); TEST_EQ (int64, values64[i]); } /*******************************/ TEST_FEATURE ("string serialisation and deserialisation"); for (i = 0; i < sizestr; i++) { TEST_TRUE (state_set_json_string_var (json, "s", strings[i])); TEST_TRUE (state_get_json_string_var (json, "s", NULL, str)); if (strings[i] == NULL) { TEST_EQ (strings[i], str); } else { TEST_EQ_STR (strings[i], str); } } /*******************************/ TEST_FEATURE ("strict string serialisation and deserialisation"); for (i = 0; i < sizestr; i++) { TEST_TRUE (state_set_json_string_var (json, "s", strings[i])); ret = state_get_json_string_var_strict (json, "s", NULL, str); if (strings[i] == NULL) { TEST_FALSE (ret); TEST_EQ (strings[i], str); } else { TEST_TRUE (ret); TEST_EQ_STR (strings[i], str); } } /*******************************/ TEST_FEATURE ("32-bit object integer serialisation and deserialisation"); for (i = 0; i < size32; i++) { foo->int32 = values32[i]; TEST_TRUE (state_set_json_int_var_from_obj (json, foo, int32)); TEST_TRUE (state_get_json_int_var_to_obj (json, new_foo, int32)); TEST_EQ (new_foo->int32, foo->int32); } /*******************************/ TEST_FEATURE ("64-bit object integer serialisation and deserialisation"); for (i = 0; i < size64; i++) { foo->int64 = values64[i]; TEST_TRUE (state_set_json_int_var_from_obj (json, foo, int64)); TEST_TRUE (state_get_json_int_var_to_obj (json, new_foo, int64)); TEST_EQ (new_foo->int64, foo->int64); } json_object_put (json); /*******************************/ TEST_FEATURE ("empty object string array serialisation and deserialisation"); json = json_object_new_object (); TEST_NE_P (json, NULL); foo->array = nih_str_array_new (NULL); TEST_NE_P (foo->array, NULL); len = new_len = 0; TEST_TRUE (state_set_json_str_array_from_obj (json, foo, array)); TEST_TRUE (state_get_json_str_array_to_obj (json, new_foo, array)); /* count elements */ new_len = 0; for (char **p = new_foo->array; p && *p; p++, new_len++) ; ret = TEST_CMP_STR_ARRAYS (foo->array, new_foo->array, len, new_len); TEST_EQ (ret, 0); /* An empty array should be deserialised to "no array" * (since an empty JSON array is the encoding for "no array"). */ TEST_EQ_P (new_foo->array, NULL); json_object_put (json); /*******************************/ TEST_FEATURE ("object string array serialisation and deserialisation"); json = json_object_new_object (); TEST_NE_P (json, NULL); foo = nih_new (NULL, Foo); TEST_NE_P (foo, NULL); memset (foo, '\0', sizeof (Foo)); new_foo = nih_new (NULL, Foo); TEST_NE_P (new_foo, NULL); memset (new_foo, '\0', sizeof (Foo)); foo->array = nih_str_array_new (NULL); TEST_NE_P (foo->array, NULL); len = new_len = 0; NIH_MUST (nih_str_array_add (&foo->array, NULL, &len, "")); NIH_MUST (nih_str_array_add (&foo->array, NULL, &len, "")); NIH_MUST (nih_str_array_add (&foo->array, NULL, &len, "hello=")); NIH_MUST (nih_str_array_add (&foo->array, NULL, &len, "FOO=BAR")); NIH_MUST (nih_str_array_add (&foo->array, NULL, &len, "wibble")); NIH_MUST (nih_str_array_add (&foo->array, NULL, &len, "\n")); NIH_MUST (nih_str_array_add (&foo->array, NULL, &len, "\t \n")); NIH_MUST (nih_str_array_add (&foo->array, NULL, &len, "\"'$*&()[]{}-_=+/?@':;>.<,~#")); NIH_MUST (nih_str_array_add (&foo->array, NULL, &len, "")); TEST_TRUE (state_set_json_str_array_from_obj (json, foo, array)); TEST_TRUE (state_get_json_str_array_to_obj (json, new_foo, array)); /* count elements */ new_len = 0; for (char **p = new_foo->array; p && *p; p++, new_len++) ; ret = TEST_CMP_STR_ARRAYS (foo->array, new_foo->array, len, new_len); TEST_EQ (ret, 0); json_object_put (json); /*******************************/ TEST_FEATURE ("empty object env array serialisation and deserialisation"); json = json_object_new_object (); TEST_NE_P (json, NULL); foo = nih_new (NULL, Foo); TEST_NE_P (foo, NULL); memset (foo, '\0', sizeof (Foo)); new_foo = nih_new (NULL, Foo); TEST_NE_P (new_foo, NULL); memset (new_foo, '\0', sizeof (Foo)); foo->env = nih_str_array_new (foo); TEST_NE_P (foo->env, NULL); len = 0; TEST_TRUE (state_set_json_str_array_from_obj (json, foo, env)); TEST_TRUE (state_get_json_env_array_to_obj (json, new_foo, env)); /* count elements */ new_len = 0; for (char **p = new_foo->env; p && *p; p++, new_len++) ; ret = TEST_CMP_STR_ARRAYS (foo->env, new_foo->env, len, new_len); TEST_EQ (ret, 0); TEST_EQ_P (new_foo->env, NULL); json_object_put (json); /*******************************/ TEST_FEATURE ("object env array serialisation and deserialisation"); json = json_object_new_object (); TEST_NE_P (json, NULL); foo = nih_new (NULL, Foo); TEST_NE_P (foo, NULL); memset (foo, '\0', sizeof (Foo)); new_foo = nih_new (NULL, Foo); TEST_NE_P (new_foo, NULL); memset (new_foo, '\0', sizeof (Foo)); foo->env = nih_str_array_new (foo); TEST_NE_P (foo->env, NULL); new_foo->env = NULL; len = 0; TEST_TRUE (environ_add (&foo->env, NULL, &len, TRUE, "hello=world")); TEST_TRUE (environ_add (&foo->env, NULL, &len, TRUE, "foo=")); TEST_TRUE (environ_add (&foo->env, NULL, &len, TRUE, "bar=123")); TEST_TRUE (environ_add (&foo->env, NULL, &len, TRUE, "baz=\'two words\'")); TEST_TRUE (state_set_json_str_array_from_obj (json, foo, env)); TEST_TRUE (state_get_json_env_array_to_obj (json, new_foo, env)); /* count elements */ new_len = 0; for (char **p = new_foo->env; p && *p; p++, new_len++) ; ret = TEST_CMP_STR_ARRAYS (foo->env, new_foo->env, len, new_len); TEST_EQ (ret, 0); json_object_put (json); /*******************************/ } void test_clean_args (void) { nih_local char **args = NULL; size_t len = 0; TEST_FUNCTION ("clean_args"); /*******************************/ TEST_FEATURE ("no arguments"); len = 0; args = nih_str_array_new (NULL); TEST_NE_P (args, NULL); TEST_EQ_P (args[0], NULL); clean_args (&args); TEST_EQ_P (args[0], NULL); /*******************************/ TEST_FEATURE ("1 argument"); len = 0; args = nih_str_array_new (NULL); TEST_NE_P (args, NULL); NIH_MUST (nih_str_array_add (&args, NULL, &len, "/sbin/init")); clean_args (&args); TEST_EQ_STR (args[0], "/sbin/init"); TEST_EQ_P (args[1], NULL); /*******************************/ TEST_FEATURE ("non-cleanable arguments"); len = 0; args = nih_str_array_new (NULL); TEST_NE_P (args, NULL); NIH_MUST (nih_str_array_add (&args, NULL, &len, "/sbin/init")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--no-startup-event")); clean_args (&args); TEST_EQ_STR (args[0], "/sbin/init"); TEST_EQ_STR (args[1], "--no-startup-event"); TEST_EQ_P (args[2], NULL); /*******************************/ TEST_FEATURE ("mostly cleanable arguments"); len = 0; args = nih_str_array_new (NULL); TEST_NE_P (args, NULL); NIH_MUST (nih_str_array_add (&args, NULL, &len, "/sbin/init")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--debug")); clean_args (&args); TEST_EQ_STR (args[0], "/sbin/init"); TEST_EQ_P (args[1], NULL); /*******************************/ TEST_FEATURE ("only cleanable arguments"); len = 0; args = nih_str_array_new (NULL); TEST_NE_P (args, NULL); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--verbose")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--state-fd")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "9999")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--debug")); clean_args (&args); TEST_EQ_P (args[0], NULL); /*******************************/ TEST_FEATURE ("lots of arguments"); len = 0; args = nih_str_array_new (NULL); TEST_NE_P (args, NULL); NIH_MUST (nih_str_array_add (&args, NULL, &len, "/sbin/init")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--debug")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--logdir")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "/var/log/upstart")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--state-fd")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "7")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--state-fd")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "3")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--state-fd")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "123")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--verbose")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--confdir")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "/etc/init")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--debug")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--debug")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--debug")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "--state-fd")); NIH_MUST (nih_str_array_add (&args, NULL, &len, "123")); clean_args (&args); TEST_EQ_STR (args[0], "/sbin/init"); TEST_EQ_STR (args[1], "--logdir"); TEST_EQ_STR (args[2], "/var/log/upstart"); TEST_EQ_STR (args[3], "--confdir"); TEST_EQ_STR (args[4], "/etc/init"); TEST_EQ_P (args[5], NULL); /*******************************/ } /** * test_upgrade: * * Run tests that simulate an upgrade by attempting to deserialise an * older version of the JSON data format than is currently used. **/ void test_upgrade (void) { TestDataFile *datafile; TEST_GROUP ("upgrade tests"); for (datafile = test_data_files; datafile && datafile->filename; datafile++) { nih_local char *path = NULL; nih_local char *name = NULL; nih_assert (datafile->func != NULL); name = NIH_MUST (nih_sprintf (NULL, "with data file '%s'", datafile->filename)); TEST_FEATURE (name); /* Potentially recreate the lists and hashes here which * allows individual tests to free them and assign to * NULL. */ conf_init (); session_init (); event_init (); control_init (); job_class_init (); job_class_environment_clear (); path = NIH_MUST (nih_sprintf (NULL, "%s/%s", TEST_DATA_DIR, datafile->filename)); /* Ensure environment is clean before test is run */ ensure_env_clean (); datafile->func (path); } /* Call again to make sure last test left environment sane */ ensure_env_clean (); } /** * test_upstart1_6_upgrade: * * @path: full path to JSON data file to deserialise. * * Test for original Upstart 1.6 serialisation data format containing * a blocked object that does not contain a 'session' element. * * Note that this test is NOT testing whether a JobClass with an * associated Upstart session is handled correctly, it is merely * testing that a JobClass with the NULL session encoded in the JSON * is handled correctly. **/ void test_upstart1_6_upgrade (const char *path) { nih_local char *json_string = NULL; Event *event; struct stat statbuf; size_t len; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); /* ConfSource and ConfFile objects not serialised in this * version. */ TEST_LIST_EMPTY (conf_sources); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_EMPTY (sessions); event = (Event *)nih_list_remove (events->next); TEST_NE_P (event, NULL); TEST_EQ_STR (event->name, "Christmas"); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; TEST_EQ_STR (class->name, "bar"); TEST_EQ_STR (class->path, "/com/ubuntu/Upstart/jobs/bar"); TEST_HASH_NOT_EMPTY (class->instances); NIH_HASH_FOREACH (class->instances, iter2) { Blocked *blocked; Job *job = (Job *)iter2; nih_local char *instance_path = NULL; /* instance name */ TEST_EQ_STR (job->name, ""); instance_path = NIH_MUST (nih_sprintf (NULL, "%s/_", class->path)); TEST_EQ_STR (job->path, instance_path); /* job is blocked by the event */ TEST_EQ (job->blocker, event); /* First entry in list should be a Blocked * object pointing to the job. */ TEST_LIST_NOT_EMPTY (&event->blocking); blocked = (Blocked *)(&event->blocking)->next; TEST_EQ (blocked->type, BLOCKED_JOB); TEST_EQ (blocked->job, job); } } nih_free (event); nih_free (conf_sources); nih_free (job_classes); events = NULL; conf_sources = NULL; job_classes = NULL; event_init (); conf_init (); job_class_init (); } /** * test_session_upgrade_midflight * * @path: full path to JSON data file to deserialise. * * Test for re-exec with an active and existing chroot session. * **/ void test_session_upgrade_midflight (const char *path) { nih_local char *json_string = NULL; struct stat statbuf; size_t len; int got_tty1 = FALSE; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); TEST_LIST_NOT_EMPTY (conf_sources); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_NOT_EMPTY (sessions); int session_count = 0; NIH_LIST_FOREACH (sessions, iter) { Session *session = (Session *)iter; TEST_EQ_STR (session->chroot, "/mnt"); TEST_EQ_STR (session->conf_path, "/mnt/etc/init"); session_count++; } TEST_EQ (session_count, 1); int source_types[3] = {0, 0, 0}; NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *) iter; if (! source->session) { switch (source->type) { case CONF_FILE: source_types[0]++; break; case CONF_JOB_DIR: source_types[1]++; break; default: nih_assert_not_reached (); } } else { switch (source->type) { case CONF_JOB_DIR: source_types[2]++; break; default: nih_assert_not_reached (); } } } TEST_EQ (source_types[0], 1); TEST_EQ (source_types[1], 1); TEST_EQ (source_types[2], 1); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; TEST_EQ_P (class->session, NULL); if (! strcmp (class->name, "tty1")) got_tty1 = TRUE; } /* XXX: The json contains 2 tty1 jobs: one in the NULL session, * and the other in the chroot session. * * Make sure that duplicate job names (albeit in different sessions) * do not stop the NULL session job from being recreated. */ TEST_EQ (got_tty1, TRUE); nih_free (conf_sources); nih_free (job_classes); nih_free (events); nih_free (sessions); conf_sources = NULL; job_classes = NULL; events = NULL; sessions = NULL; conf_init (); job_class_init (); event_init (); session_init (); } /** * test_session_upgrade_exists * * @path: full path to JSON data file that needs pre-processing. * * XXX: @path contains multiple occurences of @CHROOT_PATH@ which must * be replaced by a valid temporary directory path before attempting * deserialisation. * * Test to ensure Upstart can deserialise a state file containing a * chroot session where that chroot path actually exists with jobs on disk. * This was added since that exact scenario caught a bug in an early fix * for LP:#1199778 (resulting in stateless re-exec). **/ void test_session_upgrade_exists (const char *original_path) { nih_local char *json_string = NULL; struct stat statbuf; size_t len; int got_tty1 = FALSE; char chroot_path[PATH_MAX]; nih_local char *path = NULL; nih_local char *file = NULL; nih_local char *processed_json = NULL; mode_t old_perms; nih_assert (original_path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (original_path, &statbuf), 0); /* Read the original file */ file = nih_file_read (NULL, original_path, &len); TEST_NE_P (file, NULL); old_perms = umask (0); TEST_FILENAME (chroot_path); assert0 (mkdir (chroot_path, 0755)); path = NIH_MUST (nih_sprintf (NULL, "%s/etc", chroot_path)); assert0 (mkdir (path, 0755)); path = NIH_MUST (nih_sprintf (NULL, "%s/etc/init", chroot_path)); assert0 (mkdir (path, 0755)); /* Replace @CHROOT_PATH@ with our temporary path */ processed_json = search_and_replace (NULL, file, "@CHROOT_PATH@", chroot_path); TEST_NE_P (processed_json, NULL); /* Create some jobs which are also specified in the original * JSON state data. */ CREATE_FILE (path, "tty1.conf", "manual"); CREATE_FILE (path, "tty2.conf", "manual"); /* Recreate state from JSON data file */ assert0 (state_from_string (processed_json)); TEST_LIST_NOT_EMPTY (conf_sources); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_NOT_EMPTY (sessions); int session_count = 0; NIH_LIST_FOREACH (sessions, iter) { Session *session = (Session *)iter; nih_local char *new_path = NULL; /* yes, there is a double-slash in this path */ new_path = nih_sprintf (NULL, "%s/%s", chroot_path, "/etc/init"); TEST_EQ_STR (session->chroot, chroot_path); TEST_EQ_STR (session->conf_path, new_path); session_count++; } TEST_EQ (session_count, 1); int source_types[3] = {0, 0, 0}; NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *) iter; if (! source->session) { switch (source->type) { case CONF_FILE: source_types[0]++; break; case CONF_JOB_DIR: source_types[1]++; break; default: nih_assert_not_reached (); } } else { switch (source->type) { case CONF_JOB_DIR: source_types[2]++; break; default: nih_assert_not_reached (); } } } TEST_EQ (source_types[0], 1); TEST_EQ (source_types[1], 1); TEST_EQ (source_types[2], 1); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; TEST_EQ_P (class->session, NULL); if (! strcmp (class->name, "tty1")) got_tty1 = TRUE; } /* XXX: The json contains 2 tty1 jobs: one in the NULL session, * and the other in the chroot session. * * Make sure that duplicate job names (albeit in different sessions) * do not stop the NULL session job from being recreated. */ TEST_EQ (got_tty1, TRUE); nih_free (conf_sources); nih_free (job_classes); nih_free (events); nih_free (sessions); conf_sources = NULL; job_classes = NULL; events = NULL; sessions = NULL; conf_init (); job_class_init (); event_init (); session_init (); DELETE_FILE (path, "tty1.conf"); DELETE_FILE (path, "tty2.conf"); path = NIH_MUST (nih_sprintf (NULL, "%s/etc/init", chroot_path)); assert0 (rmdir (path)); path = NIH_MUST (nih_sprintf (NULL, "%s/etc", chroot_path)); assert0 (rmdir (path)); assert0 (rmdir (chroot_path)); /* Restore */ umask (old_perms); } /** * test_session_upgrade_stale * * @path: full path to JSON data file that needs pre-processing. * * Test to ensure Upstart can deserialise a state file containing a * stale chroot session which is long gone. This was added since * updated scenario caught a bug in a bug fix to an early fix for * LP:#1199778 (resulting in stateless re-exec). * **/ void test_session_upgrade_stale (const char *path) { nih_local char *json_string = NULL; struct stat statbuf; size_t len; int got_tty1 = FALSE; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); TEST_LIST_NOT_EMPTY (conf_sources); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_NOT_EMPTY (sessions); int session_count = 0; NIH_LIST_FOREACH (sessions, iter) { Session *session = (Session *)iter; if (session_count == 0) { TEST_EQ_STR (session->chroot, "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482"); TEST_EQ_STR (session->conf_path, "/var/lib/schroot/mount/raring-amd64-9684b2e0-c5c2-49f0-9baf-7eddd72f2482/etc/init"); } else { TEST_EQ_STR (session->chroot, "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f"); TEST_EQ_STR (session->conf_path, "/var/lib/schroot/mount/saucy-amd64-4c0015a8-7e99-4d1b-8453-557a82aff76f/etc/init"); } session_count++; } TEST_EQ (session_count, 2); int source_types[3] = {0, 0, 0}; NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *) iter; if (! source->session) { switch (source->type) { case CONF_FILE: source_types[0]++; break; case CONF_JOB_DIR: source_types[1]++; break; default: nih_assert_not_reached (); } } else { switch (source->type) { case CONF_JOB_DIR: source_types[2]++; break; default: nih_assert_not_reached (); } } } TEST_EQ (source_types[0], 1); TEST_EQ (source_types[1], 1); TEST_EQ (source_types[2], 2); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; TEST_EQ_P (class->session, NULL); if (! strcmp (class->name, "tty1")) got_tty1 = TRUE; } /* XXX: The json contains 2 tty1 jobs: one in the NULL session, * and the other in the chroot session. * * Make sure that duplicate job names (albeit in different sessions) * do not stop the NULL session job from being recreated. */ TEST_EQ (got_tty1, TRUE); nih_free (conf_sources); nih_free (job_classes); nih_free (events); nih_free (sessions); conf_sources = NULL; job_classes = NULL; events = NULL; sessions = NULL; conf_init (); job_class_init (); event_init (); session_init (); } /** * test_upstart1_8_upgrade: * * @path: full path to JSON data file to deserialise. * * Test for Upstart 1.8 serialisation data format where start_on and * stop_on conditions were encoded as strings, not EventOperators. **/ void test_upstart1_8_upgrade (const char *path) { nih_local char *json_string = NULL; struct stat statbuf; size_t len; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); /* ConfSource and ConfFile objects not serialised in this * version. */ TEST_LIST_EMPTY (conf_sources); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_EMPTY (sessions); nih_free (events); nih_free (conf_sources); nih_free (job_classes); events = NULL; conf_sources = NULL; job_classes = NULL; event_init (); conf_init (); job_class_init (); } /** * test_upstart_pre_security_upgrade: * * @path: full path to JSON data file to deserialise. * * Test for Upstart pre-security serialisation data format that doesn't * contain apparmor_switch element, and PROCESS_SECURITY. * **/ void test_upstart_pre_security_upgrade (const char *path) { nih_local char *json_string = NULL; Event *event; ConfSource *source; ConfFile *file; nih_local char *conf_file_path = NULL; struct stat statbuf; size_t len; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (conf_sources); /* Create the ConfSource and ConfFile objects to simulate * Upstart reading /etc/init on startup. Required since we * don't currently serialise these objects. */ source = conf_source_new (NULL, "/tmp/security", CONF_JOB_DIR); TEST_NE_P (source, NULL); conf_file_path = NIH_MUST (nih_sprintf (NULL, "%s/%s", "/tmp/security", "security")); file = conf_file_new (source, conf_file_path); TEST_NE_P (file, NULL); TEST_LIST_NOT_EMPTY (conf_sources); event = (Event *)nih_list_remove (events->next); TEST_NE_P (event, NULL); TEST_EQ_STR (event->name, "Christmas"); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; TEST_EQ_STR (class->name, "security"); TEST_EQ_STR (class->path, "/com/ubuntu/Upstart/jobs/security"); TEST_EQ_P (class->apparmor_switch, NULL); TEST_HASH_NOT_EMPTY (class->instances); TEST_EQ_P (class->process[PROCESS_SECURITY], NULL); TEST_FALSE (class->process[PROCESS_MAIN]->script); TEST_FALSE (class->process[PROCESS_PRE_START]->script); TEST_FALSE (class->process[PROCESS_POST_START]->script); TEST_FALSE (class->process[PROCESS_PRE_STOP]->script); TEST_FALSE (class->process[PROCESS_POST_STOP]->script); TEST_EQ_STR (class->process[PROCESS_MAIN]->command, "a"); TEST_EQ_STR (class->process[PROCESS_PRE_START]->command, "b"); TEST_EQ_STR (class->process[PROCESS_POST_START]->command, "c"); TEST_EQ_STR (class->process[PROCESS_PRE_STOP]->command, "d"); TEST_EQ_STR (class->process[PROCESS_POST_STOP]->command, "e"); NIH_HASH_FOREACH (class->instances, iter2) { Job *job = (Job *)iter2; nih_local char *instance_path = NULL; /* instance name */ TEST_EQ_STR (job->name, ""); instance_path = NIH_MUST (nih_sprintf (NULL, "%s/_", class->path)); TEST_EQ_STR (job->path, instance_path); TEST_EQ (job->pid[PROCESS_MAIN], 10); TEST_EQ (job->pid[PROCESS_PRE_START], 11); TEST_EQ (job->pid[PROCESS_POST_START], 12); TEST_EQ (job->pid[PROCESS_PRE_STOP], 13); TEST_EQ (job->pid[PROCESS_POST_STOP], 14); TEST_EQ (job->pid[PROCESS_SECURITY], 0); TEST_EQ_P (job->log[PROCESS_MAIN], NULL); TEST_EQ_P (job->log[PROCESS_PRE_START], NULL); TEST_EQ_P (job->log[PROCESS_POST_START], NULL); TEST_EQ_P (job->log[PROCESS_PRE_STOP], NULL); TEST_EQ_P (job->log[PROCESS_POST_STOP], NULL); TEST_EQ_P (job->log[PROCESS_SECURITY], NULL); } } nih_free (event); nih_free (conf_sources); conf_sources = NULL; nih_free (job_classes); job_classes = NULL; } /** * test_upstart_with_apparmor_upgrade: * * @path: full path to JSON data file to deserialise. * * Test that Upstart is able to deserialise the 1.8-format JSON with the * addition of the apparmor meta-data but _without_ the full serialisation * data (including complete EventOperator data for * JobClass->[start|stop]_on objects). **/ void test_upstart_with_apparmor_upgrade (const char *path) { nih_local char *json_string = NULL; struct stat statbuf; size_t len; json_object *json = NULL; json_object *json_job_classes = NULL; json_object *json_job_class = NULL; json_object *json_job_class_start_on = NULL; json_object *json_job_class_process = NULL; json_object *json_jobs = NULL; json_object *json_job = NULL; json_object *json_job_pids = NULL; json_object *json_job_logs = NULL; size_t count; /* PROCESS_MAIN, PROCESS_PRE_START, PROCESS_POST_START, PROCESS_PRE_STOP, PROCESS_POST_STOP, PROCESS_SECURITY */ size_t expected_count = 6; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); TEST_LIST_EMPTY (sessions); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_EMPTY (conf_sources); /* Re-read the json, checking for expected content */ json = json_object_from_file (path); TEST_NE_P (json, NULL); TEST_TRUE (json_object_object_get_ex (json, "job_classes", &json_job_classes)); TEST_NE_P (json_job_classes, NULL); TEST_TRUE (state_check_json_type (json_job_classes, array)); /* Look at first JobClass */ json_job_class = json_object_array_get_idx (json_job_classes, 0); TEST_NE_P (json_job_class, NULL); TEST_TRUE (state_check_json_type (json_job_class, object)); /* Check to ensure we are dealing with the old serialisation * format where the 'start on' condition was encoded as a * string. */ TEST_TRUE (json_object_object_get_ex (json_job_class, "start_on", &json_job_class_start_on)); TEST_NE_P (json_job_class_start_on, NULL); TEST_TRUE (state_check_json_type (json_job_class_start_on, string)); /* Check to ensure the JobClass contains the expected apparmor field */ TEST_TRUE (json_object_object_get_ex (json_job_class, "apparmor_switch", NULL)); TEST_TRUE (json_object_object_get_ex (json_job_class, "process", &json_job_class_process)); TEST_NE_P (json_job_class_process, NULL); TEST_TRUE (state_check_json_type (json_job_class_process, array)); count = json_object_array_length (json_job_class_process); TEST_EQ (count, expected_count); TEST_TRUE (json_object_object_get_ex (json_job_class, "jobs", &json_jobs)); TEST_NE_P (json_jobs, NULL); TEST_TRUE (state_check_json_type (json_jobs, array)); /* Look at first Job */ json_job = json_object_array_get_idx (json_jobs, 0); TEST_NE_P (json_job, NULL); TEST_TRUE (state_check_json_type (json_job, object)); /* Check size of Job->pid array is as expected */ TEST_TRUE (json_object_object_get_ex (json_job, "pid", &json_job_pids)); TEST_NE_P (json_job_pids, NULL); TEST_TRUE (state_check_json_type (json_job_pids, array)); count = json_object_array_length (json_job_pids); TEST_EQ (count, expected_count); /* Check size of Job->log array is as expected */ TEST_TRUE (json_object_object_get_ex (json_job, "log", &json_job_logs)); TEST_NE_P (json_job_logs, NULL); TEST_TRUE (state_check_json_type (json_job_logs, array)); count = json_object_array_length (json_job_logs); TEST_EQ (count, expected_count); nih_free (job_classes); job_classes = NULL; nih_free (events); events = NULL; } /** * test_upstart_full_serialise_without_apparmor_upgrade: * * @path: full path to JSON data file to deserialise. * * Test that Upstart is able to deserialise the 1.8-format JSON with the * addition of the full serialisation (including complete EventOperator * data for JobClass->[start|stop]_on objects) but _without_ the apparmor * meta-data. **/ void test_upstart_full_serialise_without_apparmor_upgrade (const char *path) { nih_local char *json_string = NULL; struct stat statbuf; size_t len; json_object *json = NULL; json_object *json_job_classes = NULL; json_object *json_job_class = NULL; json_object *json_job_class_stop_on = NULL; json_object *json_job_class_process = NULL; json_object *json_job_class_stop_on_node = NULL; json_object *json_jobs = NULL; json_object *json_job = NULL; json_object *json_job_pids = NULL; json_object *json_job_logs = NULL; size_t count; /* PROCESS_MAIN, PROCESS_PRE_START, PROCESS_POST_START, PROCESS_PRE_STOP, PROCESS_POST_STOP, */ size_t expected_count = 5; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); TEST_LIST_EMPTY (sessions); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); /* Full serialisation, so we expect some ConfSource objects */ TEST_LIST_NOT_EMPTY (conf_sources); /* Re-read the json, checking for expected content */ json = json_object_from_file (path); TEST_NE_P (json, NULL); TEST_TRUE (json_object_object_get_ex (json, "job_classes", &json_job_classes)); TEST_NE_P (json_job_classes, NULL); TEST_TRUE (state_check_json_type (json_job_classes, array)); /* Look at 2nd JobClass */ TEST_GE (json_object_array_length (json_job_classes), 2); json_job_class = json_object_array_get_idx (json_job_classes, 1); TEST_NE_P (json_job_class, NULL); TEST_TRUE (state_check_json_type (json_job_class, object)); /* Check to ensure we are dealing with the new serialisation * format where the 'stop on' condition is encoded as a * full EventOperator object. */ TEST_TRUE (json_object_object_get_ex (json_job_class, "stop_on", &json_job_class_stop_on)); TEST_NE_P (json_job_class_stop_on, NULL); /* EventOperators are serialised as an array of objects * representing the tree. */ TEST_TRUE (state_check_json_type (json_job_class_stop_on, array)); /* Look at the first element */ json_job_class_stop_on_node = json_object_array_get_idx (json_job_class_stop_on, 0); TEST_NE_P (json_job_class_stop_on_node, NULL); TEST_TRUE (state_check_json_type (json_job_class_stop_on_node, object)); /* Look for expected EventOperator elements */ TEST_TRUE (json_object_object_get_ex (json_job_class_stop_on_node, "name", NULL)); TEST_TRUE (json_object_object_get_ex (json_job_class_stop_on_node, "value", NULL)); TEST_TRUE (json_object_object_get_ex (json_job_class_stop_on_node, "type", NULL)); /* Check to ensure the JobClass does NOT contain the apparmor field */ TEST_FALSE (json_object_object_get_ex (json_job_class, "apparmor_switch", NULL)); TEST_TRUE (json_object_object_get_ex (json_job_class, "process", &json_job_class_process)); TEST_NE_P (json_job_class_process, NULL); TEST_TRUE (state_check_json_type (json_job_class_process, array)); count = json_object_array_length (json_job_class_process); TEST_EQ (count, expected_count); TEST_TRUE (json_object_object_get_ex (json_job_class, "jobs", &json_jobs)); TEST_NE_P (json_jobs, NULL); TEST_TRUE (state_check_json_type (json_jobs, array)); /* Look at first Job */ json_job = json_object_array_get_idx (json_jobs, 0); TEST_NE_P (json_job, NULL); TEST_TRUE (state_check_json_type (json_job, object)); /* Check size of Job->pid array is as expected */ TEST_TRUE (json_object_object_get_ex (json_job, "pid", &json_job_pids)); TEST_NE_P (json_job_pids, NULL); TEST_TRUE (state_check_json_type (json_job_pids, array)); count = json_object_array_length (json_job_pids); TEST_EQ (count, expected_count); /* Check size of Job->log array is as expected */ TEST_TRUE (json_object_object_get_ex (json_job, "log", &json_job_logs)); TEST_NE_P (json_job_logs, NULL); TEST_TRUE (state_check_json_type (json_job_logs, array)); count = json_object_array_length (json_job_logs); TEST_EQ (count, expected_count); nih_free (conf_sources); conf_sources = NULL; nih_free (job_classes); job_classes = NULL; nih_free (events); events = NULL; } /** * test_upstart_full_serialise_with_apparmor_upgrade: * * @path: full path to JSON data file to deserialise. * * Test that Upstart is able to deserialise the 1.8-format JSON with the * addition of the full serialisation (including complete EventOperator * data for JobClass->[start|stop]_on objects) and the apparmor * meta-data. **/ void test_upstart_full_serialise_with_apparmor_upgrade (const char *path) { nih_local char *json_string = NULL; struct stat statbuf; size_t len; json_object *json = NULL; json_object *json_job_classes = NULL; json_object *json_job_class = NULL; json_object *json_job_class_stop_on = NULL; json_object *json_job_class_process = NULL; json_object *json_job_class_stop_on_node = NULL; json_object *json_jobs = NULL; json_object *json_job = NULL; json_object *json_job_pids = NULL; json_object *json_job_logs = NULL; size_t count; /* PROCESS_MAIN, PROCESS_PRE_START, PROCESS_POST_START, PROCESS_PRE_STOP, PROCESS_POST_STOP, PROCESS_SECURITY */ size_t expected_count = 6; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); TEST_LIST_EMPTY (sessions); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); /* Full serialisation, so we expect some ConfSource objects */ TEST_LIST_NOT_EMPTY (conf_sources); /* Re-read the json, checking for expected content */ json = json_object_from_file (path); TEST_NE_P (json, NULL); TEST_TRUE (json_object_object_get_ex (json, "job_classes", &json_job_classes)); TEST_NE_P (json_job_classes, NULL); TEST_TRUE (state_check_json_type (json_job_classes, array)); /* Look at 2nd JobClass */ TEST_GE (json_object_array_length (json_job_classes), 2); json_job_class = json_object_array_get_idx (json_job_classes, 1); TEST_NE_P (json_job_class, NULL); TEST_TRUE (state_check_json_type (json_job_class, object)); /* Check to ensure we are dealing with the new serialisation * format where the 'stop on' condition is encoded as a * full EventOperator object. */ TEST_TRUE (json_object_object_get_ex (json_job_class, "stop_on", &json_job_class_stop_on)); TEST_NE_P (json_job_class_stop_on, NULL); /* EventOperators are serialised as an array of objects * representing the tree. */ TEST_TRUE (state_check_json_type (json_job_class_stop_on, array)); /* Look at the first element */ json_job_class_stop_on_node = json_object_array_get_idx (json_job_class_stop_on, 0); TEST_NE_P (json_job_class_stop_on_node, NULL); TEST_TRUE (state_check_json_type (json_job_class_stop_on_node, object)); /* Look for expected EventOperator elements */ TEST_TRUE (json_object_object_get_ex (json_job_class_stop_on_node, "name", NULL)); TEST_TRUE (json_object_object_get_ex (json_job_class_stop_on_node, "value", NULL)); TEST_TRUE (json_object_object_get_ex (json_job_class_stop_on_node, "type", NULL)); /* Check to ensure the JobClass contains the expected apparmor field */ TEST_TRUE (json_object_object_get_ex (json_job_class, "apparmor_switch", NULL)); TEST_TRUE (json_object_object_get_ex (json_job_class, "process", &json_job_class_process)); TEST_NE_P (json_job_class_process, NULL); TEST_TRUE (state_check_json_type (json_job_class_process, array)); count = json_object_array_length (json_job_class_process); TEST_EQ (count, expected_count); TEST_TRUE (json_object_object_get_ex (json_job_class, "jobs", &json_jobs)); TEST_NE_P (json_jobs, NULL); TEST_TRUE (state_check_json_type (json_jobs, array)); /* Look at first Job */ json_job = json_object_array_get_idx (json_jobs, 0); TEST_NE_P (json_job, NULL); TEST_TRUE (state_check_json_type (json_job, object)); /* Check size of Job->pid array is as expected */ TEST_TRUE (json_object_object_get_ex (json_job, "pid", &json_job_pids)); TEST_NE_P (json_job_pids, NULL); TEST_TRUE (state_check_json_type (json_job_pids, array)); count = json_object_array_length (json_job_pids); TEST_EQ (count, expected_count); /* Check size of Job->log array is as expected */ TEST_TRUE (json_object_object_get_ex (json_job, "log", &json_job_logs)); TEST_NE_P (json_job_logs, NULL); TEST_TRUE (state_check_json_type (json_job_logs, array)); count = json_object_array_length (json_job_logs); TEST_EQ (count, expected_count); nih_free (conf_sources); conf_sources = NULL; nih_free (job_classes); job_classes = NULL; nih_free (events); events = NULL; } /** * test_reload_signal_state: * * @path: full path to JSON data file to deserialise. * * Test that Upstart is able to deserialise the 1.9-format JSON with the * addition of the reload signal stanza. **/ void test_reload_signal_state (const char *path) { nih_local char *json_string = NULL; struct stat statbuf; size_t len; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); TEST_LIST_EMPTY (sessions); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_NOT_EMPTY (conf_sources); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; if (strcmp (class->name, "whoopsie") == 0) { TEST_EQ (class->reload_signal, 10); } else TEST_EQ (class->reload_signal, SIGHUP); } nih_free (conf_sources); nih_free (job_classes); nih_free (events); nih_free (sessions); conf_sources = NULL; job_classes = NULL; events = NULL; sessions = NULL; conf_init (); job_class_init (); event_init (); session_init (); } /** * test_job_environ_upgrade: * * @path: full path to JSON data file to deserialise. * * Test that Upstart is able to deserialise 1.10-format JSON with * the job_environ data. **/ void test_job_environ_upgrade (const char *path) { nih_local char *json_string = NULL; json_object *json = NULL; json_object *json_value = NULL; struct stat statbuf; size_t len; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* Read the json, checking for expected content */ json = json_object_from_file (path); TEST_NE_P (json, NULL); /* Ensure it's there */ TEST_TRUE (json_object_object_get_ex (json, "job_environment", &json_value)); /* free the JSON */ json_object_put (json); /* Recreate state from JSON data file */ assert0 (state_from_string (json_string)); TEST_LIST_EMPTY (sessions); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_NOT_EMPTY (conf_sources); nih_free (conf_sources); nih_free (job_classes); nih_free (events); nih_free (sessions); conf_sources = NULL; job_classes = NULL; events = NULL; sessions = NULL; conf_init (); job_class_init (); event_init (); session_init (); } /** * test_cgroup_and_process_data_state: * * @path: full path to JSON data file to deserialise. * * Test that Upstart can deserialise: * * - cgroup stanzas (if cgroups enabled). * - the cgroup manager address (if cgroups enabled). * - JobProcessData encoded as "process_data" in JSON. **/ void test_cgroup_and_process_data_state (const char *path) { #ifdef ENABLE_CGROUPS nih_local char *cgroup_address = NULL; const char *address; json_object *json_value = NULL; #endif /* ENABLE_CGROUPS */ nih_local char *json_string = NULL; nih_local char *processed_json_string = NULL; json_object *json = NULL; struct stat statbuf; size_t len; int fds[2] = { -1, -1 }; nih_local char *read_fd_str = NULL; JobClass *class; Job *job; JobProcessData *process_data; nih_assert (path); conf_init (); session_init (); event_init (); control_init (); job_class_init (); TEST_LIST_EMPTY (sessions); TEST_LIST_EMPTY (events); TEST_LIST_EMPTY (conf_sources); TEST_HASH_EMPTY (job_classes); #ifdef ENABLE_CGROUPS cgroup_manager_address = NULL; #endif /* ENABLE_CGROUPS */ /* Check data file exists */ TEST_EQ (stat (path, &statbuf), 0); json_string = nih_file_read (NULL, path, &len); TEST_NE_P (json_string, NULL); /* The JSON contains a "process_data" object that represents a * JobProcessData object denoting a job process whose child * setup phase is still "in-flight" (ongoing). * * The problem is that when the JobProcessData object is * reconstructed, Upstart will attempt to operate on the * job_process_fd file descriptor so that fd must be valid at * the time the test is run. * * The solution is to create a valid fd and rewrite the JSON to * specify that valid fd. */ assert0 (pipe (fds)); read_fd_str = nih_sprintf (NULL, "%d", fds[0]); TEST_NE_P (read_fd_str, NULL); /* Replace @CHROOT_PATH@ with our temporary path */ processed_json_string = search_and_replace (NULL, json_string, "@JOB_PROCESS_FD@", read_fd_str); TEST_NE_P (processed_json_string, NULL); /* Read the json, checking for expected content */ json = json_tokener_parse (processed_json_string); TEST_NE_P (json, NULL); #ifdef ENABLE_CGROUPS /* Ensure it's there */ TEST_TRUE (json_object_object_get_ex (json, "cgroup_manager_address", &json_value)); address = json_object_get_string (json_value); TEST_NE_P (address, NULL); cgroup_address = NIH_MUST (nih_strdup (NULL, address)); /* free the JSON */ json_object_put (json); #endif /* ENABLE_CGROUPS */ /* Recreate state from JSON data file */ assert0 (state_from_string (processed_json_string)); #ifdef ENABLE_CGROUPS TEST_NE_P (cgroup_manager_address, NULL); TEST_EQ_STR (cgroup_manager_address, cgroup_address); #endif /* ENABLE_CGROUPS */ class = (JobClass *)nih_hash_lookup (job_classes, "upstart-force-slow-child"); TEST_NE_P (class, NULL); job = (Job *)nih_hash_lookup (class->instances, ""); TEST_NE_P (job, NULL); TEST_GE (job->pid[PROCESS_MAIN], 1); TEST_NE_P (job->process_data, NULL); process_data = job->process_data[PROCESS_MAIN]; TEST_NE_P (process_data, NULL); TEST_EQ_P (process_data->job, job); TEST_EQ (process_data->process, PROCESS_MAIN); TEST_EQ_P (process_data->script, NULL); TEST_EQ (process_data->shell_fd, -1); TEST_EQ (process_data->job_process_fd, fds[0]); TEST_EQ (process_data->status, 0); TEST_TRUE (process_data->valid); TEST_LIST_EMPTY (sessions); TEST_LIST_NOT_EMPTY (events); TEST_HASH_NOT_EMPTY (job_classes); TEST_LIST_NOT_EMPTY (conf_sources); nih_free (conf_sources); nih_free (job_classes); nih_free (events); nih_free (sessions); conf_sources = NULL; job_classes = NULL; events = NULL; sessions = NULL; close (fds[0]); close (fds[1]); conf_init (); job_class_init (); event_init (); session_init (); } /** * conf_source_from_path: * * @path: path to consider, * @type: tyoe of ConfSource to check for, * @session: session. * * Look for a ConfSource with path @path, type @type and session * @session. * * Returns: Matching ConfSource or NULL if not found. */ ConfSource * conf_source_from_path (const char *path, ConfSourceType type, const Session *session) { nih_assert (path); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; if (! strcmp (source->path, path) && source->type == type && source->session == session) return source; } return NULL; } int main (int argc, char *argv[]) { /* run tests in legacy (pre-session support) mode */ setenv ("UPSTART_NO_SESSIONS", "1", 1); /* Modify Upstart's behaviour slightly since it's running under * the test suite. */ test_basic_types (); test_clean_args (); test_enums (); test_int_arrays (); test_string_arrays (); test_hex_encoding (); test_rlimit_encoding (); test_session_serialise (); test_process_serialise (); test_blocking (); test_event_serialise (); test_log_serialise (); test_job_serialise (); test_job_class_serialise (); test_upgrade (); return 0; } upstart-1.13.2/init/tests/test_conf_static.c0000664000175000017500000001313612373101356016034 00000000000000/* upstart * * test_conf.c - test suite for init/conf.c * * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include "conf.c" void test_toggle_conf_name (void) { char override_ext[] = ".override"; char dirname[PATH_MAX]; char filename[PATH_MAX]; JobClass *job; char *f; char *p; TEST_FUNCTION ("toggle_conf_name"); TEST_FEATURE ("changing conf to override"); TEST_FILENAME (dirname); strcpy (filename, dirname); strcat (filename, "/foo.conf"); f = toggle_conf_name (NULL, filename); TEST_NE_P (f, NULL); p = strstr (f, ".override"); TEST_NE_P (p, NULL); TEST_EQ_P (p, f+strlen (f) - strlen (override_ext)); nih_free (f); TEST_FEATURE ("changing override to conf"); strcpy (filename, dirname); strcat (filename, "/bar.override"); f = toggle_conf_name (NULL, filename); TEST_NE_P (f, NULL); p = strstr (f, ".conf"); TEST_NE_P (p, NULL); TEST_EQ_P (p, f+strlen (f) - strlen (".conf")); nih_free (f); /* test parent param */ job = job_class_new (NULL, "foo", NULL); TEST_NE_P (job, NULL); f = toggle_conf_name (job, filename); TEST_NE_P (f, NULL); TEST_EQ (TRUE, nih_alloc_parent (f, job)); nih_free (job); } void test_conf_to_job_name (void) { char dirname[PATH_MAX]; char *filename; char *name; TEST_FUNCTION ("conf_to_job_name"); TEST_FEATURE ("with .conf file"); TEST_FILENAME (dirname); filename = nih_sprintf (NULL, "%s/foo.conf", dirname); name = conf_to_job_name (dirname, filename); TEST_EQ_STR (name, "foo"); nih_free (filename); nih_free (name); TEST_FEATURE ("with .override file"); filename = nih_sprintf (NULL, "%s/foo.override", dirname); name = conf_to_job_name (dirname, filename); TEST_EQ_STR (name, "foo"); nih_free (filename); nih_free (name); TEST_FEATURE ("with .conf in a sub-directory"); filename = nih_sprintf (NULL, "%s/foo/bar.conf", dirname); name = conf_to_job_name (dirname, filename); TEST_EQ_STR (name, "foo/bar"); nih_free (filename); nih_free (name); TEST_FEATURE ("without extension"); filename = nih_sprintf (NULL, "%s/foo", dirname); name = conf_to_job_name (dirname, filename); TEST_EQ_STR (name, "foo"); nih_free (filename); nih_free (name); } void test_conf_get_best_override (void) { const char *sources[] = {"peter", "paul", "mary", NULL}; FILE *f; char dirname[PATH_MAX]; char *dir; char *expected; char *path; TEST_FUNCTION ("conf_get_best_override"); TEST_FILENAME (dirname); mkdir (dirname, 0755); for (const char **src = sources; *src; src++) { dir = nih_sprintf (NULL, "%s/%s", dirname, *src); TEST_EQ (mkdir (dir, 0755), 0); NIH_MUST (conf_source_new (NULL, dir, CONF_JOB_DIR)); nih_free (dir); } TEST_FEATURE ("with no overrides"); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; path = conf_get_best_override ("foo", source); TEST_EQ_P (path, NULL); } TEST_FEATURE ("with single highest priority override"); expected = nih_sprintf (NULL, "%s/%s/foo.override", dirname, sources[0]); f = fopen (expected, "w"); TEST_NE_P (f, NULL); TEST_EQ (fclose (f), 0); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; path = conf_get_best_override ("foo", source); TEST_EQ_STR (path, expected); nih_free (path); } TEST_EQ (unlink (expected), 0); TEST_FEATURE ("with single middle priority override"); expected = nih_sprintf (NULL, "%s/%s/foo.override", dirname, sources[1]); f = fopen (expected, "w"); TEST_NE_P (f, NULL); TEST_EQ (fclose (f), 0); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; path = conf_get_best_override ("foo", source); /* Poor-man's basename(1) */ dir = conf_to_job_name (dirname, source->path); if (strcmp (dir, sources[0]) == 0) { TEST_EQ_P (path, NULL); } else { TEST_EQ_STR (path, expected); nih_free (path); } nih_free (dir); } TEST_EQ (unlink (expected), 0); TEST_FEATURE ("with single lowest priority override"); expected = nih_sprintf (NULL, "%s/%s/foo.override", dirname, sources[2]); f = fopen (expected, "w"); TEST_NE_P (f, NULL); TEST_EQ (fclose (f), 0); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; path = conf_get_best_override ("foo", source); /* Poor-man's basename(1) */ dir = conf_to_job_name (dirname, source->path); if (strcmp (dir, sources[2]) == 0) { TEST_EQ_STR (path, expected); nih_free (path); } else { TEST_EQ_P (path, NULL); } nih_free (dir); } TEST_EQ (unlink (expected), 0); /* Clean up */ for (const char **src = sources; *src; src++) { dir = nih_sprintf (NULL, "%s/%s", dirname, *src); TEST_EQ (rmdir (dir), 0); nih_free (dir); } TEST_EQ (rmdir (dirname), 0); NIH_LIST_FOREACH_SAFE (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; nih_free (source); } } int main (int argc, char *argv[]) { test_toggle_conf_name (); test_conf_to_job_name (); test_conf_get_best_override (); return 0; } upstart-1.13.2/init/tests/wrap_inotify.c0000664000175000017500000001102412373101356015205 00000000000000/* upstart * * wrap_inotify.c - library to subvert inotify calls. * * Copyright 2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** * = Description = * * The test_conf upstart test requires certain test scenarios to run in * an environment where inotify(7) is not available/functional to force the * underlying NIH library to perform a manual filesystem tree traversal. * * Since inotify limits are _per user_ and not _per process_, it is not * possible to disable inotify on a system reliabliy for the duration * of a test run since the test is at the mercy of other processes that * are making inotify calls too. * * The only reliable method therefore is to "fake" the inotify calls * using this library. * * To use this library: * * 1) Have the test code set the environment variable "INOTIFY_DISABLE" to * any value to disable inotify, and unset the variable to leave it * enabled. * * 2) Run the test code using LD_PRELOAD to force the dynamic * link-loader to use these inotify definitions rather than those * provided by libc: * * (LD_PRELOAD=/path/to/this/libary.so test_code) * * To convince yourself this library is being used, set "INOTIFY_DEBUG" * to any value for some stdout debug messages. **/ /* to ensure we get RTLD_NEXT */ #define _GNU_SOURCE #include #include #include #include #include #include /** * Determine if inotify should be disabled. **/ #define disable_inotify() \ (getenv ("INOTIFY_DISABLE")) /** * Determine if inotify debug should be displayed to stdout. **/ #define debug_inotify() \ (getenv ("INOTIFY_DEBUG")) /** * debug_msg: * * If debug is enabled, display a message to stdout stating if inotify * is enabled along with details of the called function. **/ #define debug_msg() \ do { \ if (debug_inotify ()) { \ printf ("DEBUG:%s:%d: inotify %s\n", \ __func__, __LINE__, \ disable_inotify () \ ? "disabled" : "enabled"); \ fflush (NULL); \ } \ } while (0) int __wrap_inotify_init (void) __attribute ((warn_unused_result, no_instrument_function)); int __wrap_inotify_add_watch (int fd, const char *pathname, uint32_t mask) __attribute ((warn_unused_result, no_instrument_function)); int __wrap_inotify_rm_watch (int fd, int wd) __attribute ((warn_unused_result, no_instrument_function)); int (*real_inotify_init_addr) (void); int (*real_inotify_add_watch_addr) (int fd, const char *pathname, uint32_t mask); int (*real_inotify_rm_watch_addr) (int fd, int wd); int __wrap_inotify_init (void) { if (disable_inotify ()) { /* simulate reaching inotify instances user limit */ errno = EMFILE; return -1; } *(void **)(&real_inotify_init_addr) = dlsym (RTLD_NEXT, "inotify_init"); assert (! dlerror ()); assert (real_inotify_init_addr); return real_inotify_init_addr (); } int __wrap_inotify_add_watch (int fd, const char *pathname, uint32_t mask) { if (disable_inotify ()) { /* simulate reaching inotify watches user limit */ errno = ENOSPC; return -1; } *(void **)(&real_inotify_add_watch_addr) = dlsym (RTLD_NEXT, "inotify_add_watch"); assert (! dlerror ()); assert (real_inotify_add_watch_addr); return real_inotify_add_watch_addr (fd, pathname, mask); } int __wrap_inotify_rm_watch (int fd, int wd) { if (disable_inotify ()) { ; /* not meaningful, so just pass through */ } *(void **)(&real_inotify_rm_watch_addr) = dlsym (RTLD_NEXT, "inotify_rm_watch"); assert (! dlerror ()); assert (real_inotify_rm_watch_addr); return real_inotify_rm_watch_addr (fd, wd); } int inotify_init (void) { debug_msg (); return __wrap_inotify_init (); } int inotify_add_watch (int fd, const char *pathname, uint32_t mask) { debug_msg (); return __wrap_inotify_add_watch (fd, pathname, mask); } int inotify_rm_watch (int fd, int wd) { debug_msg (); return __wrap_inotify_rm_watch (fd, wd); } upstart-1.13.2/init/cgroup.h0000664000175000017500000001440512401640554012643 00000000000000/* upstart * * cgroup.c - cgroup support. * * Copyright © 2013-2014 Canonical Ltd. * Author: James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_CGROUP_H #define INIT_CGROUP_H #include #include /** * DBUS_PATH_CGMANAGER: * * D-Bus object path the cgroup manager is available on. **/ #ifndef DBUS_PATH_CGMANAGER #define DBUS_PATH_CGMANAGER "/org/linuxcontainers/cgmanager" #endif /** * UPSTART_CGROUP_ROOT: * * Name of root cgroup. **/ #define UPSTART_CGROUP_ROOT "/" /** * UPSTART_CGROUP_ENVVAR: * * Name of special variable that may be specified within a cgroup stanza * and which expands to a job-unique cgroup path. **/ #define UPSTART_CGROUP_ENVVAR "UPSTART_CGROUP" /** * UPSTART_CGROUP_SHELL_ENVVAR: * * Value of UPSTART_CGROUP_ENVVAR with leading dollar. **/ #define UPSTART_CGROUP_SHELL_ENVVAR "$" UPSTART_CGROUP_ENVVAR /** * CGroupSetting: * * Representation of a control group setting. * * Control groups are implemented as directories created under a * special sysfs sub-directory mount. These directories contain files * created by the kernel. Some of these files represent tunables * such that values written into them modify the behaviour of the parent * cgroup. A CGroupSetting represents the meta-data to be written to * such a tunable cgroup file. * * @entry: list header, * @key: setting to change, * @value: value of @key. **/ typedef struct cgroup_setting { NihList entry; char *key; char *value; } CGroupSetting; /** * CGroupName: * * @entry: list header, * @name: name of cgroup, * @expanded: value of @name where all variables have been expanded * (or NULL if expanded value is the same as @name), * @settings: list of CGroupSettings. * * Representation of a control group name. * * Note: @name is in fact a relative path fragment which can optionally * contain embedded variables which will be expanded and which will be created * below the appropriate cgroup controller. **/ typedef struct cgroup_name { NihList entry; char *name; char *expanded; NihList settings; } CGroupName; /** * CGroup: * * @entry: list header, * @controller: cgroup controller name, * @names: list of CGroupName objects. * * Representation of a control group. * * Note: @cgroups must contain atleast one entry since a control group * is represented by its controlling subsystem and a name. **/ typedef struct cgroup { NihList entry; char *controller; NihList names; } CGroup; NIH_BEGIN_EXTERN void cgroup_init (void); int cgroup_support_enabled (void) __attribute__ ((warn_unused_result)); CGroupName *cgroup_name_new (void *parent, const char *name) __attribute__ ((warn_unused_result)); json_object *cgroup_name_serialise (CGroupName *name) __attribute__ ((warn_unused_result)); json_object *cgroup_name_serialise_all (NihList *names) __attribute__ ((warn_unused_result)); CGroupName *cgroup_name_deserialise (void *parent, json_object *json) __attribute__ ((warn_unused_result)); int cgroup_name_deserialise_all (void *parent, NihList *list, json_object *json) __attribute__ ((warn_unused_result)); json_object *cgroup_serialise (CGroup *group) __attribute__ ((warn_unused_result)); json_object *cgroup_serialise_all (NihList *cgroups) __attribute__ ((warn_unused_result)); CGroup *cgroup_deserialise (void *parent, json_object *json) __attribute__ ((warn_unused_result)); int cgroup_deserialise_all (void *parent, NihList *list, json_object *json) __attribute__ ((warn_unused_result)); CGroupSetting *cgroup_setting_new (void *parent, const char *key, const char *value) __attribute__ ((warn_unused_result)); CGroup *cgroup_new (void *parent, const char *controller) __attribute__ ((warn_unused_result)); int cgroup_manager_set_address (const char *address) __attribute__ ((warn_unused_result)); int cgroup_manager_connect (void) __attribute__ ((warn_unused_result)); int cgroup_manager_available (void) __attribute__ ((warn_unused_result)); int cgroup_clear (NihList *cgroups); int cgroup_setup (NihList *cgroups, char * const *env, uid_t uid, gid_t gid) __attribute__ ((warn_unused_result)); int cgroup_chown (const char *controller, const char *path, uid_t uid, gid_t gid) __attribute__ ((warn_unused_result)); json_object *cgroup_manager_serialise (void) __attribute__ ((warn_unused_result)); int cgroup_manager_deserialise (json_object *json) __attribute__ ((warn_unused_result)); json_object *cgroup_serialise_all (NihList *cgroups) __attribute__ ((warn_unused_result)); json_object *cgroup_setting_serialise (const CGroupSetting *setting) __attribute__ ((warn_unused_result)); json_object *cgroup_setting_serialise_all (NihList *settings) __attribute__ ((warn_unused_result)); CGroupSetting *cgroup_setting_deserialise (void *parent, json_object *json) __attribute__ ((warn_unused_result)); int cgroup_setting_deserialise_all (void *parent, NihList *list, json_object *json) __attribute__ ((warn_unused_result)); int cgroup_add (void *parent, NihList *list, const char *controller, const char *name, const char *key, const char *value) __attribute__ ((warn_unused_result)); int cgroup_create (const char *controller, const char *path) __attribute__ ((warn_unused_result)); int cgroup_enter (const char *controller, const char *path, pid_t pid) __attribute__ ((warn_unused_result)); int cgroup_enter_groups (NihList *cgroups) __attribute__ ((warn_unused_result)); int cgroup_settings_apply (const char *controller, const char *path, NihList *settings) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_CGROUP_H */ upstart-1.13.2/init/quiesce.h0000664000175000017500000000453712373101356013007 00000000000000/* upstart * * Copyright © 2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_QUIESCE_H #define INIT_QUIESCE_H #include /** * QUIESCE_DEFAULT_JOB_RUNTIME: * * The default maximum length of time to wait after emitting the * SESSION_END_EVENT event before stopping all jobs. **/ #define QUIESCE_DEFAULT_JOB_RUNTIME 5 /** * QuiesceRequester: * * Reason for Session Init wishing to shutdown; either the Session Init * has been notified the system is being shutdown, or the session has * requested it be ended (for example due to a user logout request). **/ typedef enum quiesce_requester { QUIESCE_REQUESTER_INVALID = -1, QUIESCE_REQUESTER_SYSTEM = 0, QUIESCE_REQUESTER_SESSION, } QuiesceRequester; /** * QuiescePhase: * * Phase 0: No quiesce operation in progress. * * Phase 1: Wait: Period between SESSION_END_EVENT being emitted and * QUIESCE_DEFAULT_JOB_RUNTIME being reached. * * Phase 2: Kill: Period between QUIESCE_DEFAULT_JOB_RUNTIME being * reached and kill signal being sent to all jobs. * * Phase 3: Cleanup: Period between all jobs having ended * (either naturally or by induction) and final exit. **/ typedef enum quiesce_phase { QUIESCE_PHASE_NOT_QUIESCED, QUIESCE_PHASE_WAIT, QUIESCE_PHASE_KILL, QUIESCE_PHASE_CLEANUP, } QuiescePhase; NIH_BEGIN_EXTERN void quiesce (QuiesceRequester requester); void quiesce_wait_callback (void *data, NihTimer *timer); void quiesce_show_slow_jobs (void); void quiesce_finalise (void); void quiesce_complete (void); int quiesce_in_progress (void) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_QUIESCE_H */ upstart-1.13.2/init/conf.h0000664000175000017500000001334712373101356012275 00000000000000/* upstart * * Copyright 2010,2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_CONF_H #define INIT_CONF_H #include #include #include #include #include "session.h" #include "job_class.h" /** * ConfSourceType: * * We support various different types of configuration source, both solitary * files and directory trees. Files within a directory tree may define any * single top-level type, or may be as top-level configuration files and name * what they define within themselves. **/ typedef enum conf_source_type { CONF_FILE, /* solitary file */ CONF_DIR, /* FIXME: */ CONF_JOB_DIR, /* directory tree of jobs */ } ConfSourceType; /** * ConfSource: * @entry: list header, * @session: attached session, * @path: path to source, * @type: type of source, * @watch: NihWatch structure for automatic change notification, * @flag: reload flag, * @files: hash table of files. * * This structure represents a single source of configuration, which may be * a single file or a directory of files of various types, depending on * @type. * * Normally inotify is used to watch the source for changes and load them * automatically, however mandatory reloading is also supported; for this * the @flag member is toggled, and copied to all files reloaded; * any that are in the old state are deleted. **/ typedef struct conf_source { NihList entry; Session * session; char *path; ConfSourceType type; NihWatch *watch; int flag; NihHash *files; } ConfSource; /** * ConfFile: * @entry: list header, * @path: path to file, * @source: configuration source, * @flag: reload flag, * @data: pointer to actual item. * * This structure represents a file within @source and links to the item * parsed from it. * * The @flag member is used to support mandatory reloading; when the file is * created and parsed, it is set to the same value as the source's. Then * the source can trivially see which files have been lost, since they have * the wrong flag value. **/ typedef struct conf_file { NihList entry; char *path; ConfSource *source; int flag; union { void *data; JobClass *job; }; } ConfFile; NIH_BEGIN_EXTERN extern NihList *conf_sources; void conf_init (void); void conf_destroy (void); ConfSource *conf_source_new (const void *parent, const char *path, ConfSourceType type) __attribute__ ((warn_unused_result)); ConfFile * conf_file_new (ConfSource *source, const char *path) __attribute__ ((warn_unused_result)); void conf_reload (void); int conf_source_reload (ConfSource *source) __attribute__ ((warn_unused_result)); int conf_file_destroy (ConfFile *file); JobClass * conf_select_job (const char *name, const Session *session); const char * conf_source_type_enum_to_str (ConfSourceType type) __attribute__ ((warn_unused_result)); ConfSourceType conf_source_type_str_to_enum (const char *type) __attribute__ ((warn_unused_result)); json_object * conf_source_serialise (const ConfSource *source) __attribute__ ((warn_unused_result)); json_object * conf_source_serialise_all (void) __attribute__ ((warn_unused_result)); ConfSource * conf_source_deserialise (void *parent, json_object *json) __attribute__ ((warn_unused_result)); int conf_source_deserialise_all (json_object *json) __attribute__ ((warn_unused_result)); json_object * conf_file_serialise (const ConfFile *file) __attribute__ ((warn_unused_result)); ConfFile * conf_file_deserialise (ConfSource *source, json_object *json) __attribute__ ((warn_unused_result)); int conf_file_deserialise_all (ConfSource *source, json_object *json) __attribute__ ((warn_unused_result)); ssize_t conf_source_get_index (const ConfSource *source) __attribute__ ((warn_unused_result)); ConfFile * conf_file_find (const char *name, const Session *session) __attribute__ ((warn_unused_result)); #ifdef DEBUG /* used for debugging only */ #include "job.h" size_t debug_count_hash_entries (const NihHash *hash); size_t debug_count_list_entries (const NihList *list) __attribute__ ((unused)); void debug_show_job_class (const JobClass *class) __attribute__ ((unused)); void debug_show_job_classes (void) __attribute__ ((unused)); void debug_show_job (const Job *job) __attribute__ ((unused)); void debug_show_jobs (const NihHash *instances) __attribute__ ((unused)); void debug_show_event (const Event *event) __attribute__ ((unused)); void debug_show_events (void) __attribute__ ((unused)); void debug_show_conf_file(const ConfFile *file) __attribute__ ((unused)); void debug_show_conf_source(const ConfSource *source) __attribute__ ((unused)); void debug_show_conf_sources(void) __attribute__ ((unused)); void debug_show_event_operator (EventOperator *oper) __attribute__ ((unused)); void debug_show_event_operators (EventOperator *root) __attribute__ ((unused)); #endif NIH_END_EXTERN #endif /* INIT_CONF_H */ upstart-1.13.2/init/session.h0000664000175000017500000000635312373101356013032 00000000000000/* upstart * * Copyright © 2010,2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_SESSION_H #define INIT_SESSION_H #include #include #include #include #include /** * Session: * @entry: list header, * @chroot: path all jobs are chrooted to, * @conf_path: configuration path (full path to chroot root). * * This structure is used to identify collections of jobs * that share a common @chroot (*). Note that @conf_path is * unique across all sessions. * * Summary of Session values for different environments: * * +-------------+--------------------------------------------------+ * | D-Bus | Session | * +------+------+--------+-----+-----------------------------------+ * | user | PID | chroot | uid | Object contents | * +------+------+--------+-----+-----------------------------------+ * | 0 | >0 | no | 0 | NULL (*1) | * | 0 | >0 | yes | 0 | chroot + conf_path set | * | >0 | ?? | yes | >0 | Not permitted (*2) | * +------+------+--------+-----+-----------------------------------+ * * Notes: * * (*) - this structure used to also store user session details (hence * the name), but the functionality was removed with the advent of * a true user mode. * * (*1) - The "NULL session" represents the "traditional" environment * before sessions were introduced (namely a non-chroot environment * where all job and event operations were handled by uid 0 (root)). * * (*2) - User lookup is not reliable since the user to query exists * within the chroot, but the only possible lookup is outside the * chroot. * **/ typedef struct session { NihList entry; char * chroot; char * conf_path; } Session; NIH_BEGIN_EXTERN extern NihList *sessions; void session_init (void); void session_destroy (void); Session * session_new (const void *parent, const char *chroot) __attribute__ ((warn_unused_result)); Session * session_from_dbus (const void *parent, NihDBusMessage *message); json_object * session_serialise_all (void) __attribute__ ((warn_unused_result)); int session_deserialise_all (json_object *json) __attribute__ ((warn_unused_result)); int session_get_index (const Session *session) __attribute__ ((warn_unused_result)); Session * session_from_index (int idx) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_SESSION_H */ upstart-1.13.2/init/control.c0000664000175000017500000014067212377572330013035 00000000000000/* upstart * * control.c - D-Bus connections, objects and methods * * Copyright 2009-2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "environ.h" #include "session.h" #include "job_class.h" #include "job.h" #include "blocked.h" #include "conf.h" #include "control.h" #include "errors.h" #include "state.h" #include "event.h" #include "events.h" #include "paths.h" #include "xdg.h" #include "com.ubuntu.Upstart.h" #ifdef ENABLE_CGROUPS #include "cgroup.h" #endif /* ENABLE_CGROUPS */ /* Prototypes for static functions */ static int control_server_connect (DBusServer *server, DBusConnection *conn); static void control_disconnected (DBusConnection *conn); static void control_register_all (DBusConnection *conn); static void control_bus_flush (void); static int control_get_origin_uid (NihDBusMessage *message, uid_t *uid) __attribute__ ((warn_unused_result)); static int control_check_permission (NihDBusMessage *message) __attribute__ ((warn_unused_result)); static void control_session_file_create (void); static void control_session_file_remove (void); /** * use_session_bus: * * If TRUE, connect to the D-Bus session bus rather than the system bus. * * Used for testing to simulate (as far as possible) a system-like init * when running as a non-priv user (but not as a Session Init). **/ int use_session_bus = FALSE; /** * dbus_bus_type: * * Type of D-Bus bus to connect to. **/ DBusBusType dbus_bus_type; /** * control_server_address: * * Address on which the control server may be reached. **/ char *control_server_address = NULL; /** * control_server: * * D-Bus server listening for new direct connections. **/ DBusServer *control_server = NULL; /** * control_bus_address: * * Address on which the control bus may be reached. **/ char *control_bus_address = NULL; /** * control_bus: * * Open connection to a D-Bus bus. The connection may be opened with * control_bus_open() and if lost will become NULL. **/ DBusConnection *control_bus = NULL; /** * control_conns: * * Open control connections, including the connection to a D-Bus * bus and any private client connections. **/ NihList *control_conns = NULL; /* External definitions */ extern int user_mode; extern int disable_respawn; extern char *session_file; /** * control_init: * * Initialise the control connections list. **/ void control_init (void) { if (! control_conns) control_conns = NIH_MUST (nih_list_new (NULL)); if (! control_server_address) { if (user_mode) { NIH_MUST (nih_strcat_sprintf (&control_server_address, NULL, "%s-session/%d/%d", DBUS_ADDRESS_UPSTART, getuid (), getpid ())); control_session_file_create (); } else { control_server_address = NIH_MUST (nih_strdup (NULL, DBUS_ADDRESS_UPSTART)); } } } /** * control_cleanup: * * Perform cleanup operations. **/ void control_cleanup (void) { control_session_file_remove (); } /** * control_server_open: * * Open a listening D-Bus server and store it in the control_server global. * New connections are permitted from the root user, and handled * automatically in the main loop. * * Returns: zero on success, negative value on raised error. **/ int control_server_open (void) { DBusServer *server; nih_assert (control_server == NULL); control_init (); server = nih_dbus_server (control_server_address, control_server_connect, control_disconnected); if (! server) return -1; control_server = server; return 0; } /** * control_server_connect: * * Called when a new client connects to our server and is used to register * objects on the new connection. * * Returns: always TRUE. **/ static int control_server_connect (DBusServer *server, DBusConnection *conn) { NihListEntry *entry; nih_assert (server != NULL); nih_assert (server == control_server); nih_assert (conn != NULL); nih_info (_("Connection from private client")); /* Register objects on the connection. */ control_register_all (conn); /* Add the connection to the list */ entry = NIH_MUST (nih_list_entry_new (NULL)); entry->data = conn; nih_list_add (control_conns, &entry->entry); return TRUE; } /** * control_server_close: * * Close the connection to the D-Bus system bus. Since the connection is * shared inside libdbus, this really only drops our reference to it so * it's possible to have method and signal handlers called even after calling * this (normally to dispatch what's in the queue). **/ void control_server_close (void) { if (! control_server) return; dbus_server_disconnect (control_server); dbus_server_unref (control_server); control_server = NULL; } /** * control_bus_open: * * Open a connection to the appropriate D-Bus bus and store it in the * control_bus global. The connection is handled automatically * in the main loop. * * Returns: zero on success, negative value on raised error. **/ int control_bus_open (void) { DBusConnection *conn; DBusError error; NihListEntry *entry; int ret; nih_assert (control_bus == NULL); dbus_error_init (&error); control_init (); dbus_bus_type = control_get_bus_type (); /* Connect to the appropriate D-Bus bus and hook everything up into * our own main loop automatically. */ if (user_mode && control_bus_address) { conn = nih_dbus_connect (control_bus_address, control_disconnected); if (! conn) return -1; if (! dbus_bus_register (conn, &error)) { nih_dbus_error_raise (error.name, error.message); dbus_error_free (&error); return -1; } nih_debug ("Connected to notified D-Bus bus"); } else { conn = nih_dbus_bus (use_session_bus ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, control_disconnected); if (! conn) return -1; nih_debug ("Connected to D-Bus %s bus", dbus_bus_type == DBUS_BUS_SESSION ? "session" : "system"); } /* Register objects on the bus. */ control_register_all (conn); /* Request our well-known name. We do this last so that once it * appears on the bus, clients can assume we're ready to talk to * them. */ ret = dbus_bus_request_name (conn, DBUS_SERVICE_UPSTART, DBUS_NAME_FLAG_DO_NOT_QUEUE, &error); if (ret < 0) { /* Error while requesting the name */ nih_dbus_error_raise (error.name, error.message); dbus_error_free (&error); dbus_connection_unref (conn); return -1; } else if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { /* Failed to obtain the name (already taken usually) */ nih_error_raise (CONTROL_NAME_TAKEN, _(CONTROL_NAME_TAKEN_STR)); dbus_connection_unref (conn); return -1; } /* Add the connection to the list */ entry = NIH_MUST (nih_list_entry_new (NULL)); entry->data = conn; nih_list_add (control_conns, &entry->entry); control_bus = conn; return 0; } /** * control_bus_close: * * Close the connection to the D-Bus system bus. Since the connection is * shared inside libdbus, this really only drops our reference to it so * it's possible to have method and signal handlers called even after calling * this (normally to dispatch what's in the queue). **/ void control_bus_close (void) { nih_assert (control_bus != NULL); dbus_connection_unref (control_bus); control_disconnected (control_bus); } /** * control_disconnected: * * This function is called when the connection to the D-Bus system bus, * or a client connection to our D-Bus server, is dropped and our reference * is about to be lost. We clear the connection from our current list * and drop the control_bus global if relevant. **/ static void control_disconnected (DBusConnection *conn) { nih_assert (conn != NULL); if (conn == control_bus) { DBusError error; dbus_error_init (&error); if (user_mode && control_bus_address) { nih_warn (_("Disconnected from notified D-Bus bus")); } else { nih_warn (_("Disconnected from D-Bus %s bus"), dbus_bus_type == DBUS_BUS_SESSION ? "session" : "system"); } control_bus = NULL; } /* Remove from the connections list */ NIH_LIST_FOREACH_SAFE (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; if (entry->data == conn) nih_free (entry); } } /** * control_register_all: * @conn: connection to register objects for. * * Registers the manager object and objects for all jobs and instances on * the given connection. **/ static void control_register_all (DBusConnection *conn) { nih_assert (conn != NULL); job_class_init (); /* Register the manager object, this is the primary point of contact * for clients. We only check for success, otherwise we're happy * to let this object be tied to the lifetime of the connection. */ NIH_MUST (nih_dbus_object_new (NULL, conn, DBUS_PATH_UPSTART, control_interfaces, NULL)); /* Register objects for each currently registered job and its * instances. */ NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; job_class_register (class, conn, FALSE); } } /** * control_reload_configuration: * @data: not used, * @message: D-Bus connection and message received. * * Implements the ReloadConfiguration method of the com.ubuntu.Upstart * interface. * * Called to request that Upstart reloads its configuration from disk, * useful when inotify is not available or the user is generally paranoid. * * Notes: chroot sessions are permitted to make this call. * * Returns: zero on success, negative value on raised error. **/ int control_reload_configuration (void *data, NihDBusMessage *message) { nih_assert (message != NULL); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to reload configuration")); return -1; } nih_info (_("Reloading configuration")); /* This can only be called after deserialisation */ conf_reload (); return 0; } /** * control_get_job_by_name: * @data: not used, * @message: D-Bus connection and message received, * @name: name of job to get, * @job: pointer for object path reply. * * Implements the GetJobByName method of the com.ubuntu.Upstart * interface. * * Called to obtain the path to a D-Bus object for the job named @name, * which will be stored in @job. If no job class with that name exists, * the com.ubuntu.Upstart.Error.UnknownJob D-Bus error will be raised. * * Returns: zero on success, negative value on raised error. **/ int control_get_job_by_name (void *data, NihDBusMessage *message, const char *name, char **job) { Session *session; JobClass *class = NULL; JobClass *global_class = NULL; nih_assert (message != NULL); nih_assert (name != NULL); nih_assert (job != NULL); job_class_init (); /* Verify that the name is valid */ if (! strlen (name)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Name may not be empty string")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); /* Lookup the job */ class = (JobClass *)nih_hash_search (job_classes, name, NULL); while (class && (class->session != session)) { /* Found a match in the global session which may be used * later if no matching user session job exists. */ if ((! class->session) && (session && ! session->chroot)) global_class = class; class = (JobClass *)nih_hash_search (job_classes, name, &class->entry); } /* If no job with the given name exists in the appropriate * session, look in the global namespace (aka the NULL session). */ if (! class) class = global_class; if (! class) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.UnknownJob", _("Unknown job: %s"), name); return -1; } /* Copy the path */ *job = nih_strdup (message, class->path); if (! *job) nih_return_system_error (-1); return 0; } /** * control_get_all_jobs: * @data: not used, * @message: D-Bus connection and message received, * @jobs: pointer for array of object paths reply. * * Implements the GetAllJobs method of the com.ubuntu.Upstart * interface. * * Called to obtain the paths of all known jobs, which will be stored in * @jobs. If no jobs are registered, @jobs will point to an empty array. * * Returns: zero on success, negative value on raised error. **/ int control_get_all_jobs (void *data, NihDBusMessage *message, char ***jobs) { Session *session; char **list; size_t len; nih_assert (message != NULL); nih_assert (jobs != NULL); job_class_init (); len = 0; list = nih_str_array_new (message); if (! list) nih_return_system_error (-1); /* Get the relevant session */ session = session_from_dbus (NULL, message); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; if ((class->session || (session && session->chroot)) && (class->session != session)) continue; if (! nih_str_array_add (&list, message, &len, class->path)) { nih_error_raise_system (); nih_free (list); return -1; } } *jobs = list; return 0; } int control_emit_event (void *data, NihDBusMessage *message, const char *name, char * const *env, int wait) { return control_emit_event_with_file (data, message, name, env, wait, -1); } /** * control_emit_event_with_file: * @data: not used, * @message: D-Bus connection and message received, * @name: name of event to emit, * @env: environment of environment, * @wait: whether to wait for event completion before returning, * @file: file descriptor. * * Implements the top half of the EmitEvent method of the com.ubuntu.Upstart * interface, the bottom half may be found in event_finished(). * * Called to emit an event with a given @name and @env, which will be * added to the event queue and processed asynchronously. If @name or * @env are not valid, the org.freedesktop.DBus.Error.InvalidArgs D-Bus * error will be returned immediately. If the event fails, the * com.ubuntu.Upstart.Error.EventFailed D-Bus error will be returned when * the event finishes. * * When @wait is TRUE the method call will not return until the event * has completed, which means that all jobs affected by the event have * finished starting (running for tasks) or stopping; when @wait is FALSE, * the method call returns once the event has been queued. * * Returns: zero on success, negative value on raised error. **/ int control_emit_event_with_file (void *data, NihDBusMessage *message, const char *name, char * const *env, int wait, int file) { Event *event; Blocked *blocked; nih_assert (message != NULL); nih_assert (name != NULL); nih_assert (env != NULL); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to emit an event")); return -1; } /* Verify that the name is valid */ if (! strlen (name)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Name may not be empty string")); close (file); return -1; } /* Verify that the environment is valid */ if (! environ_all_valid (env)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Env must be KEY=VALUE pairs")); close (file); return -1; } /* Make the event and block the message on it */ event = event_new (NULL, name, (char **)env); if (! event) { nih_error_raise_system (); close (file); return -1; } event->fd = file; if (event->fd >= 0) { long flags; flags = fcntl (event->fd, F_GETFD); flags &= ~FD_CLOEXEC; fcntl (event->fd, F_SETFD, flags); } /* Obtain the session */ event->session = session_from_dbus (NULL, message); if (wait) { blocked = blocked_new (event, BLOCKED_EMIT_METHOD, message); if (! blocked) { nih_error_raise_system (); nih_free (event); close (file); return -1; } nih_list_add (&event->blocking, &blocked->entry); } else { NIH_ZERO (control_emit_event_reply (message)); } return 0; } /** * control_get_version: * @data: not used, * @message: D-Bus connection and message received, * @version: pointer for reply string. * * Implements the get method for the version property of the * com.ubuntu.Upstart interface. * * Called to obtain the version of the init daemon, which will be stored * as a string in @version. * * Returns: zero on success, negative value on raised error. **/ int control_get_version (void * data, NihDBusMessage *message, char ** version) { nih_assert (message != NULL); nih_assert (version != NULL); *version = nih_strdup (message, package_string); if (! *version) nih_return_no_memory_error (-1); return 0; } /** * control_get_log_priority: * @data: not used, * @message: D-Bus connection and message received, * @log_priority: pointer for reply string. * * Implements the get method for the log_priority property of the * com.ubuntu.Upstart interface. * * Called to obtain the init daemon's current logging level, which will * be stored as a string in @log_priority. * * Returns: zero on success, negative value on raised error. **/ int control_get_log_priority (void * data, NihDBusMessage *message, char ** log_priority) { const char *priority; nih_assert (message != NULL); nih_assert (log_priority != NULL); switch (nih_log_priority) { case NIH_LOG_DEBUG: priority = "debug"; break; case NIH_LOG_INFO: priority = "info"; break; case NIH_LOG_MESSAGE: priority = "message"; break; case NIH_LOG_WARN: priority = "warn"; break; case NIH_LOG_ERROR: priority = "error"; break; case NIH_LOG_FATAL: priority = "fatal"; break; default: nih_assert_not_reached (); } *log_priority = nih_strdup (message, priority); if (! *log_priority) nih_return_no_memory_error (-1); return 0; } /** * control_set_log_priority: * @data: not used, * @message: D-Bus connection and message received, * @log_priority: string log priority to be set. * * Implements the get method for the log_priority property of the * com.ubuntu.Upstart interface. * * Called to change the init daemon's current logging level to that given * as a string in @log_priority. If the string is not recognised, the * com.ubuntu.Upstart.Error.InvalidLogPriority error will be returned. * * Returns: zero on success, negative value on raised error. **/ int control_set_log_priority (void * data, NihDBusMessage *message, const char * log_priority) { nih_assert (message != NULL); nih_assert (log_priority != NULL); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to set log priority")); return -1; } if (! strcmp (log_priority, "debug")) { nih_log_set_priority (NIH_LOG_DEBUG); } else if (! strcmp (log_priority, "info")) { nih_log_set_priority (NIH_LOG_INFO); } else if (! strcmp (log_priority, "message")) { nih_log_set_priority (NIH_LOG_MESSAGE); } else if (! strcmp (log_priority, "warn")) { nih_log_set_priority (NIH_LOG_WARN); } else if (! strcmp (log_priority, "error")) { nih_log_set_priority (NIH_LOG_ERROR); } else if (! strcmp (log_priority, "fatal")) { nih_log_set_priority (NIH_LOG_FATAL); } else { nih_dbus_error_raise (DBUS_ERROR_INVALID_ARGS, _("The log priority given was not recognised")); return -1; } return 0; } /** * control_get_bus_type: * * Determine D-Bus bus type to connect to. * * Returns: Type of D-Bus bus to connect to. **/ DBusBusType control_get_bus_type (void) { return (use_session_bus || user_mode) ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM; } /** * control_notify_disk_writeable: * @data: not used, * @message: D-Bus connection and message received, * * Implements the NotifyDiskWriteable method of the * com.ubuntu.Upstart interface. * * Called to flush the job logs for all jobs that ended before the log * disk became writeable. * * Notes: Session Inits are permitted to make this call. In the common * case of starting a Session Init as a child of a Display Manager this * is somewhat meaningless, but it does mean that if a Session Init were * started from a system job, behaviour would be as expected. * * Returns: zero on success, negative value on raised error. **/ int control_notify_disk_writeable (void *data, NihDBusMessage *message) { int ret; Session *session; nih_assert (message != NULL); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to notify disk is writeable")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); /* "nop" when run from a chroot */ if (session && session->chroot) return 0; ret = log_clear_unflushed (); if (ret < 0) { nih_error_raise_system (); return -1; } return 0; } /** * control_notify_dbus_address: * @data: not used, * @message: D-Bus connection and message received, * @address: Address of D-Bus to connect to. * * Implements the NotifyDBusAddress method of the * com.ubuntu.Upstart interface. * * Called to allow the Session Init to connect to the D-Bus * Session Bus when available. * * Returns: zero on success, negative value on raised error. **/ int control_notify_dbus_address (void *data, NihDBusMessage *message, const char *address) { nih_assert (message); nih_assert (address); if (getpid () == 1) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("Not permissible to notify D-Bus address for PID 1")); return -1; } if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to notify D-Bus address")); return -1; } /* Ignore as already connected */ if (control_bus) return 0; control_bus_address = nih_strdup (NULL, address); if (! control_bus_address) { nih_dbus_error_raise_printf (DBUS_ERROR_NO_MEMORY, _("Out of Memory")); return -1; } if (control_bus_open () < 0) return -1; return 0; } /** * control_notify_cgroup_manager_address: * @data: not used, * @message: D-Bus connection and message received, * @address: D-Bus address that cgroup manager is connected to. * * Implements the NotifyCGroupManagerAddress method of the * com.ubuntu.Upstart interface. * * Called to allow the cgroup manager to be contacted, * thus enabling the cgroup stanza. * * Returns: zero on success, negative value on raised error. **/ int control_notify_cgroup_manager_address (void *data, NihDBusMessage *message, const char *address) { nih_assert (message); nih_assert (address); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to notify cgroup manager address")); return -1; } #ifdef ENABLE_CGROUPS if (! cgroup_support_enabled ()) return 0; /* Already called */ if (cgroup_manager_available ()) return 0; if (! cgroup_manager_set_address (address)) { nih_dbus_error_raise_printf (DBUS_ERROR_NO_MEMORY, _("Out of Memory")); return -1; } nih_debug ("set cgroup manager address"); if (! job_class_induct_jobs ()) { nih_dbus_error_raise_printf (DBUS_ERROR_NO_MEMORY, _("Out of Memory")); return -1; } #else nih_debug ("cgroup support not available"); #endif /* ENABLE_CGROUPS */ return 0; } /** * control_bus_flush: * * Drain any remaining messages in the D-Bus queue. **/ static void control_bus_flush (void) { control_init (); if (! control_bus) return; while (dbus_connection_dispatch (control_bus) == DBUS_DISPATCH_DATA_REMAINS) ; } /** * control_prepare_reexec: * * Prepare for a re-exec by allowing the bus connection to be retained * over re-exec and clearing all queued messages. **/ void control_prepare_reexec (void) { control_init (); /* Necessary to disallow further commands but also to allow the * new instance to open the control server. */ if (control_server) control_server_close (); control_bus_flush (); } /** * control_conn_to_index: * * @connection: D-Bus connection. * * Convert a control (DBusConnection) connection to an index number * the list of control connections. * * Returns: connection index, or -1 on error. **/ int control_conn_to_index (const DBusConnection *connection) { int conn_index = 0; int found = FALSE; nih_assert (connection); NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; if (connection == conn) { found = TRUE; break; } conn_index++; } if (! found) return -1; return conn_index; } /** * control_conn_from_index: * * @conn_index: control connection index number. * * Lookup control connection based on index number. * * Returns: existing connection on success, or NULL if connection * not found. **/ DBusConnection * control_conn_from_index (int conn_index) { int i = 0; nih_assert (conn_index >= 0); nih_assert (control_conns); NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; if (i == conn_index) return conn; i++; } return NULL; } /** * control_bus_release_name: * * Unregister well-known D-Bus name. * * Returns: 0 on success, -1 on raised error. **/ int control_bus_release_name (void) { DBusError error; int ret; if (! control_bus) return 0; dbus_error_init (&error); ret = dbus_bus_release_name (control_bus, DBUS_SERVICE_UPSTART, &error); if (ret < 0) { nih_dbus_error_raise (error.name, error.message); dbus_error_free (&error); return -1; } return 0; } /** * control_get_state: * * @data: not used, * @message: D-Bus connection and message received, * @state: output string returned to client. * * Convert internal state to JSON string. * * Returns: zero on success, negative value on raised error. **/ int control_get_state (void *data, NihDBusMessage *message, char **state) { Session *session; size_t len; nih_assert (message); nih_assert (state); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to request state")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); /* We don't want chroot sessions snooping outside their domain. * * Ideally, we'd allow them to query their own session, but the * current implementation doesn't lend itself to that. */ if (session && session->chroot) { nih_warn (_("Ignoring state query from chroot session")); return 0; } if (state_to_string (state, &len) < 0) goto error; nih_ref (*state, message); return 0; error: nih_dbus_error_raise_printf (DBUS_ERROR_NO_MEMORY, _("Out of Memory")); return -1; } /** * control_restart: * * @data: not used, * @message: D-Bus connection and message received. * * Implements the Restart method of the com.ubuntu.Upstart * interface. * * Called to request that Upstart performs a stateful re-exec. * * Returns: zero on success, negative value on raised error. **/ int control_restart (void *data, NihDBusMessage *message) { Session *session; nih_assert (message != NULL); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to request restart")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); /* Chroot sessions must not be able to influence * the outside system. * * Making this a NOP is safe since it is the Upstart outside the * chroot which manages all chroot jobs. */ if (session && session->chroot) { nih_warn (_("Ignoring restart request from chroot session")); return 0; } nih_info (_("Restarting")); stateful_reexec (); return 0; } /** * control_notify_event_emitted * * @event: Event. * * Re-emits an event over DBUS using the EventEmitted signal **/ void control_notify_event_emitted (Event *event) { nih_assert (event != NULL); control_init (); NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; NIH_ZERO (control_emit_event_emitted (conn, DBUS_PATH_UPSTART, event->name, event->env)); } } /** * control_notify_restarted * * DBUS signal sent when upstart has re-executed itself. **/ void control_notify_restarted (void) { control_init (); NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; NIH_ZERO (control_emit_restarted (conn, DBUS_PATH_UPSTART)); } } /** * control_set_env_list: * * @data: not used, * @message: D-Bus connection and message received, * @job_details: name and instance of job to apply operation to, * @vars: array of name[/value] pairs of environment variables to set, * @replace: TRUE if @name should be overwritten if already set, else * FALSE. * * Implements the SetEnvList method of the com.ubuntu.Upstart * interface. * * Called to request Upstart store one or more name/value pairs. * * If @job_details is empty, change will be applied to all job * environments, else only apply changes to specific job environment * encoded within @job_details. * * Returns: zero on success, negative value on raised error. **/ int control_set_env_list (void *data, NihDBusMessage *message, char * const *job_details, char * const *vars, int replace) { Session *session; Job *job = NULL; char *job_name = NULL; char *instance = NULL; char * const *var; nih_assert (message); nih_assert (job_details); nih_assert (vars); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job environment")); return -1; } if (getpid () == 1) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("Not permissible to modify PID 1 job environment")); return -1; } if (job_details[0]) { job_name = job_details[0]; /* this can be a null value */ instance = job_details[1]; } /* Verify that job name is valid */ if (job_name && ! strlen (job_name)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Job may not be empty string")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); /* Chroot sessions must not be able to influence * the outside system. */ if (session && session->chroot) { nih_warn (_("Ignoring set env request from chroot session")); return 0; } /* Lookup the job */ control_get_job (session, job, job_name, instance); for (var = vars; var && *var; var++) { nih_local char *envvar = NULL; if (! *var) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Variable may not be empty string")); return -1; } /* If variable does not contain a delimiter, add one to ensure * it gets entered into the job environment table. Without the * delimiter, the variable will be silently ignored unless it's * already set in inits environment. But in that case there is * no point in setting such a variable to its already existing * value. */ if (! strchr (*var, '=')) { envvar = NIH_MUST (nih_sprintf (NULL, "%s=", *var)); } else { envvar = NIH_MUST (nih_strdup (NULL, *var)); } if (job) { /* Modify job-specific environment */ nih_assert (job->env); NIH_MUST (environ_add (&job->env, job, NULL, replace, envvar)); } else if (job_class_environment_set (envvar, replace) < 0) { nih_return_no_memory_error (-1); } } return 0; } /** * control_set_env: * * @data: not used, * @message: D-Bus connection and message received, * @job_details: name and instance of job to apply operation to, * @var: name[/value] pair of environment variable to set, * @replace: TRUE if @name should be overwritten if already set, else * FALSE. * * Implements the SetEnv method of the com.ubuntu.Upstart * interface. * * Called to request Upstart store a particular name/value pair. * * If @job_details is empty, change will be applied to all job * environments, else only apply changes to specific job environment * encoded within @job_details. * * Returns: zero on success, negative value on raised error. **/ int control_set_env (void *data, NihDBusMessage *message, char * const *job_details, const char *var, int replace) { nih_local char **vars = NULL; if (! var) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Variable may not be empty string")); return -1; } vars = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (nih_str_array_add (&vars, NULL, NULL, var)); return control_set_env_list (data, message, job_details, vars, replace); } /** * control_unset_env_list: * * @data: not used, * @message: D-Bus connection and message received, * @job_details: name and instance of job to apply operation to, * @names: array of variables to clear from the job environment array. * * Implements the UnsetEnvList method of the com.ubuntu.Upstart * interface. * * Called to request Upstart remove one or more variables from the job * environment array. * * Returns: zero on success, negative value on raised error. **/ int control_unset_env_list (void *data, NihDBusMessage *message, char * const *job_details, char * const *names) { Session *session; Job *job = NULL; char *job_name = NULL; char *instance = NULL; char * const *name; nih_assert (message); nih_assert (job_details); nih_assert (names); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job environment")); return -1; } if (getpid () == 1) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("Not permissible to modify PID 1 job environment")); return -1; } if (job_details[0]) { job_name = job_details[0]; /* this can be a null value */ instance = job_details[1]; } /* Verify that job name is valid */ if (job_name && ! strlen (job_name)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Job may not be empty string")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); /* Chroot sessions must not be able to influence * the outside system. */ if (session && session->chroot) { nih_warn (_("Ignoring unset env request from chroot session")); return 0; } /* Lookup the job */ control_get_job (session, job, job_name, instance); for (name = names; name && *name; name++) { if (! *name) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Variable may not be empty string")); return -1; } if (job) { /* Modify job-specific environment */ nih_assert (job->env); if (! environ_remove (&job->env, job, NULL, *name)) return -1; } else if (job_class_environment_unset (*name) < 0) { goto error; } } return 0; error: nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, "%s: %s", _("No such variable"), *name); return -1; } /** * control_unset_env: * * @data: not used, * @message: D-Bus connection and message received, * @job_details: name and instance of job to apply operation to, * @name: variable to clear from the job environment array. * * Implements the UnsetEnv method of the com.ubuntu.Upstart * interface. * * Called to request Upstart remove a particular variable from the job * environment array. * * Returns: zero on success, negative value on raised error. **/ int control_unset_env (void *data, NihDBusMessage *message, char * const *job_details, const char *name) { nih_local char **names = NULL; if (! name) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Variable may not be empty string")); return -1; } names = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (nih_str_array_add (&names, NULL, NULL, name)); return control_unset_env_list (data, message, job_details, names); } /** * control_get_env: * * @data: not used, * @message: D-Bus connection and message received, * @job_details: name and instance of job to apply operation to, * @name: name of environment variable to retrieve, * @value: value of @name. * * Implements the GetEnv method of the com.ubuntu.Upstart * interface. * * Called to obtain the value of a specified job environment variable. * * Returns: zero on success, negative value on raised error. **/ int control_get_env (void *data, NihDBusMessage *message, char * const *job_details, const char *name, char **value) { Session *session; const char *tmp; Job *job = NULL; char *job_name = NULL; char *instance = NULL; nih_assert (message != NULL); nih_assert (job_details); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to query job environment")); return -1; } if (! name || ! *name) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Variable may not be empty string")); return -1; } if (job_details[0]) { job_name = job_details[0]; /* this can be a null value */ instance = job_details[1]; } /* Verify that job name is valid */ if (job_name && ! strlen (job_name)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Job may not be empty string")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); /* Chroot sessions must not be able to influence * the outside system. */ if (session && session->chroot) { nih_warn (_("Ignoring get env request from chroot session")); return 0; } /* Lookup the job */ control_get_job (session, job, job_name, instance); if (job) { tmp = environ_get (job->env, name); if (! tmp) goto error; *value = nih_strdup (message, tmp); if (! *value) nih_return_no_memory_error (-1); return 0; } tmp = job_class_environment_get (name); if (! tmp) goto error; *value = nih_strdup (message, tmp); if (! *value) nih_return_no_memory_error (-1); return 0; error: nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, "%s: %s", _("No such variable"), name); return -1; } /** * control_list_env: * * @data: not used, * @message: D-Bus connection and message received, * @job_details: name and instance of job to apply operation to, * @env: pointer to array of all job environment variables. * * Implements the ListEnv method of the com.ubuntu.Upstart * interface. * * Called to obtain an unsorted array of all environment variables * that will be set in a jobs environment. * * Returns: zero on success, negative value on raised error. **/ int control_list_env (void *data, NihDBusMessage *message, char * const *job_details, char ***env) { Session *session; Job *job = NULL; char *job_name = NULL; char *instance = NULL; nih_assert (message); nih_assert (job_details); nih_assert (env); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to query job environment")); return -1; } if (job_details[0]) { job_name = job_details[0]; /* this can be a null value */ instance = job_details[1]; } /* Verify that job name is valid */ if (job_name && ! strlen (job_name)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Job may not be empty string")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); /* Lookup the job */ control_get_job (session, job, job_name, instance); if (job) { *env = nih_str_array_copy (job, NULL, job->env); if (! *env) nih_return_no_memory_error (-1); return 0; } *env = job_class_environment_get_all (message); if (! *env) nih_return_no_memory_error (-1); return 0; } /** * control_reset_env: * * @data: not used, * @message: D-Bus connection and message received, * @job_details: name and instance of job to apply operation to. * * Implements the ResetEnv method of the com.ubuntu.Upstart * interface. * * Called to reset the environment all subsequent jobs will run in to * the default minimal environment. * * Returns: zero on success, negative value on raised error. **/ int control_reset_env (void *data, NihDBusMessage *message, char * const *job_details) { Session *session; Job *job = NULL; char *job_name = NULL; char *instance = NULL; nih_assert (message); nih_assert (job_details); if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job environment")); return -1; } if (getpid () == 1) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("Not permissible to modify PID 1 job environment")); return -1; } if (job_details[0]) { job_name = job_details[0]; /* this can be a null value */ instance = job_details[1]; } /* Verify that job name is valid */ if (job_name && ! strlen (job_name)) { nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS, _("Job may not be empty string")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); /* Chroot sessions must not be able to influence * the outside system. */ if (session && session->chroot) { nih_warn (_("Ignoring reset env request from chroot session")); return 0; } /* Lookup the job */ control_get_job (session, job, job_name, instance); if (job) { size_t len; if (job->env) { nih_free (job->env); job->env = NULL; } job->env = job_class_environment (job, job->class, &len); if (! job->env) nih_return_system_error (-1); return 0; } job_class_environment_reset (); return 0; } /** * control_get_origin_uid: * @message: D-Bus connection and message received, * @uid: returned uid value. * * Returns TRUE: if @uid now contains uid corresponding to @message, * else FALSE. **/ static int control_get_origin_uid (NihDBusMessage *message, uid_t *uid) { DBusError dbus_error; unsigned long unix_user = 0; const char *sender; nih_assert (message); nih_assert (uid); dbus_error_init (&dbus_error); if (! message->message || ! message->connection) return FALSE; sender = dbus_message_get_sender (message->message); if (sender) { unix_user = dbus_bus_get_unix_user (message->connection, sender, &dbus_error); if (unix_user == (unsigned long)-1) { dbus_error_free (&dbus_error); return FALSE; } } else { if (! dbus_connection_get_unix_user (message->connection, &unix_user)) { return FALSE; } } *uid = (uid_t)unix_user; return TRUE; } /** * control_check_permission: * * @message: D-Bus connection and message received. * * Determine if caller should be allowed to make a control request. * * Note that these permission checks rely on D-Bus to limit * session bus access to the same user. * * Returns: TRUE if permission is granted, else FALSE. **/ static int control_check_permission (NihDBusMessage *message) { int ret; uid_t uid; pid_t pid; uid_t origin_uid = 0; nih_assert (message); uid = getuid (); pid = getpid (); ret = control_get_origin_uid (message, &origin_uid); /* Its possible that D-Bus might be unable to determine the user * making the request. In this case, deny the request unless * we're running as a Session Init or via the test harness. */ if ((ret && origin_uid == uid) || user_mode || (uid && pid != 1)) return TRUE; return FALSE; } /** * control_session_file_create: * * Create session file if possible. * * Errors are not fatal - the file is just not created. **/ static void control_session_file_create (void) { nih_local char *session_dir = NULL; FILE *f; int ret; nih_assert (control_server_address); session_dir = get_session_dir (); if (! session_dir) return; NIH_MUST (nih_strcat_sprintf (&session_file, NULL, "%s/%d%s", session_dir, (int)getpid (), SESSION_EXT)); f = fopen (session_file, "w"); if (! f) { nih_error ("%s: %s", _("unable to create session file"), session_file); return; } ret = fprintf (f, SESSION_ENV "=%s\n", control_server_address); if (ret < 0) nih_error ("%s: %s", _("unable to write session file"), session_file); fclose (f); } /** * control_session_file_remove: * * Delete session file. * * Errors are not fatal. **/ static void control_session_file_remove (void) { if (session_file) (void)unlink (session_file); } /** * control_session_end: * * @data: not used, * @message: D-Bus connection and message received. * * Implements the EndSession method of the com.ubuntu.Upstart * interface. * * Called to request that Upstart stop all jobs and exit. Only * appropriate when running as a Session Init and user wishes to * 'logout'. * * Returns: zero on success, negative value on raised error. **/ int control_end_session (void *data, NihDBusMessage *message) { Session *session; nih_assert (message); /* Not supported at the system level */ if (getpid () == 1) return 0; if (! control_check_permission (message)) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to end session")); return -1; } /* Get the relevant session */ session = session_from_dbus (NULL, message); if (session && session->chroot) { nih_warn (_("Ignoring session end request from chroot session")); return 0; } quiesce (QUIESCE_REQUESTER_SESSION); return 0; } /** * control_serialise_bus_address: * * Convert control_bus_address into JSON representation. * * Returns: JSON string representing control_bus_address or NULL if * control_bus_address not set or on error. * * Note: If NULL is returned, check the value of control_bus_address * itself to determine if the error is real. **/ json_object * control_serialise_bus_address (void) { control_init (); /* A NULL return represents a JSON null */ return control_bus_address ? json_object_new_string (control_bus_address) : NULL; } /** * control_deserialise_bus_address: * * @json: root of JSON-serialised state. * * Convert JSON representation of control_bus_address back into a native * string. * * Returns: 0 on success, -1 on error. **/ int control_deserialise_bus_address (json_object *json) { const char *address; nih_assert (json); nih_assert (! control_bus_address); control_init (); /* control_bus_address was never set */ if (state_check_json_type (json, null)) return 0; if (! state_check_json_type (json, string)) goto error; address = json_object_get_string (json); if (! address) goto error; control_bus_address = nih_strdup (NULL, address); if (! control_bus_address) goto error; return 0; error: return -1; } upstart-1.13.2/init/job_process.c0000664000175000017500000023267412401640554013661 00000000000000/* upstart * * job_process.c - job process handling * * Copyright © 2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ /* Required for pty handling */ #define _XOPEN_SOURCE 600 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "paths.h" #include "system.h" #include "environ.h" #include "process.h" #include "job_process.h" #include "job_class.h" #include "job.h" #include "errors.h" #include "control.h" #include "xdg.h" #include "apparmor.h" #ifdef ENABLE_CGROUPS #include "cgroup.h" #endif /* ENABLE_CGROUPS */ /** * SHELL_CHARS: * * This is the list of characters that, if encountered in a process, cause * it to always be run with a shell. **/ #define SHELL_CHARS "~`!$^&*()=|\\{}[];\"'<>?" /** * JobProcessWireError: * * This structure is used to pass an error from the child process back to the * parent. It contains the same basic particulars as a JobProcessError but * without the message. **/ typedef struct job_process_wire_error { JobProcessErrorType type; int arg; int errnum; } JobProcessWireError; /** * log_dir: * * Full path to directory where job logs are written. * **/ char *log_dir = NULL; /** * disable_respawn: * * If TRUE, disallow respawning. **/ int disable_respawn = FALSE; /* Prototypes for static functions */ static void job_process_remap_fd (int *fd, int reserved_fd, int error_fd); /** * disable_job_logging: * * If TRUE, do not log any job output. * **/ int disable_job_logging = 0; /** * no_inherit_env: * * If TRUE, do not copy the Session Inits environment variables or umask * to that provided to jobs. **/ int no_inherit_env = FALSE; /* Prototypes for static functions */ static void job_process_kill_timer (Job *job, NihTimer *timer); static void job_process_terminated (Job *job, ProcessType process, int status, int state_only); static int job_process_catch_runaway (Job *job); static void job_process_stopped (Job *job, ProcessType process); static void job_process_trace_new (Job *job, ProcessType process); static void job_process_trace_new_child (Job *job, ProcessType process); static void job_process_trace_signal (Job *job, ProcessType process, int signum); static void job_process_trace_fork (Job *job, ProcessType process); static void job_process_trace_exec (Job *job, ProcessType process); extern char *control_server_address; extern int user_mode; extern int session_end; extern time_t quiesce_phase_time; /** * job_process_start: * * @job: job context for process to be run in, * @process: job process to run. * * This function looks up @process in the job's process table and uses * the information there to spawn a new process for the @job, storing the * pid in that table entry. * * The process is normally executed using the system shell, unless the * script member of @process is FALSE and there are no typical shell * characters within the command member, in which case it is executed * directly using exec after splitting on whitespace. * * When executed with the shell, if the command (which may be an entire * script) is reasonably small (less than 1KB) it is passed to the * shell using the POSIX-specified -c option. Otherwise the shell is told * to read commands from one of the special /proc/self/fd/NN devices and NihIo * used to feed the script into that device. A pointer to the NihIo object * is not kept or stored because it will automatically clean itself up should * the script go away as the other end of the pipe will be closed. * * In either case the shell is run with the -e option so that commands will * fail if their exit status is not checked. * * This function will only block on temporary job_process_spawn_with_fd() error * (for example fork() failure): in normal operation it returns as soon as * the fork() was successful, registering an NihIo which provides * asynchronous handling of the child setup stage. The specified error * handler will be called should child setup fail. * * It is up to the caller to decide whether non-temporary errors are a reason * to change the job state or not. **/ void job_process_start (Job *job, ProcessType process) { Process *proc; nih_local char **argv = NULL; nih_local char **env = NULL; nih_local char *script = NULL; char **e; size_t argc, envc; int fds[2] = { -1, -1 }; int trace = FALSE, shell = FALSE; int job_process_fd = -1; JobProcessData *process_data = NULL; nih_assert (job); nih_assert (process > PROCESS_INVALID); nih_assert (process < PROCESS_LAST); proc = job->class->process[process]; nih_assert (proc != NULL); nih_assert (proc->command != NULL); /* We run the process using a shell if it says it wants to be run * as such, or if it contains any shell-like characters; since that's * the best way to deal with things like variables. */ if ((proc->script) || strpbrk (proc->command, SHELL_CHARS)) { char *nl, *p; argc = 0; argv = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (nih_str_array_add (&argv, NULL, &argc, SHELL)); NIH_MUST (nih_str_array_add (&argv, NULL, &argc, "-e")); /* If the process wasn't originally marked to be run through * a shell, prepend exec to the script so that the shell * gets out of the way after parsing. */ if (proc->script) { script = NIH_MUST (nih_strdup (NULL, proc->command)); } else { script = NIH_MUST (nih_sprintf (NULL, "exec %s", proc->command)); } /* Don't pipe single-line scripts into the shell using * /proc/self/fd/NNN, instead just pass them over the * command-line (taking care to strip off the trailing * newlines). */ p = nl = strchr (script, '\n'); while (p && (*p == '\n')) p++; if ((! nl) || (! *p)) { /* Strip off the newline(s) */ if (nl) *nl = '\0'; NIH_MUST (nih_str_array_add (&argv, NULL, &argc, "-c")); NIH_MUST (nih_str_array_addp (&argv, NULL, &argc, script)); /* Next argument is argv[0]; just pass the shell */ NIH_MUST (nih_str_array_add (&argv, NULL, &argc, SHELL)); } else { nih_local char *cmd = NULL; /* Close the writing end when the child is exec'd */ NIH_ZERO (pipe (fds)); nih_io_set_cloexec (fds[1]); shell = TRUE; cmd = NIH_MUST (nih_sprintf (argv, "%s/%d", "/proc/self/fd", JOB_PROCESS_SCRIPT_FD)); NIH_MUST (nih_str_array_addp (&argv, NULL, &argc, cmd)); } } else { /* Split the command on whitespace to produce a list of * arguments that we can exec directly. */ argv = NIH_MUST (nih_str_split (NULL, proc->command, " \t\r\n", TRUE)); } /* We provide the standard job environment to all of its processes, * except for pre-stop which also has the stop event environment, * adding special variables that indicate which job it was -- mostly * so that initctl can have clever behaviour when called within them. */ envc = 0; env = NIH_MUST (nih_str_array_new (NULL)); if (job->env) NIH_MUST (environ_append (&env, NULL, &envc, TRUE, job->env)); if (job->stop_env && ((process == PROCESS_PRE_STOP) || (process == PROCESS_POST_STOP))) for (e = job->stop_env; *e; e++) NIH_MUST (environ_set (&env, NULL, &envc, TRUE, *e)); NIH_MUST (environ_set (&env, NULL, &envc, TRUE, "UPSTART_JOB=%s", job->class->name)); NIH_MUST (environ_set (&env, NULL, &envc, TRUE, "UPSTART_INSTANCE=%s", job->name)); if (user_mode) NIH_MUST (environ_set (&env, NULL, &envc, TRUE, "UPSTART_SESSION=%s", control_server_address)); /* If we're about to spawn the main job and we expect it to become * a daemon or fork before we can move out of spawned, we need to * set a trace on it. */ if ((process == PROCESS_MAIN) && ((job->class->expect == EXPECT_DAEMON) || (job->class->expect == EXPECT_FORK))) trace = TRUE; /* Spawn the process, repeat until fork() works */ while ((job->pid[process] = job_process_spawn_with_fd (job, argv, env, trace, fds[0], process, &job_process_fd)) < 0) { NihError *err; err = nih_error_get (); nih_warn ("%s: %s", _("Temporary process spawn error"), err->message); nih_free (err); } nih_info (_("%s %s process (%d)"), job_name (job), process_name (process), job->pid[process]); job->trace_forks = 0; job->trace_state = trace ? TRACE_NEW : TRACE_NONE; if (shell) { /* Clean up and close the reading end (we don't need it) */ close (fds[0]); } /* At this stage, a child process has been spawned, but may not * yet have been setup appropriately. This operation is handled * asynchronously since some setup operations may block, * and even though they are running in a new child process, they could * still block PID 1 since the latter needs to wait until the * child is fully setup and the appropriate program has been * exec'd before marking the job as running. * * This is now achieved by creating an NihIo and registering * appropriate handlers such that notification of successful * child setup and child error scenarios are handled * automatically. * * job_process_child_reader() handles updating the jobs state. */ process_data = job->process_data[process] = NIH_MUST (job_process_data_new (job->process_data, job, process, job_process_fd)); if (shell) { process_data->shell_fd = fds[1]; process_data->script = script; nih_ref (script, process_data); } /* Set up a handler to monitor the child fd asynchronously */ job_register_child_handler (job->process_data[process], job_process_fd, process_data); } /** * job_process_spawn_with_fd: * @job: job of process to be spawned, * @argv: NULL-terminated list of arguments for the process, * @env: NULL-terminated list of environment variables for the process, * @trace: whether to trace this process, * @script_fd: script file descriptor, * @process: job process to spawn, * @job_process_fd: readable child setup pipe file descriptor. * * This function spawns a new process using the class details in @job to set up * the environment for it; the process is always a session and process group * leader as we never want anything in our own group. * * The process to be executed is given in the @argv array which is passed * directly to execvp(), so should be in the same NULL-terminated form with * the first argument containing the path or filename of the binary. The * PATH environment in the @job's associated class will be searched. * * If @trace is TRUE, the process will be traced with ptrace and this will * cause the process to be stopped when the exec() call is made. You must * wait for this and then may use it to set options before continuing the * process. * * If @script_fd is not -1, this file descriptor is dup()d to the special fd 9 * (moving any other out of the way if necessary). * * This function only spawns the process, it is up to the caller to ensure * that the information is saved into the job and that the process is watched, * etc. Also, it is up to the caller to monitor @job_process_fd to * ensure the child setup was successful; data available to read * indicates a failure to setup the child environment (represented by a * JOB_PROCESS_ERROR error) whereas if the descriptor is simply * closed setup was successful and the caller can then mark the job * process as started. * * Spawning a process may fail for temporary reasons, usually due to a failure * of the fork() syscall. * * Returns: process id of new process on success, -1 on raised error **/ pid_t job_process_spawn_with_fd (Job *job, char * const argv[], char * const *env, int trace, int script_fd, ProcessType process, int *job_process_fd) { sigset_t child_set, orig_set; pid_t pid; int i, fds[2] = { -1, -1 }; int pty_master = -1; int pty_slave = -1; char pts_name[PATH_MAX]; char filename[PATH_MAX]; FILE *fd; nih_local char *log_path = NULL; JobClass *class; uid_t job_setuid = -1; gid_t job_setgid = -1; struct passwd *pwd = NULL; struct group *grp = NULL; #ifdef ENABLE_CGROUPS int cgroups_needed = FALSE; #endif /* ENABLE_CGROUPS */ nih_assert (job != NULL); nih_assert (job->class != NULL); nih_assert (job->log != NULL); nih_assert (process < PROCESS_LAST); class = job->class; nih_assert (class != NULL); #ifdef ENABLE_CGROUPS cgroups_needed = job_needs_cgroups (job); if (cgroups_needed) { if (! cgroup_support_enabled ()) nih_return_error (-1, CGROUP_ERROR, _("cgroup support not available")); /* Should never happen */ if (! cgroup_manager_available ()) nih_return_error (-1, CGROUP_ERROR, _("cgroup manager not available")); } #endif /* ENABLE_CGROUPS */ /* Create a pipe to communicate with the child process until it * execs so we know whether that was successful or an error occurred. */ if (pipe (fds) < 0) nih_return_system_error (-1); if (class->console == CONSOLE_LOG && disable_job_logging) class->console = CONSOLE_NONE; if (class->console == CONSOLE_LOG) { NihError *err; /* Ensure log destroyed for previous matching job process * (occurs when job restarted but previous process has not * yet been reaped). */ if (job->log[process]) { nih_free (job->log[process]); job->log[process] = NULL; } log_path = job_process_log_path (job, 0); if (! log_path) { /* Consume and re-raise */ err = nih_error_get (); nih_assert (err->number == ENOMEM); nih_free (err); close (fds[0]); close (fds[1]); nih_return_no_memory_error (-1); } pty_master = posix_openpt (O_RDWR | O_NOCTTY); if (pty_master < 0) { nih_error (_("Failed to create pty - disabling logging for job")); /* Ensure that the job can still be started by * disabling logging. */ class->console = CONSOLE_NONE; close (fds[0]); close (fds[1]); nih_return_system_error (-1); } /* Stop any process created _before_ the log object below is * freed from inheriting this fd. */ nih_io_set_cloexec (pty_master); /* pty_master will be closed by log_destroy() */ job->log[process] = log_new (job->log, log_path, pty_master, 0); if (! job->log[process]) { close (pty_master); close (fds[0]); close (fds[1]); nih_return_system_error (-1); } } /* Block all signals while we fork to avoid the child process running * our own signal handlers before we've reset them all back to the * default. */ sigfillset (&child_set); sigprocmask (SIG_BLOCK, &child_set, &orig_set); /* Ensure that any lingering data in stdio buffers is flushed * to avoid the child getting a copy of it. * If not done, CONSOLE_LOG jobs may end up with unexpected data * in their logs if we run with for example '--debug'. */ fflush (NULL); /* Fork the child process, handling success and failure by resetting * the signal mask and returning the new process id or a raised error. */ pid = fork (); if (pid > 0) { if (class->debug) { nih_info (_("Pausing %s (%d) [pre-exec] for debug"), class->name, pid); } sigprocmask (SIG_SETMASK, &orig_set, NULL); close (fds[1]); *job_process_fd = fds[0]; nih_io_set_cloexec (*job_process_fd); return pid; } else if (pid < 0) { nih_error_raise_system (); sigprocmask (SIG_SETMASK, &orig_set, NULL); close (fds[0]); close (fds[1]); if (class->console == CONSOLE_LOG) { nih_free (job->log[process]); job->log[process] = NULL; } return -1; } /* We're now in the child process. * * The rest of this function sets the child up and ends by executing * the new binary. Failures are handled by terminating the child * and writing an error back to the parent. */ /* Close the reading end of the pipe with our parent and mark the * writing end to be closed-on-exec so the parent knows we got that * far because read() returned zero. */ close (fds[0]); job_process_remap_fd (&fds[1], JOB_PROCESS_SCRIPT_FD, fds[1]); nih_io_set_cloexec (fds[1]); if (class->console == CONSOLE_LOG) { struct sigaction act; struct sigaction ignore; job_process_remap_fd (&pty_master, JOB_PROCESS_SCRIPT_FD, fds[1]); /* Child is the slave, so won't need this */ nih_io_set_cloexec (pty_master); /* Temporarily disable child handler as grantpt(3) disallows one * being in effect when called. */ ignore.sa_handler = SIG_DFL; ignore.sa_flags = 0; sigemptyset (&ignore.sa_mask); if (sigaction (SIGCHLD, &ignore, &act) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_SIGNAL, 0); } if (grantpt (pty_master) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_GRANTPT, 0); } /* Restore child handler */ if (sigaction (SIGCHLD, &act, NULL) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_SIGNAL, 0); } if (unlockpt (pty_master) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_UNLOCKPT, 0); } if (ptsname_r (pty_master, pts_name, sizeof(pts_name)) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_PTSNAME, 0); } pty_slave = open (pts_name, O_RDWR | O_NOCTTY); if (pty_slave < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_OPENPT_SLAVE, 0); } job_process_remap_fd (&pty_slave, JOB_PROCESS_SCRIPT_FD, fds[1]); } /* Move the script fd to special fd 9; the only gotcha is if that * would be our error descriptor, but that's handled above. */ if ((script_fd != -1) && (script_fd != JOB_PROCESS_SCRIPT_FD)) { int tmp = dup2 (script_fd, JOB_PROCESS_SCRIPT_FD); if (tmp < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_DUP, 0); } close (script_fd); script_fd = tmp; } /* Become the leader of a new session and process group, shedding * any controlling tty (which we shouldn't have had anyway). */ setsid (); /* Set the process environment from the function parameters. */ environ = (char **)env; /* Set the standard file descriptors to an output of our chosing; * any other open descriptor must be intended for the child, or have * the FD_CLOEXEC flag so it's automatically closed when we exec() * later. */ if (system_setup_console (class->console, FALSE) < 0) { if (class->console == CONSOLE_OUTPUT) { NihError *err; err = nih_error_get (); nih_warn (_("Failed to open system console: %s"), err->message); nih_free (err); if (system_setup_console (CONSOLE_NONE, FALSE) < 0) job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CONSOLE, 0); } else job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CONSOLE, 0); } if (class->console == CONSOLE_LOG) { /* Redirect stdout and stderr to the logger fd */ if (dup2 (pty_slave, STDOUT_FILENO) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_DUP, 0); } if (dup2 (pty_slave, STDERR_FILENO) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_DUP, 0); } close (pty_slave); } /* Switch to the specified AppArmor profile, but only for the main process, so we don't confine the pre- and post- processes. */ if ((class->apparmor_switch) && (process == PROCESS_MAIN)) { nih_local char *profile = NULL; /* Use the environment to expand the AppArmor profile name */ profile = NIH_SHOULD (environ_expand (NULL, class->apparmor_switch, environ)); if (! profile) { job_process_error_abort (fds[1], JOB_PROCESS_ERROR_SECURITY, 0); } if (apparmor_switch (profile) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_SECURITY, 0); } } if (process != PROCESS_SECURITY) { /* Set resource limits for the process, skipping over any that * aren't set in the job class such that they inherit from * ourselves (and we inherit from kernel defaults). */ for (i = 0; i < RLIMIT_NLIMITS; i++) { if (! class->limits[i]) continue; if (setrlimit (i, class->limits[i]) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_RLIMIT, i); } } /* Set the file mode creation mask; this is one of the few operations * that can never fail. */ umask (class->umask); /* Adjust the process priority ("nice level"). */ if (class->nice != JOB_NICE_INVALID && setpriority (PRIO_PROCESS, 0, class->nice) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_PRIORITY, 0); } /* Adjust the process OOM killer priority. */ if (class->oom_score_adj != JOB_DEFAULT_OOM_SCORE_ADJ) { int oom_value; snprintf (filename, sizeof (filename), "/proc/%d/oom_score_adj", getpid ()); oom_value = class->oom_score_adj; fd = fopen (filename, "w"); if ((! fd) && (errno == ENOENT)) { snprintf (filename, sizeof (filename), "/proc/%d/oom_adj", getpid ()); oom_value = (class->oom_score_adj * ((class->oom_score_adj < 0) ? 17 : 15)) / 1000; fd = fopen (filename, "w"); } if (! fd) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_OOM_ADJ, 0); } else { fprintf (fd, "%d\n", oom_value); if (fclose (fd)) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_OOM_ADJ, 0); } } } /* Handle changing a chroot session job prior to dealing with * the 'chroot' stanza. */ if (class->session && class->session->chroot) { if (chroot (class->session->chroot) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CHROOT, 0); } } /* Change the root directory, confining path resolution within it; * we do this before the working directory call so that is always * relative to the new root. */ if (class->chroot) { if (chroot (class->chroot) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CHROOT, 0); } } /* Change the working directory of the process, either to the one * configured in the job, or to the root directory of the filesystem * (or at least relative to the chroot). */ if (class->chdir || user_mode == FALSE) { if (chdir (class->chdir ? class->chdir : "/") < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CHDIR, 0); } } /* Change the user and group of the process to the one * configured in the job. We must wait until now to lookup the * UID and GID from the names to accommodate both chroot * session jobs and jobs with a chroot stanza. */ if (class->setuid) { /* Without resetting errno, it's impossible to * distinguish between a non-existent user and and * error during lookup */ errno = 0; pwd = getpwnam (class->setuid); if (! pwd) { if (errno != 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_GETPWNAM, 0); } else { nih_error_raise (JOB_PROCESS_INVALID_SETUID, JOB_PROCESS_INVALID_SETUID_STR); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_BAD_SETUID, 0); } } job_setuid = pwd->pw_uid; /* This will be overridden if setgid is also set: */ job_setgid = pwd->pw_gid; } if (class->setgid) { errno = 0; grp = getgrnam (class->setgid); if (! grp) { if (errno != 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_GETGRNAM, 0); } else { nih_error_raise (JOB_PROCESS_INVALID_SETGID, JOB_PROCESS_INVALID_SETGID_STR); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_BAD_SETGID, 0); } } job_setgid = grp->gr_gid; } if (script_fd != -1 && (job_setuid != (uid_t) -1 || job_setgid != (gid_t) -1) && fchown (script_fd, job_setuid, job_setgid) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CHOWN, 0); } /* Make sure we always have the needed pwd and grp structs. * Then pass those to initgroups() to setup the user's group list. * Only do that if we're root as initgroups() won't work when non-root. */ if (geteuid () == 0) { if (! pwd) { pwd = getpwuid (geteuid ()); if (! pwd) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_GETPWUID, 0); } } if (! grp) { grp = getgrgid (getegid ()); if (! grp) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_GETGRGID, 0); } } if (pwd && grp) { if (initgroups (pwd->pw_name, grp->gr_gid) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_INITGROUPS, 0); } } } #ifdef ENABLE_CGROUPS if (cgroups_needed) { if (cgroup_manager_connect () < 0) job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CGROUP_MGR_CONNECT, 0); if (! cgroup_setup (&job->class->cgroups, env, class->setuid ? job_setuid : geteuid (), class->setgid ? job_setgid : getegid ())) { job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CGROUP_SETUP, 0); } /* If spawning the last process for the job, * arrange for the cgroup manager to destroy * all job cgroups relating to this job once all * job processes have completed. */ if (job_last_process (job, process)) { if (! cgroup_clear (&job->class->cgroups)) { job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CGROUP_CLEAR, 0); } } } #endif /* ENABLE_CGROUPS */ /* Start dropping privileges */ if (job_setgid != (gid_t) -1 && setgid (job_setgid) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_SETGID, 0); } if (job_setuid != (uid_t)-1 && setuid (job_setuid) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_SETUID, 0); } } /* Reset all the signal handlers back to their default handling so * the child isn't unexpectedly ignoring any, and so we won't * surprisingly handle them before we've exec()d the new process. */ nih_signal_reset (); sigprocmask (SIG_SETMASK, &orig_set, NULL); /* Notes: * * - we can't use pause() here since there would then be no way to * resume the process without killing it. * * - we have to close the pipe back to the parent since if we don't, * the parent hangs until the STOP is cleared. Although this may be * acceptable for normal operation, this causes the test suite to * fail. Note that closing the pipe means from this point onwards, * the parent cannot know the true outcome of the spawn: that * responsibility lies with the debugger. * * - note that running with the debug stanza enabled will * unavoidably stop stateful re-exec from working correctly * since the stopped debug child process will hold copies of * the parents file descriptors open until it continues to * call exec below. */ if (class->debug) { /* Since we have not exec'd at this point, we will still * have a copy of the parents fds open. As such, re-exec * will not work. */ close (fds[1]); raise (SIGSTOP); } #ifdef ENABLE_CGROUPS /* Move the pid into the appropriate cgroups now that * the process is running with the correct group and user * ownership. */ if (cgroups_needed && cgroup_enter_groups (&job->class->cgroups) != TRUE) job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CGROUP_ENTER, 0); #endif /* ENABLE_CGROUPS */ /* Set up a process trace if we need to trace forks */ if (trace) { if (ptrace (PTRACE_TRACEME, 0, NULL, 0) < 0) { nih_error_raise_system(); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_PTRACE, 0); } } /* Execute the process, if we escape from here it failed */ if (execvp (argv[0], argv) < 0) { nih_error_raise_system (); job_process_error_abort (fds[1], JOB_PROCESS_ERROR_EXEC, 0); } nih_assert_not_reached (); } /** * job_process_error_abort: * @fd: writing end of pipe, * @type: step that failed, * @arg: argument to @type. * * Abort the child process, first writing the error details in @type, @arg * and the currently raised NihError to the writing end of the pipe specified * by @fd. * * This function calls the exit() system call, so never returns. **/ void job_process_error_abort (int fd, JobProcessErrorType type, int arg) { NihError *err; JobProcessWireError wire_err; /* Get the currently raised system error */ err = nih_error_get (); /* Fill in the structure we send over the pipe */ wire_err.type = type; wire_err.arg = arg; wire_err.errnum = err->number; /* Write structure to the pipe; in theory this should never fail, but * if it does, we abort anyway. */ while (write (fd, &wire_err, sizeof (wire_err)) < 0) ; nih_free (err); exit (255); } /** * job_process_error_handler: * @buf: data read from child process, * @len: length of data read as @wire_err. * * Read from the reading end of the pipe specified by @fd, if we receive * data then the child raised a process error which we reconstruct and raise * again; otherwise no problem was found and no action is taken. * * The reconstructed error will be of JOB_PROCESS_ERROR type, the human- * readable message is generated according to the type of process error * and argument passed along with it. **/ void job_process_error_handler (const char *buf, size_t len) { JobProcessWireError *wire_err; JobProcessError *err; const char *res; wire_err = (JobProcessWireError *)buf; nih_assert (wire_err); /* Read the error from the pipe; a zero read indicates that the * exec succeeded so we return success, otherwise if we don't receive * a JobProcessWireError structure, we return a temporary error so we * try again. */ if (len != sizeof (JobProcessWireError)) { errno = EILSEQ; nih_return_system_error (); } /* Construct a JobProcessError to be raised containing information * from the wire, augmented with human-readable information we * generate here. */ err = NIH_MUST (nih_new (NULL, JobProcessError)); err->type = wire_err->type; err->arg = wire_err->arg; err->errnum = wire_err->errnum; err->error.number = JOB_PROCESS_ERROR; switch (err->type) { case JOB_PROCESS_ERROR_DUP: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to move script fd: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_CONSOLE: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to open console: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_RLIMIT: switch (err->arg) { case RLIMIT_CPU: res = "cpu"; break; case RLIMIT_FSIZE: res = "fsize"; break; case RLIMIT_DATA: res = "data"; break; case RLIMIT_STACK: res = "stack"; break; case RLIMIT_CORE: res = "core"; break; case RLIMIT_RSS: res = "rss"; break; case RLIMIT_NPROC: res = "nproc"; break; case RLIMIT_NOFILE: res = "nofile"; break; case RLIMIT_MEMLOCK: res = "memlock"; break; case RLIMIT_AS: res = "as"; break; case RLIMIT_LOCKS: res = "locks"; break; case RLIMIT_SIGPENDING: res = "sigpending"; break; case RLIMIT_MSGQUEUE: res = "msgqueue"; break; case RLIMIT_NICE: res = "nice"; break; case RLIMIT_RTPRIO: res = "rtprio"; break; default: nih_assert_not_reached (); } err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to set \"%s\" resource limit: %s"), res, strerror (err->errnum))); break; case JOB_PROCESS_ERROR_PRIORITY: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to set priority: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_OOM_ADJ: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to set oom adjustment: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_CHROOT: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to change root directory: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_CHDIR: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to change working directory: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_PTRACE: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to set trace: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_EXEC: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to execute: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_GETPWNAM: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to getpwnam: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_GETGRNAM: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to getgrnam: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_GETPWUID: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to getpwuid: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_GETGRGID: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to getgrgid: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_BAD_SETUID: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to find setuid user"))); break; case JOB_PROCESS_ERROR_BAD_SETGID: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to find setgid group"))); break; case JOB_PROCESS_ERROR_SETUID: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to setuid: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_SETGID: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to setgid: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_CHOWN: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to chown: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_UNLOCKPT: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to unlockpt: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_GRANTPT: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to granpt: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_PTSNAME: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to get ptsname: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_OPENPT_SLAVE: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to open pty slave: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_SIGNAL: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to modify signal handler: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_ALLOC: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to allocate memory: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_INITGROUPS: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to initgroups: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_SECURITY: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to switch security profile: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_CGROUP_MGR_CONNECT: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to connect to CGManager: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_CGROUP_SETUP: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to setup cgroup: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_CGROUP_ENTER: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to enter cgroup: %s"), strerror (err->errnum))); break; case JOB_PROCESS_ERROR_CGROUP_CLEAR: err->error.message = NIH_MUST (nih_sprintf ( err, _("unable to mark cgroups for removal: %s"), strerror (err->errnum))); break; default: nih_assert_not_reached (); } nih_error_raise_error (&err->error); } /** * job_process_kill: * @job: job to kill process of, * @process: process to be killed. * * This function forces a @job to leave its current state by sending * @process the "kill signal" defined signal (TERM by default), and maybe * later the KILL signal. The actual state changes are performed by * job_child_reaper when the process has actually terminated. **/ void job_process_kill (Job *job, ProcessType process) { nih_assert (job != NULL); nih_assert (job->pid[process] > 0); nih_assert (job->kill_timer == NULL); nih_assert (job->kill_process == PROCESS_INVALID); nih_info (_("Sending %s signal to %s %s process (%d)"), nih_signal_to_name (job->class->kill_signal), job_name (job), process_name (process), job->pid[process]); if (system_kill (job->pid[process], job->class->kill_signal) < 0) { NihError *err; err = nih_error_get (); if (err->number != ESRCH) nih_warn (_("Failed to send %s signal to %s %s process (%d): %s"), nih_signal_to_name (job->class->kill_signal), job_name (job), process_name (process), job->pid[process], err->message); nih_free (err); return; } job_process_set_kill_timer (job, process, job->class->kill_timeout); } /** * job_process_jobs_running: * * Determine if any jobs are running. Note that simply checking if class * instances exist is insufficient: since this call is used for shutdown * abstract jobs must not be able to block the shutdown. * * Returns: TRUE if jobs are still running, else FALSE. **/ int job_process_jobs_running (void) { job_class_init (); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; NIH_HASH_FOREACH (class->instances, job_iter) { Job *job = (Job *)job_iter; int i; for (i = 0; i < PROCESS_LAST; i++) { if (job->pid[i]) return TRUE; } } } return FALSE; } /** * job_process_stop_all: * * Stop all running jobs. **/ void job_process_stop_all (void) { job_class_init (); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; /* Note that instances get killed in a random order */ NIH_HASH_FOREACH (class->instances, job_iter) { Job *job = (Job *)job_iter; /* Request job instance stops */ job_change_goal (job, JOB_STOP); } } } /** * job_process_set_kill_timer: * @job: job to set kill timer for, * @process: process to be killed, * @timeout: timeout to apply for timer. * * Set kill timer for specified @job @process with timeout @timeout. **/ void job_process_set_kill_timer (Job *job, ProcessType process, time_t timeout) { nih_assert (job); nih_assert (timeout); nih_assert (job->kill_timer == NULL); job->kill_process = process; job->kill_timer = NIH_MUST (nih_timer_add_timeout ( job, timeout, (NihTimerCb)job_process_kill_timer, job)); } /** * job_process_adj_kill_timer: * * @job: job whose kill timer is to be modified, * @due: new due time to set for job kill timer. * * Adjust due time for @job's kill timer to @due. **/ void job_process_adj_kill_timer (Job *job, time_t due) { nih_assert (job); nih_assert (job->kill_timer); nih_assert (due); job->kill_timer->due = due; } /** * job_process_kill_timer: * @job: job to kill process of, * @timer: timer that caused us to be called. * * This callback is called if the process failed to terminate within * a particular time of being sent the TERM signal. The process is killed * more forcibly by sending the KILL signal. **/ static void job_process_kill_timer (Job *job, NihTimer *timer) { ProcessType process; nih_assert (job != NULL); nih_assert (timer != NULL); nih_assert (job->kill_timer == timer); nih_assert (job->kill_process != PROCESS_INVALID); process = job->kill_process; nih_assert (job->pid[process] > 0); job->kill_timer = NULL; job->kill_process = PROCESS_INVALID; nih_info (_("Sending %s signal to %s %s process (%d)"), "KILL", job_name (job), process_name (process), job->pid[process]); if (system_kill (job->pid[process], SIGKILL) < 0) { NihError *err; err = nih_error_get (); if (err->number != ESRCH) nih_warn (_("Failed to send %s signal to %s %s process (%d): %s"), "KILL", job_name (job), process_name (process), job->pid[process], err->message); nih_free (err); } } /** * job_process_handler: * @data: unused, * @pid: process that changed, * @event: event that occurred on the child, * @status: exit status, signal raised or ptrace event. * * This callback should be registered with nih_child_add_watch() so that * when processes associated with jobs die, stop, receive signals or other * ptrace events, the appropriate action is taken. * * Normally this is registered so it is called for all processes, and is * safe to do as it only acts if the process is linked to a job. **/ void job_process_handler (void *data, pid_t pid, NihChildEvents event, int status) { Job *job; ProcessType process; NihLogLevel priority; const char *sig; nih_assert (pid > 0); /* Find the job that an event ocurred for, and identify which of the * job's process it was. If we don't know about it, then we simply * ignore the event. */ job = job_process_find (pid, &process); if (! job) return; /* Check the job's normal exit clauses to see whether this is a failure * worth warning about. */ priority = NIH_LOG_WARN; for (size_t i = 0; i < job->class->normalexit_len; i++) { if (job->class->normalexit[i] == status) { priority = NIH_LOG_INFO; break; } } switch (event) { case NIH_CHILD_EXITED: /* Child exited; check status to see whether it exited * normally (zero) or with a non-zero status. */ if (status) { nih_log_message (priority, _("%s %s process (%d) " "terminated with status %d"), job_name (job), process_name (process), pid, status); } else { nih_info (_("%s %s process (%d) exited normally"), job_name (job), process_name (process), pid); } job_process_terminated (job, process, status, FALSE); break; case NIH_CHILD_KILLED: case NIH_CHILD_DUMPED: /* Child was killed by a signal, and maybe dumped core. We * store the signal value in the higher byte of status (it's * safe to do that) to distinguish it from a normal exit * status. */ sig = nih_signal_to_name (status); if (sig) { nih_log_message (priority, _("%s %s process (%d) killed by %s signal"), job_name (job), process_name (process), pid, sig); } else { nih_warn (_("%s %s process (%d) killed by signal %d"), job_name (job), process_name (process), pid, status); } status <<= 8; job_process_terminated (job, process, status, FALSE); break; case NIH_CHILD_STOPPED: /* Child was stopped by a signal, make sure it was SIGSTOP * and not a tty-related signal. */ sig = nih_signal_to_name (status); if (sig) { nih_info (_("%s %s process (%d) stopped by %s signal"), job_name (job), process_name (process), pid, sig); } else { nih_info (_("%s %s process (%d) stopped by signal %d"), job_name (job), process_name (process), pid, status); } if (status == SIGSTOP) job_process_stopped (job, process); break; case NIH_CHILD_CONTINUED: /* Child was continued by a signal. */ sig = nih_signal_to_name (status); if (sig) { nih_info (_("%s %s process (%d) continued by %s signal"), job_name (job), process_name (process), pid, sig); } else { nih_info (_("%s %s process (%d) continued by signal %d"), job_name (job), process_name (process), pid, status); } break; case NIH_CHILD_TRAPPED: /* Child received a signal while we were tracing it. This * can be a signal raised inside the kernel as a side-effect * of the trace because the child called fork() or exec(); * we only know that from our own state tracking. */ if ((job->trace_state == TRACE_NEW) && (status == SIGTRAP)) { job_process_trace_new (job, process); } else if ((job->trace_state == TRACE_NEW_CHILD) && (status == SIGSTOP)) { job_process_trace_new_child (job, process); } else { job_process_trace_signal (job, process, status); } break; case NIH_CHILD_PTRACE: /* Child called an important syscall that can modify the * state of the process trace we hold. */ switch (status) { case PTRACE_EVENT_FORK: job_process_trace_fork (job, process); break; case PTRACE_EVENT_EXEC: job_process_trace_exec (job, process); break; default: nih_assert_not_reached (); } break; default: nih_assert_not_reached (); } } /** * job_process_terminated: * @job: job that changed, * @process: specific process, * @status: exit status or signal in higher byte, * @state_only: if TRUE, only update the jobs state (not its goal). * * This function is called whenever a @process attached to @job terminates, * @status should contain the exit status in the lower byte or signal in * the higher byte. * * The job structure is updated and the next appropriate state for the job * is chosen, which may involve changing the goal to stop first. **/ static void job_process_terminated (Job *job, ProcessType process, int status, int state_only) { int failed = FALSE, stop = FALSE, state = TRUE; struct utmpx *utmptr; struct timeval tv; nih_assert (job != NULL); if (job->state == JOB_SECURITY_SPAWNING || job->state == JOB_PRE_STARTING || job->state == JOB_SPAWNING || job->state == JOB_POST_STARTING || job->state == JOB_PRE_STOPPING || job->state == JOB_POST_STOPPING) { /* A child process has been spawned by * job_process_spawn(), but we have not yet received * confirmation of whether the child setup phase was * successful or not. * * The fact that we are in this function means the child * setup actually failed, however we handle that * by waiting for the handlers registered by * job_register_child_handler() to be called to deal * with this error. */ nih_assert (job->process_data); nih_assert (job->process_data[process]); /* Add the child data for the *second* call to this * function when the child pipe has been closed. */ job->process_data[process]->status = status; job->state = job_next_state (job); return; } switch (process) { case PROCESS_MAIN: nih_assert ((job->state == JOB_RUNNING) || (job->state == JOB_SPAWNED) || (job->state == JOB_KILLED) || (job->state == JOB_STOPPING) || (job->state == JOB_POST_START) || (job->state == JOB_PRE_STOP)); /* We don't change the state if we're in post-start and there's * a post-start process running, or if we're in pre-stop and * there's a pre-stop process running; we wait for those to * finish instead. */ if ((job->state == JOB_POST_START) && job->class->process[PROCESS_POST_START] && (job->pid[PROCESS_POST_START] > 0)) { state = FALSE; } else if ((job->state == JOB_PRE_STOP) && job->class->process[PROCESS_PRE_STOP] && (job->pid[PROCESS_PRE_STOP] > 0)) { state = FALSE; } /* Dying when we killed it is perfectly normal and never * considered a failure. We also don't want to tamper with * the goal since we might be restarting the job anyway. */ if (job->state == JOB_KILLED) break; /* Yet another corner case is terminating when we were * already stopping, we don't to tamper with the goal or * state because we're still waiting for the stopping * event to finish and that might restart it anyway. * We also don't want to consider it a failure, because * we want the stopping and stopped events to match. */ if (job->state == JOB_STOPPING) { state = FALSE; break; } /* We don't assume that because the primary process was * killed or exited with a non-zero status, it failed. * Instead we check the normalexit list to see whether * the exit signal or status is in that list, and only * if not, do we consider it failed. * * For services that can be respawned, a zero exit status is * also a failure unless listed. */ if ((status || (job->class->respawn && (! job->class->task))) && (job->goal == JOB_START)) { failed = TRUE; for (size_t i = 0; i < job->class->normalexit_len; i++) { if (job->class->normalexit[i] == status) { failed = FALSE; break; } } /* We might be able to respawn the failed job; * that's a simple matter of doing nothing. Check * the job isn't running away first though. */ if (failed && job->class->respawn && ! disable_respawn) { if (job_process_catch_runaway (job)) { nih_warn (_("%s respawning too fast, stopped"), job_name (job)); failed = FALSE; job_failed (job, PROCESS_INVALID, 0); } else { nih_warn (_("%s %s process ended, respawning"), job_name (job), process_name (process)); failed = FALSE; /* If we're not going to change the * state because there's a post-start * or pre-stop script running, we need * to remember to do it when that * finishes. */ if (! state) job_change_goal (job, JOB_RESPAWN); break; } } } /* Otherwise whether it's failed or not, we should * stop the job now. */ stop = TRUE; break; case PROCESS_SECURITY: nih_assert (job->state == JOB_SECURITY); /* We should always fail the job if the security profile * failed to load */ if (status) { failed = TRUE; stop = TRUE; } break; case PROCESS_PRE_START: nih_assert (job->state == JOB_PRE_START); /* If the pre-start script is killed or exits with a status * other than zero, it's always considered a failure since * we don't know what state the job might be in. */ if (status) { failed = TRUE; stop = TRUE; } break; case PROCESS_POST_START: nih_assert (job->state == JOB_POST_START || job->state == JOB_RUNNING); /* We always want to change the state when the post-start * script terminates; if the main process is running, we'll * stay in that state, otherwise we'll skip through. * * Failure is ignored since there's not much we can do * about it at this point. */ break; case PROCESS_PRE_STOP: nih_assert (job->state == JOB_PRE_STOP); /* We always want to change the state when the pre-stop * script terminates, we either want to go back into running * or head towards killing the main process. * * Failure is ignored since there's not much we can do * about it at this point. */ break; case PROCESS_POST_STOP: nih_assert (job->state == JOB_POST_STOP); /* If the post-stop script is killed or exits with a status * other than zero, it's always considered a failure since * we don't know what state the job might be in. */ if (status) { failed = TRUE; stop = TRUE; } break; default: nih_assert_not_reached (); } /* Cancel any timer trying to kill the job, since it's just * died. We could do this inside the main process block above, but * leaving it here for now means we can use the timer for any * additional process later. */ if (job->kill_timer) { nih_unref (job->kill_timer, job); job->kill_timer = NULL; job->kill_process = PROCESS_INVALID; } if (job->class->console == CONSOLE_LOG && job->log[process] && ! state_only) { int ret; /* It is imperative that we free the log at this stage to ensure * that jobs which respawn have their log written _now_ * (and not just when the overall Job object is freed at * some distant future point). */ ret = log_handle_unflushed (job->log, job->log[process]); if (ret != 0) { if (ret < 0) { /* Any lingering data will now be lost in what * is probably a low-memory scenario. */ nih_warn (_("Failed to add log to unflushed queue")); } nih_free (job->log[process]); } /* Either the log has been freed, or it needs to be * severed from its parent job fully. */ job->log[process] = NULL; } if (! state_only) { /* Find existing utmp entry for the process pid */ setutxent(); while ((utmptr = getutxent()) != NULL) { if (utmptr->ut_pid == job->pid[process]) { /* set type and clean ut_user, ut_host, * ut_time as described in utmp(5) */ utmptr->ut_type = DEAD_PROCESS; memset(utmptr->ut_user, 0, UT_NAMESIZE); memset(utmptr->ut_host, 0, UT_HOSTSIZE); utmptr->ut_time = 0; /* Update existing utmp file. */ pututxline(utmptr); /* set ut_time for log */ gettimeofday(&tv, NULL); utmptr->ut_tv.tv_sec = tv.tv_sec; utmptr->ut_tv.tv_usec = tv.tv_usec; /* Write wtmp entry */ updwtmpx (_PATH_WTMP, utmptr); break; } } endutxent(); /* Clear the process pid field */ job->pid[process] = 0; } /* Mark the job as failed */ if (failed) job_failed (job, process, status); /* Cancel goal transition if the job state only should be * changed. */ if (state_only && stop) { stop = 0; nih_assert (! failed); } /* Change the goal to stop; normally this doesn't have any * side-effects, except when we're in the RUNNING state when it'll * change the state as well. We obviously don't want to change the * state twice. */ if (stop) { if (job->state == JOB_RUNNING) state = FALSE; job_change_goal (job, JOB_STOP); } if (state) job_change_state (job, job_next_state (job)); } /** * job_process_catch_runaway * @job: job being started. * * This function is called when changing the state of a job to starting, * before emitting the event. It ensures that a job doesn't end up in * a restart loop by limiting the number of restarts in a particular * time limit. * * Returns: TRUE if the job is respawning too fast, FALSE if not. */ static int job_process_catch_runaway (Job *job) { struct timespec now; nih_assert (job != NULL); if (job->class->respawn_limit && job->class->respawn_interval) { time_t interval; /* Time since last respawn ... this goes very large if we * haven't done one, which is fine */ nih_assert (clock_gettime (CLOCK_MONOTONIC, &now) == 0); interval = now.tv_sec - job->respawn_time; if (interval < job->class->respawn_interval) { job->respawn_count++; if (job->respawn_count > job->class->respawn_limit) return TRUE; } else { job->respawn_time = now.tv_sec; job->respawn_count = 1; } } return FALSE; } /** * job_process_stopped: * @job: job that changed, * @process: specific process. * * This function is called whenever a @process attached to @job is stopped * by the SIGSTOP signal (and not by a tty-related signal). * * Some jobs use this signal to signify that they have completed starting * up and are now running; thus we move them out of the spawned state. **/ static void job_process_stopped (Job *job, ProcessType process) { nih_assert (job != NULL); /* Any process can stop on a signal, but we only care about the * main process when the state is still spawned. */ if ((process != PROCESS_MAIN) || ((job->state != JOB_SPAWNING) && job->state != JOB_SPAWNED)) return; /* Send SIGCONT back and change the state to the next one, if this * job behaves that way. */ if (job->class->expect == EXPECT_STOP) { kill (job->pid[process], SIGCONT); job_change_state (job, job_next_state (job)); } } /** * job_process_trace_new: * @job: job that changed, * @process: specific process. * * This function is called when the traced @process attached to @job calls * its first exec(), still within the Upstart code before passing control * to the new executable. * * It sets the options for the trace so that forks and execs are reported. **/ static void job_process_trace_new (Job *job, ProcessType process) { nih_assert (job != NULL); nih_assert ((job->trace_state == TRACE_NEW) || (job->trace_state == TRACE_NEW_CHILD)); /* Any process can get us to trace them, but we only care about the * main process when the state is still spawned. */ if ((process != PROCESS_MAIN) || ((job->state != JOB_SPAWNING) && (job->state != JOB_SPAWNED))) { return; } /* Set options so that we are notified when the process forks, and * get a different kind of notification when it execs to a plain * SIGTRAP. */ if (ptrace (PTRACE_SETOPTIONS, job->pid[process], NULL, PTRACE_O_TRACEFORK | PTRACE_O_TRACEEXEC) < 0) { nih_warn (_("Failed to set ptrace options for " "%s %s process (%d): %s"), job_name (job), process_name (process), job->pid[process], strerror (errno)); return; } job->trace_state = TRACE_NORMAL; /* Allow the process to continue without delivering the * kernel-generated signal that was for our eyes not theirs. */ if (ptrace (PTRACE_CONT, job->pid[process], NULL, 0) < 0) nih_warn (_("Failed to continue traced %s %s process (%d): %s"), job_name (job), process_name (process), job->pid[process], strerror (errno)); } /** * job_process_trace_new_child: * @job: job that changed, * @process: specific process. * * This function is called whenever a traced @process attached to @job stops * after the fork() so that we can set the options before continuing it. * * Check to see whether we've reached the number of forks we expected, if * so detach the process and move towards the running state; otherwise we * set our important ptrace options, update the trace state so that * further SIGSTOP or SIGTRAP signals are treated as just that and allow * the process to continue. **/ static void job_process_trace_new_child (Job *job, ProcessType process) { nih_assert (job != NULL); nih_assert (job->trace_state == TRACE_NEW_CHILD); /* Any process can get us to trace them, but we only care about the * main process when the state is still spawned. */ if ((process != PROCESS_MAIN) || ((job->state != JOB_SPAWNING) && (job->state != JOB_SPAWNED))) return; /* We need to fork at least twice unless we're expecting a * single fork when we only need to fork once; once that limit * has been reached, end the trace. */ job->trace_forks++; if ((job->trace_forks > 1) || (job->class->expect == EXPECT_FORK)) { if (ptrace (PTRACE_DETACH, job->pid[process], NULL, 0) < 0) nih_warn (_("Failed to detach traced " "%s %s process (%d): %s"), job_name (job), process_name (process), job->pid[process], strerror (errno)); job->trace_state = TRACE_NONE; job_change_state (job, job_next_state (job)); return; } job_process_trace_new (job, process); } /** * job_process_trace_signal: * @job: job that changed, * @process: specific process. * * This function is called whenever a traced @process attached to @job has * a signal sent to it. * * We don't care about these, they're a side effect of ptrace that we can't * turn off, so we just deliver them untampered with. **/ static void job_process_trace_signal (Job *job, ProcessType process, int signum) { nih_assert (job != NULL); /* Any process can get us to trace them, but we only care about the * main process when the state is still spawned. */ if ((process != PROCESS_MAIN) || ((job->state != JOB_SPAWNING) && (job->state != JOB_SPAWNED)) || (job->trace_state != TRACE_NORMAL)) return; /* Deliver the signal */ if (ptrace (PTRACE_CONT, job->pid[process], NULL, signum) < 0) nih_warn (_("Failed to deliver signal to traced " "%s %s process (%d): %s"), job_name (job), process_name (process), job->pid[process], strerror (errno)); } /** * job_process_trace_fork: * @job: job that changed, * @process: specific process. * * This function is called whenever a traced @process attached to @job calls * the fork() system call. * * We obtain the new child process id from the message and update the * structure so that we follow that instead, detaching from the process that * called fork. **/ static void job_process_trace_fork (Job *job, ProcessType process) { unsigned long data; nih_assert (job != NULL); /* Any process can get us to trace them, but we only care about the * main process when the state is still spawned. */ if ((process != PROCESS_MAIN) || ((job->state != JOB_SPAWNING) && (job->state != JOB_SPAWNED)) || (job->trace_state != TRACE_NORMAL)) { return; } /* Obtain the child process id from the ptrace event. */ if (ptrace (PTRACE_GETEVENTMSG, job->pid[process], NULL, &data) < 0) { nih_warn (_("Failed to obtain child process id " "for %s %s process (%d): %s"), job_name (job), process_name (process), job->pid[process], strerror (errno)); return; } nih_info (_("%s %s process (%d) became new process (%d)"), job_name (job), process_name (process), job->pid[process], (pid_t)data); /* We no longer care about this process, it's the child that we're * interested in from now on, so detach it and allow it to go about * its business unhindered. */ if (ptrace (PTRACE_DETACH, job->pid[process], NULL, 0) < 0) nih_warn (_("Failed to detach traced %s %s process (%d): %s"), job_name (job), process_name (process), job->pid[process], strerror (errno)); /* Update the process we're supervising which is about to get SIGSTOP * so set the trace options to capture it. */ job->pid[process] = (pid_t)data; job->trace_state = TRACE_NEW_CHILD; /* We may have already had the wait notification for the new child * waiting at SIGSTOP, in which case a ptrace() call will succeed * for it. */ if (ptrace (PTRACE_SETOPTIONS, job->pid[process], NULL, 0) < 0) { nih_debug ("Failed to set options for new %s %s process (%d), " "probably not yet forked: %s", job_name (job), process_name (process), job->pid[process], strerror (errno)); return; } job_process_trace_new_child (job, process); } /** * job_process_trace_exec: * @job: job that changed, * @process: specific process. * * This function is called whenever a traced @process attached to @job calls * the exec() system call after we've set options on it to distinguish them * from ordinary SIGTRAPs. * * We assume that if the job calls exec that it's finished forking so we can * drop the trace entirely; we have no interest in tracing the new child. **/ static void job_process_trace_exec (Job *job, ProcessType process) { nih_assert (job != NULL); /* Any process can get us to trace them, but we only care about the * main process when the state is still spawned and we're tracing it. */ if ((process != PROCESS_MAIN) || ((job->state != JOB_SPAWNING) && job->state != JOB_SPAWNED) || (job->trace_state != TRACE_NORMAL)) return; nih_info (_("%s %s process (%d) executable changed"), job_name (job), process_name (process), job->pid[process]); if (job->trace_forks) { if (ptrace (PTRACE_DETACH, job->pid[process], NULL, 0) < 0) nih_warn (_("Failed to detach traced " "%s %s process (%d): %s"), job_name (job), process_name (process), job->pid[process], strerror (errno)); job->trace_state = TRACE_NONE; job_change_state (job, job_next_state (job)); } else { if (ptrace (PTRACE_CONT, job->pid[process], NULL, 0) < 0) nih_warn (_("Failed to continue traced %s %s process (%d): %s"), job_name (job), process_name (process), job->pid[process], strerror (errno)); } } /** * job_process_find: * @pid: process id to find, * @process: pointer to place process which is running @pid. * * Finds the job with a process of the given @pid in the jobs hash table. * If @process is not NULL, the @process variable is set to point at the * process entry in the table which has @pid. * * Returns: job found or NULL if not known. **/ Job * job_process_find (pid_t pid, ProcessType *process) { nih_assert (pid > 0); job_class_init (); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; NIH_HASH_FOREACH (class->instances, job_iter) { Job *job = (Job *)job_iter; int i; for (i = 0; i < PROCESS_LAST; i++) { if (job->pid[i] == pid) { if (process) *process = i; return job; } } } } return NULL; } /** * job_process_log_path: * * @job: Job, * @user_job: TRUE if @job refers to a non-root job, else FALSE. * * Determine full path to on-disk log file for specified @job. * * This differs depending on whether the job is a system job or a user job. * Instance names are appended to the log name. * * Returns: newly allocated log path string, or NULL on raised error. **/ char * job_process_log_path (Job *job, int user_job) { JobClass *class = NULL; char *log_path = NULL; nih_local char *dir = NULL; nih_local char *class_name = NULL; char *p; nih_assert (job); nih_assert (job->class); /* Logging of user job output not currently supported */ nih_assert (user_job == 0); class = job->class; nih_assert (class->name); /* Override, primarily for tests */ if (getenv (LOGDIR_ENV) && ! user_mode) { dir = nih_strdup (NULL, getenv (LOGDIR_ENV)); nih_debug ("Using alternative directory '%s' for logs", dir); } else { dir = nih_strdup (NULL, log_dir ? log_dir : JOB_LOGDIR); } if (! dir) nih_return_no_memory_error (NULL); /* If the job is running inside a chroot, it must be logged to a * file within the chroot. */ if (job->class->session && job->class->session->chroot) { char *tmp = dir; dir = nih_sprintf (NULL, "%s%s", job->class->session->chroot, tmp); nih_free (tmp); } class_name = nih_strdup (NULL, class->name); if (! class_name) nih_return_no_memory_error (NULL); /* Remap slashes since we write all logs to the * same directory. */ p = class_name; while (*p) { if (*p == JOB_PROCESS_LOG_REMAP_FROM_CHAR) *p = JOB_PROCESS_LOG_REMAP_TO_CHAR; p++; } /* Handle jobs with multiple instances */ if (job->name && *job->name) { nih_local char *instance_name = NULL; instance_name = nih_strdup (NULL, job->name); if (! instance_name) nih_return_no_memory_error (NULL); p = instance_name; while (*p) { if (*p == JOB_PROCESS_LOG_REMAP_FROM_CHAR) *p = JOB_PROCESS_LOG_REMAP_TO_CHAR; p++; } log_path = nih_sprintf (NULL, "%s/%s-%s%s", dir, class_name, instance_name, JOB_PROCESS_LOG_FILE_EXT); } else { log_path = nih_sprintf (NULL, "%s/%s%s", dir, class_name, JOB_PROCESS_LOG_FILE_EXT); } if (! log_path) nih_return_no_memory_error (NULL); return log_path; } /** * job_process_remap_fd: * * @fd: pointer to fd to potentially remap, * @reserved_fd: reserved fd value, * @error_fd: fd to report errors on, * * Remap @fd to a new value iff it has the same value as @reserved_fd. * * Errors are reported via @error_fd and are fatal. * * Notes: * * - File descriptor flags are not retained. * - It is permissible for @error_fd to have the same value as @fd. **/ static void job_process_remap_fd (int *fd, int reserved_fd, int error_fd) { int new = -1; nih_assert (fd); nih_assert (reserved_fd); nih_assert (error_fd >= 0); if (*fd != reserved_fd) { /* fd does not need remapping */ return; } new = dup (*fd); if (new < 0) { nih_error_raise_system (); job_process_error_abort (error_fd, JOB_PROCESS_ERROR_DUP, 0); } close (*fd); *fd = new; } /** * job_process_child_reader: * * @process_data: JobProcessHandlerData structure, * @io: NihIo with data to be read, * @buf: buffer data is available in, * @len: bytes in @buf. * * Called automatically when an error occurred setting up the child process. **/ void job_process_child_reader (JobProcessData *process_data, NihIo *io, const char *buf, size_t len) { Job *job; ProcessType process; NihError *err; /* The job is in the process of being killed which must mean all * the job pids are dead. Hence, there is no point in attempting * to talk to them. */ if (! process_data) return; if (! process_data->valid) return; nih_assert (io); nih_assert (buf); job = process_data->job; process = process_data->process; /* Construct the NIH error from the data received from * the child. */ job_process_error_handler (buf, len); err = nih_error_get (); if (err->number != JOB_PROCESS_ERROR) { nih_warn ("%s: %s", _("Temporary process spawn error"), err->message); nih_free (err); return; } /* Wilco. Out. */ nih_io_buffer_shrink (io->recv_buf, len); /* Non-temporary error condition */ nih_warn (_("Failed to spawn %s %s process: %s"), job_name (job), process_name (process), err->message); nih_free (err); /* Non-temporary error condition, we're not going * to be able to spawn this job. */ if (process_data->shell_fd != -1) { close (process_data->shell_fd); /* Invalidate */ process_data->shell_fd = -1; } if (job && job->class->console == CONSOLE_LOG && job->log[process]) { /* Ensure the pty_master watch gets * removed and the fd closed. */ nih_free (job->log[process]); job->log[process] = NULL; } /* Now call the handler registered via job_process_start() * to deal with the error condition. */ job_child_error_handler (job, process); /* Note that pts_master is closed automatically in the parent * when the log object is destroyed. */ process_data->valid = FALSE; nih_io_shutdown (io); /* Invalidate */ process_data->job_process_fd = -1; } /** * @process_data: JobProcessData, * @io: NihIo. * * NihIoCloseHandler called when job process starts successfully. **/ void job_process_close_handler (JobProcessData *process_data, NihIo *io) { Job *job; ProcessType process; int status; /* The job is in the process of being killed which must mean all * the job pids are dead. Hence, there is no point in attempting * to talk to them. */ if (! process_data) return; if (! process_data->valid) return; nih_assert (io); job = process_data->job; process = process_data->process; status = process_data->status; /* Ensure the job process error fd is closed before attempting * to handle any scripts. */ nih_free (io); /* invalidate */ process_data->job_process_fd = -1; process_data->valid = FALSE; job_process_run_bottom (process_data); if (job && job->state == JOB_SPAWNED) { if (job->class->expect == EXPECT_NONE) { if (process == PROCESS_MAIN) { /* Job has not specified expect stanza so will * not have its state automatically progressed * by the ptrace handlers, hence bump it * manually. */ job_change_state (job, job_next_state (job)); } } } /* Don't change the jobs goal yet as the process may not have * actually terminted (and hence will have * job_process_terminated() called on it again later). */ switch (job->state) { case JOB_SECURITY_SPAWNING: case JOB_PRE_STARTING: case JOB_SPAWNING: case JOB_POST_STARTING: case JOB_PRE_STOPPING: case JOB_POST_STOPPING: job_process_terminated (job, process, status, TRUE); break; default: /* NOP */ break; } } /** * job_process_run_bottom: * * @process_data: JobProcessData. * * Perform final job process setup. **/ void job_process_run_bottom (JobProcessData *process_data) { Job *job; char *script; int shell_fd; nih_assert (process_data); job = process_data->job; shell_fd = process_data->shell_fd; script = process_data->script; /* Handle job process containing a script section by sending the * script to the child shell. */ if (script && shell_fd != -1) { NihIo *io; /* Put the entire script into an NihIo send buffer and * then mark it for closure so that the shell gets EOF * and the structure gets cleaned up automatically. */ while (! (io = nih_io_reopen (job, shell_fd, NIH_IO_STREAM, NULL, NULL, NULL, NULL))) { NihError *err; err = nih_error_get (); if (err->number != ENOMEM) nih_assert_not_reached (); nih_free (err); } /* We're feeding using a pipe, which has a file descriptor * on the child end even though it open()s it again using * a path. Instruct the shell to close this extra fd and * not to leak it. */ NIH_ZERO (nih_io_printf (io, "exec %d<&-\n", JOB_PROCESS_SCRIPT_FD)); NIH_ZERO (nih_io_write (io, script, strlen (script))); /* We're only using the io for writing, so clear the * default flag. */ io->watch->events &= ~NIH_IO_READ; nih_io_shutdown (io); /* Invalidate now that we've sent the script to the * child. */ process_data->shell_fd = -1; process_data->valid = FALSE; } } /** * job_process_data_new: * * @parent: parent pointer, * @job: job, * @process: currently-running job process, * @job_process_fd: error file descriptor connected to job process used * to signal successful job process setup. * * Create a new job process data object to record meta-data for an * asynchronously-started job process. The lifetime of such objects is * limited to the time taken for the job process to fail or indicate * successful startup (both scenarios are handled by @job_process_fd). * * Returns: Newly-allocated JobProcess on success, or NULL on * insufficient memory. **/ JobProcessData * job_process_data_new (void *parent, Job *job, ProcessType process, int job_process_fd) { JobProcessData *process_data; nih_assert (job); nih_assert (job_process_fd != -1); process_data = NIH_MUST (nih_new (parent, JobProcessData)); if (! process_data) return NULL; process_data->process = process; process_data->job_process_fd = job_process_fd; process_data->script = NULL; process_data->shell_fd = -1; process_data->valid = TRUE; process_data->job = job; process_data->status = 0; return process_data; } /** * job_process_data_serialise: * * @job: job, * @process_data: job process data. * * Returns: JSON-serialised JobProcessData object, or NULL on error. **/ json_object * job_process_data_serialise (const Job *job, const JobProcessData *process_data) { json_object *json; nih_assert (job); json = json_object_new_object (); if (! json) return NULL; /* Job has no "in-flight" process */ if (! process_data) return json; nih_assert (process_data->job_process_fd != -1); /* XXX: Note that Job is not serialised; it's not necessary * since the JobProcessData itself is serialised within its Job * and the job pointer can be reinstated on deserialisation. */ if (! state_set_json_enum_var (json, process_type_enum_to_str, "process", process_data->process)) goto error; if (! state_set_json_string_var_from_obj (json, process_data, script)) goto error; /* Clear the cloexec flag to ensure the descriptors * remains open across the re-exec. */ if (process_data->shell_fd != -1) { if (state_modify_cloexec (process_data->shell_fd, FALSE) < 0) goto error; } if (state_modify_cloexec (process_data->job_process_fd, FALSE) < 0) goto error; if (! state_set_json_int_var_from_obj (json, process_data, shell_fd)) goto error; if (! state_set_json_int_var_from_obj (json, process_data, job_process_fd)) goto error; if (! state_set_json_int_var_from_obj (json, process_data, status)) goto error; if (! state_set_json_int_var_from_obj (json, process_data, valid)) goto error; return json; error: json_object_put (json); return NULL; } /** * job_process_data_deserialise: * * @parent: parent pointer, * @job: job, * @json: JSON-serialised JobProcessData object to deserialise. * * Returns: JobProcessData object, or NULL on error. **/ JobProcessData * job_process_data_deserialise (void *parent, Job *job, json_object *json) { JobProcessData *process_data = NULL; ProcessType process; int job_process_fd; nih_assert (job); nih_assert (json); if (! state_check_json_type (json, object)) return NULL; if (! state_get_json_enum_var (json, process_type_str_to_enum, "process", process)) return NULL; if (! state_get_json_int_var (json, "job_process_fd", job_process_fd)) return NULL; process_data = job_process_data_new (parent, job, process, job_process_fd); if (! process_data) return NULL; if (! state_get_json_string_var_to_obj (json, process_data, script)) goto error; if (! state_get_json_int_var_to_obj (json, process_data, shell_fd)) goto error; if (! state_get_json_int_var_to_obj (json, process_data, status)) goto error; if (! state_get_json_int_var_to_obj (json, process_data, valid)) goto error; /* Reset the cloexec flag to ensure the descriptors * are not leaked to any child processes. */ if (process_data->shell_fd != -1) { if (state_modify_cloexec (process_data->shell_fd, TRUE) < 0) goto error; } if (state_modify_cloexec (process_data->job_process_fd, TRUE) < 0) goto error; return process_data; error: if (process_data) nih_free (process_data); return NULL; } upstart-1.13.2/init/parse_conf.h0000664000175000017500000000205012373101356013454 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_PARSE_CONF_H #define INIT_PARSE_CONF_H #include #include "conf.h" NIH_BEGIN_EXTERN int parse_conf (ConfFile *conffile, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_PARSE_CONF_H */ upstart-1.13.2/init/events.h0000664000175000017500000000531712373101356012652 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_EVENTS_H #define INIT_EVENTS_H /** * STARTUP_EVENT: * * Name of the event that we generate when init is first executed. **/ #ifndef DEBUG #define STARTUP_EVENT "startup" #else /* DEBUG */ #define STARTUP_EVENT "debug" #endif /** * SESSION_END_EVENT: * * Name of the event Upstart emits to denote a Session Init * is shutting down. **/ #define SESSION_END_EVENT "session-end" /** * CTRLALTDEL_EVENT: * * Name of the event that we generate when the Control-Alt-Delete key * combination is pressed. **/ #define CTRLALTDEL_EVENT "control-alt-delete" /** * KBDREQUEST_EVENT: * * Name of the event that we generate when the Alt-UpArrow key combination * is pressed. **/ #define KBDREQUEST_EVENT "keyboard-request" /** * PWRSTATUS_EVENT: * * Name of the event that we generate when we receive SIGPWR, indicating * that the power status has changed. **/ #define PWRSTATUS_EVENT "power-status-changed" /** * JOB_STARTING_EVENT: * * Name of the event we generate when we're ready to start a job; the job * is not actually started until the handling of this event finishes. **/ #define JOB_STARTING_EVENT "starting" /** * JOB_STARTED_EVENT: * * Name of the event we generate once a job has been started and is now * running. This is not generated until the spawned pid is located (if * appropriate) and the post-start script has finished. **/ #define JOB_STARTED_EVENT "started" /** * JOB_STOPPING_EVENT: * * Name of the event we generate when we're ready to stop a job, which * includes arguments and environment indicating whether the job failed. * This is run after the pre-stop script has finished without setting the * goal back to start. The job is not actually stopped until the handling * of this event finishes. **/ #define JOB_STOPPING_EVENT "stopping" /** * JOB_STOPPED_EVENT: * * Name of the event we generate once a job has been stopped and is now * waiting. **/ #define JOB_STOPPED_EVENT "stopped" #endif /* INIT_EVENTS_H */ upstart-1.13.2/init/event_operator.h0000664000175000017500000001036512373101356014401 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_EVENT_OPERATOR_H #define INIT_EVENT_OPERATOR_H #include #include #include "event.h" /** * EventOperatorType: * * This is used to distinguish between the different boolean behaviours of * the EventOperator structure. **/ typedef enum event_operator_type { EVENT_OR, EVENT_AND, EVENT_MATCH } EventOperatorType; /** * EventOperator: * @node: tree node, * @type: operator type, * @value: operator value, * @name: name of event to match (EVENT_MATCH only), * @env: environment variables of event to match (EVENT_MATCH only), * @event: event matched (EVENT_MATCH only). * * This structure is used to build up an event expression tree; the leaf * nodes are all of EVENT_MATCH type which match a specific event, the other * nodes are built up of EVENT_OR and EVENT_AND operators that combine the * EventOperators to their left and right in interesting ways. * * @value indicates whether this operator is currently TRUE or FALSE. * For EVENT_MATCH operators, a TRUE @value means that @event is set to * the matched event; for EVENT_OR and EVENT_AND operators, @value is set * depending on the value of both immediate children. * * Once an event has been matched, the @event member is set and a reference * held until the structure is cleared. **/ typedef struct event_operator { NihTree node; EventOperatorType type; int value; char *name; char **env; Event *event; } EventOperator; NIH_BEGIN_EXTERN EventOperator *event_operator_new (const void *parent, EventOperatorType type, const char *name, char **env) __attribute__ ((warn_unused_result)); EventOperator *event_operator_copy (const void *parent, const EventOperator *old_oper) __attribute__ ((warn_unused_result)); int event_operator_destroy (EventOperator *oper); void event_operator_update (EventOperator *oper); int event_operator_match (EventOperator *oper, Event *event, char * const *env); int event_operator_handle (EventOperator *root, Event *event, char * const *env); char ** event_operator_environment (EventOperator *root, char ***env, const void *parent, size_t *len, const char *key); int * event_operator_fds (EventOperator *root, const void *parent, int **fds, size_t *num_fds, char ***env, size_t *len, const char *key); void event_operator_events (EventOperator *root, const void *parent, NihList *list); void event_operator_reset (EventOperator *root); const char * event_operator_type_enum_to_str (EventOperatorType type) __attribute__ ((warn_unused_result)); EventOperatorType event_operator_type_str_to_enum (const char *type) __attribute__ ((warn_unused_result)); json_object * event_operator_serialise (const EventOperator *oper) __attribute__ ((warn_unused_result)); json_object * event_operator_serialise_all (EventOperator *root) __attribute__ ((warn_unused_result)); EventOperator * event_operator_deserialise (void *parent, json_object *json) __attribute__ ((warn_unused_result)); EventOperator * event_operator_deserialise_all (void *parent, json_object *json) __attribute__ ((warn_unused_result)); char *event_operator_collapse (EventOperator *condition) __attribute__ ((warn_unused_result, unused)); NIH_END_EXTERN #endif /* INIT_EVENT_OPERATOR_H */ upstart-1.13.2/init/parse_job.c0000664000175000017500000023666412373101356013320 00000000000000/* upstart * * parse_job.c - job definition parsing * * Copyright © 2010,2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "process.h" #include "job_class.h" #include "event.h" #include "parse_job.h" #include "errors.h" #include "apparmor.h" #ifdef ENABLE_CGROUPS #include "cgroup.h" #endif /* ENABLE_CGROUPS */ /* Prototypes for static functions */ static int parse_exec (Process *process, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int parse_script (Process *process, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int parse_process (JobClass *class, ProcessType process, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static EventOperator *parse_on (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int parse_on_operator (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno, NihList *stack, EventOperator **root) __attribute__ ((warn_unused_result)); static int parse_on_paren (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno, NihList *stack, EventOperator **root, size_t *paren) __attribute__ ((warn_unused_result)); static int parse_on_operand (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno, NihList *stack, EventOperator **root) __attribute__ ((warn_unused_result)); static int parse_on_collect (JobClass *class, NihList *stack, EventOperator **root) __attribute__ ((warn_unused_result)); static int stanza_instance (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_description (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_author (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_version (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_env (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_export (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_start (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_stop (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_emits (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_exec (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_script (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_pre_start (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_post_start (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_pre_stop (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_post_stop (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_expect (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_task (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_kill (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_reload (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_apparmor (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_respawn (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_normal (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_console (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_umask (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_nice (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_oom (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_limit (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_chroot (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_chdir (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_setuid (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_setgid (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_debug (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_manual (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_usage (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int stanza_cgroup (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); static int parse_cgroup (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) __attribute__ ((warn_unused_result)); /** * debug_stanza_enabled: * * If TRUE, honour the debug stanza, else consider it a NOP. **/ int debug_stanza_enabled = FALSE; /** * stanzas: * * This is the table of known job definition stanzas and the functions * that handle parsing them. **/ static NihConfigStanza stanzas[] = { { "instance", (NihConfigHandler)stanza_instance }, { "description", (NihConfigHandler)stanza_description }, { "author", (NihConfigHandler)stanza_author }, { "version", (NihConfigHandler)stanza_version }, { "env", (NihConfigHandler)stanza_env }, { "export", (NihConfigHandler)stanza_export }, { "start", (NihConfigHandler)stanza_start }, { "stop", (NihConfigHandler)stanza_stop }, { "emits", (NihConfigHandler)stanza_emits }, { "exec", (NihConfigHandler)stanza_exec }, { "script", (NihConfigHandler)stanza_script }, { "pre-start", (NihConfigHandler)stanza_pre_start }, { "post-start", (NihConfigHandler)stanza_post_start }, { "pre-stop", (NihConfigHandler)stanza_pre_stop }, { "post-stop", (NihConfigHandler)stanza_post_stop }, { "expect", (NihConfigHandler)stanza_expect }, { "task", (NihConfigHandler)stanza_task }, { "kill", (NihConfigHandler)stanza_kill }, { "reload", (NihConfigHandler)stanza_reload }, { "respawn", (NihConfigHandler)stanza_respawn }, { "normal", (NihConfigHandler)stanza_normal }, { "console", (NihConfigHandler)stanza_console }, { "umask", (NihConfigHandler)stanza_umask }, { "nice", (NihConfigHandler)stanza_nice }, { "oom", (NihConfigHandler)stanza_oom }, { "limit", (NihConfigHandler)stanza_limit }, { "chroot", (NihConfigHandler)stanza_chroot }, { "chdir", (NihConfigHandler)stanza_chdir }, { "setuid", (NihConfigHandler)stanza_setuid }, { "setgid", (NihConfigHandler)stanza_setgid }, { "debug", (NihConfigHandler)stanza_debug }, { "manual", (NihConfigHandler)stanza_manual }, { "usage", (NihConfigHandler)stanza_usage }, { "apparmor", (NihConfigHandler)stanza_apparmor }, { "cgroup", (NihConfigHandler)stanza_cgroup }, NIH_CONFIG_LAST }; /** * parse_job: * @parent: parent object for new job, * @session: session, * @update: If not NULL, update the existing specified JobClass, * @name: name of new job, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * This function is used to parse a job definition from @file, for a job * named @name. A sequence of stanzas is expected, defining the parameters * of the job. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned job. When all parents * of the returned job are freed, the returned job will also be * freed. * * Returns: if @update is NULL, returns new JobClass structure on success, NULL on raised error. * If @update is not NULL, returns @update or NULL on error. **/ JobClass * parse_job (const void *parent, Session *session, JobClass *update, const char *name, const char *file, size_t len, size_t *pos, size_t *lineno) { JobClass *class; nih_assert (name != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (update) { class = update; nih_debug ("Reusing JobClass %s (%s)", class->name, class->path); } else { nih_debug ("Creating new JobClass %s", name); class = job_class_new (parent, name, session); if (! class) nih_return_system_error (NULL); } if (nih_config_parse_file (file, len, pos, lineno, stanzas, class) < 0) { if (!update) nih_free (class); return NULL; } return class; } /** * parse_exec: * @process: process being parsed. * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * This function is used to parse the arguments to a process's exec * stanza from @file, the command and its arguments are expected to follow * and will be the command run for the job. * * The Process for this to be parsed into should have already been * allocated. * * Returns: zero on success, negative value on error. **/ static int parse_exec (Process *process, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (process != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (! nih_config_has_token (file, len, pos, lineno)) nih_return_error (-1, NIH_CONFIG_EXPECTED_TOKEN, _(NIH_CONFIG_EXPECTED_TOKEN_STR)); if (process->command) nih_unref (process->command, process); process->script = FALSE; process->command = nih_config_parse_command (process, file, len, pos, lineno); if (! process->command) return -1; return 0; } /** * parse_script: * @process: process being parsed. * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * This function is used to parse a script block for a process's script * stanza from @file. A block terminated with "end script" is expected to * follow, and will be stored in the command for the job. * * The Process for this to be parsed into should have already been * allocated. * * Returns: zero on success, negative value on error. **/ static int parse_script (Process *process, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (process != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (nih_config_skip_comment (file, len, pos, lineno) < 0) return -1; if (process->command) nih_unref (process->command, process); process->script = TRUE; process->command = nih_config_parse_block (process, file, len, pos, lineno, "script"); if (! process->command) return -1; return 0; } /** * parse_process: * @class: job class being parsed, * @process: which process is being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * This function is used to allocate a Process for @process within @class, * and expects either "exec" or "script" to follow, calling parse_exec() * or parse_script() appropriately. * * Returns: zero on success, negative value on error. **/ static int parse_process (JobClass *class, ProcessType process, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char *arg = NULL; size_t a_pos, a_lineno; int ret = -1; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); /* Allocate a new Process structure if we need to */ if (! class->process[process]) { class->process[process] = process_new (class->process); if (! class->process[process]) nih_return_system_error (-1); } a_pos = *pos; a_lineno = (lineno ? *lineno: 1); /* Parse the next argument to find out what type of process this is */ arg = nih_config_next_token (NULL, file, len, &a_pos, &a_lineno, NIH_CONFIG_CNLWS, FALSE); if (! arg) goto finish; if (! strcmp (arg, "exec")) { ret = parse_exec (class->process[process], stanza, file, len, &a_pos, &a_lineno); } else if (! strcmp (arg, "script")) { ret = parse_script (class->process[process], stanza, file, len, &a_pos, &a_lineno); } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * parse_on: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * This function is used to parse the arguments to an "on" stanza as an * event expression. Names and arguments to events, intermixed with * operators and grouped by parentheses are expected to follow and are * allocated as a tree of EventOperator structures, the root of which is * returned. * * Returns: EventOperator at root of expression tree on success, NULL * on raised error. **/ static EventOperator * parse_on (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { NihList stack; EventOperator *root = NULL; size_t on_pos, on_lineno, paren = 0; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); nih_list_init (&stack); on_pos = *pos; on_lineno = (lineno ? *lineno : 1); /* Parse all of the tokens that we find following the configuration * stanza; unlike other stanzas we happily parse multiple lines * provided that we're inside parens, and we permit comments at the * end of those lines. */ do { nih_config_skip_whitespace (file, len, &on_pos, &on_lineno); do { /* Update error position */ *pos = on_pos; if (lineno) *lineno = on_lineno; /* Peek at the first character, since open and * close parens aren't picked up by our normal * tokeniser. */ if ((*pos < len) && strchr ("()", file[*pos])) { if (parse_on_paren (class, stanza, file, len, &on_pos, &on_lineno, &stack, &root, &paren) < 0) { root = NULL; goto finish; } /* Otherwise it's either an operator or operand; * parse it as an operator first, that function * handles transfer to parse_on_operand() in the * case of unrecognised token. */ } else if (parse_on_operator (class, stanza, file, len, &on_pos, &on_lineno, &stack, &root) < 0) { root = NULL; goto finish; } } while (nih_config_has_token (file, len, &on_pos, &on_lineno)); if (nih_config_skip_comment (file, len, &on_pos, &on_lineno) < 0) nih_assert_not_reached (); } while ((on_pos < len) && paren); /* The final operator and operand should be still on the stack and * need collecting; if not, take the stack pointer out before * returning otherwise we'll try and access it. */ if (parse_on_collect (class, &stack, &root) < 0) { nih_list_remove (&stack); return NULL; } /* If the stack isn't empty, then we've hit an open parenthesis and * not found a matching close one. We've probably parsed the entire * file by accident! */ if (! NIH_LIST_EMPTY (&stack)) { nih_error_raise (PARSE_MISMATCHED_PARENS, _(PARSE_MISMATCHED_PARENS_STR)); root = NULL; goto finish; } finish: /* Remove the stack pointer from the list of items, otherwise we'll * return it and we'll try and access it when freed. */ nih_list_remove (&stack); *pos = on_pos; if (lineno) *lineno = on_lineno; return root; } /** * parse_on_simple: * @class: job class being parsed, * @stanza_name: name of stanza type to parse ("start" or "stop"), * @string: string to parse. * * Parse either a "start" or "stop" condition from @string (which must * start with the first byte beyond either "start on" or "stop on". * * Returns: EventOperator at root of expression tree on success, NULL * on raised error. **/ EventOperator * parse_on_simple (JobClass *class, const char *stanza_name, const char *string) { EventOperator *root = NULL; NihConfigStanza *stanza = NULL; size_t pos = 0; size_t lineno = 0; size_t len; nih_assert (class); nih_assert (stanza_name); nih_assert (string); /* Find the appropriate config stanza */ for (NihConfigStanza *s = stanzas; s->name; s++) { if (! strcmp (stanza_name, s->name)) { stanza = s; break; } } nih_assert (stanza); len = strlen (string); root = parse_on (class, stanza, string, len, &pos, &lineno); return root; } /** * parse_on_operator: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number, * @stack: input operator stack, * @root: output operator. * * This function parses a single token from the arguments of the "on" * stanza. If the token is not a valid operator, this will call * parse_on_operand() instead. * * Operators are pushed onto @stack after collecting any existing operators * and operands on the stack, and placing them as the operator's left child. * * Returns: zero on success, negative value on raised error. **/ static int parse_on_operator (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno, NihList *stack, EventOperator **root) { size_t a_pos, a_lineno; nih_local char *arg = NULL; EventOperatorType type; EventOperator *oper; NihListEntry *item; int ret = -1; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); nih_assert (stack != NULL); nih_assert (root != NULL); /* Get the next token to see whether it's an operator keyword that * we recognise, don't dequote since this allows people to quote * operators to turn them into ordinary operands. */ a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_token (NULL, file, len, &a_pos, &a_lineno, "()" NIH_CONFIG_CNLWS, FALSE); if (! arg) goto finish; /* Compare token against known operators; if it isn't, then rewind * back to the starting position and deal with it as an operand. */ if (! strcmp (arg, "and")) { type = EVENT_AND; } else if (! strcmp (arg, "or")) { type = EVENT_OR; } else { return parse_on_operand (class, stanza, file, len, pos, lineno, stack, root); } /* Before we push the new operator onto the stack, we need to collect * any existing operators and operands. */ if (parse_on_collect (class, stack, root) < 0) return -1; /* Create the new operator, placing the existing root node as its * left-hand child. */ oper = event_operator_new (class, type, NULL, NULL); if (! oper) nih_return_system_error (-1); nih_ref (*root, oper); nih_unref (*root, class); nih_tree_add (&oper->node, &(*root)->node, NIH_TREE_LEFT); *root = NULL; /* Push the new operator onto the stack */ item = nih_list_entry_new (class); if (! item) nih_return_system_error (-1); item->data = oper; nih_list_add_after (stack, &item->entry); ret = 0; finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * parse_on_paren: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number, * @stack: input operator stack, * @root: output operator, * @paren: number of nested parentheses. * * This function deals with an open or close parenthesis in the arguments * of the "on" stanza; it must only be called when the character at the * current position is either. * * @paren is incremented for each open parenthesis, and decremented for * each close one. This is a gross check for whether the parsing is * currently within a grouping, and used by parse_on() to ignore newlines * within them. * * An open parenthesis pushes a NULL operator onto the stack, this stops * parse_on_collect() from collecting beyond it. * * A close parenthesis collects all operators on the stack up to the * first (matching) marker, and removes the marker. * * Returns: zero on success, negative value on raised error. **/ static int parse_on_paren (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno, NihList *stack, EventOperator **root, size_t *paren) { NihListEntry *item; EventOperator *oper; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); nih_assert (stack != NULL); nih_assert (root != NULL); nih_assert (paren != NULL); switch (file[*pos]) { case '(': (*paren)++; /* An open parenthesis may only occur if we're in a valid * state for an operand; we must have no items on the stack, * or an open parenthesis on the stack, or an operator * on the stack; and must have nothing collected. */ item = (! NIH_LIST_EMPTY (stack) ? (NihListEntry *)stack->next: NULL); oper = (item ? (EventOperator *)item->data : NULL); if (*root || (item && oper && (oper->type == EVENT_MATCH))) nih_return_error (-1, PARSE_EXPECTED_OPERATOR, _(PARSE_EXPECTED_OPERATOR_STR)); /* We push a NULL item onto the operator stack to denote * the beginning of a parenthesis group, this prevents us * popping past it later. */ item = nih_list_entry_new (class); if (! item) nih_return_system_error (-1); nih_list_add_after (stack, &item->entry); break; case ')': (*paren)--; /* Collect up to the first open paren marker. */ if (parse_on_collect (class, stack, root) < 0) return -1; /* If we run out of stack, then we have mismatched parens. */ if (NIH_LIST_EMPTY (stack)) nih_return_error (-1, PARSE_MISMATCHED_PARENS, _(PARSE_MISMATCHED_PARENS_STR)); /* The top item on the stack should be the open parenthesis * marker, which we want to discard. */ nih_free (stack->next); break; default: nih_assert_not_reached (); } /* Skip over the paren and any following whitespace */ (*pos)++; nih_config_skip_whitespace (file, len, pos, lineno); return 0; } /** * parse_on_operand: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number, * @stack: input operator stack, * @root: output operator. * * This function parses a single operand to the "or" stanza. An operand * is any token not considered an operator, such as the name of an event * or arguments to that event. * * If the item on the top of @stack is an EVENT_MATCH operator, the operand * is added to that operator's argument list; otherwise the operand is * treated as the name of an event and a new EVENT_MATCH operator pushed * onto the stack. * * Returns: zero on success, negative value on raised error. **/ static int parse_on_operand (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno, NihList *stack, EventOperator **root) { EventOperator *oper; NihListEntry *item; nih_local char *arg = NULL; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); nih_assert (stack != NULL); nih_assert (root != NULL); arg = nih_config_next_token (NULL, file, len, pos, lineno, "()" NIH_CONFIG_CNLWS, TRUE); if (! arg) return -1; /* Look at the item on the top of the stack; if it is an * EVENT_MATCH operator then the operand is an argument to that event; * otherwise if the stack is empty, or the top item is an operator * of some kind, then the operand begins a new EVENT_MATCH operator. */ item = (! NIH_LIST_EMPTY (stack) ? (NihListEntry *)stack->next: NULL); oper = (item ? (EventOperator *)item->data : NULL); if ((! item) || (! oper) || (oper->type != EVENT_MATCH)) { /* Argument is the name of an event to be matched; create * an EventOperator to match it and push it onto the stack. * * We get away with not popping anything here because we * know that we can never end up with two events on the top * of the stack. */ oper = event_operator_new (class, EVENT_MATCH, arg, NULL); if (! oper) nih_return_system_error (-1); item = nih_list_entry_new (class); if (! item) nih_return_system_error (-1); item->data = oper; nih_list_add_after (stack, &item->entry); } else { char **e; int pos = TRUE; /* Argument is an environment variable for the event on * the top of the stack, so we append it there. */ if (! nih_str_array_addp (&oper->env, oper, NULL, arg)) nih_return_system_error (-1); /* Sanity check the event's environment to ensure that no * positional arguments follow name-based ones. */ for (e = oper->env; e && *e; e++) { if (strchr (*e, '=')) { pos = FALSE; } else if (! pos) { nih_error_raise (PARSE_EXPECTED_VARIABLE, _(PARSE_EXPECTED_VARIABLE_STR)); return -1; } } } return 0; } /** * parse_on_collect: * @class: job class being parsed, * @stack: input operator stack, * @root: output operator. * * This function collects the input operators from @stack, up until the * beginning of the stack or a group within it (denoted by a stack item * with NULL data), and places the collected operator tree in @root. * * @root may point to a NULL pointer, or to a previously collected * operator; in which case it will become the right-hand child of the * operator on the top of the stack. * * On return from this function, @root will always point to a non-NULL * pointer since it is an error to fail to collect from the stack. * * Returns: zero on success, negative value on raised error. **/ static int parse_on_collect (JobClass *class, NihList *stack, EventOperator **root) { nih_assert (class != NULL); nih_assert (stack != NULL); nih_assert (root != NULL); NIH_LIST_FOREACH_SAFE (stack, iter) { NihListEntry *item = (NihListEntry *)iter; EventOperator *oper = (EventOperator *)item->data; /* Stop on the opening of a parenthesis group */ if (! oper) break; /* Remove the item from the stack */ nih_free (item); /* Make the existing root node a child of the new operator; * there must be one for operators, and must not be one for * event matches. */ if ((oper->type != EVENT_MATCH) && (*root)) { nih_ref (*root, oper); nih_unref (*root, class); nih_tree_add (&oper->node, &(*root)->node, NIH_TREE_RIGHT); } else if (oper->type != EVENT_MATCH) { nih_return_error (-1, PARSE_EXPECTED_EVENT, _(PARSE_EXPECTED_EVENT_STR)); } else if (*root) { nih_return_error (-1, PARSE_EXPECTED_OPERATOR, _(PARSE_EXPECTED_OPERATOR_STR)); } /* Make the operator the new root */ *root = oper; } /* If we failed to collect any operands, an event was expected */ if (! *root) nih_return_error (-1, PARSE_EXPECTED_EVENT, _(PARSE_EXPECTED_EVENT_STR)); return 0; } /** * parse_cgroup: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * This function is used to parse the arguments to a cgroup stanza * from @file. * * Returns: zero on success, negative value on raised error. **/ static int parse_cgroup (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { char *arg2; char *arg3; nih_local char *controller = NULL; nih_local char *name = NULL; nih_local char *key = NULL; nih_local char *value = NULL; nih_assert (class); nih_assert (stanza); nih_assert (file); nih_assert (pos); /* XXX: Note that if cgroups are *NOT* enabled, we still need to * parse the cgroup stanzas tokens (to consume that input) - we * just don't add use those tokens to create a Cgroup object. */ if (! nih_config_has_token (file, len, pos, lineno)) nih_return_error (-1, NIH_CONFIG_EXPECTED_TOKEN, _(NIH_CONFIG_EXPECTED_TOKEN_STR)); controller = nih_config_next_arg (NULL, file, len, pos, lineno); if (! controller) return -1; if (! nih_config_has_token (file, len, pos, lineno)) { /* Only a controller was specified */ goto out; } arg2 = nih_config_next_arg (NULL, file, len, pos, lineno); if (! arg2) return -1; if (! nih_config_has_token (file, len, pos, lineno)) { /* Controller + name specified */ name = arg2; nih_ref (name, arg2); goto out; } arg3 = nih_config_next_arg (NULL, file, len, pos, lineno); if (! arg3) return -1; if (! nih_config_has_token (file, len, pos, lineno)) { /* Controller + key/value pair specified */ key = arg2; nih_ref (key , arg2); value = arg3; nih_ref (value, arg3); goto out; } /* Controller + name + key/value pair specified */ value = nih_config_next_arg (NULL, file, len, pos, lineno); if (! value) return -1; key = arg3; nih_ref (key, arg3); name = arg2; nih_ref (name, arg2); out: #ifdef ENABLE_CGROUPS if (! cgroup_add (class, &class->cgroups, controller, name, key, value)) nih_return_no_memory_error (-1); #endif /* ENABLE_CGROUPS */ return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_debug: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a debug stanza from @file. No parameters are supported. * * Returns: zero always. **/ static int stanza_debug (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (debug_stanza_enabled) class->debug = TRUE; return 0; } /** * stanza_manual: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a manual stanza from @file. No parameters are supported. * * Returns: zero always. **/ static int stanza_manual (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); /* manual simply disregards any start on events seen previously */ nih_debug ("disregarding start on events for %s", class->name); if (class->start_on) nih_unref (class->start_on, class); class->start_on = NULL; return 0; } /** * stanza_instance: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse an instance stanza from @file, this has an argument specifying * the instance name pattern which is stored in the class's instance member * and expanded before use. * * Returns: zero on success, negative value on error. **/ static int stanza_instance (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (class->instance) nih_unref (class->instance, class); class->instance = nih_config_next_arg (class, file, len, pos, lineno); if (! class->instance) return -1; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_description: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a description stanza from @file. This stanza expects a single * argument giving a human-readable description of the job which is * stored for later use. * * Returns: zero on success, negative value on error. **/ static int stanza_description (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (class->description) nih_unref (class->description, class); class->description = nih_config_next_arg (class, file, len, pos, lineno); if (! class->description) return -1; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_author: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse an author stanza from @file. This stanza expects a single * argument giving a human-readable author name for the job which is * stored for later use. * * Returns: zero on success, negative value on error. **/ static int stanza_author (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (class->author) nih_unref (class->author, class); class->author = nih_config_next_arg (class, file, len, pos, lineno); if (! class->author) return -1; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_version: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a version stanza from @file. This stanza expects a single * argument giving a human-readable version number for the job which is * stored for later use. * * Returns: zero on success, negative value on error. **/ static int stanza_version (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (class->version) nih_unref (class->version, class); class->version = nih_config_next_arg (class, file, len, pos, lineno); if (! class->version) return -1; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_env: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse an env stanza from @file, extracting a single argument of the form * VAR or VAR=VALUE. These are stored in the env array, which is increased * in size to accommodate the new value. * * Returns: zero on success, negative value on error. **/ static int stanza_env (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char *env = NULL; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); env = nih_config_next_arg (NULL, file, len, pos, lineno); if (! env) return -1; if (! nih_str_array_addp (&class->env, class, NULL, env)) nih_return_system_error (-1); return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_export: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse an export stanza from @file, extracting one or more arguments * containing environment variable names. These are stored in the export * array, which is increased in size to accomodate the new values. * * Returns: zero on success, negative value on error. **/ static int stanza_export (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char **args = NULL; char **arg; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (! nih_config_has_token (file, len, pos, lineno)) nih_return_error (-1, NIH_CONFIG_EXPECTED_TOKEN, _(NIH_CONFIG_EXPECTED_TOKEN_STR)); args = nih_config_parse_args (NULL, file, len, pos, lineno); if (! args) return -1; for (arg = args; *arg; arg++) if (! nih_str_array_addp (&class->export, class, NULL, *arg)) nih_return_system_error (-1); return 0; } /** * stanza_start: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a start stanza from @file. This stanza expects a second "on" * argument, followed by an event which is allocated as an EventOperator * structure and stored in the start events list of the class. * * Returns: zero on success, negative value on error. **/ static int stanza_start (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char *arg = NULL; size_t a_pos, a_lineno; int ret = -1; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_token (NULL, file, len, &a_pos, &a_lineno, NIH_CONFIG_CNLWS, FALSE); if (! arg) goto finish; if (! strcmp (arg, "on")) { if (class->start_on) nih_unref (class->start_on, class); class->start_on = parse_on (class, stanza, file, len, &a_pos, &a_lineno); if (! class->start_on) goto finish; ret = 0; } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_stop: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a stop stanza from @file. This stanza expects a second "on" * argument, followed by an event which is allocated as an EventInfo structure * and stored in the stop events list of the class and copied to the instance * later. * * Returns: zero on success, negative value on error. **/ static int stanza_stop (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char *arg = NULL; size_t a_pos, a_lineno; int ret = -1; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_token (NULL, file, len, &a_pos, &a_lineno, NIH_CONFIG_CNLWS, FALSE); if (! arg) goto finish; if (! strcmp (arg, "on")) { if (class->stop_on) nih_unref (class->stop_on, class); class->stop_on = parse_on (class, stanza, file, len, &a_pos, &a_lineno); if (! class->stop_on) goto finish; ret = 0; } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_emits: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse an emits stanza from @file. This stanza expects one or more * arguments giving the names of additional events that can be emitted * by this job. These are stored in the emits array, which is increased * in size to accomodate the new values. * * Returns: zero on success, negative value on error. **/ static int stanza_emits (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char **args = NULL; char **arg; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (! nih_config_has_token (file, len, pos, lineno)) nih_return_error (-1, NIH_CONFIG_EXPECTED_TOKEN, _(NIH_CONFIG_EXPECTED_TOKEN_STR)); args = nih_config_parse_args (NULL, file, len, pos, lineno); if (! args) return -1; for (arg = args; *arg; arg++) if (! nih_str_array_addp (&class->emits, class, NULL, *arg)) nih_return_system_error (-1); return 0; } /** * stanza_exec: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse an exec stanza from @file by allocating the main job process and * calling parse_exec() to parse it. * * Returns: zero on success, negative value on error. **/ static int stanza_exec (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (! class->process[PROCESS_MAIN]) { class->process[PROCESS_MAIN] = process_new (class->process); if (! class->process[PROCESS_MAIN]) nih_return_system_error (-1); } return parse_exec (class->process[PROCESS_MAIN], stanza, file, len, pos, lineno); } /** * stanza_script: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a script stanza from @file by allocating the main job process and * calling parse_script() to parse it. * * Returns: zero on success, negative value on error. **/ static int stanza_script (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (! class->process[PROCESS_MAIN]) { class->process[PROCESS_MAIN] = process_new (class->process); if (! class->process[PROCESS_MAIN]) nih_return_system_error (-1); } return parse_script (class->process[PROCESS_MAIN], stanza, file, len, pos, lineno); } /** * stanza_pre_start: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a pre-start stanza from @file by calling parse_process() * with PROCESS_PRE_START to parse it. * * Returns: zero on success, negative value on error. **/ static int stanza_pre_start (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); return parse_process (class, PROCESS_PRE_START, stanza, file, len, pos, lineno); } /** * stanza_post_start: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a post-start stanza from @file by calling parse_process() * with PROCESS_POST_START to parse it. * * Returns: zero on success, negative value on error. **/ static int stanza_post_start (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); return parse_process (class, PROCESS_POST_START, stanza, file, len, pos, lineno); } /** * stanza_pre_stop: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a pre-stop stanza from @file by calling parse_process() * with PROCESS_PRE_STOP to parse it. * * Returns: zero on success, negative value on error. **/ static int stanza_pre_stop (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); return parse_process (class, PROCESS_PRE_STOP, stanza, file, len, pos, lineno); } /** * stanza_post_stop: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a post-stop stanza from @file by calling parse_process() * with PROCESS_POST_STOP to parse it. * * Returns: zero on success, negative value on error. **/ static int stanza_post_stop (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); return parse_process (class, PROCESS_POST_STOP, stanza, file, len, pos, lineno); } /** * stanza_expect: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse an expect stanza from @file. This stanza expects a single argument * single argument giving one of the possible ExpectType enumerations which * sets the class's expect member. * * Returns: zero on success, negative value on error. **/ static int stanza_expect (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { size_t a_pos, a_lineno; int ret = -1; nih_local char *arg = NULL; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! arg) goto finish; if (! strcmp (arg, "stop")) { class->expect = EXPECT_STOP; } else if (! strcmp (arg, "daemon")) { class->expect = EXPECT_DAEMON; } else if (! strcmp (arg, "fork")) { class->expect = EXPECT_FORK; } else if (! strcmp (arg, "none")) { class->expect = EXPECT_NONE; } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_task: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a task stanza from @file. This sets the task flag for the class, and * takes no further arguments. * * Returns: zero on success, negative value on error. **/ static int stanza_task (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); class->task = TRUE; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_kill: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a kill stanza from @file, extracting a second-level stanza that * states which value to set from its argument. * * Returns: zero on success, negative value on error. **/ static int stanza_kill (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { size_t a_pos, a_lineno; int ret = -1; char *endptr; nih_local char *arg = NULL; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_token (NULL, file, len, &a_pos, &a_lineno, NIH_CONFIG_CNLWS, FALSE); if (! arg) goto finish; if (! strcmp (arg, "timeout")) { nih_local char *timearg = NULL; /* Update error position to the timeout value */ *pos = a_pos; if (lineno) *lineno = a_lineno; timearg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! timearg) goto finish; errno = 0; class->kill_timeout = strtol (timearg, &endptr, 10); if (errno || *endptr || (class->kill_timeout < 0)) nih_return_error (-1, PARSE_ILLEGAL_INTERVAL, _(PARSE_ILLEGAL_INTERVAL_STR)); } else if (! strcmp (arg, "signal")) { unsigned long status; nih_local char *sigarg = NULL; int signal; /* Update error position to the exit status */ *pos = a_pos; if (lineno) *lineno = a_lineno; sigarg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! sigarg) goto finish; signal = nih_signal_from_name (sigarg); if (signal < 0) { errno = 0; status = strtoul (sigarg, &endptr, 10); if (errno || *endptr || (status > INT_MAX)) nih_return_error (-1, PARSE_ILLEGAL_SIGNAL, _(PARSE_ILLEGAL_SIGNAL_STR)); signal = status; } /* Set the signal */ class->kill_signal = signal; } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_reload: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a reload stanza from @file, extracting a second-level stanza that * states which value to set from its argument. * * Returns: zero on success, negative value on error. **/ static int stanza_reload (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { size_t a_pos, a_lineno; int ret = -1; char *endptr; nih_local char *arg = NULL; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_token (NULL, file, len, &a_pos, &a_lineno, NIH_CONFIG_CNLWS, FALSE); if (! arg) goto finish; if (! strcmp (arg, "signal")) { unsigned long status; nih_local char *sigarg = NULL; int signal; /* Update error position to the exit status */ *pos = a_pos; if (lineno) *lineno = a_lineno; sigarg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! sigarg) goto finish; signal = nih_signal_from_name (sigarg); if (signal < 0) { errno = 0; status = strtoul (sigarg, &endptr, 10); if (errno || *endptr || (status > INT_MAX)) nih_return_error (-1, PARSE_ILLEGAL_SIGNAL, _(PARSE_ILLEGAL_SIGNAL_STR)); signal = status; } /* Set the signal */ class->reload_signal = signal; } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_apparmor: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse an apparmor stanza from @file, extracting a second-level stanza that * states which value to set from its argument. * * Returns: zero on success, negative value on error. **/ static int stanza_apparmor (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { size_t a_pos, a_lineno; int ret = -1; nih_local char *arg = NULL; Process *process; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_token (NULL, file, len, &a_pos, &a_lineno, NIH_CONFIG_CNLWS, FALSE); if (! arg) goto finish; if (! strcmp (arg, "load")) { nih_local char *aaarg = NULL; /* Update error position to the load value */ *pos = a_pos; if (lineno) *lineno = a_lineno; aaarg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! aaarg) goto finish; /* Allocate a new Process structure if we need to */ if (! class->process[PROCESS_SECURITY]) { class->process[PROCESS_SECURITY] = process_new (class->process); if (! class->process[PROCESS_SECURITY]) nih_return_system_error (-1); } process = class->process[PROCESS_SECURITY]; if (process->command) nih_unref (process->command, process); process->script = FALSE; process->command = nih_sprintf (process, "%s %s %s", APPARMOR_PARSER, APPARMOR_PARSER_OPTS, aaarg); if (! process->command) nih_return_system_error (-1); } else if (! strcmp (arg, "switch")) { /* Update error position to the switch value */ *pos = a_pos; if (lineno) *lineno = a_lineno; class->apparmor_switch = nih_config_next_arg (class, file, len, &a_pos, &a_lineno); if (! class->apparmor_switch) goto finish; } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_respawn: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a daemon stanza from @file. This either has no arguments, in * which case it sets the respawn flag for the job, or it has the "limit" * argument and sets the respawn rate limit. * * Returns: zero on success, negative value on error. **/ static int stanza_respawn (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char *arg = NULL; size_t a_pos, a_lineno; int ret = -1; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); /* Deal with the no-argument form first */ if (! nih_config_has_token (file, len, pos, lineno)) { class->respawn = TRUE; return nih_config_skip_comment (file, len, pos, lineno); } /* Take the next argument, a sub-stanza keyword. */ a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_token (NULL, file, len, &a_pos, &a_lineno, NIH_CONFIG_CNLWS, FALSE); if (! arg) goto finish; if (! strcmp (arg, "limit")) { nih_local char *limitarg = NULL; char *endptr; /* Update error position to the limit value */ *pos = a_pos; if (lineno) *lineno = a_lineno; /* Parse the limit value */ limitarg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! limitarg) goto finish; if (strcmp (limitarg, "unlimited")) { nih_local char *timearg = NULL; errno = 0; class->respawn_limit = strtol (limitarg, &endptr, 10); if (errno || *endptr || (class->respawn_limit < 0)) nih_return_error (-1, PARSE_ILLEGAL_LIMIT, _(PARSE_ILLEGAL_LIMIT_STR)); /* Update error position to the timeout value */ *pos = a_pos; if (lineno) *lineno = a_lineno; /* Parse the timeout value */ timearg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! timearg) goto finish; errno = 0; class->respawn_interval = strtol (timearg, &endptr, 10); if (errno || *endptr || (class->respawn_interval < 0)) nih_return_error (-1, PARSE_ILLEGAL_INTERVAL, _(PARSE_ILLEGAL_INTERVAL_STR)); } else { class->respawn_limit = 0; class->respawn_interval = 0; } ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_normal: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a normal stanza from @file. This stanza expects a single "exit" * argument, followed by one or more arguments giving signal names or * exit codes that the main process can return and be considered to have been * stopped normally. * * Arguments are stored in the normalexit array, and the normalexit_len * value updated. Signals are stored in the higher bytes. * * Returns: zero on success, negative value on error. **/ static int stanza_normal (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { size_t a_pos, a_lineno; int ret = -1; nih_local char *arg = NULL; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_token (NULL, file, len, &a_pos, &a_lineno, NIH_CONFIG_CNLWS, FALSE); if (! arg) goto finish; if (! strcmp (arg, "exit")) { do { unsigned long status; nih_local char *exitarg = NULL; char *endptr; int *new_ne, signum; /* Update error position to the exit status */ *pos = a_pos; if (lineno) *lineno = a_lineno; exitarg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! exitarg) goto finish; signum = nih_signal_from_name (exitarg); if (signum < 0) { errno = 0; status = strtoul (exitarg, &endptr, 10); if (errno || *endptr || (status > INT_MAX)) nih_return_error (-1, PARSE_ILLEGAL_EXIT, _(PARSE_ILLEGAL_EXIT_STR)); } else { status = signum << 8; } new_ne = nih_realloc (class->normalexit, class, sizeof (int) * (class->normalexit_len + 1)); if (! new_ne) nih_return_system_error (-1); class->normalexit = new_ne; class->normalexit[class->normalexit_len++] = (int) status; } while (nih_config_has_token (file, len, &a_pos, &a_lineno)); ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_console: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a console stanza from @file, extracting a single argument that * specifies where console output should be sent. * * Returns: zero on success, negative value on error. **/ static int stanza_console (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { size_t a_pos, a_lineno; int ret = -1; nih_local char *arg = NULL; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! arg) goto finish; class->console = job_class_console_type (arg); if (class->console == (ConsoleType)-1) { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_umask: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a umask stanza from @file, extracting a single argument containing * a process file creation mask. * * Returns: zero on success, negative value on error. **/ static int stanza_umask (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char *arg = NULL; char *endptr; size_t a_pos, a_lineno; int ret = -1; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! arg) goto finish; errno = 0; class->umask = (mode_t)strtoul (arg, &endptr, 8); if (errno || *endptr || (class->umask & ~0777)) nih_return_error (-1, PARSE_ILLEGAL_UMASK, _(PARSE_ILLEGAL_UMASK_STR)); ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_nice: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a nice stanza from @file, extracting a single argument containing * a process priority. * * Returns: zero on success, negative value on error. **/ static int stanza_nice (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char *arg = NULL; char *endptr; size_t a_pos, a_lineno; int ret = -1; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! arg) goto finish; errno = 0; class->nice = (int)strtol (arg, &endptr, 10); if (errno || *endptr || (class->nice < -20) || (class->nice > 19)) nih_return_error (-1, PARSE_ILLEGAL_NICE, _(PARSE_ILLEGAL_NICE_STR)); ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_oom: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse an oom stanza from @file, extracting a single argument containing * a OOM killer adjustment (which may be "never" for the magic -17 value). * * Returns: zero on success, negative value on error. **/ static int stanza_oom (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_local char *arg = NULL; char *endptr; size_t a_pos, a_lineno; int oom_adj; int ret = -1; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! arg) goto finish; if (! strcmp (arg, "score")) { nih_local char *scorearg = NULL; /* Update error position to the score value */ *pos = a_pos; if (lineno) *lineno = a_lineno; scorearg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! scorearg) goto finish; if (! strcmp (scorearg, "never")) { class->oom_score_adj = -1000; } else { errno = 0; class->oom_score_adj = (int)strtol (scorearg, &endptr, 10); if (errno || *endptr || (class->oom_score_adj < -1000) || (class->oom_score_adj > 1000)) nih_return_error (-1, PARSE_ILLEGAL_OOM, _(PARSE_ILLEGAL_OOM_SCORE_STR)); } } else if (! strcmp (arg, "never")) { class->oom_score_adj = -1000; } else { errno = 0; oom_adj = (int)strtol (arg, &endptr, 10); class->oom_score_adj = (oom_adj * 1000) / ((oom_adj < 0) ? 17 : 15); if (errno || *endptr || (oom_adj < -17) || (oom_adj > 15)) nih_return_error (-1, PARSE_ILLEGAL_OOM, _(PARSE_ILLEGAL_OOM_STR)); } ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_limit: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a limit stanza from @file, extracting a second-level stanza that * states which limit to set from its two following arguments. * * Returns: zero on success, negative value on error. **/ static int stanza_limit (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { int resource; nih_local char *arg = NULL, *softarg = NULL, *hardarg = NULL; char *endptr; size_t a_pos, a_lineno; int ret = -1; nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); a_pos = *pos; a_lineno = (lineno ? *lineno : 1); arg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! arg) goto finish; if (! strcmp (arg, "as")) { resource = RLIMIT_AS; } else if (! strcmp (arg, "core")) { resource = RLIMIT_CORE; } else if (! strcmp (arg, "cpu")) { resource = RLIMIT_CPU; } else if (! strcmp (arg, "data")) { resource = RLIMIT_DATA; } else if (! strcmp (arg, "fsize")) { resource = RLIMIT_FSIZE; } else if (! strcmp (arg, "memlock")) { resource = RLIMIT_MEMLOCK; } else if (! strcmp (arg, "msgqueue")) { resource = RLIMIT_MSGQUEUE; } else if (! strcmp (arg, "nice")) { resource = RLIMIT_NICE; } else if (! strcmp (arg, "nofile")) { resource = RLIMIT_NOFILE; } else if (! strcmp (arg, "nproc")) { resource = RLIMIT_NPROC; } else if (! strcmp (arg, "rss")) { resource = RLIMIT_RSS; } else if (! strcmp (arg, "rtprio")) { resource = RLIMIT_RTPRIO; } else if (! strcmp (arg, "sigpending")) { resource = RLIMIT_SIGPENDING; } else if (! strcmp (arg, "stack")) { resource = RLIMIT_STACK; } else { nih_return_error (-1, NIH_CONFIG_UNKNOWN_STANZA, _(NIH_CONFIG_UNKNOWN_STANZA_STR)); } if (! class->limits[resource]) { class->limits[resource] = nih_new (class, struct rlimit); if (! class->limits[resource]) nih_return_system_error (-1); } /* Update error position to the soft limit value */ *pos = a_pos; if (lineno) *lineno = a_lineno; /* Parse the soft limit value */ softarg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! softarg) goto finish; if (strcmp (softarg, "unlimited")) { errno = 0; class->limits[resource]->rlim_cur = strtoul (softarg, &endptr, 10); if (errno || *endptr) nih_return_error (-1, PARSE_ILLEGAL_LIMIT, _(PARSE_ILLEGAL_LIMIT_STR)); } else { class->limits[resource]->rlim_cur = RLIM_INFINITY; } /* Update error position to the hard limit value */ *pos = a_pos; if (lineno) *lineno = a_lineno; /* Parse the hard limit value */ hardarg = nih_config_next_arg (NULL, file, len, &a_pos, &a_lineno); if (! hardarg) goto finish; if (strcmp (hardarg, "unlimited")) { errno = 0; class->limits[resource]->rlim_max = strtoul (hardarg, &endptr, 10); if (errno || *endptr) nih_return_error (-1, PARSE_ILLEGAL_LIMIT, _(PARSE_ILLEGAL_LIMIT_STR)); } else { class->limits[resource]->rlim_max = RLIM_INFINITY; } ret = nih_config_skip_comment (file, len, &a_pos, &a_lineno); finish: *pos = a_pos; if (lineno) *lineno = a_lineno; return ret; } /** * stanza_chroot: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a chroot stanza from @file, extracting a single argument * containing a directory name. * * Returns: zero on success, negative value on error. **/ static int stanza_chroot (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (class->chroot) nih_unref (class->chroot, class); class->chroot = nih_config_next_arg (class, file, len, pos, lineno); if (! class->chroot) return -1; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_chdir: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a chdir stanza from @file, extracting a single argument * containing a directory name. * * Returns: zero on success, negative value on error. **/ static int stanza_chdir (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (class->chdir) nih_unref (class->chdir, class); class->chdir = nih_config_next_arg (class, file, len, pos, lineno); if (! class->chdir) return -1; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_setuid: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a setuid stanza from @file, extracting a single argument * containing a user name. * * Returns: zero on success, negative value on error. **/ static int stanza_setuid (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (class->setuid) nih_unref (class->setuid, class); class->setuid = nih_config_next_arg (class, file, len, pos, lineno); if (! class->setuid) return -1; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_setgid: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a setgid stanza from @file, extracting a single argument * containing a group name. * * Returns: zero on success, negative value on error. **/ static int stanza_setgid (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (class->setgid) nih_unref (class->setgid, class); class->setgid = nih_config_next_arg (class, file, len, pos, lineno); if (! class->setgid) return -1; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_usage: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a usage stanza from @file, extracting a single argument * containing a usage message. * * Returns: zero on success, negative value on error. **/ static int stanza_usage (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class != NULL); nih_assert (stanza != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); if (class->usage) nih_unref (class->usage, class); class->usage = nih_config_next_arg (class, file, len, pos, lineno); if (! class->usage) return -1; return nih_config_skip_comment (file, len, pos, lineno); } /** * stanza_cgroup: * @class: job class being parsed, * @stanza: stanza found, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * Parse a cgroup stanza from @file. * * Returns: zero on success, negative value on error. **/ static int stanza_cgroup (JobClass *class, NihConfigStanza *stanza, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (class); nih_assert (stanza); nih_assert (file); nih_assert (pos); return parse_cgroup (class, stanza, file, len, pos, lineno); } upstart-1.13.2/init/blocked.c0000664000175000017500000000772312373101356012747 00000000000000/* upstart * * job.c - core state machine of tasks and services * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include "job.h" #include "event.h" #include "blocked.h" /** * blocked_new: * @parent: parent of blocked structure, * @type: type of object blocked, * @data: pointer to object. * * Allocates a Blocked structure for the object details given, which is * normally appended to the caller's own blocking list. It is also up * to the called to ensure that the object is aware of the block, and handle * unblocking the object when done. * * If @parent is not NULL, it should be a pointer to another allocated * block which will be used as the parent for this block. When @parent * is freed, the returned block will be freed too. * * Returns: new Blocked structure or NULL if insufficient memory. **/ Blocked * blocked_new (const void *parent, BlockedType type, void *data) { Blocked *blocked; nih_assert (data != NULL); blocked = nih_new (parent, Blocked); if (! blocked) return NULL; nih_list_init (&blocked->entry); nih_alloc_set_destructor (blocked, nih_list_destroy); blocked->type = type; switch (blocked->type) { case BLOCKED_JOB: blocked->job = (Job *)data; break; case BLOCKED_EVENT: blocked->event = (Event *)data; break; case BLOCKED_EMIT_METHOD: case BLOCKED_JOB_START_METHOD: case BLOCKED_JOB_STOP_METHOD: case BLOCKED_JOB_RESTART_METHOD: case BLOCKED_INSTANCE_START_METHOD: case BLOCKED_INSTANCE_STOP_METHOD: case BLOCKED_INSTANCE_RESTART_METHOD: blocked->message = (NihDBusMessage *)data; nih_ref (blocked->message, blocked); break; default: nih_assert_not_reached (); } return blocked; } /** * blocked_enum_to_str: * * @type: BlockedType. * * Convert Blocked to a string representation. * * Returns: string representation of @type, or NULL if not known. **/ const char * blocked_type_enum_to_str (BlockedType type) { state_enum_to_str (BLOCKED_JOB, type); state_enum_to_str (BLOCKED_EVENT, type); state_enum_to_str (BLOCKED_EMIT_METHOD, type); state_enum_to_str (BLOCKED_JOB_START_METHOD, type); state_enum_to_str (BLOCKED_JOB_STOP_METHOD, type); state_enum_to_str (BLOCKED_JOB_RESTART_METHOD, type); state_enum_to_str (BLOCKED_INSTANCE_START_METHOD, type); state_enum_to_str (BLOCKED_INSTANCE_STOP_METHOD, type); state_enum_to_str (BLOCKED_INSTANCE_RESTART_METHOD, type); return NULL; } /** * blocked_type_str_to_enum: * * @type: string BlockedType value. * * Convert @type back into enum value. * * Returns: BlockedType representation of @type, or -1 if not known. **/ BlockedType blocked_type_str_to_enum (const char *type) { nih_assert (type); state_str_to_enum (BLOCKED_JOB, type); state_str_to_enum (BLOCKED_EVENT, type); state_str_to_enum (BLOCKED_EMIT_METHOD, type); state_str_to_enum (BLOCKED_JOB_START_METHOD, type); state_str_to_enum (BLOCKED_JOB_STOP_METHOD, type); state_str_to_enum (BLOCKED_JOB_RESTART_METHOD, type); state_str_to_enum (BLOCKED_INSTANCE_START_METHOD, type); state_str_to_enum (BLOCKED_INSTANCE_STOP_METHOD, type); state_str_to_enum (BLOCKED_INSTANCE_RESTART_METHOD, type); return -1; } upstart-1.13.2/init/environ.c0000664000175000017500000005024312373101356013017 00000000000000/* upstart * * environ.c - environment table utilities * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include "environ.h" #include "errors.h" /* Prototypes for static functions */ static char *environ_expand_until (char **str, const void *parent, size_t *len, size_t *pos, char * const *env, const char *until); /** * environ_add: * @env: pointer to environment table, * @parent: parent object for new array, * @len: length of @env, * @replace: TRUE if existing entry should be replaced, * @str: string to add. * * Add the new environment variable @str to the table @env (which has @len * elements, excluding the final NULL element), either replacing an existing * entry or appended to the end. Both the array and the new string within it * are allocated using nih_alloc(). * * @str may be in KEY=VALUE format, in which case the given key will be * replaced with that value or appended to the table; or it may simply * be in KEY format, which which case the value is taken from init's own * environment. * * @len will be updated to contain the new array length and @env will * be updated to point to the new array pointer; use the return value * simply to check for success. * * If the array pointed to by @env is NULL, the array will be allocated * and @str the first element, and if @parent is not NULL, it should be a * pointer to another object which will be used as a parent for the returned * array. When all parents of the returned array are freed, the returned * array will also be freed. * * When the array pointed to by @env is not NULL, @parent is ignored; * though it usual to pass a parent of @env for style reasons. * * Returns: new array pointer or NULL if insufficient memory. **/ char ** environ_add (char ***env, const void *parent, size_t *len, int replace, const char *str) { size_t key, _len; char **old_str; nih_local char *new_str = NULL; nih_assert (env != NULL); nih_assert (str != NULL); /* Calculate the length in case we need to remove entries */ if (! len) { char **e; len = &_len; _len = 0; for (e = *env; e && *e; e++) _len++; } /* Calculate the length of the key in the string, if we reach the * end of the string, then we lookup the value in the environment * and use that as the new value otherwise use the string given. */ key = strcspn (str, "="); if (str[key] == '=') { new_str = nih_strdup (NULL, str); if (! new_str) return NULL; } else { const char *value; value = getenv (str); if (value) { new_str = nih_sprintf (NULL, "%s=%s", str, value); if (! new_str) return NULL; } } /* Check the environment table for an existing entry for the key, * if we find one we either finish or overwrite it instead of * extending the table. */ old_str = (char **)environ_lookup (*env, str, key); if (old_str && replace) { nih_unref (*old_str, *env); if (new_str) { *old_str = new_str; nih_ref (new_str, *env); } else { memmove (old_str, old_str + 1, (char *)(*env + *len) - (char *)old_str); (*len)--; } return *env; } else if (old_str) { return *env; } /* No existing entry exists so extend the table instead. */ if (new_str) { if (! nih_str_array_addp (env, parent, len, new_str)) return NULL; } return *env; } /** * environ_remove: * @env: pointer to environment table, * @parent: parent object for new array, * @len: length of @env, * @str: string to remove. * * Remove @str from environment table @env. If @str does not exist in * @env, the returned array will have the same contents as the original * @env. * * Returns: new array pointer or NULL if insufficient memory (or @env is * too small to reduce). **/ char ** environ_remove (char ***env, const void *parent, size_t *len, const char *str) { size_t _len; size_t keylen; char **e; nih_assert (env); nih_assert (str); if (! len) { len = &_len; _len = 0; for (e = *env; e && *e; e++) _len++; } /* Can't manipulate an empty array */ if (*len < 1) return NULL; for (e = *env; e && *e; e++) { keylen = strcspn (*e, "="); /* Found @str in the existing environment (either as a * name=value pair, or a bare name), so don't copy it to * the new environment. */ if (! strncmp (str, *e, keylen)) { nih_unref (*e, *env); /* shuffle up the remaining entries */ memmove (e, e + 1, (char *)(*env + *len) - (char *)e); (*len)--; } } /* shrink amount of memory used */ if (! nih_realloc (*env, parent, sizeof (**env) * (*len + 1))) return NULL; return *env; } /** * environ_append: * @env: pointer to environment table, * @parent: parent object for new array, * @len: length of @env, * @replace: TRUE if existing entries should be replaced, * @new_env: environment table to append to @env. * * Appends the entries in the environment table @new_env to the existing * table @env (which has @len elements, excluding the final NULL element), * either replacing an existing entry entry or appended to the end. * * Both the array and the new strings within it are allocated using * nih_alloc(). * * @len will be updated to contain the new array length and @env will * be updated to point to the new array pointer; use the return value * simply to check for success. * * If the array pointed to by @env is NULL, the array will be allocated * and @str the first element, and if @parent is not NULL, it should be a * pointer to another object which will be used as a parent for the returned * array. When all parents of the returned array are freed, the returned * array will also be freed. * * When the array pointed to by @env is not NULL, @parent is ignored; * though it usual to pass a parent of @env for style reasons. * * Note that if this fails, some of the entries may have been appended * to the array already. It's perfectly safe to call it again, since * existing entries will either be replaced with the same value or * retained (with the same value they're supposed to have). * * Returns: new array pointer or NULL if insufficient memory. **/ char ** environ_append (char ***env, const void *parent, size_t *len, int replace, char * const *new_env) { char * const *e; nih_assert (env != NULL); for (e = new_env; e && *e; e++) if (! environ_add (env, parent, len, replace, *e)) return NULL; return *env; } /** * environ_set: * @env: pointer to environment table, * @parent: parent object for new array, * @len: length of @env, * @replace: TRUE if existing entry should be replaced, * @format: format string. * * Add the new environment variable named @key with the value specified by * the format string @format to the table @env (which has @len elements, * excluding the final NULL element), either replacing an existing entry or * appended to the end. Both the array and the new string within it * are allocated using nih_alloc(). * * The resulting string may be in KEY=VALUE format, in which case the given * key will be replaced with that value or appended to the table; or it may * simply be in KEY format, which which case the value is taken from init's * own environment. * * @len will be updated to contain the new array length and @env will * be updated to point to the new array pointer; use the return value * simply to check for success. * * If the array pointed to by @env is NULL, the array will be allocated * and @str the first element, and if @parent is not NULL, it should be a * pointer to another object which will be used as a parent for the returned * array. When all parents of the returned array are freed, the returned * array will also be freed. * * When the array pointed to by @env is not NULL, @parent is ignored; * though it usual to pass a parent of @env for style reasons. * * Returns: new array pointer or NULL if insufficient memory. **/ char ** environ_set (char ***env, const void *parent, size_t *len, int replace, const char *format, ...) { nih_local char *str = NULL; va_list args; char **ret; nih_assert (env != NULL); nih_assert (format != NULL); va_start (args, format); str = nih_vsprintf (NULL, format, args); va_end (args); if (! str) return NULL; ret = environ_add (env, parent, len, replace, str); return ret; } /** * environ_lookup: * @env: pointer to environment table, * @key: key to lookup, * @len: length of @key. * * Lookup the environment variable named @key, which is @len characters long, * in the @env table given which contains entries of KEY=VALUE form. * * Returns: pointer to entry in @env or NULL if not found. **/ char * const * environ_lookup (char * const *env, const char *key, size_t len) { char * const *e; nih_assert (key != NULL); for (e = env; e && *e; e++) if ((strncmp (*e, key, len) == 0) && ((*e)[len] == '=')) return e; return NULL; } /** * environ_get: * @env: pointer to environment table, * @key: key to lookup. * * Lookup the environment variable named @key in the @env table given * which contains entries of KEY=VALUE form and return a pointer to the * value. * * Returns: string from @env or NULL if not found. **/ const char * environ_get (char * const *env, const char *key) { nih_assert (key != NULL); return environ_getn (env, key, strlen (key)); } /** * environ_getn: * @env: pointer to environment table, * @key: key to lookup, * @len: length of @key. * * Lookup the environment variable named @key, which is @len characters long, * in the @env table given which contains entries of KEY=VALUE form and * return a pointer to the value. * * Returns: string from @env or NULL if not found. **/ const char * environ_getn (char * const *env, const char *key, size_t len) { char * const *e; nih_assert (key != NULL); e = environ_lookup (env, key, len); if (e) { const char *ret; ret = strchr (*e, '='); nih_assert (ret != NULL); return ret + 1; } return NULL; } /** * environ_all_valid: * @env: NULL-terminated array of variables to check. * * Checks each of the environment variables in @env for validity; that is * each must be of KEY=VALUE form. * * This is intended for checking external data such as that in control * messages; environment lists defined in job definitions are actually * permitted to omit the VALUE to retrieve it from the environment. * * Returns: TRUE if all entries are valid, FALSE otherwise. **/ int environ_all_valid (char * const *env) { char * const *e; nih_assert (env != NULL); for (e = env; *e; e++) { char *value; value = strchr (*e, '='); if (! value) return FALSE; } return TRUE; } /** * environ_expand: * @parent: parent object for new string, * @string: string to expand, * @env: NULL-terminated list of environment variables to use. * * Expand variable references in @string using the NULL-terminated list of * KEY=VALUE strings in the given @env table, returning a newly allocated * string with the references replaced by the values. * * Variables may be referenced trivially as $KEY, or where ambiguity is * present as ${KEY}. References may be nested, so ${$KEY}} will first * expand $KEY, and then expand the variable named within that variable. * * Shell like operator expansions are also permitted. ${KEY:-default} * will expand to $KEY if not unset or null, "default" otherwise. * ${KEY-default} is as above, but expands to null if $KEY is null. * * ${KEY:+alternate} will expand to null if $KEY is unset or null, * "alternate" otherwise. ${KEY+alternate} is as above, but will expand * to "alternate" only if $KEY is unset. * * Unknown references are raised as an error instead of being substituted * with null, for that behaviour you should explicity use ${KEY-} * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned string. When all parents * of the returned string are freed, the returned string will also be * freed. * * Returns: newly allocated string or NULL on raised error. **/ char * environ_expand (const void *parent, const char *string, char * const *env) { char *str; size_t len, pos; nih_assert (string != NULL); str = nih_strdup (parent, string); if (! str) { nih_error_raise_system (); return NULL; } len = strlen (string); pos = 0; if (! environ_expand_until (&str, parent, &len, &pos, env, "")) return NULL; return str; } /** * environ_expand_until: * @str: string being expanded, * @parent: parent object for new string, * @len: length of @str, * @pos: current position within @str, * @env: NULL-terminated list of environment variables to use, * @until: characters to stop expansion on. * * Perform an in-place expansion of variable references in @str using the * NULL-terminated list of KEY=VALUE strings in the given @env table, * stopping expansion when any of the characters in @until or the end of * @str is reached. * * See environ_expand() for the valid references. * * @len will be updated after each expansion to contain the new length, * which may be shorter or longer than before depending on the relative * lengths of the reference and value. * * @pos will be likewise updated to point to the character listed in @until. * * @parent is ignored, though for style reasons it is usual to pass a * parent of @str. * * Returns: reallocated string or NULL on raised error. **/ static char * environ_expand_until (char **str, const void *parent, size_t *len, size_t *pos, char * const *env, const char *until) { nih_assert (str != NULL); nih_assert (*str != NULL); nih_assert (len != NULL); nih_assert (pos != NULL); nih_assert (until != NULL); for (;;) { enum { OP_VALUE, OP_DEFAULT, OP_ALTERNATE } op = OP_VALUE; size_t start, end; size_t name_start, name_end; size_t arg_start = 0, arg_end = 0; int ignore_empty = FALSE; const char *value; size_t value_len, offset; /* Locate the start of the next reference, if we have no * further references, we can exit the loop and return the * string. */ while (((*str)[*pos] != '$') && (! strchr (until, (*str)[*pos]))) (*pos)++; if ((*str)[*pos] != '$') break; /* Look at the next character to find out whether this is * a simple expansion, a bracketed expansion or a lone * dollar sign. */ start = (*pos)++; if (((*str)[*pos] == '_') || (((*str)[*pos] >= 'A') && ((*str)[*pos] <= 'Z')) || (((*str)[*pos] >= 'a') && ((*str)[*pos] <= 'z'))) { /* Simple reference; use all following alphanumeric * characters and leave pos pointing at the first * non-reference character. */ name_start = (*pos)++; while (((*str)[*pos] == '_') || (((*str)[*pos] >= 'A') && ((*str)[*pos] <= 'Z')) || (((*str)[*pos] >= 'a') && ((*str)[*pos] <= 'z')) || (((*str)[*pos] >= '0') && ((*str)[*pos] <= '9'))) (*pos)++; name_end = end = (*pos); } else if (((*str)[*pos] == '{') && ((*str)[*pos + 1] == '}')) { /* Empty bracketed expression; this is a special that * is always replaced by the literal dollar sign. */ *pos += 2; end = *pos; value = "$"; value_len = 1; goto subst; } else if ((*str)[*pos] == '{') { /* Bracketed reference; step over the bracket and * treat the inner as another string to be expanded, * terminated by any character that terminates the * name part of the reference. */ name_start = ++(*pos); if (! environ_expand_until (str, parent, len, pos, env, "}:-+")) return NULL; name_end = (*pos); /* Check for an expression operator; if we find one, * step over it and evalulate the rest of the bracketed * expression to find the substitute value. */ if (((*str)[*pos] == ':') && (*str)[*pos + 1] == '-') { (*pos) += 2; op = OP_DEFAULT; ignore_empty = TRUE; } else if (((*str)[*pos] == ':') && (*str)[*pos + 1] == '+') { (*pos) += 2; op = OP_ALTERNATE; ignore_empty = TRUE; } else if ((*str)[*pos] == '-') { (*pos)++; op = OP_DEFAULT; } else if ((*str)[*pos] == '+') { (*pos)++; op = OP_ALTERNATE; } else if (((*str)[*pos] != '}') && ((*str)[*pos] != '\0')) { nih_error_raise (ENVIRON_EXPECTED_OPERATOR, _(ENVIRON_EXPECTED_OPERATOR_STR)); goto error; } /* Expand any argument appearing after the expression * operator; for simple value expansion, this will * be almost a no-op, except we'll have defined values */ arg_start = *pos; if (! environ_expand_until (str, parent, len, pos, env, "}")) return NULL; arg_end = (*pos); /* Make sure the final character ends the bracketed * expression and that we haven't hit the end of the * string. */ if ((*str)[*pos] != '}') { nih_error_raise (ENVIRON_MISMATCHED_BRACES, _(ENVIRON_MISMATCHED_BRACES_STR)); goto error; } end = ++(*pos); } else { continue; } /* Lookup the environment variable. How we handle whether * this is NULL or not depends on the operator in effect. */ value = environ_getn (env, *str + name_start, name_end - name_start); switch (op) { case OP_VALUE: /* Value must be directly substituted from the * environment; if it doesn't exist, raise an error. */ if (value == NULL) { nih_error_raise_printf ( ENVIRON_UNKNOWN_PARAM, "%s: %.*s", _(ENVIRON_UNKNOWN_PARAM_STR), (int)(name_end - name_start), *str + name_start); goto error; } value_len = strlen (value); break; case OP_DEFAULT: /* Value may be directly substitued from the * environment if set, otherwise we substitute from * the argument to the expression. */ if ((value == NULL) || (ignore_empty && (value[0] == '\0'))) { value = *str + arg_start; value_len = arg_end - arg_start; } else { value_len = strlen (value); } break; case OP_ALTERNATE: /* Substitute the empty string if the value is * NULL or unset, otherwise substitute the argument * to the expression. */ if ((value == NULL) || (ignore_empty && (value[0] == '\0'))) { value = ""; value_len = 0; } else { value = *str + arg_start; value_len = arg_end - arg_start; } break; default: nih_assert_not_reached (); } subst: /* Work out whether we need to extend the string to fit the * value in place, then adjust the string so that there's * the right gap for the value to slot in. */ if (value_len > end - start) { char *new_str; offset = value_len - (end - start); new_str = nih_realloc (*str, parent, *len + offset + 1); if (! new_str) { nih_error_raise_system (); goto error; } *str = new_str; memmove (*str + end + offset, *str + end, *len - end + 1); memmove (*str + start, value, value_len); *len += offset; *pos += offset; } else if (value_len < end - start) { offset = (end - start) - value_len; memmove (*str + start, value, value_len); memmove (*str + end - offset, *str + end, *len - end + 1); *len -= offset; *pos -= offset; } else { memmove (*str + start, value, value_len); } } return *str; error: nih_free (*str); *str = NULL; return NULL; } upstart-1.13.2/init/job.c0000664000175000017500000020022212401640554012103 00000000000000/* upstart * * job.c - core state machine of tasks and services * * Copyright © 2010,2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "events.h" #include "environ.h" #include "process.h" #include "session.h" #include "job_class.h" #include "job.h" #include "job_process.h" #include "event.h" #include "event_operator.h" #include "blocked.h" #include "control.h" #include "parse_job.h" #include "state.h" #include "apparmor.h" #ifdef ENABLE_CGROUPS #include "cgroup.h" #endif /* ENABLE_CGROUPS */ #include "com.ubuntu.Upstart.Job.h" #include "com.ubuntu.Upstart.Instance.h" /* Prototypes for static functions */ static const char * job_goal_enum_to_str (JobGoal goal) __attribute__ ((warn_unused_result)); static JobGoal job_goal_str_to_enum (const char *goal) __attribute__ ((warn_unused_result)); static const char * job_trace_state_enum_to_str (TraceState state) __attribute__ ((warn_unused_result)); static TraceState job_trace_state_str_to_enum (const char *state) __attribute__ ((warn_unused_result)); static json_object * job_serialise_kill_timer (NihTimer *timer) __attribute__ ((warn_unused_result)); static NihTimer * job_deserialise_kill_timer (json_object *json) __attribute__ ((warn_unused_result)); static int job_destroy (Job *job); /** * job_destroy: * * @job: Job. * * Called automatically when Job is being destroyed. * * Returns: 0 always. **/ static int job_destroy (Job *job) { int i; nih_assert (job); /* Free any associated NihIo's to avoid the handlers getting * called potentially after the job has been freed. */ if (job->process_data) { for (i = 0; i < PROCESS_LAST; i++) { if (job->process_data[i]) { nih_free (job->process_data[i]); job->process_data[i] = NULL; } } } nih_list_destroy (&job->entry); return 0; } /** * job_new: * @class: class of job, * @name: name for new instance. * * Allocates and returns a new Job structure for the @class given, * appending it to the list of instances for @class. The returned job * will also be an nih_alloc() child of @class. * * @name is used to uniquely identify the instance and is normally * generated by expanding the @class's instance member. * * Returns: newly allocated job structure or NULL if insufficient memory. **/ Job * job_new (JobClass *class, const char *name) { Job *job; int i; nih_assert (class != NULL); nih_assert (name != NULL); control_init (); job = nih_new (class, Job); if (! job) return NULL; nih_list_init (&job->entry); /* Ensure unset before destructor could possibly be called */ job->process_data = NULL; nih_alloc_set_destructor (job, job_destroy); job->name = nih_strdup (job, name); if (! job->name) goto error; job->class = class; if (job->class->session && job->class->session->chroot) { /* JobClass already contains a valid D-Bus path prefix for the job */ job->path = nih_dbus_path (job, class->path, job->name, NULL); } else { job->path = nih_dbus_path (job, DBUS_PATH_UPSTART, "jobs", class->name, job->name, NULL); } if (! job->path) goto error; job->goal = JOB_STOP; job->state = JOB_WAITING; job->env = NULL; job->start_env = NULL; job->stop_env = NULL; job->stop_on = NULL; if (class->stop_on) { job->stop_on = event_operator_copy (job, class->stop_on); if (! job->stop_on) goto error; } job->fds = NULL; job->num_fds = 0; job->pid = nih_alloc (job, sizeof (pid_t) * PROCESS_LAST); if (! job->pid) goto error; for (i = 0; i < PROCESS_LAST; i++) job->pid[i] = 0; /* Each job process needs its own log object to ensure sane * behaviour: consider a post-start that starts and ends * before the main process ends: it will be reaped (and its log * flushed) before the main process has a chance to have its log * drained. */ job->log = nih_alloc (job, sizeof (Log *) * PROCESS_LAST); if (! job->log) goto error; for (i = 0; i < PROCESS_LAST; i++) job->log[i] = NULL; job->blocker = NULL; nih_list_init (&job->blocking); job->kill_timer = NULL; job->kill_process = PROCESS_INVALID; job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job->respawn_time = 0; job->respawn_count = 0; job->trace_forks = 0; job->trace_state = TRACE_NONE; nih_hash_add (class->instances, &job->entry); NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; job_register (job, conn, TRUE); } /* Since some job processes can run in parallel, we must ensure * that the asynchronous-spawning of such job processes is * handled by providing a handler for each pid. * * Strictly, this is only necessary for certain combinations of * job processes (such as PROCESS_MAIN and PROCESS_POST_START), * however for consistency with other entities (such as Log), we * create a slot for all job processes since there is minimal * overhead (a single pointer) for those job processes tha * cannot run in parallel with others. */ job->process_data = nih_alloc (job, sizeof (JobProcessData *) * PROCESS_LAST); if (! job->process_data) goto error; for (i = 0; i < PROCESS_LAST; i++) job->process_data[i] = NULL; return job; error: nih_free (job); return NULL; } /** * job_register: * @job: job to register, * @conn: connection to register for, * @signal: emit the InstanceAdded signal. * * Register the @job instance with the D-Bus connection @conn, using * the path set when the job was created. **/ void job_register (Job *job, DBusConnection *conn, int signal) { nih_assert (job != NULL); nih_assert (conn != NULL); NIH_MUST (nih_dbus_object_new (job, conn, job->path, job_interfaces, job)); nih_debug ("Registered instance %s", job->path); if (signal) NIH_ZERO (job_class_emit_instance_added (conn, job->class->path, job->path)); } /** * job_change_goal: * @job: job to change goal of, * @goal: goal to change to. * * This function changes the current goal of a @job to the new @goal given, * performing any necessary state changes or actions (such as killing * the running process) to correctly enter the new goal. * * If the job is not in a rest state (WAITING or RUNNING), this has no * other effect than changing the goal; since the job is waiting on some * other event. The goal change will cause it to take action to head * towards stopped. * * If the job is in the WAITING state and @goal is START, the job will * begin to be started and will block in the STARTING state for an event * to finish. * * If the job is in the RUNNING state and @goal is STOP, the job will * begin to be stopped and will either block in the PRE-STOP state for * the pre-stop script or the STOPPING state for an event to finish. * * Thus in all circumstances, @job is safe to use once this function * returns. Though further calls to job_change_state may change that as * noted. **/ void job_change_goal (Job *job, JobGoal goal) { nih_assert (job != NULL); if (job->goal == goal) return; nih_info (_("%s goal changed from %s to %s"), job_name (job), job_goal_name (job->goal), job_goal_name (goal)); job->goal = goal; NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; NIH_ZERO (job_emit_goal_changed ( conn, job->path, job_goal_name (job->goal))); } /* Normally whatever process or event is associated with the state * will finish naturally, so all we need do is change the goal and * we'll change direction through the state machine at that point. * * The exceptions are the natural rest states of waiting and a * running process; these need induction to get them moving. */ switch (goal) { case JOB_START: if (job->state == JOB_WAITING) job_change_state (job, job_next_state (job)); break; case JOB_STOP: if (job->state == JOB_RUNNING) job_change_state (job, job_next_state (job)); break; case JOB_RESPAWN: break; default: nih_assert_not_reached (); } } /** * job_change_state: * @job: job to change state of, * @state: state to change to. * * This function changes the current state of a @job to the new @state * given, performing any actions to correctly enter the new state (such * as spawning scripts or processes). * * The associated event is also queued by this function. * * Some state transitions are not be permitted and will result in an * assertion failure. Also some state transitions may result in further * transitions, so the state when this function returns may not be the * state requested. * * WARNING: On return from this function, @job may no longer be valid * since it will be freed once it becomes fully stopped. **/ void job_change_state (Job *job, JobState state) { nih_assert (job != NULL); while (job->state != state) { JobState old_state; int unused; /* If we got blocked during async spawns, stop * transitions. */ if (job->blocker) return; nih_info (_("%s state changed from %s to %s"), job_name (job), job_state_name (job->state), job_state_name (state)); old_state = job->state; job->state = state; NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; NIH_ZERO (job_emit_state_changed ( conn, job->path, job_state_name (job->state))); } /* Perform whatever action is necessary to enter the new * state, such as executing a process or emitting an event. */ switch (job->state) { case JOB_STARTING: nih_assert (job->goal == JOB_START); nih_assert ((old_state == JOB_WAITING) || (old_state == JOB_POST_STOP)); /* Throw away our old environment and use the newly * set environment from now on; unless that's NULL * in which case we just keep our old environment. */ if (job->start_env) { if (job->env) nih_unref (job->env, job); job->env = job->start_env; job->start_env = NULL; } /* Throw away the stop environment */ if (job->stop_env) { nih_unref (job->stop_env, job); job->stop_env = NULL; } /* Clear any old failed information */ job->failed = FALSE; job->failed_process = PROCESS_INVALID; job->exit_status = 0; job->blocker = job_emit_event (job); break; case JOB_SECURITY_SPAWNING: nih_assert (job->goal == JOB_START); nih_assert (old_state == JOB_STARTING); if (job->class->process[PROCESS_SECURITY] && apparmor_available()) { job_process_start (job, PROCESS_SECURITY); } state = job_next_state (job); break; case JOB_SECURITY: nih_assert (job->goal == JOB_START); nih_assert (old_state == JOB_SECURITY_SPAWNING); if (! (job->class->process[PROCESS_SECURITY] && apparmor_available())) { state = job_next_state (job); } break; case JOB_PRE_STARTING: nih_assert (job->goal == JOB_START); nih_assert (old_state == JOB_SECURITY); /* spawn pre-start asynchronously, child * watcher asynchronously will change goal to * stop if spawning fails. */ if (job->class->process[PROCESS_PRE_START]) { job_process_start (job, PROCESS_PRE_START); } state = job_next_state (job); break; case JOB_PRE_START: nih_assert (job->goal == JOB_START); nih_assert (old_state == JOB_PRE_STARTING); /* if no pre-start process, go to next * state. otherwise async child watcher will * trigger us to go to the next state */ if (! job->class->process[PROCESS_PRE_START]) state = job_next_state (job); break; case JOB_SPAWNING: nih_assert (job->goal == JOB_START); nih_assert (old_state == JOB_PRE_START); if (job->class->process[PROCESS_MAIN]) { job_process_start (job, PROCESS_MAIN); } state = job_next_state (job); break; case JOB_SPAWNED: nih_assert (job->goal == JOB_START); nih_assert (old_state == JOB_SPAWNING); if (! job->class->process[PROCESS_MAIN]) { state = job_next_state (job); } break; case JOB_POST_STARTING: nih_assert (job->goal == JOB_START); nih_assert (old_state == JOB_SPAWNED); if (job->class->process[PROCESS_POST_START]) { job_process_start (job, PROCESS_POST_START); } state = job_next_state (job); break; case JOB_POST_START: nih_assert (job->goal == JOB_START); nih_assert (old_state == JOB_POST_STARTING); if (! job->class->process[PROCESS_POST_START]) { state = job_next_state (job); } break; case JOB_RUNNING: nih_assert (job->goal == JOB_START); nih_assert ((old_state == JOB_POST_START) || (old_state == JOB_PRE_STOP)); if (old_state == JOB_PRE_STOP) { /* Throw away the stop environment */ if (job->stop_env) { nih_unref (job->stop_env, job); job->stop_env = NULL; } /* Cancel the stop attempt */ job_finished (job, FALSE); } else { job_emit_event (job); /* If we're not a task, our goal is to be * running. */ if (! job->class->task) job_finished (job, FALSE); } break; case JOB_PRE_STOPPING: nih_assert (job->goal == JOB_STOP); nih_assert (old_state == JOB_RUNNING); if (job->class->process[PROCESS_PRE_STOP]) { job_process_start (job, PROCESS_PRE_STOP); } state = job_next_state (job); break; case JOB_PRE_STOP: nih_assert (job->goal == JOB_STOP); nih_assert (old_state == JOB_PRE_STOPPING); if (! job->class->process[PROCESS_PRE_STOP]) { state = job_next_state (job); } break; case JOB_STOPPING: nih_assert ((old_state == JOB_STARTING) || (old_state == JOB_PRE_STARTING) || (old_state == JOB_PRE_START) || (old_state == JOB_SECURITY) || (old_state == JOB_SPAWNED) || (old_state == JOB_POST_START) || (old_state == JOB_RUNNING) || (old_state == JOB_PRE_STOP)); job->blocker = job_emit_event (job); break; case JOB_KILLED: nih_assert (old_state == JOB_STOPPING); if (job->class->process[PROCESS_MAIN] && (job->pid[PROCESS_MAIN] > 0)) { job_process_kill (job, PROCESS_MAIN); } else { state = job_next_state (job); } break; case JOB_POST_STOPPING: nih_assert (old_state == JOB_KILLED); if (job->class->process[PROCESS_POST_STOP]) { job_process_start (job, PROCESS_POST_STOP); } state = job_next_state (job); break; case JOB_POST_STOP: nih_assert (old_state == JOB_POST_STOPPING); if (! job->class->process[PROCESS_POST_STOP]) { state = job_next_state (job); } break; case JOB_WAITING: nih_assert (job->goal == JOB_STOP); nih_assert ((old_state == JOB_POST_STOP) || (old_state == JOB_STARTING)); job_emit_event (job); job_finished (job, FALSE); /* Remove the job from the list of instances and * then allow a better class to replace us * in the hash table if we have no other instances * and there is one. */ nih_list_remove (&job->entry); unused = job_class_reconsider (job->class); /* If the class is due to be deleted, free it * taking the job with it; otherwise free the * job. */ if (job->class->deleted && unused) { nih_debug ("Destroyed unused job %s", job->class->name); nih_free (job->class); } else { nih_debug ("Destroyed inactive instance %s", job_name (job)); NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; NIH_ZERO (job_class_emit_instance_removed ( conn, job->class->path, job->path)); } /* Destroy the instance */ nih_free (job); } return; } } } /** * job_next_state: * @job: job undergoing state change. * * The next state a job needs to change into is not always obvious as it * depends both on the current state and the ultimate goal of the job, ie. * whether we're moving towards stop or start. * * This function contains the logic to decide the next state the job should * be in based on the current state and goal. * * It is up to the caller to ensure the goal is set appropriately before * calling this function, for example setting it to JOB_STOP if something * failed. It is also up to the caller to actually set the new state as * this simply returns the suggested one. * * Returns: suggested state to change to. **/ JobState job_next_state (Job *job) { nih_assert (job != NULL); switch (job->state) { case JOB_WAITING: switch (job->goal) { case JOB_STOP: nih_assert_not_reached (); case JOB_START: return JOB_STARTING; default: nih_assert_not_reached (); } case JOB_STARTING: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_SECURITY_SPAWNING; default: nih_assert_not_reached (); } case JOB_SECURITY_SPAWNING: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_SECURITY; default: nih_assert_not_reached (); } case JOB_SECURITY: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_PRE_STARTING; default: nih_assert_not_reached (); } case JOB_PRE_STARTING: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_PRE_START; default: nih_assert_not_reached (); } case JOB_PRE_START: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_SPAWNING; default: nih_assert_not_reached (); } case JOB_SPAWNING: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_SPAWNED; default: nih_assert_not_reached (); } case JOB_SPAWNED: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_POST_STARTING; default: nih_assert_not_reached (); } case JOB_POST_STARTING: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_POST_START; default: nih_assert_not_reached (); } case JOB_POST_START: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_RUNNING; case JOB_RESPAWN: job_change_goal (job, JOB_START); return JOB_STOPPING; default: nih_assert_not_reached (); } case JOB_RUNNING: switch (job->goal) { case JOB_STOP: if (job->class->process[PROCESS_MAIN] && (job->pid[PROCESS_MAIN] > 0)) { return JOB_PRE_STOPPING; } else { return JOB_STOPPING; } case JOB_START: return JOB_STOPPING; default: nih_assert_not_reached (); } case JOB_PRE_STOPPING: switch (job->goal) { case JOB_STOP: return JOB_PRE_STOP; case JOB_START: return JOB_PRE_STOP; default: nih_assert_not_reached (); } case JOB_PRE_STOP: switch (job->goal) { case JOB_STOP: return JOB_STOPPING; case JOB_START: return JOB_RUNNING; case JOB_RESPAWN: job_change_goal (job, JOB_START); return JOB_STOPPING; default: nih_assert_not_reached (); } case JOB_STOPPING: switch (job->goal) { case JOB_STOP: return JOB_KILLED; case JOB_START: return JOB_KILLED; default: nih_assert_not_reached (); } case JOB_KILLED: switch (job->goal) { case JOB_STOP: return JOB_POST_STOPPING; case JOB_START: return JOB_POST_STOPPING; default: nih_assert_not_reached (); } case JOB_POST_STOPPING: switch (job->goal) { case JOB_STOP: return JOB_POST_STOP; case JOB_START: return JOB_POST_STOP; default: nih_assert_not_reached (); } case JOB_POST_STOP: switch (job->goal) { case JOB_STOP: return JOB_WAITING; case JOB_START: return JOB_STARTING; default: nih_assert_not_reached (); } default: nih_assert_not_reached (); } } /** * job_failed: * @job: job that has failed, * @process: process that failed, * @status: status of @process at failure. * * Mark @job as having failed, unless it already has been marked so, storing * @process and @status so that they may show up as arguments and environment * to the stop and stopped events generated for the job. * * Additionally this marks the start and stop events as failed as well; this * is reported to the emitter of the event, and will also cause a failed event * to be generated after the event completes. * * @process may be -1 to indicate a failure to respawn, and @exit_status * may be -1 to indicate a spawn failure. **/ void job_failed (Job *job, ProcessType process, int status) { nih_assert (job != NULL); if (job->failed) return; job->failed = TRUE; job->failed_process = process; job->exit_status = status; NIH_LIST_FOREACH (control_conns, iter) { NihListEntry *entry = (NihListEntry *)iter; DBusConnection *conn = (DBusConnection *)entry->data; NIH_ZERO (job_emit_failed (conn, job->path, status)); } job_finished (job, TRUE); } /** * job_finished: * @job: job that is blocking, * @failed: mark events as failed. * * This function unblocks any events blocking on @job; it is called when the * job reaches a rest state (waiting for all, running for services), when a * new command is received or when the job fails. * * If @failed is TRUE then the events that are blocking will be marked as * failed. **/ void job_finished (Job *job, int failed) { nih_assert (job != NULL); NIH_LIST_FOREACH_SAFE (&job->blocking, iter) { Blocked *blocked = (Blocked *)iter; switch (blocked->type) { case BLOCKED_EVENT: if (failed) blocked->event->failed = TRUE; event_unblock (blocked->event); break; case BLOCKED_JOB_START_METHOD: if (failed) { NIH_ZERO (nih_dbus_message_error ( blocked->message, DBUS_INTERFACE_UPSTART ".Error.JobFailed", _("Job failed to start"))); } else { NIH_ZERO (job_class_start_reply ( blocked->message, job->path)); } break; case BLOCKED_JOB_STOP_METHOD: if (failed) { NIH_ZERO (nih_dbus_message_error ( blocked->message, DBUS_INTERFACE_UPSTART ".Error.JobFailed", _("Job failed while stopping"))); } else { NIH_ZERO (job_class_stop_reply ( blocked->message)); } break; case BLOCKED_JOB_RESTART_METHOD: if (failed) { NIH_ZERO (nih_dbus_message_error ( blocked->message, DBUS_INTERFACE_UPSTART ".Error.JobFailed", _("Job failed to restart"))); } else { NIH_ZERO (job_class_restart_reply ( blocked->message, job->path)); } break; case BLOCKED_INSTANCE_START_METHOD: if (failed) { NIH_ZERO (nih_dbus_message_error ( blocked->message, DBUS_INTERFACE_UPSTART ".Error.JobFailed", _("Job failed to start"))); } else { NIH_ZERO (job_start_reply (blocked->message)); } break; case BLOCKED_INSTANCE_STOP_METHOD: if (failed) { NIH_ZERO (nih_dbus_message_error ( blocked->message, DBUS_INTERFACE_UPSTART ".Error.JobFailed", _("Job failed while stopping"))); } else { NIH_ZERO (job_stop_reply (blocked->message)); } break; case BLOCKED_INSTANCE_RESTART_METHOD: if (failed) { NIH_ZERO (nih_dbus_message_error ( blocked->message, DBUS_INTERFACE_UPSTART ".Error.JobFailed", _("Job failed to restart"))); } else { NIH_ZERO (job_restart_reply (blocked->message)); } break; default: nih_assert_not_reached (); } nih_free (blocked); } } /** * job_emit_event: * @job: job generating the event. * * Called from a state change because it believes an event should be * emitted. Constructs the event with the right arguments and environment * and adds it to the pending queue. * * The starting and stopping events will record the job as blocking on * the event, and will change the job's state when they finish. * * The stopping and stopped events have an extra argument that is "ok" if * the job terminated successfully, or "failed" if it terminated with an * error. If failed, a further argument indicates which process it was * that caused the failure and either an EXIT_STATUS or EXIT_SIGNAL * environment variable detailing it. * * Returns: new Event in the queue. **/ Event * job_emit_event (Job *job) { Event *event; const char *name; int block = FALSE, stop = FALSE; nih_local char **env = NULL; char **e; size_t len; nih_assert (job != NULL); switch (job->state) { case JOB_STARTING: name = JOB_STARTING_EVENT; block = TRUE; break; case JOB_RUNNING: name = JOB_STARTED_EVENT; break; case JOB_STOPPING: name = JOB_STOPPING_EVENT; block = TRUE; stop = TRUE; break; case JOB_WAITING: name = JOB_STOPPED_EVENT; stop = TRUE; break; default: nih_assert_not_reached (); } len = 0; env = NIH_MUST (nih_str_array_new (NULL)); /* Add the job and instance name */ NIH_MUST (environ_set (&env, NULL, &len, TRUE, "JOB=%s", job->class->name)); NIH_MUST (environ_set (&env, NULL, &len, TRUE, "INSTANCE=%s", job->name)); /* Stop events include a "failed" argument if a process failed, * otherwise stop events have an "ok" argument. */ if (stop && job->failed) { NIH_MUST (environ_add (&env, NULL, &len, TRUE, "RESULT=failed")); /* Include information about the process that failed, and * the signal/exit information. If it was the spawn itself * that failed, we don't include signal/exit information and * if it was a respawn failure, we use the special "respawn" * argument instead of the process name, */ if ((job->failed_process != PROCESS_INVALID) && (job->exit_status != -1)) { NIH_MUST (environ_set (&env, NULL, &len, TRUE, "PROCESS=%s", process_name (job->failed_process))); /* If the job was terminated by a signal, that * will be stored in the higher byte and we * set EXIT_SIGNAL instead of EXIT_STATUS. */ if (job->exit_status & ~0xff) { const char *sig; sig = nih_signal_to_name (job->exit_status >> 8); if (sig) { NIH_MUST (environ_set (&env, NULL, &len, TRUE, "EXIT_SIGNAL=%s", sig)); } else { NIH_MUST (environ_set (&env, NULL, &len, TRUE, "EXIT_SIGNAL=%d", job->exit_status >> 8)); } } else { NIH_MUST (environ_set (&env, NULL, &len, TRUE, "EXIT_STATUS=%d", job->exit_status)); } } else if (job->failed_process != PROCESS_INVALID) { NIH_MUST (environ_set (&env, NULL, &len, TRUE, "PROCESS=%s", process_name (job->failed_process))); } else { NIH_MUST (environ_add (&env, NULL, &len, TRUE, "PROCESS=respawn")); } } else if (stop) { NIH_MUST (environ_add (&env, NULL, &len, TRUE, "RESULT=ok")); } /* Add any exported variables from the job environment */ for (e = job->class->export; e && *e; e++) { char * const *str; str = environ_lookup (job->env, *e, strlen (*e)); if (str) NIH_MUST (environ_add (&env, NULL, &len, FALSE, *str)); } event = NIH_MUST (event_new (NULL, name, env)); event->session = job->class->session; if (block) { Blocked *blocked; blocked = NIH_MUST (blocked_new (event, BLOCKED_JOB, job)); nih_list_add (&event->blocking, &blocked->entry); } return event; } /** * job_name: * @job: job to return name of. * * Returns a string used in messages that contains the job name; this * always begins with the name from the class, and then if set, * has the name of the instance appended in brackets. * * Returns: internal copy of the string. **/ const char * job_name (Job *job) { static char *name = NULL; nih_assert (job != NULL); if (name) nih_discard (name); if (*job->name) { name = NIH_MUST (nih_sprintf (NULL, "%s (%s)", job->class->name, job->name)); } else { name = NIH_MUST (nih_strdup (NULL, job->class->name)); } return name; } /** * job_goal_name: * @goal: goal to convert. * * Converts an enumerated job goal into the string used for the status * and for logging purposes. * * Returns: static string or NULL if goal not known. **/ const char * job_goal_name (JobGoal goal) { switch (goal) { case JOB_STOP: return N_("stop"); case JOB_START: return N_("start"); case JOB_RESPAWN: return N_("respawn"); default: return NULL; } } /** * job_goal_from_name: * @goal: goal to convert. * * Converts a job goal string into the enumeration. * * Returns: enumerated goal or -1 if not known. **/ JobGoal job_goal_from_name (const char *goal) { nih_assert (goal != NULL); if (! strcmp (goal, "stop")) { return JOB_STOP; } else if (! strcmp (goal, "start")) { return JOB_START; } else if (! strcmp (goal, "respawn")) { return JOB_RESPAWN; } else { return -1; } } /** * job_state_name: * @state: state to convert. * * Converts an enumerated job state into the string used for the status * and for logging purposes. * * Returns: static string or NULL if state not known. **/ const char * job_state_name (JobState state) { switch (state) { case JOB_WAITING: return N_("waiting"); case JOB_STARTING: return N_("starting"); case JOB_SECURITY_SPAWNING: return N_("security-spawning"); case JOB_SECURITY: return N_("security"); case JOB_PRE_STARTING: return N_("pre-starting"); case JOB_PRE_START: return N_("pre-start"); case JOB_SPAWNING: return N_("spawning"); case JOB_SPAWNED: return N_("spawned"); case JOB_POST_STARTING: return N_("post-starting"); case JOB_POST_START: return N_("post-start"); case JOB_RUNNING: return N_("running"); case JOB_PRE_STOPPING: return N_("pre-stopping"); case JOB_PRE_STOP: return N_("pre-stop"); case JOB_STOPPING: return N_("stopping"); case JOB_KILLED: return N_("killed"); case JOB_POST_STOPPING: return N_("post-stopping"); case JOB_POST_STOP: return N_("post-stop"); default: return NULL; } } /** * job_state_from_name: * @state: state to convert. * * Converts a job state string into the enumeration. * * Returns: enumerated state or -1 if not known. **/ JobState job_state_from_name (const char *state) { nih_assert (state != NULL); if (! strcmp (state, "waiting")) { return JOB_WAITING; } else if (! strcmp (state, "starting")) { return JOB_STARTING; } else if (! strcmp (state, "security-spawning")) { return JOB_SECURITY_SPAWNING; } else if (! strcmp (state, "security")) { return JOB_SECURITY; } else if (! strcmp (state, "pre-starting")) { return JOB_PRE_STARTING; } else if (! strcmp (state, "pre-start")) { return JOB_PRE_START; } else if (! strcmp (state, "spawning")) { return JOB_SPAWNING; } else if (! strcmp (state, "spawned")) { return JOB_SPAWNED; } else if (! strcmp (state, "post-starting")) { return JOB_POST_STARTING; } else if (! strcmp (state, "post-start")) { return JOB_POST_START; } else if (! strcmp (state, "running")) { return JOB_RUNNING; } else if (! strcmp (state, "pre-stopping")) { return JOB_PRE_STOPPING; } else if (! strcmp (state, "pre-stop")) { return JOB_PRE_STOP; } else if (! strcmp (state, "stopping")) { return JOB_STOPPING; } else if (! strcmp (state, "killed")) { return JOB_KILLED; } else if (! strcmp (state, "post-stopping")) { return JOB_POST_STOPPING; } else if (! strcmp (state, "post-stop")) { return JOB_POST_STOP; } else { return -1; } } /** * job_start: * @job: job to be started, * @message: D-Bus connection and message received, * @wait: whether to wait for command to finish before returning. * * Implements the top half of the Start method of the * com.ubuntu.Upstart.Instance interface, the bottom half may be found in * job_finished(). * * Called on a stopping instance @job to cause it to be restarted. If the * instance goal is already start, the com.ubuntu.Upstart.Error.AlreadyStarted * D_Bus error will be returned immediately. If the instance fails to * start again, the com.ubuntu.Upstart.Error.JobFailed D-Bus error will * be returned when the problem occurs. * * When @wait is TRUE the method call will not return until the job has * finished starting (running for tasks); when @wait is FALSE, the method * call returns once the command has been processed and the goal changed. * * Returns: zero on success, negative value on raised error. **/ int job_start (Job *job, NihDBusMessage *message, int wait) { Session *session; Blocked *blocked = NULL; nih_assert (job != NULL); nih_assert (message != NULL); /* Don't permit out-of-session modification */ session = session_from_dbus (NULL, message); if (session != job->class->session) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job: %s"), job_name (job)); return -1; } if (job->goal == JOB_START) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.AlreadyStarted", _("Job is already running: %s"), job_name (job)); return -1; } #ifdef ENABLE_CGROUPS /* Job has specified a cgroup stanza but since the cgroup * manager has not yet been contacted, the job cannot be started. */ if (job_class_cgroups (job->class) && ! cgroup_manager_available ()) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.CGroupManagerNotAvailable", _("Job cannot be started as cgroup manager not available: %s"), job_name (job)); return -1; } #endif /* ENABLE_CGROUPS */ if (wait) { blocked = blocked_new (job, BLOCKED_INSTANCE_START_METHOD, message); if (! blocked) nih_return_system_error (-1); } if (job->start_env) nih_unref (job->start_env, job); job->start_env = NULL; job_finished (job, FALSE); if (blocked) nih_list_add (&job->blocking, &blocked->entry); job_change_goal (job, JOB_START); if (! wait) NIH_ZERO (job_start_reply (message)); return 0; } /** * job_stop: * @job: job to be stopped, * @message: D-Bus connection and message received, * @wait: whether to wait for command to finish before returning. * * Implements the top half of the Stop method of the * com.ubuntu.Upstart.Instance interface, the bottom half may be found in * job_finished(). * * Called on a running instance @job to cause it to be stopped. If the * instance goal is already stop, the com.ubuntu.Upstart.Error.AlreadyStopped * D_Bus error will be returned immediately. If the instance fails while * stopping, the com.ubuntu.Upstart.Error.JobFailed D-Bus error will * be returned when the problem occurs. * * When @wait is TRUE the method call will not return until the job has * finished stopping; when @wait is FALSE, the method call returns once * the command has been processed and the goal changed. * * Returns: zero on success, negative value on raised error. **/ int job_stop (Job *job, NihDBusMessage *message, int wait) { Session *session; Blocked *blocked = NULL; nih_assert (job != NULL); nih_assert (message != NULL); /* Don't permit out-of-session modification */ session = session_from_dbus (NULL, message); if (session != job->class->session) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job: %s"), job_name (job)); return -1; } if (job->goal == JOB_STOP) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.AlreadyStopped", _("Job has already been stopped: %s"), job_name (job)); return -1; } if (wait) { blocked = blocked_new (job, BLOCKED_INSTANCE_STOP_METHOD, message); if (! blocked) nih_return_system_error (-1); } if (job->stop_env) nih_unref (job->stop_env, job); job->stop_env = NULL; job_finished (job, FALSE); if (blocked) nih_list_add (&job->blocking, &blocked->entry); job_change_goal (job, JOB_STOP); if (! wait) NIH_ZERO (job_stop_reply (message)); return 0; } /** * job_restart: * @job: job to be restarted, * @message: D-Bus connection and message received, * @wait: whether to wait for command to finish before returning. * * Implements the top half of the Restart method of the * com.ubuntu.Upstart.Instance interface, the bottom half may be found in * job_finished(). * * Called on a running instance @job to cause it to be restarted. If the * instance goal is already stop, the com.ubuntu.Upstart.Error.AlreadyStopped * D-Bus error will be returned immediately. If the instance fails to * restart, the com.ubuntu.Upstart.Error.JobFailed D-Bus error will * be returned when the problem occurs. * * When @wait is TRUE the method call will not return until the job has * finished starting again (running for tasks); when @wait is FALSE, the * method call returns once the command has been processed and the goal * changed. * * Returns: zero on success, negative value on raised error. **/ int job_restart (Job *job, NihDBusMessage *message, int wait) { Session *session; Blocked *blocked = NULL; nih_assert (job != NULL); nih_assert (message != NULL); /* Don't permit out-of-session modification */ session = session_from_dbus (NULL, message); if (session != job->class->session) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job: %s"), job_name (job)); return -1; } if (job->goal == JOB_STOP) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.AlreadyStopped", _("Job has already been stopped: %s"), job_name (job)); return -1; } if (wait) { blocked = blocked_new (job, BLOCKED_INSTANCE_RESTART_METHOD, message); if (! blocked) nih_return_system_error (-1); } if (job->start_env) nih_unref (job->start_env, job); job->start_env = NULL; if (job->stop_env) nih_unref (job->stop_env, job); job->stop_env = NULL; job_finished (job, FALSE); if (blocked) nih_list_add (&job->blocking, &blocked->entry); job_change_goal (job, JOB_STOP); job_change_goal (job, JOB_START); if (! wait) NIH_ZERO (job_restart_reply (message)); return 0; } /** * job_reload: * @job: job to reload, * @message: D-Bus connection and message received, * * Implements the Reload method of the com.ubuntu.Upstart.Instance * interface. * * Called on a running instance @job to reload. * * Returns: zero on success, negative value on raised error. **/ int job_reload (Job *job, NihDBusMessage *message) { Session *session; nih_assert (job != NULL); nih_assert (message != NULL); /* Don't permit out-of-session modification */ session = session_from_dbus (NULL, message); if (session != job->class->session) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.PermissionDenied", _("You do not have permission to modify job: %s"), job_name (job)); return -1; } if (job->pid[PROCESS_MAIN] <= 0) { nih_dbus_error_raise_printf ( DBUS_INTERFACE_UPSTART ".Error.NotRunning", _("Job is not running: %s"), job_name (job)); return -1; } if (kill (job->pid[PROCESS_MAIN], job->class->reload_signal) < 0) nih_return_system_error (-1); NIH_ZERO (job_reload_reply (message)); return 0; } /** * job_get_name: * @job: job to obtain name from, * @message: D-Bus connection and message received, * @name: pointer for reply string. * * Implements the get method for the name property of the * com.ubuntu.Upstart.Instance interface. * * Called to obtain the instance name of the given @job, which will be stored * in @name. * * Returns: zero on success, negative value on raised error. **/ int job_get_name (Job *job, NihDBusMessage *message, char **name) { nih_assert (job != NULL); nih_assert (message != NULL); nih_assert (name != NULL); *name = job->name; nih_ref (*name, message); return 0; } /** * job_get_goal: * @job: job to obtain goal from, * @message: D-Bus connection and message received, * @goal: pointer for reply string. * * Implements the get method for the goal property of the * com.ubuntu.Upstart.Instance interface. * * Called to obtain the goal of the given @job as a string, which will be * stored in @goal. * * Returns: zero on success, negative value on raised error. **/ int job_get_goal (Job *job, NihDBusMessage *message, char **goal) { nih_assert (job != NULL); nih_assert (message != NULL); nih_assert (goal != NULL); *goal = nih_strdup (message, job_goal_name (job->goal)); if (! *goal) nih_return_no_memory_error (-1); return 0; } /** * job_get_state: * @job: job to obtain state from, * @message: D-Bus connection and message received, * @state: pointer for reply string. * * Implements the get method for the state property of the * com.ubuntu.Upstart.Instance interface. * * Called to obtain the state of the given @job as a string, which will be * stored in @state. * * Returns: zero on success, negative value on raised error. **/ int job_get_state (Job *job, NihDBusMessage *message, char **state) { nih_assert (job != NULL); nih_assert (message != NULL); nih_assert (state != NULL); *state = nih_strdup (message, job_state_name (job->state)); if (! *state) nih_return_no_memory_error (-1); return 0; } /** * job_get_processes: * @job: job to obtain state from, * @message: D-Bus connection and message received, * @processes: pointer for reply array. * * Implements the get method for the processes property of the * com.ubuntu.Upstart.Instance interface. * * Called to obtain the current set of processes for the given @job as an * array of process names and pids, which will be stored in @processes. * * Returns: zero on success, negative value on raised error. **/ int job_get_processes (Job * job, NihDBusMessage * message, JobProcessesElement ***processes) { size_t num_processes; nih_assert (job != NULL); nih_assert (message != NULL); nih_assert (processes != NULL); *processes = nih_alloc (message, sizeof (JobProcessesElement *) * 1); if (! *processes) nih_return_no_memory_error (-1); num_processes = 0; (*processes)[num_processes] = NULL; for (int i = 0; i < PROCESS_LAST; i++) { JobProcessesElement * process; JobProcessesElement **tmp; if (job->pid[i] <= 0) continue; process = nih_new (*processes, JobProcessesElement); if (! process) { nih_error_raise_no_memory (); nih_free (*processes); return -1; } process->item0 = nih_strdup (process, process_name (i)); if (! process->item0) { nih_error_raise_no_memory (); nih_free (*processes); return -1; } process->item1 = job->pid[i]; tmp = nih_realloc (*processes, message, (sizeof (JobProcessesElement *) * (num_processes + 2))); if (! tmp) { nih_error_raise_no_memory (); nih_free (*processes); return -1; } *processes = tmp; (*processes)[num_processes++] = process; (*processes)[num_processes] = NULL; } return 0; } /** * job_serialise: * @job: job serialise. * * Convert @job into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Note that the 'class' element is not encoded - it is assumed the * caller will encode the returned JSON Job object as a child of the * parent JSON-encoded JobClass object so a reference is not required. * * Returns: JSON-serialised Job object, or NULL on error. **/ json_object * job_serialise (const Job *job) { json_object *json; json_object *json_pid; json_object *json_fds; json_object *json_logs; json_object *json_handler_data; nih_assert (job); json = json_object_new_object (); if (! json) return NULL; if (! state_set_json_string_var_from_obj (json, job, name)) goto error; if (! state_set_json_string_var_from_obj (json, job, path)) goto error; if (! state_set_json_enum_var (json, job_goal_enum_to_str, "goal", job->goal)) goto error; if (! state_set_json_enum_var (json, job_state_enum_to_str, "state", job->state)) goto error; if (! state_set_json_str_array_from_obj (json, job, env)) goto error; if (! state_set_json_str_array_from_obj (json, job, start_env)) goto error; if (! state_set_json_str_array_from_obj (json, job, stop_env)) goto error; if (job->stop_on) { json_object *json_stop_on; json_stop_on = event_operator_serialise_all (job->stop_on); if (! json_stop_on) goto error; json_object_object_add (json, "stop_on", json_stop_on); } json_fds = state_serialise_int_array (int, job->fds, job->num_fds); if (! json_fds) goto error; json_object_object_add (json, "fds", json_fds); json_pid = state_serialise_int_array (pid_t, job->pid, PROCESS_LAST); if (! json_pid) goto error; json_object_object_add (json, "pid", json_pid); /* Encode the blocking event as an index number which represents * the event's position in the JSON events array. */ if (job->blocker) { int event_index; event_index = event_to_index (job->blocker); if (event_index < 0) goto error; /* For consistency, it would be preferable to encode the * event name, but the index is actually better since it is * simple and unambiguous - encoding the name would also require * us to encode the env to make the event unique. */ if (! state_set_json_int_var (json, "blocker", event_index)) goto error; } if (! NIH_LIST_EMPTY (&job->blocking)) { json_object *json_blocking; json_blocking = state_serialise_blocking (&job->blocking); if (! json_blocking) goto error; json_object_object_add (json, "blocking", json_blocking); } /* conditionally encode kill timer */ if (job->kill_timer) { json_object *kill_timer; kill_timer = job_serialise_kill_timer (job->kill_timer); if (! kill_timer) goto error; json_object_object_add (json, "kill_timer", kill_timer); } if (! state_set_json_enum_var (json, process_type_enum_to_str, "kill_process", job->kill_process)) goto error; if (! state_set_json_int_var_from_obj (json, job, failed)) goto error; if (! state_set_json_enum_var (json, process_type_enum_to_str, "failed_process", job->failed_process)) goto error; if (! state_set_json_int_var_from_obj (json, job, exit_status)) goto error; if (! state_set_json_int_var_from_obj (json, job, respawn_time)) goto error; if (! state_set_json_int_var_from_obj (json, job, respawn_count)) goto error; if (! state_set_json_int_var_from_obj (json, job, trace_forks)) goto error; if (! state_set_json_enum_var (json, job_trace_state_enum_to_str, "trace_state", job->trace_state)) goto error; json_logs = json_object_new_array (); if (! json_logs) return json; for (int process = 0; process < PROCESS_LAST; process++) { json_object *json_log; json_log = log_serialise (job->log[process]); if (! json_log) goto error; if (json_object_array_add (json_logs, json_log) < 0) goto error; } json_object_object_add (json, "log", json_logs); json_handler_data = json_object_new_array (); if (! json_handler_data) return json; for (int process = 0; process < PROCESS_LAST; process++) { json_object *json_data = NULL; /* Only bother serialising if the process data hasn't * been handled yet. */ if (job->process_data[process] && job->process_data[process]->valid) { json_data = job_process_data_serialise (job, job->process_data[process]); if (! json_data) goto error; } if (json_object_array_add (json_handler_data, json_data) < 0) goto error; } json_object_object_add (json, "process_data", json_handler_data); return json; error: json_object_put (json); return NULL; } /** * job_serialise_all: * * Convert existing Job objects to JSON representation. * * Returns: JSON object containing array of Job objects, or NULL on error. **/ json_object * job_serialise_all (const NihHash *jobs) { json_object *json; nih_assert (jobs); json = json_object_new_array (); if (! json) return NULL; NIH_HASH_FOREACH (jobs, iter) { json_object *json_job; Job *job = (Job *)iter; json_job = job_serialise (job); if (! json_job) goto error; json_object_array_add (json, json_job); } return json; error: json_object_put (json); return NULL; } /** * job_deserialise: * @parent: job class for JSON-encoded jobs, * @json: JSON-serialised Job object to deserialise. * * XXX: All events must have been deserialised prior to this function * XXX: being called. * * Returns: Job object, or NULL on error. **/ Job * job_deserialise (JobClass *parent, json_object *json) { nih_local char *name = NULL; Job *job = NULL; json_object *json_kill_timer; json_object *json_fds; json_object *json_pid; json_object *json_logs; json_object *json_process_data; json_object *json_stop_on = NULL; size_t len; int ret; nih_assert (parent); nih_assert (json); if (! state_check_json_type (json, object)) return NULL; if (! state_get_json_string_var_strict (json, "name", NULL, name)) goto error; job = NIH_MUST (job_new (parent, name)); if (! job) return NULL; if (! state_get_json_string_var_to_obj_strict (json, job, path)) goto error; if (! state_get_json_enum_var (json, job_goal_str_to_enum, "goal", job->goal)) goto error; if (! state_get_json_enum_var (json, job_state_str_to_enum, "state", job->state)) goto error; if (! state_get_json_env_array_to_obj (json, job, env)) goto error; if (! state_get_json_env_array_to_obj (json, job, start_env)) goto error; if (! state_get_json_env_array_to_obj (json, job, stop_env)) goto error; if (json_object_object_get_ex (json, "stop_on", &json_stop_on)) { if (state_check_json_type (json_stop_on, array)) { job->stop_on = event_operator_deserialise_all (job, json_stop_on); if (! job->stop_on) goto error; } else { nih_local char *stop_on = NULL; /* Old format (string) * * Note that we re-search for the JSON key here * (json, rather than json_stop_on) to allow * the use of the convenience macro. This is * of course slower, but its a legacy scenario. */ if (! state_get_json_string_var_strict (json, "stop_on", NULL, stop_on)) goto error; if (*stop_on) { nih_local JobClass *tmp = NULL; tmp = NIH_MUST (job_class_new (NULL, "tmp", NULL)); tmp->stop_on = parse_on_simple (tmp, "stop", stop_on); if (! tmp->stop_on) { NihError *err; err = nih_error_get (); nih_error ("%s %s: %s", _("BUG"), _("instance 'stop on' parse error"), err->message); nih_free (err); goto error; } nih_free (job->stop_on); job->stop_on = event_operator_copy (job, tmp->stop_on); if (! job->stop_on) goto error; } } } /* fds and num_fds handled by caller */ /* pid handled by caller */ /* blocking is handled by state_deserialise_blocking() */ if (json_object_object_get_ex (json, "blocker", NULL)) { int event_index = -1; if (! state_get_json_int_var (json, "blocker", event_index)) goto error; job->blocker = event_from_index (event_index); if (! job->blocker) goto error; } if (! state_get_json_enum_var (json, process_type_str_to_enum, "kill_process", job->kill_process)) goto error; /* Check to see if a kill timer exists first since we do not * want to end up creating a real but empty timer. */ if (json_object_object_get_ex (json, "kill_timer", &json_kill_timer)) { /* Found a partial kill timer, so create a new one and * adjust its due time. By the time the main loop gets * called, the due time will probably be in the past * such that the job will be stopped. * * To be completely fair we should: * * - encode the time at the point of serialisation in a * JSON 'meta' header. * - query the time post-deserialisation and calculate * the delta (being the time to perform the stateful * re-exec). * - add that time to all jobs with active kill timers * to give their processes the full amount of time to * end. */ nih_local NihTimer *kill_timer = job_deserialise_kill_timer (json_kill_timer); if (! kill_timer) goto error; nih_assert (job->kill_process); job_process_set_kill_timer (job, job->kill_process, kill_timer->timeout); job_process_adj_kill_timer (job, kill_timer->due); } if (! state_get_json_int_var_to_obj (json, job, failed)) goto error; if (! state_get_json_enum_var (json, process_type_str_to_enum, "failed_process", job->failed_process)) goto error; if (! state_get_json_int_var_to_obj (json, job, exit_status)) goto error; if (! state_get_json_int_var_to_obj (json, job, respawn_time)) goto error; if (! state_get_json_int_var_to_obj (json, job, respawn_count)) goto error; if (! json_object_object_get_ex (json, "fds", &json_fds)) goto error; ret = state_deserialise_int_array (job, json_fds, int, &job->fds, &job->num_fds); if (ret < 0) goto error; if (! json_object_object_get_ex (json, "pid", &json_pid)) goto error; ret = state_deserialise_int_array (job, json_pid, pid_t, &job->pid, &len); if (ret < 0) goto error; /* If we are missing one, we're probably importing from a * previous version that didn't include PROCESS_SECURITY. * Simply add the missing one. */ if (len == PROCESS_LAST - 1) { job->pid = nih_realloc (job->pid, job, sizeof (pid_t) * PROCESS_LAST); if (! job->pid) goto error; job->pid[PROCESS_LAST - 1] = 0; } else if (len != PROCESS_LAST) { goto error; } if (! state_get_json_int_var_to_obj (json, job, trace_forks)) goto error; if (! state_get_json_enum_var (json, job_trace_state_str_to_enum, "trace_state", job->trace_state)) goto error; if (! json_object_object_get_ex (json, "log", &json_logs)) goto error; if (! state_check_json_type (json_logs, array)) goto error; for (int process = 0; process < PROCESS_LAST; process++) { json_object *json_log; json_log = json_object_array_get_idx (json_logs, process); if (json_log) { /* NULL if there was no log configured, or we failed to * deserialise it; either way, this should be non-fatal. */ job->log[process] = log_deserialise (job->log, json_log); } else { /* If we are missing one, we're probably importing from a * previous version that didn't include PROCESS_SECURITY. * Simply ignore the missing one. */ if (process == PROCESS_LAST - 1) { job->log[process] = NULL; } else { goto error; } } } if (json_object_object_get_ex (json, "process_data", &json_process_data)) { if (! state_check_json_type (json_process_data, array)) goto error; for (int process = 0; process < PROCESS_LAST; process++) { json_object *json_data = NULL; json_data = json_object_array_get_idx (json_process_data, process); if (json_data) { /* NULL if there was no process_data for this job process, or we failed to * deserialise it; either way, this should be non-fatal. */ job->process_data[process] = job_process_data_deserialise (job->process_data, job, json_data); if (! job->process_data[process]) goto error; /* Recreate watch */ if (job->process_data[process]->valid) { job_register_child_handler (job->process_data[process], job->process_data[process]->job_process_fd, job->process_data[process]); } } else { job->process_data[process] = NULL; } } } return job; error: nih_free (job); return NULL; } /** * job_deserialise_all: * * @parent: job class for JSON-encoded jobs, * @json: root of JSON-serialised state. * * Convert JSON representation of jobs back into Job objects associated * with @parent. * * Returns: 0 on success, -1 on error. **/ int job_deserialise_all (JobClass *parent, json_object *json) { json_object *json_jobs; Job *job; nih_assert (parent); nih_assert (json); if (! json_object_object_get_ex (json, "jobs", &json_jobs)) goto error; if (! state_check_json_type (json_jobs, array)) goto error; for (int i = 0; i < json_object_array_length (json_jobs); i++) { json_object *json_job; json_job = json_object_array_get_idx (json_jobs, i); if (! json_job) goto error; if (! state_check_json_type (json_job, object)) goto error; job = job_deserialise (parent, json_job); if (! job) goto error; } return 0; error: return -1; } /** * job_goal_enum_to_str: * * @goal: JobGoal. * * Convert JobGoal to a string representation. * * Returns: string representation of @goal, or NULL if not known. **/ static const char * job_goal_enum_to_str (JobGoal goal) { state_enum_to_str (JOB_STOP, goal); state_enum_to_str (JOB_START, goal); state_enum_to_str (JOB_RESPAWN, goal); return NULL; } /** * job_goal_str_to_enum: * * @goal: string JobGoal value. * * Convert @goal back into enum value. * * Returns: JobGoal representation of @goal, or -1 if not known. **/ static JobGoal job_goal_str_to_enum (const char *goal) { state_str_to_enum (JOB_STOP, goal); state_str_to_enum (JOB_START, goal); state_str_to_enum (JOB_RESPAWN, goal); return -1; } /** * job_state_enum_to_str: * * @state: JobState. * * Convert JobState to a string representation. * * Returns: string representation of @state, or NULL if not known. **/ const char * job_state_enum_to_str (JobState state) { state_enum_to_str (JOB_WAITING, state); state_enum_to_str (JOB_STARTING, state); state_enum_to_str (JOB_SECURITY_SPAWNING, state); state_enum_to_str (JOB_SECURITY, state); state_enum_to_str (JOB_PRE_STARTING, state); state_enum_to_str (JOB_PRE_START, state); state_enum_to_str (JOB_SPAWNING, state); state_enum_to_str (JOB_SPAWNED, state); state_enum_to_str (JOB_POST_STARTING, state); state_enum_to_str (JOB_POST_START, state); state_enum_to_str (JOB_RUNNING, state); state_enum_to_str (JOB_PRE_STOPPING, state); state_enum_to_str (JOB_PRE_STOP, state); state_enum_to_str (JOB_STOPPING, state); state_enum_to_str (JOB_KILLED, state); state_enum_to_str (JOB_POST_STOPPING, state); state_enum_to_str (JOB_POST_STOP, state); return NULL; } /** * job_state_str_to_enum: * * @state: string JobState value. * * Convert @state back into enum value. * * Returns: JobState representation of @state, or -1 if not known. **/ JobState job_state_str_to_enum (const char *state) { state_str_to_enum (JOB_WAITING, state); state_str_to_enum (JOB_STARTING, state); state_str_to_enum (JOB_SECURITY_SPAWNING, state); state_str_to_enum (JOB_SECURITY, state); state_str_to_enum (JOB_PRE_STARTING, state); state_str_to_enum (JOB_PRE_START, state); state_str_to_enum (JOB_SPAWNING, state); state_str_to_enum (JOB_SPAWNED, state); state_str_to_enum (JOB_POST_STARTING, state); state_str_to_enum (JOB_POST_START, state); state_str_to_enum (JOB_RUNNING, state); state_str_to_enum (JOB_PRE_STOPPING, state); state_str_to_enum (JOB_PRE_STOP, state); state_str_to_enum (JOB_STOPPING, state); state_str_to_enum (JOB_KILLED, state); state_str_to_enum (JOB_POST_STOPPING, state); state_str_to_enum (JOB_POST_STOP, state); return -1; } /** * job_state_enum_to_str: * * @state: TraceState. * * Convert TraceState to a string representation. * * Returns: string representation of @state, or NULL if not known. **/ static const char * job_trace_state_enum_to_str (TraceState state) { state_enum_to_str (TRACE_NONE, state); state_enum_to_str (TRACE_NEW, state); state_enum_to_str (TRACE_NEW_CHILD, state); state_enum_to_str (TRACE_NORMAL, state); return NULL; } /** * job_trace_state_str_to_enum: * * @state: string TraceState value. * * Convert @state back into enum value. * * Returns: TraceState representation of @state, or -1 if not known. **/ static TraceState job_trace_state_str_to_enum (const char *state) { state_str_to_enum (TRACE_NONE, state); state_str_to_enum (TRACE_NEW, state); state_str_to_enum (TRACE_NEW_CHILD, state); state_str_to_enum (TRACE_NORMAL, state); return -1; } /** * job_serialise_kill_timer: * * @timer: NihTimer to serialise. * * Serialise @timer into JSON. * * Returns: JSON-serialised NihTimer object, or NULL on error. **/ static json_object * job_serialise_kill_timer (NihTimer *timer) { json_object *json; nih_assert (timer); json = json_object_new_object (); if (! json) return NULL; if (! state_set_json_int_var_from_obj (json, timer, timeout)) goto error; if (! state_set_json_int_var_from_obj (json, timer, due)) goto error; return json; error: json_object_put (json); return NULL; } /** * job_deserialise_kill_timer: * * @json: JSON representation of NihTimer. * * Deserialise @json back into an NihTimer. * * Returns: NihTimer on NULL on error. **/ static NihTimer * job_deserialise_kill_timer (json_object *json) { NihTimer *timer; nih_assert (json); timer = nih_new (NULL, NihTimer); if (! timer) return NULL; memset (timer, '\0', sizeof (NihTimer)); if (! state_get_json_int_var_to_obj (json, timer, due)) goto error; if (! state_get_json_int_var_to_obj (json, timer, timeout)) goto error; return timer; error: nih_free (timer); return NULL; } /** * job_find: * * @session: session of job class, * @job_class: name of job class, * @job_name: name of job instance. * * Lookup job based on parent class name and * job instance name. * * Returns: existing Job on success, or NULL if job class or * job are not found in @session. **/ Job * job_find (const Session *session, JobClass *class, const char *job_class, const char *job_name) { Job *job; nih_assert (class || job_class); nih_assert (job_classes); if (! job_name) goto error; if (! class) class = job_class_get_registered (job_class, session); if (! class) goto error; job = (Job *)nih_hash_lookup (class->instances, job_name); if (! job) goto error; return job; error: return NULL; } /** * job_needs_cgroups: * * @job: job. * * Determine if specified job requires cgroups. * * Returns: TRUE if @job needs atleast 1 cgroup, else FALSE. **/ int job_needs_cgroups (const Job *job) { nih_assert (job); #ifdef ENABLE_CGROUPS return job_class_cgroups (job->class); #else /* No cgroup support */ return FALSE; #endif /* ENABLE_CGROUPS */ } /** * job_child_error_handler: * * @job: job, * @process: process that failed to start. * * JobProcessErrorHandler that deals with errors resulting from * a failure to start a job process. **/ void job_child_error_handler (Job *job, ProcessType process) { nih_assert (job); nih_assert (process > PROCESS_INVALID); nih_assert (process < PROCESS_LAST); job->pid[process] = 0; switch (process) { case PROCESS_SECURITY: job_failed (job, PROCESS_SECURITY, -1); job_change_goal (job, JOB_STOP); break; case PROCESS_PRE_START: job_failed (job, PROCESS_PRE_START, -1); job_change_goal (job, JOB_STOP); job_change_state (job, job_next_state (job)); break; case PROCESS_MAIN: job_failed (job, PROCESS_MAIN, -1); job_change_goal (job, JOB_STOP); job_change_state (job, job_next_state (job)); break; case PROCESS_POST_START: job_change_state (job, job_next_state (job)); break; case PROCESS_PRE_STOP: job_change_state (job, job_next_state (job)); break; case PROCESS_POST_STOP: job_failed (job, PROCESS_POST_STOP, -1); job_change_goal (job, JOB_STOP); job_change_state (job, job_next_state (job)); break; default: nih_assert_not_reached (); } } #ifdef ENABLE_CGROUPS /** * job_last_process: * * @job: job, * @process: process. * * Returns: TRUE if the last defined process for @job is @process, * else FALSE. **/ int job_last_process (const Job *job, ProcessType process) { ProcessType i; ProcessType last = PROCESS_INVALID; nih_assert (job); nih_assert (process >= PROCESS_MAIN); nih_assert (process < PROCESS_LAST); for (i = 0; i < PROCESS_LAST; i++) { if (job->class->process[i]) last = i; } return last == process ? TRUE : FALSE; } #endif /* ENABLE_CGROUPS */ upstart-1.13.2/init/event.c0000664000175000017500000004644512373101356012471 00000000000000/* upstart * * event.c - event queue and handling * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include "environ.h" #include "event.h" #include "job.h" #include "blocked.h" #include "control.h" #include "errors.h" #include "quiesce.h" #include "com.ubuntu.Upstart.h" #ifdef ENABLE_CGROUPS #include "cgroup.h" #endif /* ENABLE_CGROUPS */ /* Prototypes for static functions */ static void event_pending (Event *event); static void event_pending_handle_jobs (Event *event); static void event_finished (Event *event); static const char * event_progress_enum_to_str (EventProgress progress) __attribute__ ((warn_unused_result)); static EventProgress event_progress_str_to_enum (const char *name) __attribute__ ((warn_unused_result)); extern json_object *json_events; /** * events: * * This list holds the list of events in the process of pending, being * handled or awaiting cleanup; each item is an Event structure. **/ NihList *events = NULL; /** * event_init: * * Initialise the event list. **/ void event_init (void) { if (! events) events = NIH_MUST (nih_list_new (NULL)); } /** * event_new: * @parent: parent object for new event, * @name: name of event to emit, * @env: NULL-terminated array of environment variables for event. * * Allocates an Event structure for the event details given and * appends it to the queue of events. * * @env is optional, and may be NULL; if given it should be a NULL-terminated * array of environment variables in KEY=VALUE form. @env will be referenced * by the new event. After calling this function, you should never use * nih_free() to free @env and instead use nih_unref() or nih_discard() if * you no longer need to use it. * * When the event reaches the top of the queue, it is taken off and placed * into the handling queue. It is not removed from that queue until there * are no remaining references to it. * * The event is created with nothing blocking it. Be sure to call * event_block() otherwise it will be automatically freed next time * through the main loop. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned event. When all parents * of the returned event are freed, the returned event will also be * freed. * * Returns: new Event structure pending in the queue or NULL if insufficent * memory. **/ Event * event_new (const void *parent, const char *name, char **env) { Event *event; nih_assert (name != NULL); nih_assert (strlen (name) > 0); event_init (); event = nih_new (parent, Event); if (! event) return NULL; nih_list_init (&event->entry); event->session = NULL; event->fd = -1; event->progress = EVENT_PENDING; event->failed = FALSE; event->blockers = 0; nih_list_init (&event->blocking); nih_alloc_set_destructor (event, nih_list_destroy); /* Fill in the event details */ event->name = nih_strdup (event, name); if (! event->name) { nih_free (event); return NULL; } event->env = env; if (event->env) nih_ref (event->env, event); /* Place it in the pending list */ nih_debug ("Pending %s event", name); nih_list_add (events, &event->entry); nih_main_loop_interrupt (); return event; } /** * event_block: * @event: event to block. * * This function should be called by jobs that wish to hold a reference on * the event and block it from finishing. * * Once the reference is no longer needed, you must call event_unblock() * to allow the event to be finished, and potentially freed. **/ void event_block (Event *event) { nih_assert (event != NULL); event->blockers++; } /** * event_unblock: * @event: event to unblock. * * This function should be called by jobs that are holding a reference on the * event which blocks it from finishing, and wish to discard that reference. * * It must match a previous call to event_block(). **/ void event_unblock (Event *event) { nih_assert (event != NULL); nih_assert (event->blockers > 0); event->blockers--; } /** * event_poll: * * This function is used to process the list of events; any in the pending * state are moved into the handling state and job states changed. Any * in the finished state will have subscribers and jobs notified that the * event has completed. * * Events remain in the handling state while they have blocking jobs. * * This function will only return once the events list is empty, or all * events are in the handling state; so any time an event queues another, * it will be processed immediately. * * Normally this function is used as a main loop callback. **/ void event_poll (void) { int poll_again; event_init (); do { poll_again = FALSE; NIH_LIST_FOREACH_SAFE (events, iter) { Event *event = (Event *)iter; /* Ignore events that we're handling and are * blocked, there's nothing we can do to hurry them. * * Decide whether to poll again based on the state * before handling the event; that way we always loop * at least once more after finding a pending or * finished event, in case they added new events as * a side effect that we missed. */ switch (event->progress) { case EVENT_PENDING: event_pending (event); poll_again = TRUE; /* fall through */ case EVENT_HANDLING: if (event->blockers) break; event->progress = EVENT_FINISHED; /* fall through */ case EVENT_FINISHED: event_finished (event); poll_again = TRUE; break; default: nih_assert_not_reached (); } } } while (poll_again); } /** * event_pending: * @event: pending event. * * This function is called for each event in the list that is in the pending * state. Subscribers to emitted events are notified, and the event is * passed to the job system to start or stop any. * * The event is marked as handling; if no jobs took it, then it is * immediately finished. **/ static void event_pending (Event *event) { nih_assert (event != NULL); nih_assert (event->progress == EVENT_PENDING); nih_info (_("Handling %s event"), event->name); event->progress = EVENT_HANDLING; event_pending_handle_jobs (event); } /** * event_pending_handle_jobs: * @event: event to be handled. * * This function is called whenever an event reaches the handling state. * It iterates the list of jobs and stops or starts any necessary. **/ static void event_pending_handle_jobs (Event *event) { int empty = TRUE; #ifdef ENABLE_CGROUPS int warn = FALSE; #endif /* ENABLE_CGROUPS */ nih_assert (event != NULL); job_class_init (); NIH_HASH_FOREACH_SAFE (job_classes, iter) { JobClass *class = (JobClass *)iter; /* Only affect jobs within the same session as the event * unless the event has no session, in which case do them * all. */ if (event->session && (class->session != event->session)) continue; /* We stop first so that if an event is listed both as a * stop and start event, it causes an active running process * to be killed, and then stop script then the start script * to be run. In any other state, it has no special effect. * * (The other way around would be just strange, it'd cause * a process's start and stop scripts to be run without the * actual process). */ NIH_HASH_FOREACH_SAFE (class->instances, job_iter) { Job *job = (Job *)job_iter; if (job->stop_on && event_operator_handle (job->stop_on, event, job->env) && job->stop_on->value) { if (job->goal != JOB_STOP) { size_t len = 0; if (job->stop_env) nih_unref (job->stop_env, job); job->stop_env = NULL; /* Collect environment that stopped * the job for the pre-stop script; * it can make a more informed * decision whether the stop is valid. * We don't add class environment * since this is appended to the * existing job environment. */ NIH_MUST (event_operator_environment ( job->stop_on, &job->stop_env, job, &len, "UPSTART_STOP_EVENTS")); job_finished (job, FALSE); event_operator_events ( job->stop_on, job, &job->blocking); job_change_goal (job, JOB_STOP); } event_operator_reset (job->stop_on); } } /* If the job has specified a cgroup stanza, do not * start it until the cgroup manager is available. Also, * block any events that the job requires such that when * the cgroup manager is available, the job may be * started. */ #ifdef ENABLE_CGROUPS if (class->start_on && job_class_cgroups (class)) { if (cgroup_manager_available ()) { if (class->cgmanager_wait) { /* Unref the events that were ref'ed * whilst waiting for the cgroup manager * to become available. */ event_operator_reset (class->start_on); class->cgmanager_wait = FALSE; } } else { warn = TRUE; /* Reference the event to stop it being destroyed since it will * be required by the job once the cgroup manager eventually * becomes available. */ if (! class->cgmanager_wait) { if (event_operator_handle (class->start_on, event, NULL)) class->cgmanager_wait = TRUE; } continue; } } #endif /* ENABLE_CGROUPS */ /* Now we match the start events for the class to see * whether we need a new instance. */ if (class->start_on && event_operator_handle (class->start_on, event, NULL) && class->start_on->value) { if (! job_class_induct_job (class)) return; } } #ifdef ENABLE_CGROUPS if (warn) nih_debug ("Cannot start some jobs until cgroup manager available"); #endif /* ENABLE_CGROUPS */ if (! quiesce_in_progress ()) return; /* Determine if any job instances remain */ NIH_HASH_FOREACH_SAFE (job_classes, iter) { JobClass *class = (JobClass *)iter; NIH_HASH_FOREACH_SAFE (class->instances, job_iter) { empty = FALSE; break; } if (! empty) break; } /* If no instances remain, force quiesce to finish */ if (empty) quiesce_complete (); } /** * event_finished: * @event: finished event. * * This function is called for each event in the list that is in the finished * state. Subscribers and jobs are notified, then, if the event failed, a * new pending failed event is queued. Finally the event is freed and * removed from the list. **/ static void event_finished (Event *event) { nih_assert (event != NULL); nih_assert (event->progress == EVENT_FINISHED); nih_debug ("Finished %s event", event->name); NIH_LIST_FOREACH_SAFE (&event->blocking, iter) { Blocked *blocked = (Blocked *)iter; switch (blocked->type) { case BLOCKED_JOB: /* Event was blocking a job, let it enter the * next state. */ blocked->job->blocker = NULL; job_change_state (blocked->job, job_next_state (blocked->job)); break; case BLOCKED_EMIT_METHOD: /* Event was blocking an emit method call, send * the reply, or an error if the event failed. */ if (event->failed) { NIH_ZERO (nih_dbus_message_error ( blocked->message, DBUS_INTERFACE_UPSTART ".Error.EventFailed", "%s", _("Event failed"))); } else { NIH_ZERO (control_emit_event_reply ( blocked->message)); } break; default: nih_assert_not_reached (); } nih_free (blocked); } close (event->fd); if (event->failed) { char *name; name = strrchr (event->name, '/'); if ((! name) || strcmp (name, "/failed")) { nih_local char *failed = NULL; Event *new_event; failed = NIH_MUST (nih_sprintf (NULL, "%s/failed", event->name)); new_event = NIH_MUST (event_new (NULL, failed, NULL)); new_event->session = event->session; if (event->env) new_event->env = NIH_MUST (nih_str_array_copy ( new_event, NULL, event->env)); } } control_notify_event_emitted (event); nih_free (event); } /** * event_serialise: * @event: event to serialise. * * Convert @event into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Note that event->blocking is NOT serialised. Instead, those objects * which event->blocking refers to encode the fact that they are blocked * on the event (index in the JSON) in question. Deserialisation * restores event->blocking via a 2-pass technique. event->blockers is * recorded to allow a double-check. * * Returns: JSON-serialised Event object, or NULL on error. **/ json_object * event_serialise (const Event *event) { json_object *json; int session_index; nih_assert (event); nih_assert (event->name); json = json_object_new_object (); if (! json) return NULL; session_index = session_get_index (event->session); if (session_index < 0) goto error; if (! state_set_json_int_var (json, "session", session_index)) goto error; if (! state_set_json_string_var_from_obj (json, event, name)) goto error; if (event->env) { if (! state_set_json_str_array_from_obj (json, event, env)) goto error; } if (! state_set_json_int_var_from_obj (json, event, fd)) goto error; if (! state_set_json_enum_var (json, event_progress_enum_to_str, "progress", event->progress)) goto error; if (! state_set_json_int_var_from_obj (json, event, failed)) goto error; if (! state_set_json_int_var_from_obj (json, event, blockers)) goto error; if (! NIH_LIST_EMPTY (&event->blocking)) { json_object *json_blocking; json_blocking = state_serialise_blocking (&event->blocking); if (! json_blocking) goto error; json_object_object_add (json, "blocking", json_blocking); } return json; error: json_object_put (json); return NULL; } /** * event_serialise_all: * * Convert existing Event objects to JSON representation. * * Returns: JSON object containing array of Events, or NULL on error. **/ json_object * event_serialise_all (void) { json_object *json; event_init (); json = json_object_new_array (); if (! json) return NULL; NIH_LIST_FOREACH (events, iter) { Event *event = (Event *)iter; json_object *json_event; json_event = event_serialise (event); if (! json_event) goto error; json_object_array_add (json, json_event); } return json; error: json_object_put (json); return NULL; } /** * event_deserialise: * @json: JSON-serialised Event object to deserialise. * * Convert @json into an Event object. * * Returns: Event object, or NULL on error. **/ Event * event_deserialise (json_object *json) { json_object *json_env; Event *event = NULL; nih_local char *name = NULL; nih_local char **env = NULL; int session_index = -1; nih_assert (json); if (! state_check_json_type (json, object)) return NULL; if (! state_get_json_string_var_strict (json, "name", NULL, name)) goto error; if (json_object_object_get_ex (json, "env", NULL)) { if (! state_get_json_var_full (json, "env", array, json_env)) goto error; if (! state_deserialise_str_array (NULL, json_env, &env)) goto error; } event = event_new (NULL, name, env); if (! event) return NULL; if (! state_get_json_int_var_to_obj (json, event, fd)) goto error; if (! state_get_json_int_var (json, "session", session_index)) goto error; /* can't check return value here (as all values are legitimate) */ event->session = session_from_index (session_index); if (! state_get_json_enum_var (json, event_progress_str_to_enum, "progress", event->progress)) goto error; if (! state_get_json_int_var_to_obj (json, event, failed)) goto error; /* We can only set the blockers count in the scenario that * EventOperators are serialised (since without this, it is not * possible to manually reconstruct the state of the * EventOperators post-re-exec. */ if (json_object_object_get_ex (json, "blockers", NULL)) { if (! state_get_json_int_var_to_obj (json, event, blockers)) goto error; } return event; error: nih_free (event); return NULL; } /** * event_deserialise_all: * * @json: root of JSON-serialised state. * * Convert JSON representation of events back into Event objects. * * Returns: 0 on success, -1 on error. **/ int event_deserialise_all (json_object *json) { Event *event; nih_assert (json); event_init (); nih_assert (NIH_LIST_EMPTY (events)); if (! json_object_object_get_ex (json, "events", &json_events)) goto error; if (! state_check_json_type (json_events, array)) goto error; for (int i = 0; i < json_object_array_length (json_events); i++) { json_object *json_event; json_event = json_object_array_get_idx (json_events, i); if (! json_event) goto error; if (! state_check_json_type (json_event, object)) goto error; event = event_deserialise (json_event); if (! event) goto error; } return 0; error: return -1; } /** * event_progress_enum_to_str: * * @progress: event progress. * * Convert EventProgress to a string representation. * * Returns: string representation of @progress, or NULL if not known. **/ static const char * event_progress_enum_to_str (EventProgress progress) { state_enum_to_str (EVENT_PENDING, progress); state_enum_to_str (EVENT_HANDLING, progress); state_enum_to_str (EVENT_FINISHED, progress); return NULL; } /** * event_progress_str_to_enum: * * @: name of EventOperator value. * * Convert string representation of EventProgress into a * real EventProgress value. * * Returns: EventProgress representing @progress, or -1 if not known. **/ static EventProgress event_progress_str_to_enum (const char *progress) { state_str_to_enum (EVENT_PENDING, progress); state_str_to_enum (EVENT_HANDLING, progress); state_str_to_enum (EVENT_FINISHED, progress); return -1; } /** * event_to_index: * * @event: event. * * Convert an Event to an index number within * the list of events. * * Returns: event index, or -1 on error. **/ int event_to_index (const Event *event) { int event_index = 0; int found = FALSE; nih_assert (event); event_init (); NIH_LIST_FOREACH (events, iter) { Event *tmp = (Event *)iter; if (tmp == event) { found = TRUE; break; } event_index++; } if (! found) return -1; return event_index; } /** * event_from_index: * * @event_index: event index number. * * Lookup Event based on index number. * * Returns: existing Event on success, or NULL if event not found. **/ Event * event_from_index (int event_index) { int i = 0; nih_assert (event_index >= 0); event_init (); NIH_LIST_FOREACH (events, iter) { Event *event = (Event *)iter; if (i == event_index) return event; i++; } return NULL; } upstart-1.13.2/init/apparmor.c0000664000175000017500000000456412373101356013165 00000000000000/* upstart * * apparmor.c - handle AppArmor profiles * * Copyright © 2013 Canonical Ltd. * Author: Marc Deslauriers . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include "apparmor.h" /** * apparmor_switch: * @profile: AppArmor profile to switch to * * This function switches to a new AppArmor profile on exec * * Returns: zero on success, -1 on error **/ int apparmor_switch (char *profile) { nih_local char *filename = NULL; FILE *f; nih_assert (profile != NULL); /* Silently fail if AppArmor isn't enabled. */ if (! apparmor_available()) return 0; filename = nih_sprintf (NULL, "/proc/%d/attr/exec", getpid()); if (! filename) return -1; f = fopen (filename, "w"); if (! f) return -1; fprintf (f, "exec %s\n", profile); if (fclose (f)) return -1; return 0; } /** * apparmor_available: * * This function checks to see if AppArmor is available and enabled * * Returns: TRUE if AppArmor is available, FALSE if it isn't **/ int apparmor_available (void) { struct stat statbuf; FILE *f; int value = 0; /* Do not load if AppArmor is disabled. */ f = fopen ("/sys/module/apparmor/parameters/enabled", "r"); if (! f) return FALSE; value = fgetc (f); if (fclose (f)) return FALSE; if (value != 'Y') return FALSE; /* Do not load if AppArmor parser isn't available. */ if (stat (APPARMOR_PARSER, &statbuf) == 0) { if(! (S_ISREG(statbuf.st_mode) && statbuf.st_mode & S_IXUSR)) return FALSE; } else { return FALSE; } return TRUE; } upstart-1.13.2/init/man/0000775000175000017500000000000012402042411012007 500000000000000upstart-1.13.2/init/man/init.50000664000175000017500000011215512373101356013000 00000000000000.TH init 5 2014-05-09 "Upstart" .\" .SH NAME init \- Upstart init daemon job configuration .\" .SH SYNOPSIS .TP .B /etc/init/ Default location of system job configuration files. .\" .TP .B $XDG_CONFIG_HOME/upstart/, $XDG_CONFIG_DIRS/upstart/ Default locations of user session job configuration files. .\" .TP .B $HOME/.init/ Deprecated location of user job configuration files (still honoured by User Session Mode). .\" .SH DESCRIPTION On startup, the Upstart .BR init (8) daemon reads its job configuration from files in the .I /etc/init/ directory by default, and watches for future changes to these files using .BR inotify (7). If Upstart was invoked as a user process with \-\-user option, it will run in User Session mode. See .B User Session Mode for further details. To be considered by Upstart, files in this directory must have a recognized suffix and may also be present in sub\-directories. There are two recognized suffixes: .IP \(bu 4 Files ending in .I .conf are called configuration files, or simply "conf files" for short. These are the primary vehicle for specifying a job. .IP \(bu 4 Files ending in .I .override are called override files. If an override file is present, the stanzas it contains take precedence over those equivalently named stanzas in the corresponding configuration file contents for a particular job. The main use for override files is to modify how a job will run without having to modify its configuration file directly. See the section \fBOverride File Handling\fP below for further details. .P A job can thus be defined by either: .IP \[bu] 2 A single configuration file. .IP \[bu] A single configuration file \fBand\fP a single override file. .P Unless explicitly stated otherwise, any reference to a jobs configuration can refer both to a configuration file or an override file. Each configuration file defines the template for a single \fIservice\fP (long-running process or daemon) or \fItask\fP (short-lived process). Note that a configuration file is not itself a job: it is a description of an environment a job could be run in. A job is the runtime embodiment of a configuration file. The configuration file name as displayed by Upstart and associated tooling is taken from its relative path within the directory without the extension. For example a configuration file .I /etc/init/rc-sysinit.conf is named .IR rc\-sysinit , while a configuration file .I /etc/init/net/apache.conf is named .IR net/apache . Since override files only modify the way a configuration file is interpreted, they are not named. Configuration files are plain text and should not be executable. .\" .SS Chroot Support Upstart is able to manage jobs within a \fBchroot\fP(2). To control jobs within the chroot environment, use the standard .BR initctl (8) facility. Note that it is not necessary to install D\-Bus within the chroot (in fact it is not recommended). Note that this facility is distinct from the \fBchroot\fR stanza (see .B Process environment below). .\" .SS User Session Mode Upstart can manage complete User Sessions. In this mode it runs with a process id greater than 1 and will read job configuration files from the following list of directories in the order shown: .IP \(bu 4 .I $XDG_CONFIG_HOME/upstart/ .IP \(bu 4 .I $HOME/.init/ .IP \(bu 4 .I $XDG_CONFIG_DIRS/upstart/ .IP \(bu 4 .I /usr/share/upstart/sessions/ .P Note that the first directory to contain a job is considered the owner of that job name: any subsequently searched directory that contains a job of the same name will be ignored. The same applies for override files: only the first override file found in the search order will be applied. Note that an override file can be in the same directory or earlier to that directory which contains the job file. Jobs in these locations are expected to launch the user's session. Upstart will try to parent all spawned process with the aid of .BR prctl (2) "" . If successful this will ensure that even double-forking daemons will be reparented to the User Session process, and not to the .BR init (8) daemon running with process id 1. When running in User Session mode, Upstart will kill all job processes on session logout or shutdown. All log output will be in .I $XDG_CACHE_HOME/upstart which defaults to .I $HOME/.cache/upstart . .\" .SS Configuration File Format Each line begins with a configuration stanza and continues until either the end of the line or a line containing a closing stanza. Line breaks within a stanza are permitted within single or double quotes, or if preceded by a blackslash. If a stanza is duplicated, the last occurence will be used. Unrecognized stanzas will generate parse errors, which will stop a job from running. Stanzas and their arguments are delimited by whitespace, which consists of one or more space or tab characters which are otherwise ignored unless placed within single or double quotes. Comments begin with a `#' and continue until the end of the line. Blank lines and lines consisting only of whitespace or comments are ignored. .\" .SS Process definition The primary use of jobs is to define services or tasks to be run by the .BR init (8) daemon. Each job may have one or more different processes run as part of its lifecycle, with the most common known as the main process. The main process is defined using either the .B exec or .B script stanzas, only one of which is permitted. These specify the executable or shell script that will be run when the job is considered to be running. Once this process terminates, the job stops. All processes are run with the full job environment available as environment variables in their process. .TP .B exec \fICOMMAND \fR[ \fIARG \fR]... This stanza defines the process to be run as the name of an executable on the filesystem, and zero or more arguments to be passed to it. Any special characters, e.g. quotes or `$' specified will result in the entire command being passed to a shell for expansion. .nf exec /usr/sbin/acpid \-c $EVENTSDIR \-s $SOCKET .fi .\" .TP .B script \fR... \fBend script This stanza defines the process to be run as a shell script that will be executed using .BR sh(1). The .I \-e shell option is always used, so any command that fails will terminate the script. The .B script stanza appears on its own on a line, the script is everything up until the first .B end script stanza appearing on its own on a line. .nf script dd bs=1 if=/proc/kmsg of=$KMSGSINK exec /sbin/klogd \-P $KMSGSINK end script .fi .PP There are an additional four processes that may be run as part of the job's lifecycle. These are specified as the process name, followed by an .B exec or .B script stanza. .TP .B pre\-start exec\fR|\fBscript\fR... This process will be run after the job's .BR starting (7) event has finished, but before the main process is run. It is typically used to prepare the environment, such as making necessary directories, and it may also call the .BR stop (8) command without arguments to cancel the start. .\" .TP .B post\-start exec\fR|\fBscript\fR... This process will be run before the job's .BR started (7) event is emitted, but after the main process has been spawned. It is typically used to send necessary commands to the main process, or to delay the .BR started (7) event until the main process is ready to receive clients. .\" .TP .B pre\-stop exec\fR|\fBscript\fR... This process is run if the job is stopped by an event listed in its .B stop on stanza or by the .BR stop (8) command. It will be run before the job's .BR stopping (7) event is emitted and before the main process is killed. It is typically used to send any necessary shutdown commands to the main process, and it may also call the .BR start (8) command without arguments to cancel the stop. .\" .TP .B post\-stop exec\fR|\fBscript\fR... This process is run after the main process has been killed and before the job's .BR stopped (7) event is emitted. It is typically used to clean up the environment, such as removing temporary directories. .PP All of these processes, including the main process, are optional. Services without a main process will appear to be running until they are stopped: this is commonly used to define states such as runlevels. It is permissible to have no main process, but to have .B pre\-start and .B post\-stop processes for the state. .RS .nf pre\-start exec ifup \-a post\-stop exec ifdown \-a .fi .RE .\" .SS Event definition Jobs can be manually started and stopped at any time by a system administrator using the .BR start (8) and .BR stop (8) tools, however it is far more useful for jobs to be started and stopped automatically by the .BR init (8) daemon when necessary. This is done by specifying which events should cause your job to be started, and which cause your process to be stopped again. The set of possible events is limitless, however there are a number of standard events defined by the .BR init (8) daemon and .BR telinit (8) tools that you will want to use. When first started, the .BR init (8) daemon will emit the .BR startup (7) event. This will activate jobs that implement System V compatibility and the .BR runlevel (7) event. As jobs are started and stopped, the .BR init (8) daemon will emit the .BR starting (7), .BR started (7), .BR stopping (7) and .BR stopped (7) events on their behalf. .TP .B start on \fIEVENT \fR[[\fIKEY=\fR]\fIVALUE\fR]... [\fBand\fR|\fBor\fR...] The .B start on stanza defines the set of events that will cause the job to be automatically started. Each .I EVENT is given by its name. Multiple events are permitted using the .B and & .B or logical operators, and complex expressions may be performed with parentheses (within which line breaks are permitted). You may also match on the environment variables contained within the event by specifying the .I KEY and expected .IR VALUE . If you know the order in which the variables are given to the event you may omit the .IR KEY . .I VALUE may contain wildcard matches and globs as permitted by .BR fnmatch (3) and may expand the value of any variable defined with the .B env stanza. Negation is permitted by using .I != between the .I KEY and .IR VALUE . If an event is emitted for which no jobs have registered interest (via either .B start on or .BR "stop on" ")," the event is destroyed. If a job specifies a single event in its start condition and that event is emitted and matches any specifies event environment variables, the overall condition becomes true, the job is started and -- assuming no other job has registered an interest in it -- the event is destroyed. However, if an event is emitted which matches .I part of a jobs start condition, the job is said to be blocking the event (since the event is unable to change state until the job has started) and will both cause the event to persist and the job start condition to be marked as partially completed. Once all events in the start condition have been emitted, the overall job start condition becomes true and the job will be started. If no other jobs have registered interest in the events in the start condition, they will then be destroyed. Note that no job processes are started until the overall expression evaluates to true. Note that if a new job is created which specifies that it starts on one or more events .IR "that have already been destroyed" "," that job will not start automatically until those events are emitted again. Depending on the event, this may not happen until the next time the system is booted. Although complex expressions are supported, it should be possible to specify the start condition for the majority of jobs with very simple expressions (between one and four events as a very approximate guide). A large number or complex combination of events is often an indication that the condition should be refactored. Examples of .B start on conditions: .nf start on started gdm or started kdm start on stopped JOB=foo RESULT=failed PROCESS=pre-start start on device\-added SUBSYSTEM=tty DEVPATH=ttyS* start on net\-device\-added INTERFACE!=lo start on (A and B C=D and E F=G) .fi .TP .B stop on \fIEVENT \fR[[\fIKEY=\fR]\fIVALUE\fR]... [\fBand\fR|\fBor\fR...] The .\" .B stop on stanza defines the set of events that will cause the job to be automatically stopped. It has the same syntax as \fBstart on\fP. .I VALUE may additionally expand the value of any variable that came from the job's start environment (either the event or the command that started it). Examples of .B stop on conditions: .nf stop on A stop on starting B and stopped JOB=C stop on stopping gdm or stopping kdm stop on device\-removed DEVPATH=$DEVPATH .fi .TP .B manual This stanza will disregard any .I previously seen .B start on definition. By adding this stanza on any line below the .B start on definition, it provides the ability to stop a job from being automatically started. When specified, the only way to start such a job is via \fBstart\fP (8). .SS Job environment Each job is run with an environment constructed from the following categories: .\" .IP \(bu 4 A minimal set of standard system variables added by Upstart. .sp 1 All jobs contain the .B TERM and .B PATH variables. .\" .IP \(bu 4 Variables set using the .BR initctl (8) job environment commands (such as \fIset-env\fP). .sp 1 These commands also allow unsetting of variables. .\" .IP \(bu 4 A set of special variables added by Upstart that relate to the job itself. .sp 1 All jobs also contain the .B UPSTART_JOB and .B UPSTART_INSTANCE environment variables, containing the name of the job and instance. These are mostly used by the .BR initctl (8) utility to default to acting on the job the commands are called from. .\" .IP \(bu 4 Those variables introduced by the events or command that started the job. .sp 1 The special .B UPSTART_EVENTS environment variable contains the list of events that started the job, it will not be present if the job was started manually. The .B pre\-stop and .B post\-stop scripts are run with the environment of the events or commands that stopped the job. The .B UPSTART_STOP_EVENTS environment variable contains the list of events that stopped the job, it will not be present if the job was stopped manually. .\" .IP \(bu 4 Variables set within the job itself using the .B env and .B export stanzas. These provide default values - if the command or event which causes the job to start specifies alternative values, those are given priority over the defaults. .RS .\" .TP .B env \fIKEY\fR[=\fIVALUE\fR] Defines a default environment variable, the value of which may be overridden by the event or command that starts the job. If \'KEY=VALUE\' is specified, the variable KEY is given the value VALUE. If only \'KEY\' is given, then the value is taken from the .BR init (8) daemon's own environment. .\" .TP .B export \fIKEY\fR... Exports the value of one or more environment variables into the .BR starting (7), .BR started (7), .BR stopping (7) and .BR stopped (7) events for this job .ft B and to all resultant events .ft (not just those relating to the current job). Note that each .I KEY is the .I name of a variable; it is .B not prefixed with a dollar (\(aq$\(aq) sign. .RE The first two categories above comprise the .I job environment table which is applied to all jobs. Note that changing the job environment table will only affect newly-started jobs. .\" .SS Services, tasks and respawning Jobs are .I services by default. This means that the act of starting the job is considered to be finished when the job is running, and that even exiting with a zero exit status means the service will be respawned. .TP .B task This stanza may be used to specify that the job is a .I task instead. This means that the act of starting the job is not considered to be finished until the job itself has been run and stopped again, but that exiting with a zero exit status means the task has completed successfully and will not be respawned. .PP The .BR start (8) command, and any .BR starting (7) or .BR stopping (7) events will block only until a service is running or until a task has finished. .TP .B respawn A service or task with this stanza will be automatically started if it should stop abnormally. All reasons for a service stopping, except the .BR stop (8) command itself, are considered abnormal. Tasks may exit with a zero exit status to prevent being respawned. Note that specifying this stanza .I without also specifying the .B respawn limit stanza will apply the default respawn limit as specified below. .\" .TP .B respawn limit \fR[\fICOUNT INTERVAL\fR|\fIunlimited\fR] Respawning is subject to a limit, if the job is respawned more than .I COUNT times in .I INTERVAL seconds, it will be considered to be having deeper problems and will be stopped. Default COUNT is 10. Default INTERVAL is 5 seconds. If the special argument .I unlimited is specified instead of a .I COUNT and .I INTERVAL value, no limit will be applied and the job will be respawned indefinitely. Specifying either .I COUNT or .I INTERVAL as zero implies .IR unlimited "." This stanza only applies to automatic respawns and not the .BR restart (8) command. .\" .TP .B normal exit \fISTATUS\fR|\fISIGNAL\fR... Additional exit statuses or even signals may be added, if the job process terminates with any of these it will not be considered to have failed and will not be respawned. A signal can be specified either as a full name (for example "\fISIGTERM\fP") or a partial name (for example "\fITERM\fP"). .nf normal exit 0 1 TERM SIGHUP .fi .\" .SS Instances By default, only one instance of any job is permitted to exist at one time. Attempting to start a job when it's already starting or running results in an error. Note that a job is considered to be running if its pre\-start process is running. Multiple instances may be permitted by defining the names of those instances. If an instance with the same name is not already starting or running, a new instance will be started instead of returning an error. .TP .B instance \fINAME This stanza defines the names of instances, on its own its not particularly useful since it would just define the name of the single permitted instance, however .I NAME expands any variable defined in the job's environment. These will often be variables that you need to pass to the process anyway, so are an excellent way to limit the instances. .nf instance $CONFFILE exec /sbin/httpd \-c $CONFFILE .fi .nf instance $TTY exec /sbin/getty \-8 38300 $TTY .fi These jobs appear in the .BR initctl (8) output with the instance name in parentheses, and have the .B INSTANCE environment variable set in their events. .\" .SS Documentation Upstart provides several stanzas useful for documentation and external tools. .TP .B description \fIDESCRIPTION This stanza may contain a description of the job. .nf description "This does neat stuff" .fi .\" .TP .B author \fIAUTHOR This stanza may contain the author of the job, often used as a contact for bug reports. .nf author "Scott James Remnant " .fi .\" .TP .B version \fIVERSION This stanza may contain version information about the job, such as revision control or package version number. It is not used or interpreted by .BR init (8) in any way. .nf version "$Id$" .fi .\" .TP .B emits \fIEVENT\fR... All processes on the system are free to emit their own events by using the .BR initctl (8) tool, or by communicating directly with the .BR init (8) daemon. This stanza allows a job to document in its job configuration what events it emits itself, and may be useful for graphing possible transitions. The .BR initctl "(8) " check\-config command attempts to use this stanza to resolve events. .I EVENT can be either a literal string or a string including shell wildcard meta-characters (asterisk (\(aq*\(aq), question mark (\(aq?\(aq), and square brackets (\(aq[\(aq and \(aq]\(aq)). Meta-characters are useful to allow .BR initctl "(8) " check\-config to resolve a class of events, such as those emitted by .BR upstart-udev-bridge (8) "" . .\" .TP .B usage \fIUSAGE This stanza may contain the text used by .BR initctl "(8) " usage command. This text may be also shown when commands .BR start (8), .BR stop (8) or .BR status (8) fail. .nf usage "tty DEV=ttyX - where X is console id" .fi .\" .SS Process environment Many common adjustments to the process environment, such as resource limits, may be configured directly in the job rather than having to handle them yourself. .TP .B console \fBnone\fR|\fBlog\fR|\fBoutput\fR|\fBowner\fR .\" .RS .B none .RS If \fBnone\fR is specified, the jobs standard input, standard output and standard error file descriptors are connected to .IR /dev/null "." Any output generated by a job will be discarded. This used to be the default prior to the introduction of \fBlog\fR in Upstart 1.4. .RE .RE .sp 1 .\" .RS .B log .RS .B If \fBlog\fR is specified, standard input is connected to .IR /dev/null "," and standard output and standard error are connected to a pseudo-tty which logs all job output. Output is logged to file .IR /var/log/upstart/ or .IR $XDG_CACHE_HOME/upstart/ for system and user session jobs respectively. If a job has specified \fBinstance\fR, .I will equate to .I -.log where \(aq\(aq is replaced by the specific instance value and \(aq\(aq is replaced with the job name (job configuration file name, without the extension). If \fBinstance\fR is not specified, .I will be .I .log where \(aq\(aq is replaced with the job name. Jobs started from within a chroot will have their output logged to such a path within the chroot. If log files already exist, they are appended to. All slash (\(aq/\(aq) characters in .I are replaced with underscore (\(aq_\(aq) characters. For example, any output from the \(aqwibble\(aq instance of the \(aqfoo/bar\(aq job would be encoded in file \(aqfoo_bar-wibble.log\(aq in the log file directory. This gives the log file directory a flat structure. If the directory for system jobs does not exist, job output for each job will be cached until the job finishes. Thus, the boot process .B must ensure that the directory is available as soon as possible since any job that finishes before a writeable disk is available will not be able to take advantage of this facility. If it is not possible to write to any log file due to lack of disk space, the job will be considered to have specified a .B console value of .BR none and all subsequent job output will be discarded. If the logger detects that the file it is about to write to was deleted, it will re-open the file first. Care should be taken if the log directory is a mount point since any job that starts before that mount is available and which produces output will then attempt to write logs to the mount point, not to the mounted directory. This may give the impression that log data has not been recorded. A strategy to handle this situation is to ensure the mount point directory is not writeable such that logs will only be written when the mount has succeeded (assuming the mount itself is writeable and has sufficient space). Note that since .B log utilizes pseudo-ttys, your kernel must support these. If it does not, the console value will be modified automatically to .BR none "." Further, note that it may be necessary to increase the number of available pty devices; see .BR pty (7) for details. Under Linux, full Unix 98 pty support requires that the .I devpts filesystem be mounted. If pty setup fails for any reason, an error message will be displayed and the job's console value will be reset to .BR none "." .RE .RE .sp 1 .\" .RS .B output .RS If \fBoutput\fR is specified, the standard input, standard output and standard error file descriptors are connected to .IR /dev/console "." .RE .RE .sp 1 .\" .RS .B owner .RS The \fBowner\fR value is special: it not only connects the job to the system console but sets the job to be the owner of the system console, which means it will receive certain signals from the kernel when special key combinations such as Control\-C are pressed. .RE .RE .\" .TP .B umask \fIUMASK A common configuration is to set the file mode creation mask for the process. .I UMASK should be an octal value for the mask, see .BR umask (2) for more details. .\" .TP .B nice \fINICE Another common configuration is to adjust the process's nice value, see .BR nice (1) for more details. .\" .TP .B oom score \fIADJUSTMENT\fR|\fBnever Normally the OOM killer regards all processes equally, this stanza advises the kernel to treat this job differently. .I ADJUSTMENT may be an integer value from .I -999 (very unlikely to be killed by the OOM killer) up to .I 1000 (very likely to be killed by the OOM killer). It may also be the special value .B never to have the job ignored by the OOM killer entirely. .\" .TP .B chroot \fIDIR Runs the job's processes in a .BR chroot(8) environment underneath .I DIR Note that .I DIR must have all the necessary system libraries for the process to be run, often including .I /bin/sh .\" .TP .B chdir \fIDIR Runs the job's processes with a working directory of .I DIR instead of the root of the filesystem. .\" .TP .B limit \fILIMIT SOFT\fR|\fBunlimited \fIHARD\fR|\fBunlimited Sets initial system resource limits for the job's processes. .I LIMIT may be one of .IR core , .IR cpu , .IR data , .IR fsize , .IR memlock , .IR msgqueue , .IR nice , .IR nofile , .IR nproc , .IR rss , .IR rtprio , .I sigpending or .IR stack . Limits are specified as both a .I SOFT value and a .I HARD value, both of which are integers. The special value .B unlimited may be specified for either. .\" .TP .B setuid \fIUSERNAME Changes to the user .I USERNAME before running any job process. The job process will run with the primary group of user .I USERNAME unless the .B setgid stanza is also specified in which case that group will be used instead. For system jobs .BR initgroups (3) will be called to set up supplementary group access. Failure to determine and/or set user and group details will result in the overall job failing to start. If this stanza is unspecified, all job processes will run with user ID 0 (root) in the case of system jobs, and as the user in the case of user jobs. Note that system jobs using the .B setuid stanza are still system jobs, and can not be controlled by an unprivileged user, even if the .B setuid stanza specifies that user. .\" .TP .B setgid \fIGROUPNAME Changes to the group .I GROUPNAME before running any job process. For system jobs .BR initgroups (3) will be called to set up supplementary group access. If this stanza is unspecified, the primary group of the user specified in the .B setuid block is used for all job processes. If both this and the .B setuid stanza are unspecified, all job processes will run with their group ID set to 0 (root) in the case of system jobs, and as the primary group of the user in the case of User Session jobs. .\" .TP .B cgroup \fICONTROLLER \fR[ \fINAME \fR] \fR[ \fIKEY VALUE \fR] Specify the control group all job processes will run in and optionally specify a setting for the particular cgroup. This stanza will be ignored if the version of Upstart is new enough to support cgroups but has been built without cgroup support. This stanza will also be ignored if the .BR init (8) daemon has had cgroup support disabled at boot time (see \fBinit\fR (8)). A job which specifies this stanza will not be started until both its .B start on condition is met .I and the address of the cgroup manager has been communicated to the .BR init (8) daemon using the .BR initctl (8) command .BR notify\-cgroup\-manager\-address "." If only the cgroup controller (such as \fImemory\fR, \fIcpuset\fR, \fIblkio\fR) is specified, a job-specific cgroup will be created and the job processes placed in it. The form of this cgroup is .sp .B upstart/$UPSTART_JOB .sp or if the job specifies the .B instance stanza the group will be the expanded value of: .sp .B upstart/$UPSTART_JOB-$UPSTART_INSTANCE .sp Any forward slashes in .B $UPSTART_JOB and .B $UPSTART_INSTANCE will be replaced with underscore (\(aq_\(aq) characters. This default cgroup for the job may be specified explicitly within a .B NAME using the special variable .BR $UPSTART_CGROUP "." This variable is .I not an environment variable and is only valid within the context of the .B cgroup stanza. If .B NAME is not specified or does not contain .BR $UPSTART_CGROUP "," the job processes will not be placed in an upstart-specific Note that this special variable cannot be specified with enclosing braces around the name. No validation is performed on the specified values until the job is due to be started. If the .B CONTROLLER is invalid, or the .B NAME cannot be created or the .B KEY or .B VALUE are invalid, the job will be failed. The .B NAME argument may contain any valid variable and can also contain forward slashes to run the job processes in a sub-cgroup. If any argument contains space characters, it must be quoted. If a .B KEY is specified, a .B VALUE must also be specified (even it is simply an empty string). The stanza maybe specified multiple times. The last occurence will be used except in the scenario where each occurence specifies a different .B KEY in which case all the keys and values will be applied. It is not an error if .B NAME already exists. Valid syntax: .RS Implicit NAME, no setting. .RS .nf .B cgroup CONTROLLER .fi .RE Explicit name, no setting. .RS .nf .B cgroup CONTROLLER NAME .fi .RE Implicit name with setting. .RS .nf .B cgroup CONTROLLER KEY VALUE .fi .RE Explicit name with setting. .RS .nf .B cgroup CONTROLLER NAME KEY VALUE .fi .RE .RE .RS Examples: .IP \[bu] Run all job processes in the default .B cpu cgroup controller group. .sp .RS .nf .B cgroup cpu .fi .RE .IP \[bu] As above. .sp .RS .nf .B cgroup cpu $UPSTART_CGROUP .fi .RE .IP \[bu] As above. .sp .RS .nf \fBcgroup cpu "$UPSTART_CGROUP"\fR .fi .RE .IP \[bu] Attempt to place the job processes in a non-job-specific cgroup. .sp .RS .nf \fBcgroup cpu "a-well-known-cgroup"\fR .fi .RE .IP \[bu] The job will only start once the manager is up and running and will have a 50MB memory limit, be restricted to CPU ids 0 and 1 and have a 1MB/s write limit to the block device 8:16. The job will fail to start if the system has less than 50MB of RAM or less than 2 CPUs. .sp .RS .nf .B cgroup memory $UPSTART_CGROUP limit_in_bytes 52428800 .B cgroup cpuset $UPSTART_CGROUP cpus 0-1 \fBcgroup blkio slowio throttle.write_bps_device "8:16 1048576"\fR .fi .RE .RE .\" .SS Override File Handling Override files allow a jobs environment to be changed without modifying the jobs configuration file. Rules governing override files: .IP \[bu] 2 If a job is embodied with only a configuration file, the contents of this file define the job. .IP \[bu] If an override files exists where there is no existing cofiguration file, the override file is ignored. .IP \[bu] If both a configuration file \fBand\fP an override file exist for a job and both files are syntactically correct: .RS .IP \[bu] 2 stanzas in the override file will take precedence over stanzas present in the corresponding configuration file. .IP \[bu] stanzas in the override file which are not present in the corresponding configuration file will be honoured when the job runs. .RE .IP \[bu] If both a configuration file and an override file exist for a job and subsequently the override file is deleted, the configuration file is automatically reloaded with the effect that any changes introduced by the override file are undone and the configuration file alone now defines the job. .IP \[bu] If both a configuration file and an override file exist for a job and subsequently the configuration file is deleted, a new instance of the job can no longer be started (since without a corresponding configuration file an override file is ignored). .IP \[bu] If both a configuration file and an override file exist for a job and any of the contents of the override file are invalid, the override file is ignored and only the contents of the configuration file are considered. .P .\" .SS AppArmor support Upstart provides several stanzas for loading and switching to different AppArmor profiles. If AppArmor isn't enabled in the currently running kernel, the stanzas will be silently ignored. .TP .B apparmor load \fIPROFILE This stanza specifies an AppArmor profile to load into the Linux kernel at job start. The AppArmor profile will confine a main process automatically using path attachment, or manually by using the \fBapparmor switch\fP stanza. .I PROFILE must be an absolute path to a profile and a failure will occur if the file doesn't exist. .nf apparmor load /etc/apparmor.d/usr.sbin.cupsd .fi .\" .TP .B apparmor switch \fINAME This stanza specifies the name of an AppArmor profile name to switch to before running the main process. .I NAME must be the name of a profile already loaded into the running Linux kernel, and will result in a failure if not available. .nf apparmor switch /usr/sbin/cupsd .fi .\" .SS Miscellaneous .TP .B kill signal \fISIGNAL Specifies the stopping signal, .I SIGTERM by default, a job's main process will receive when stopping the running job. The signal should be specified as a full name (for example "\fISIGTERM\fP") or a partial name (for example "\fITERM\fP"). Note that it is possible to specify the signal as a number (for example "\fI15\fP") although this should be avoided if at all possible since signal numbers may differ between systems. .nf kill signal INT .fi .\" .TP .B reload signal \fISIGNAL Specifies the reload signal, .I SIGHUP by default, a job's main process will receive when reloading the running job. The signal should be specified as a full name (for example "\fISIGHUP\fP") or a partial name (for example "\fIHUP\fP"). Note that it is possible to specify the signal as a number (for example "\fI1\fP") although this should be avoided if at all possible since signal numbers may differ between systems. .nf reload signal USR1 .fi .\" .TP .B kill timeout \fIINTERVAL Specifies the interval between sending the job's main process the "stopping" (see above) and .I SIGKILL signals when stopping the running job. Default is 5 seconds. .\" .TP .B expect stop Specifies that the job's main process will raise the .I SIGSTOP signal to indicate that it is ready. .BR init (8) will wait for this signal before running the job's post\-start script, or considering the job to be running. .BR init (8) will send the process the .I SIGCONT signal to allow it to continue. .\" .TP .B expect daemon Specifies that the job's main process is a daemon, and will fork twice after being run. .BR init (8) will follow this daemonisation, and will wait for this to occur before running the job's post\-start script or considering the job to be running. Without this stanza .BR init (8) is unable to supervise daemon processes and will believe them to have stopped as soon as they daemonise on startup. .\" .TP .B expect fork Specifies that the job's main process will fork once after being run. .BR init (8) will follow this fork, and will wait for this to occur before running the job's post\-start script or considering the job to be running. Without this stanza .BR init (8) is unable to supervise forking processes and will believe them to have stopped as soon as they fork on startup. .\" .SH RESTRICTIONS The use of symbolic links in job configuration file directories is not supported since it can lead to unpredictable behaviour resulting from broken or inaccessible links (such as would be caused by a link crossing a filesystem boundary to a filesystem that has not yet been mounted). .\" .SH BUGS The .B and and .B or operators allowed with .B start on and .B stop on do not work intuitively: operands to the right of either operator are only evaluated once and state information is then discarded. This can lead to jobs with complex \fBstart on\fP or \fPstop on\fP conditions not behaving as expected \fIwhen restarted\fP. For example, if a job encodes the following condition: .sp 1 .RS .nf start on A and (B or C) .fi .RE .P When \(aqA\(aq and \(aqB\(aq become true, the condition is satisfied so the job will be run. However, if the job ends and subsequently \(aqA\(aq and \(aqC\(aq become true, the job will \fInot\fP be re\-run even though the condtion is satisfied. Avoid using complex conditions with jobs which need to be restarted. .\" .SH FILES . .TP .I /etc/init/*.conf System job configuration files. . .TP .I /etc/init/*.override System job override files. . .TP .I $HOME/.init/*.conf User job configuration files .BR (deprecated) . . .TP .I $HOME/.init/*.override User job override files. .BR (deprecated) . . .TP .I $XDG_CONFIG_HOME/upstart/*.conf User session job configuration files. See .B User Session Mode for other locations. . .TP .I $XDG_CONFIG_HOME/upstart/*.override User session job override files. See .B User Session Mode for other locations. . .TP .I /var/log/upstart/*.log Default location of system job output logs. . .TP .I $XDG_CACHE_HOME/upstart/*.log Default location of user session job output logs. .TP .I $XDG_RUNTIME_DIR/upstart/sessions/*.session Location of session files created when running in User Session mode. .RE .\" .SH AUTHOR Manual page written by Scott James Remnant .RB < scott@netsplit.com > and James Hunt .RB < james.hunt@canonical.com > . .\" .SH REPORTING BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2009-2013 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR apparmor (7), .BR cgmanager (8), .BR init (8), .BR initctl (8), .BR prctl (2), .BR pty (7), .BR sh (1). upstart-1.13.2/init/man/startup.70000664000175000017500000000253412373101356013540 00000000000000.TH startup 7 2009-07-09 "Upstart" .\" .SH NAME startup \- event signalling system startup .\" .SH SYNOPSIS .B startup .RI [ ENV ]... .\" .SH DESCRIPTION The .B startup event is generated by the Upstart .BR init (8) daemon after it has completed its own initialisation and is the signal that the rest of the system may be started. Typically this will involve checking and mounting the partitions and drives that form the filesystem, loading drivers for connected devices and starting the X windowing system or other login environment. In the default Upstart configuration, the primary task run on the .B startup event is the .I /etc/init/rc-sysinit.conf job responsible for generating the System V compatible .BR runlevel (7) event. See that page for a more detailed explanation of this process. This event is emitted when running both as pid 1 and as a Session Init. Paradoxically there is currently no corresponding Upstart-native event signifying that the system is to be shutdown, only the System V compatible .B runlevel 0 and .B runlevel 6 events provide this functionality. However, when running as a Session Init, the .BR session\-end event performs this function. .\" .SH EXAMPLE A service with no other dependencies run on startup might use: .RS .nf start on startup .fi .RE .\" .SH SEE ALSO .BR runlevel (7) .BR session\-end (7) .BR init (5) .BR init (8) upstart-1.13.2/init/man/stopping.70000664000175000017500000000516312373101356013702 00000000000000.TH stopping 7 2009-07-09 "Upstart" .\" .SH NAME stopping \- event signalling that a job is stopping .\" .SH SYNOPSIS .B stopping .BI JOB\fR= JOB .BI INSTANCE\fR= INSTANCE .BI RESULT\fR= RESULT .IB \fR[ PROCESS\fR= PROCESS \fR] .IB \fR[ EXIT_STATUS\fR= STATUS \fR] .IB \fR[ EXIT_SIGNAL\fR= SIGNAL \fR] .RI [ ENV ]... .\" .SH DESCRIPTION The .B stopping event is generated by the Upstart .BR init (8) daemon when an instance of a job begins stopping. The .B JOB environment variable contains the job name, and the .B INSTANCE environment variable contains the instance name which will be empty for single-instance jobs. If the job is stopping normally, the .B RESULT environment variable will be .IR ok , otherwise if the job is stopping because it has failed it will be .IR failed . When the job has failed, the process that failed will be given in the .B PROCESS environment variable. This may be .IR pre-start ", " post-start ", " main ", " pre-stop " or " post-stop ; it may also be the special value .I respawn to indicate that the job is stopping because it hit the respawn limit. Finally in the case of a failed job, one of either .B EXIT_STATUS or .B EXIT_SIGNAL may be given to indicate the cause of the stop. Either .B EXIT_STATUS will contain the exit status code of the process, or .B EXIT_SIGNAL will contain the name of the signal that the process received. The .B normal exit job configuration stanza can be used to prevent particular exit status values or signals resulting in a failed job, see .BR init (5) for more information. If neither .B EXIT_STATUS or .B EXIT_SIGNAL is given for a failed process, it is because the process failed to spawn (for example, file not found). See the system logs for the error. .BR init (8) will wait for all services started by this event to be running, all tasks started by this event to have finished and all jobs stopped by this event to be stopped before allowing the job to continue stopping. This allows jobs to depend on other jobs, safely stopping themselves before their dependency goes away. This event is typically combined with the .BR started (7) event by services. Job configuration files may use the .B export stanza to export environment variables from their own environment into the .B stopping event. See .BR init (5) for more details. .\" .SH EXAMPLE A service that wishes to depend on another service might use: .RS .nf start on started apache stop on stopping apache .fi .RE A task that must be run before another task or service is stopped might use: .RS .nf start on stopping postgresql RESULT=ok .fi .RE .\" .SH SEE ALSO .BR starting (7) .BR started (7) .BR stopped (7) .BR init (5) upstart-1.13.2/init/man/started.70000664000175000017500000000240612373101356013502 00000000000000.TH started 7 2009-07-09 "Upstart" .\" .SH NAME started \- event signalling that a job is running .\" .SH SYNOPSIS .B started .BI JOB\fR= JOB .BI INSTANCE\fR= INSTANCE .RI [ ENV ]... .\" .SH DESCRIPTION The .B started event is generated by the Upstart .BR init (8) daemon when an instance of a job has finished starting and is now running. The .B JOB environment variable contains the job name, and the .B INSTANCE environment variable contains the instance name which will be empty for single-instance jobs. .BR init (8) emits this event as an informational signal, services and tasks started or stopped by this event will do so in parallel with other activity. It is typically combined with the .BR stopping (7) event by services declaring a dependency. Job configuration files may use the .B export stanza to export environment variables from their own environment into the .B started event. See .BR init (5) for more details. .\" .SH EXAMPLE A service that wishes to depend on another service might use: .RS .nf start on started apache stop on stopping apache .fi .RE A task that must be run after another task or service has been started might use: .RS .nf start on started postgresql .fi .RE .\" .SH SEE ALSO .BR starting (7) .BR stopping (7) .BR stopped (7) .BR init (5) upstart-1.13.2/init/man/inittab.50000664000175000017500000000067212373101356013467 00000000000000.TH inittab 5 2009-07-09 "Upstart" .\" .SH NAME inittab \- init daemon configuration .\" .SH SYNOPSIS .B /etc/inittab .\" .SH DESCRIPTION The .I /etc/inittab file was the configuration file used by the original System V .BR init (8) daemon. The Upstart .BR init (8) daemon does not use this file, and instead reads its configuration from files in .IR /etc/init . See .BR init (5) for more details. .\" .SH SEE ALSO .BR init (8) .BR init (5) upstart-1.13.2/init/man/keyboard-request.70000664000175000017500000000142012373101356015315 00000000000000.TH keyboard-request 7 2009-07-09 "Upstart" .\" .SH NAME keyboard-request \- event signalling console press of Alt-UpArrow .\" .SH SYNOPSIS .B keyboard-request .RI [ ENV ]... .\" .SH DESCRIPTION The .B keyboard-request event is generated by the Upstart .BR init (8) daemon when the keyboard request key combination (typically Alt-UpArrow) is pressed on the console. The support for this event depends on your kernel configuration. Suggested use for this event includes spawning a new login console when pressed, or for secure attention key support. This event is not handled in the default Upstart configuration. .\" .SH EXAMPLE A task to be run on the keyboard request might use: .RS .nf start on keyboard-request .fi .RE .\" .SH SEE ALSO .BR control-alt-delete (7) .BR init (8) upstart-1.13.2/init/man/init.80000664000175000017500000003260512373101356013004 00000000000000'\" t .TH init 8 2014-05-09 "Upstart" .\" .SH NAME init \- Upstart process management daemon .\" .SH SYNOPSIS .B init .RI [ OPTION ]... .\" .SH DESCRIPTION .B init is the parent of all processes on the system, it is executed by the kernel and is responsible for starting all other processes; it is the parent of all processes whose natural parents have died and it is responsible for reaping those when they die. Processes managed by .B init are known as jobs and are defined by files in the .I /etc/init directory. See .BR init (5) for more details on configuring Upstart. .\" .SS Events .BR init (8) is an event-based init daemon. This means that jobs will be automatically started and stopped by changes that occur to the system state, including as a result of jobs starting and stopping. This is different to dependency-based init daemons which start a specified set of goal jobs, and resolve the order in which they should be started and other jobs required by iterating their dependencies. For more information on starting and stopping jobs, as well as emitting events that will automatically start and stop jobs, see the manual page for the .BR initctl (8) tool. The primary event is the .BR startup (7) event, emitted when the daemon has finished loading its configuration. Other useful events are the .BR starting (7), .BR started (7), .BR stopping (7) and .BR stopped (7) events emitted as jobs change state. .\" .SS Job States .P \fBTable 1: Job Goals and State Transitions.\fP .TS box,tab(@); c | c s c | c s c | c | c c | l l. @Goal @_ Current State @start @ stop = waiting @ starting @ n/a starting @ pre\-start @ stopping pre\-start @ spawned @ stopping spawned @ post\-start @ stopping post\-start @ running @ stopping running @ stopping @ pre\-stop / stopping (*) pre\-stop @ running @ stopping stopping @ killed @ killed killed @ post\-stop @ post\-stop post\-stop @ starting @ waiting .TE .po \n[old_po] .in \n[old_in] .P Key: (*) If there is a \fBscript\fP or \fBexec\fP section and this process is running, state will be \(aqpre\-stop\(aq, else it will be \(aqstopping\(aq. .\" ------------------------------------------------------------ .SS Job Lifecycle .\" .IP "Starting a Job" .nr step 1 1 .IP \n[step] 3 Initially the job is "at rest" with a goal of \(aqstop\(aq and a state of \(aqwaiting\(aq (shown as \(aqstop/waiting\(aq by the .BR initctl (8) .B list and .B status commands). .\" .IP \n+[step] 3 The goal is changed from \(aqstop\(aq to \(aqstart\(aq indicating the job is attempting to start. .\" .IP \n+[step] 3 The state is changed from \(aqwaiting\(aq to \(aqstarting\(aq. .\" .IP \n+[step] 3 The \fBstarting\fP(7) event is emitted denoting the job is "about to start". .\" .IP \n+[step] 3 Any jobs whose \(aqstart on\(aq (or \(aqstop on\(aq) condition would be satisfied by this job starting are started (or stopped respectively). .\" .IP \n+[step] 3 The \fBstarting\fP(7) event completes. .\" .IP \n+[step] 3 The state is changed from \(aqstarting\(aq to \(aqpre\-start\(aq. .\" .IP \n+[step] 3 If the \fBpre\-start\fP stanza exists, the pre\-start process is spawned. .\" .IP \n+[step] 3 If the pre\-start process fails, the goal is changed from \(aqstart\(aq to \(aqstop\(aq, and the .BR stopping(7) and .BR stopped(7) events are emitted with appropriate variables set denoting the error. .\" .IP \n+[step] 3 Assuming the pre\-start did not fail or did not call "stop", the main process is spawned. .\" .IP \n+[step] 3 The state is changed from \(aqpre\-start\(aq to \(aqspawned\(aq. .\" .IP \n+[step] 3 Upstart then ascertains the \fIfinal\fP PID for the job which may be a descendent of the immediate child process if \fBexpect fork\fP or \fBexpect daemon\fP has been specified. .\" .IP \n+[step] 3 The state is changed from \(aqspawned\(aq to \(aqpost\-start\(aq. .\" .IP \n+[step] 3 If the \fBpost\-start\fP stanza exists, the post\-start process is spawned. .\" .IP \n+[step] 3 The state is changed from \(aqpost\-start\(aq to \(aqrunning\(aq. .\" .IP \n+[step] 3 The \fBstarted\fP(7) event is emitted. .sp 1 For services, when this event completes the main process will now be fully running. If the job refers to a task, it will now have completed (successfully or otherwise). .\" .IP \n+[step] 3 Any jobs whose \(aqstart on\(aq (or \(aqstop on\(aq) condition would be satisfied by this job being started are started (or stopped respectively). .\" .IP "Stopping a Job" .nr step 1 1 .IP \n[step] 3 Assuming the job is fully running, it will have a goal of \(aqstart\(aq and a state of \(aqrunning\(aq (shown as \(aqstart/running\(aq by the .BR initctl (8) .B list and .B status commands). .\" .IP \n+[step] 3 The goal is changed from \(aqstart\(aq to \(aqstop\(aq indicating the job is attempting to stop. .\" .IP \n+[step] 3 The state is changed from \(aqrunning\(aq to \(aqpre\-stop\(aq. .\" .IP \n+[step] 3 If the \fBpre\-stop\fP stanza exists, the pre\-stop process is spawned. .\" .IP \n+[step] 3 The state is changed from \(aqpre\-stop\(aq to \(aqstopping\(aq. .\" .IP \n+[step] 3 The \fBstopping\fP(7) event is emitted. .\" .IP \n+[step] 3 Any jobs whose \(aqstart on\(aq (or \(aqstop on\(aq) condition would be satisfied by this job stopping are started (or stopped respectively). .\" .IP \n+[step] 3 The main process is stopped: .RS .nr step2 1 1 .af step2 i .IP \n[step2] 3 The signal specified by the .B kill signal stanza is sent to the process group of the main process (such that all processes belonging to the jobs main process are killed). By default this signal is .BR SIGTERM "." .sp 1 See \fBsignal\fP(7) and \fBinit\fP(5). .IP \n+[step2] 3 Upstart waits for up to "kill timeout" seconds (default 5 seconds) for the process to end. .IP \n+[step2] 3 If the process is still running after the timeout, a .B SIGKILL signal is sent to the process which cannot be ignored and will forcibly stop the processes in the process group. .RE .\" .IP \n+[step] 3 The state is changed from \(aqkilled\(aq to \(aqpost\-stop\(aq. .\" .IP \n+[step] 3 If the \fBpost\-stop\fP stanza exists, the post\-stop process is spawned. .\" .IP \n+[step] 3 The state is changed from \(aqpost\-stop\(aq to \(aqwaiting\(aq. .\" .IP \n+[step] 3 The \fBstopped\fP(7) event is emitted. .sp 1 When this event completes, the job is fully stopped. .\" .IP \n+[step] 3 Any jobs whose \(aqstart on\(aq (or \(aqstop on\(aq) condition would be satisfied by this job being stopped are started (or stopped respectively). .\" .SS System V compatibility The Upstart .BR init (8) daemon does not keep track of runlevels itself, instead they are implemented entirely by its userspace tools. The event emitted to signify a change of runlevel is the .BR runlevel (7) event. For more information see its manual page. .\" .SH OPTIONS Options are passed to .BR init (8) by placing them on the kernel command-line. .\" .TP .B \-\-append-confdir \fIdirectory\fP Add the specified directory to the default directory or directories that job configuration files will be read from. This option may be specified multiple times which will result in job configuration files being loaded from each directory specified (which must exist). Directories will be searched for jobs in the specified order after the default directories have been searched. Note that if this option is used in combination with .BR \-\-confdir "," or .BR \-\-prepend\-confdir "," regardless of the order of the options on the command-line, the append directories will be added .I after the other directories. .\" .TP .B \-\-confdir \fIdirectory\fP Read job configuration files from a directory other than the default (\fI/etc/init\fP for process ID 1). This option may be specified multiple times which will result in job configuration files being loaded from each directory specified (which must exist). Directories will be searched for jobs in the specified order. In the case that multiple directories specify a job of the same name, the first job encountered will be honoured. See section .B User Session Mode in .BR init (5) for the ordered list of default configuration directories a Session Init will consider. .\" .TP .B \-\-default-console \fIvalue\fP Default value for jobs that do not specify a \(aq\fBconsole\fR\(aq stanza. This could be used for example to set the default to \(aq\fBnone\fR\(aq but still honour jobs that specify explicitly \(aq\fBconsole log\fR\(aq. See .BR init (5) for all possible values of .BR console "." .\" .TP .B \-\-no-cgroups Do not honour the .B cgroup stanza. If specified, this stanza will be ignored for any job which specifies it: the job processes will .I not be placed in the cgroup specified by the stanza and the job itself will not wait until the cgroup manager has started before starting itself. See .BR init (5) for further details. .\" .TP .B \-\-no\-dbus Do not connect to a D-Bus bus. .\" .TP .B \-\-no\-inherit\-env Stop jobs from inheriting the initial environment. Only meaningful when running in user mode. .\" .TP .B \-\-logdir \fIdirectory\fP Write job output log files to a directory other than \fI/var/log/upstart\fP (system mode) or \fI$XDG_CACHE_HOME/upstart\fP (user session mode). .\" .TP .B \-\-no\-log Disable logging of job output. Note that jobs specifying \(aq\fBconsole log\fR\(aq will be treated as if they had specified \(aq\fBconsole none\fR\(aq. See .BR init (5) for further details. .\" .TP .B \-\-no\-sessions Disable chroot sessions. .\" .TP .B \-\-no\-startup\-event Suppress emission of the initial startup event. This option should only be used for testing since it will stop the .BR init (8) daemon from starting \fBany\fP jobs automatically. .\" .TP .B \-\-prepend-confdir \fIdirectory\fP Add the specified directory to the directory or directories that job configuration files will be read from. This option may be specified multiple times which will result in job configuration files being loaded from each directory specified (which must exist). Directories will be searched for jobs in the specified order before the default directories have been searched. Note that if this option is used in combination with .BR \-\-confdir "," or .BR \-\-append\-confdir "," regardless of the order of the options on the command-line, the prepend directories will be added .I before the other directories. .\" .TP .B \-\-session Connect to the D\-Bus session bus. This should only be used for testing. .\" .TP .B \-\-startup-event \fIevent\fP Specify a different initial startup event from the standard .BR startup (7) . .\" .TP .B \-\-user Starts in user mode, as used for user sessions. Upstart will be run as an unprivileged user, reading configuration files from configuration locations as per roughly XDG Base Directory Specification. See .BR init (5) for further details. .\" .TP .B \-q, \-\-quiet Reduces output messages to errors only. .\" .TP .B \-v, \-\-verbose Outputs verbose messages about job state changes and event emissions to the system console or log, useful for debugging boot. .\" .TP .B \-\-version Outputs version information and exits. .\" .SH NOTES .B init is not normally executed by a user process, and expects to have a process id of 1. If this is not the case, it will actually execute .BR telinit (8) and pass all arguments to that. See that manual page for further details. However, if the .B \-\-user option is specified, it will run as a .B Session Init and read alternative configuration files and manage the individual user session in a similar fashion. Sending a Session Init a .I SIGTERM signal is taken as a request to shutdown due to an impending system shutdown. In this scenario, the Session Init will emit the .B session\-end event and request all running jobs stop. It will attempt to honour jobs .B kill timeout values (see .BR init (5) for further details). Note however that system policy will prevail: if jobs request timeout values longer than the system policy allows for complete system shutdown, it will not be possible to honour them before the Session Init is killed by the system. .\" .SH ENVIRONMENT VARIABLES When run as a user process, the following variables may be used to find job configuration files: .IP \(bu 4 .I $XDG_CONFIG_HOME .IP \(bu 4 .I $XDG_CONFIG_DIRS .P See .B User Session Mode in .BR init (5) for further details. .\" .SH FILES .\" .I /etc/init.conf .I /etc/init/ .I $HOME/.init/ .I $XDG_CONFIG_DIRS/upstart/ .I $XDG_CONFIG_HOME/upstart/ .\" .SH AUTHOR Written by Scott James Remnant .RB < scott@netsplit.com > .\" .SH REPORTING BUGS Report bugs at .RB < https://launchpad.net/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2009\-2013 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .\" .SH SEE ALSO .BR all\-swaps (7), .BR control\-alt\-delete (7), .BR dbus\-daemon (1), .BR dbus\-event (7), .BR dconf\-event (7), .BR file\-event (7), .BR filesystem (7), .BR init (5), .BR init (8), .BR initctl (8), .BR keyboard\-request (7), .BR local\-filesystems (7), .BR mountall (8), .BR mounted (7), .BR mounting (7), .BR power\-status\-changed (7), .BR remote\-filesystems (7), .BR runlevel (7), .BR shutdown (8), .BR socket\-event (7), .BR started (7), .BR starting (7), .BR startup (7), .BR stopped (7), .BR stopping (7), .BR telinit (8), .BR upstart\-dbus\-bridge (8), .BR upstart\-dconf\-bridge (8), .BR upstart\-event\-bridge (8), .BR upstart\-events (7), .BR upstart\-file\-bridge (8), .BR upstart\-local\-bridge (8), .BR upstart\-socket\-bridge (8), .BR upstart\-udev\-bridge (8), .BR virtual\-filesystems (7). upstart-1.13.2/init/man/session-end.70000664000175000017500000000116112373101356014260 00000000000000.TH session\-end 7 2013-02-08 "Upstart" .\" .SH NAME session\-end \- event signalling session shutdown .\" .SH SYNOPSIS .B session\-end .BI TYPE\fR= TYPE .\" .SH DESCRIPTION The .B session\-end event is generated by the Upstart .BR init (8) daemon when running as a Session Init (where its pid is not 1) when requested to stop. The .B TYPE environment variable will be set to either .I shutdown when the Session Init has received the .I SIGTERM signal, or .I logout when the Session Init has processed the .B com.ubuntu.Upstart0_6.EndSession() D\-Bus method call. .\" .SH SEE ALSO .BR startup (7) .BR init (5) .BR init (8) upstart-1.13.2/init/man/starting.70000664000175000017500000000266612373101356013677 00000000000000.TH starting 7 2009-07-09 "Upstart" .\" .SH NAME starting \- event signalling that a job is starting .\" .SH SYNOPSIS .B starting .BI JOB\fR= JOB .BI INSTANCE\fR= INSTANCE .RI [ ENV ]... .\" .SH DESCRIPTION The .B starting event is generated by the Upstart .BR init (8) daemon when a new instance of a job begins starting. The .B JOB environment variable contains the job name, and the .B INSTANCE environment variable contains the instance name which will be empty for single-instance jobs. .BR init (8) will wait for all services started by this event to be running, all tasks started by this event to have finished and all jobs stopped by this event to be stopped before allowing the job to continue starting. This allows jobs to effectively insert themselves as dependencies of other jobs. The event is typically combined with the .BR stopped (7) event by services. Job configuration files may use the .B export stanza to export environment variables from their own environment into the .B starting event. See .BR init (5) for more details. .\" .SH EXAMPLE A service that wishes to be running whenever another service would be running, started before and stopped after it, might use: .RS .nf start on starting apache stop on stopped apache .fi .RE A task that must be run before another task or service is started might use: .RS .nf start on starting postgresql .fi .RE .\" .SH SEE ALSO .BR started (7) .BR stopping (7) .BR stopped (7) .BR init (5) upstart-1.13.2/init/man/stopped.70000664000175000017500000000503512373101356013513 00000000000000.TH stopped 7 2009-07-09 "Upstart" .\" .SH NAME stopped \- event signalling that a job has stopped .\" .SH SYNOPSIS .B stopped .BI JOB\fR= JOB .BI INSTANCE\fR= INSTANCE .BI RESULT\fR= RESULT .IB \fR[ PROCESS\fR= PROCESS \fR] .IB \fR[ EXIT_STATUS\fR= STATUS \fR] .IB \fR[ EXIT_SIGNAL\fR= SIGNAL \fR] .RI [ ENV ]... .\" .SH DESCRIPTION The .B stopped event is generated by the Upstart .BR init (8) daemon when an instance of a job has stopped. The .B JOB environment variable contains the job name, and the .B INSTANCE environment variable contains the instance name which will be empty for single-instance jobs. If the job was stopped normally, the .B RESULT environment variable will be .IR ok , otherwise if the job was stopped because it has failed it will be .IR failed . When the job has failed, the process that failed will be given in the .B PROCESS environment variable. This may be .IR pre-start ", " post-start ", " main ", " pre-stop " or " post-stop ; it may also be the special value .I respawn to indicate that the job was stopped because it hit the respawn limit. Finally in the case of a failed job, one of either .B EXIT_STATUS or .B EXIT_SIGNAL may be given to indicate the cause of the stop. Either .B EXIT_STATUS will contain the exit status code of the process, or .B EXIT_SIGNAL will contain the name of the signal that the process received. The .B normal exit job configuration stanza can be used to prevent particular exit status values or signals resulting in a failed job, see .BR init (5) for more information. If neither .B EXIT_STATUS or .B EXIT_SIGNAL is given for a failed process, it is because the process failed to spawn (for example, file not found). See the system logs for the error. .BR init (8) emits this event as an informational signal, services and tasks started or stopped by this event will do so in parallel with other activity. It is typically combined with the .BR starting (7) event by services when inserting themselves as a dependency. Job configuration files may use the .B export stanza to export environment variables from their own environment into the .B stopped event. See .BR init (5) for more details. .\" .SH EXAMPLE A service that wishes to be running whenever another service would be running, started before and stopped after it, might use: .RS .nf start on starting apache stop on stopped apache .fi .RE A task that must be run after another task or service has been stopped might use: .RS .nf start on stopped postgresql .fi .RE .\" .SH SEE ALSO .BR starting (7) .BR started (7) .BR stopping (7) .BR init (5) upstart-1.13.2/init/man/power-status-changed.70000664000175000017500000000117212373101356016077 00000000000000.TH power-status-changed 7 2009-07-09 "Upstart" .\" .SH NAME power-status-changed \- event signalling change of power status .\" .SH SYNOPSIS .B power-status-changed .RI [ ENV ]... .\" .SH DESCRIPTION The .B power-status-changed event is generated by the Upstart .BR init (8) daemon when it receives the SIGPWR signal, this has been typically generated by UPS monitoring software such as .BR powstatd (8) This event is not handled in the default Upstart configuration. .\" .SH EXAMPLE A task to be run on change of power status might use: .RS .nf start on power-status-changed .fi .RE .\" .SH SEE ALSO .BR powstatd (8) .BR init (8) upstart-1.13.2/init/man/upstart.70000664000175000017500000000002012373101356013524 00000000000000.so man8/init.8 upstart-1.13.2/init/man/control-alt-delete.70000664000175000017500000000135712373101356015536 00000000000000.TH control-alt-delete 7 2009-07-09 "Upstart" .\" .SH NAME control-alt-delete \- event signalling console press of Control-Alt-Delete .\" .SH SYNOPSIS .B control-alt-delete .RI [ ENV ]... .\" .SH DESCRIPTION The .B control-alt-delete event is generated by the Upstart .BR init (8) daemon when the Control-Alt-Delete key combination is pressed on the console. Typically this combination is used to safely reboot the machine. In the default Upstart configuration handling of this event is provided by the .I /etc/init/control-alt-delete.conf task which runs the .BR shutdown (8) tool. .\" .SH EXAMPLE A task to be run on Control-Alt-Delete might use: .RS .nf start on control-alt-delete .fi .RE .\" .SH SEE ALSO .BR keyboard-request (7) .BR init (8) upstart-1.13.2/init/blocked.h0000664000175000017500000000452212373101356012746 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_BLOCKED_H #define INIT_BLOCKED_H #include #include #include #include "job.h" #include "event.h" /** * BlockedType: * * This identifies what is blocked, giving the appropriate type of the * following union to use. **/ typedef enum blocked_type { BLOCKED_JOB, BLOCKED_EVENT, BLOCKED_EMIT_METHOD, BLOCKED_JOB_START_METHOD, BLOCKED_JOB_STOP_METHOD, BLOCKED_JOB_RESTART_METHOD, BLOCKED_INSTANCE_START_METHOD, BLOCKED_INSTANCE_STOP_METHOD, BLOCKED_INSTANCE_RESTART_METHOD } BlockedType; /** * Blocked: * @entry: list header, * @type: type of object blocked, * @job: job pointer if @type is BLOCKED_JOB, * @event: event pointer if @type is BLOCKED_EVENT, * @message: D-Bus message pointer if @type is BLOCKED_*_METHOD, * @data: generic pointer to blocked object. * * This structure is used to reference an object that is blocked on * some other, such as an event completing or a job reaching a goal. * Handling of actually blocking the types here is up to the called. **/ typedef struct blocked { NihList entry; BlockedType type; union { Job *job; Event *event; NihDBusMessage *message; void *data; }; } Blocked; NIH_BEGIN_EXTERN Blocked *blocked_new (const void *parent, BlockedType type, void *data) __attribute__ ((warn_unused_result)); const char * blocked_type_enum_to_str (BlockedType type) __attribute__ ((warn_unused_result)); BlockedType blocked_type_str_to_enum (const char *type) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_BLOCKED_H */ upstart-1.13.2/init/job_process.h0000664000175000017500000001347112401640554013656 00000000000000/* upstart * * Copyright 2009,2010,2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_JOB_PROCESS_H #define INIT_JOB_PROCESS_H #include #include #include #include #include "process.h" #include "job_class.h" #include "job.h" /** * JOB_PROCESS_SCRIPT_FD: * * The special fd used to pass the script to the shell process, this can be * anything from 3-9 (0-2 are stdin/out/err, 10 and above aren't guaranteed * by POSIX). **/ #define JOB_PROCESS_SCRIPT_FD 9 /** * JOB_PROCESS_LOG_REMAP_FROM_CHAR: * JOB_PROCESS_LOG_REMAP_TO_CHAR: * * All logs are written to a single directory so any jobs containing * slashes must be remapped. **/ #ifndef JOB_PROCESS_LOG_REMAP_FROM_CHAR #define JOB_PROCESS_LOG_REMAP_FROM_CHAR '/' #endif #ifndef JOB_PROCESS_LOG_REMAP_TO_CHAR #define JOB_PROCESS_LOG_REMAP_TO_CHAR '_' #endif /** * JOB_PROCESS_LOG_FILE_EXT: * * Extension for log files. **/ #ifndef JOB_PROCESS_LOG_FILE_EXT #define JOB_PROCESS_LOG_FILE_EXT ".log" #endif /** * JobProcessErrorType: * * These constants represent the different steps of process spawning that * can produce an error. **/ typedef enum job_process_error_type { JOB_PROCESS_ERROR_DUP, JOB_PROCESS_ERROR_CONSOLE, JOB_PROCESS_ERROR_RLIMIT, JOB_PROCESS_ERROR_PRIORITY, JOB_PROCESS_ERROR_OOM_ADJ, JOB_PROCESS_ERROR_CHROOT, JOB_PROCESS_ERROR_CHDIR, JOB_PROCESS_ERROR_PTRACE, JOB_PROCESS_ERROR_EXEC, JOB_PROCESS_ERROR_GETPWNAM, JOB_PROCESS_ERROR_GETGRNAM, JOB_PROCESS_ERROR_GETPWUID, JOB_PROCESS_ERROR_BAD_SETUID, JOB_PROCESS_ERROR_BAD_SETGID, JOB_PROCESS_ERROR_SETUID, JOB_PROCESS_ERROR_SETGID, JOB_PROCESS_ERROR_CHOWN, JOB_PROCESS_ERROR_UNLOCKPT, JOB_PROCESS_ERROR_GRANTPT, JOB_PROCESS_ERROR_PTSNAME, JOB_PROCESS_ERROR_OPENPT_SLAVE, JOB_PROCESS_ERROR_SIGNAL, JOB_PROCESS_ERROR_ALLOC, JOB_PROCESS_ERROR_INITGROUPS, JOB_PROCESS_ERROR_GETGRGID, JOB_PROCESS_ERROR_SECURITY, JOB_PROCESS_ERROR_CGROUP_MGR_CONNECT, JOB_PROCESS_ERROR_CGROUP_SETUP, JOB_PROCESS_ERROR_CGROUP_ENTER, JOB_PROCESS_ERROR_CGROUP_CLEAR } JobProcessErrorType; /** * JobProcessError: * @error: ordinary NihError, * @type: specific error, * @arg: relevant argument to @type, * @errnum: system error number. * * This structure builds on NihError to include additional fields useful * for an error generated by spawning a process. @error includes the single * error number and human-readable message which are sufficient for many * purposes. * * @type indicates which step of the spawning process failed, @arg is any * information relevant to @type (such as the resource limit that could not * be set) and @errnum is the actual system error number. * * If you receive a JOB_PROCESS_ERROR, the returned NihError structure is * actually this structure and can be cast to get the additional fields. **/ typedef struct job_process_error { NihError error; JobProcessErrorType type; int arg; int errnum; } JobProcessError; /** * JobProcessErrorHandler: * * @job: job, * @state: required state job is attempting to achieve, * @process: job process that failed. * * Function that is called when a job process @process fails to start. **/ typedef void (*JobProcessErrorHandler) (Job *job, JobState state, ProcessType process); NIH_BEGIN_EXTERN void job_process_start (Job *job, ProcessType process); void job_process_run_bottom (JobProcessData *handler_data); void job_process_child_reader (JobProcessData *handler_data, NihIo *io, const char *buf, size_t len); void job_process_close_handler (JobProcessData *handler_data, NihIo *io); pid_t job_process_spawn (Job *job, char * const argv[], char * const *env, int trace, int script_fd, ProcessType process) __attribute__ ((warn_unused_result)); pid_t job_process_spawn_with_fd (Job *job, char * const argv[], char * const *env, int trace, int script_fd, ProcessType process, int *job_process_fd) __attribute__ ((warn_unused_result)); void job_process_kill (Job *job, ProcessType process); void job_process_handler (void *ptr, pid_t pid, NihChildEvents event, int status); Job *job_process_find (pid_t pid, ProcessType *process); char *job_process_log_path (Job *job, int user_job) __attribute__ ((warn_unused_result)); void job_process_set_kill_timer (Job *job, ProcessType process, time_t timeout); void job_process_adj_kill_timer (Job *job, time_t due); int job_process_jobs_running (void); void job_process_stop_all (void); JobProcessData * job_process_data_new (void *parent, Job *job, ProcessType process, int job_process_fd) __attribute__ ((warn_unused_result)); json_object * job_process_data_serialise (const Job *job, const JobProcessData *handler_data) __attribute__ ((warn_unused_result)); JobProcessData * job_process_data_deserialise (void *parent, Job *job, json_object *json) __attribute__ ((warn_unused_result)); void job_process_error_handler (const char *buf, size_t len); void job_process_error_abort (int fd, JobProcessErrorType type, int arg) __attribute__ ((noreturn)); NIH_END_EXTERN #endif /* INIT_JOB_PROCESS_H */ upstart-1.13.2/init/system.c0000664000175000017500000001457312373101356012671 00000000000000/* upstart * * system.c - core system functions * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "paths.h" #include "system.h" #include "job_class.h" /** * system_kill: * @pid: process id of process, * @signal: signal to send. * * Send all processes in the same process group as @pid, which may not * necessarily be the group leader the @signal. * * Returns: zero on success, negative value on raised error. **/ int system_kill (pid_t pid, int signal) { pid_t pgid; nih_assert (pid > 0); pgid = getpgid (pid); if (kill (pgid > 0 ? -pgid : pid, signal) < 0) nih_return_system_error (-1); return 0; } /** * system_setup_console: * @type: console type, * @reset: reset console to sane defaults. * * Set up the standard input, output and error file descriptors for the * current process based on the console @type given. If @reset is TRUE then * the console device will be reset to sane defaults. * * Returns: zero on success, negative value on raised error. **/ int system_setup_console (ConsoleType type, int reset) { int fd = -1, i; /* Close the standard file descriptors since we're about to re-open * them; it may be that some of these aren't already open, we get * called in some very strange ways. */ for (i = 0; i < 3; i++) close (i); /* Open the new first file descriptor, which should always become * file zero. */ switch (type) { case CONSOLE_OUTPUT: case CONSOLE_OWNER: /* Ordinary console input and output */ fd = open (CONSOLE, O_RDWR | O_NOCTTY); if (fd < 0) nih_return_system_error (-1); if (type == CONSOLE_OWNER) ioctl (fd, TIOCSCTTY, 1); break; /* FALLTHROUGH */ case CONSOLE_LOG: case CONSOLE_NONE: /* No console really means /dev/null */ fd = open (DEV_NULL, O_RDWR | O_NOCTTY); if (fd < 0) nih_return_system_error (-1); break; } /* Reset to sane defaults, cribbed from sysvinit, initng, etc. */ if (reset) { struct termios tty; tcgetattr (0, &tty); tty.c_cflag &= (CBAUD | CBAUDEX | CSIZE | CSTOPB | PARENB | PARODD); tty.c_cflag |= (HUPCL | CLOCAL | CREAD); /* Set up usual keys */ tty.c_cc[VINTR] = 3; /* ^C */ tty.c_cc[VQUIT] = 28; /* ^\ */ tty.c_cc[VERASE] = 127; tty.c_cc[VKILL] = 24; /* ^X */ tty.c_cc[VEOF] = 4; /* ^D */ tty.c_cc[VTIME] = 0; tty.c_cc[VMIN] = 1; tty.c_cc[VSTART] = 17; /* ^Q */ tty.c_cc[VSTOP] = 19; /* ^S */ tty.c_cc[VSUSP] = 26; /* ^Z */ /* Pre and post processing */ tty.c_iflag = (IGNPAR | ICRNL | IXON | IXANY); tty.c_oflag = (OPOST | ONLCR); tty.c_lflag = (ISIG | ICANON | ECHO | ECHOCTL | ECHOPRT | ECHOKE); /* Set the terminal line and flush it */ tcsetattr (0, TCSANOW, &tty); tcflush (0, TCIOFLUSH); } /* Copy to standard output and standard error */ while (dup (fd) < 2) ; return 0; } /** * system_mount: * @type: filesystem type, * @dir: mountpoint, * @flags: mount flags, * @options: mount options. * * Mount the kernel filesystem @type at @dir with @flags and mount options * @options, if not already mounted. This is used to ensure that the proc * and sysfs filesystems are always available. * * Returns: zero on success, negative value on raised error. **/ int system_mount (const char *type, const char *dir, unsigned long flags, const char *options) { nih_local char *parent = NULL; char * ptr; struct stat parent_stat; struct stat dir_stat; nih_assert (type != NULL); nih_assert (dir != NULL); /* Stat the parent directory of the mountpoint to obtain the dev_t */ ptr = strrchr (dir, '/'); nih_assert (ptr != NULL); parent = NIH_MUST (nih_strndup (NULL, dir, ptr == dir ? 1 : ptr - dir)); if (stat (parent, &parent_stat) < 0) nih_return_system_error (-1); /* Also stat the mountpoint to obtain the dev_t */ if (stat (dir, &dir_stat) < 0) nih_return_system_error (-1); /* If the two dev_ts do not match, then there is already a filesystem * mounted and we needn't do anything. */ if (parent_stat.st_dev != dir_stat.st_dev) return 0; /* Mount the filesystem */ if (mount ("none", dir, type, flags, options) < 0) nih_return_system_error (-1); return 0; } /** * system_mknod: * * @path: full path, * @mode: mode to create device with, * @dev: device major and minor numbers. * * Create specified device. * * Note that depending on the device, if an error occurs * it may not be reportable, hence no return value, * but an attempt to display an error. **/ void system_mknod (const char *path, mode_t mode, dev_t dev) { nih_assert (path); if (mknod (path, mode, dev) < 0 && errno != EEXIST) nih_error ("%s: %s", _("Unable to create device"), path); } /** * system_check_file: * * @path: full path, * @type: file type, * @dev: device major and minor numbers (only checked for character and * block devices). * * Perform checks on specified file. * * Returns: 0 if device exists and has the specified @path, * @type and @dev attributes, else -1. **/ int system_check_file (const char *path, mode_t type, dev_t dev) { struct stat statbuf; int ret; nih_assert (path); ret = stat (path, &statbuf); if (ret < 0 || ! ((statbuf.st_mode & S_IFMT) == type)) return -1; if (type == S_IFCHR || type == S_IFBLK) { if (major (statbuf.st_rdev) != major (dev) || minor (statbuf.st_rdev) != minor (dev)) return -1; } return 0; } upstart-1.13.2/init/quiesce.c0000664000175000017500000002136412373101356012777 00000000000000/* upstart * * quiesce.c - shutdown handling. * * Copyright © 2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include "quiesce.h" #include "events.h" #include "environ.h" #include "conf.h" #include "job_process.h" #include "control.h" #include /** * quiesce_requester: * * Where the quiesce request originated. This determines * the shutdown behaviour. **/ static QuiesceRequester quiesce_requester = QUIESCE_REQUESTER_INVALID; /** * quiesce_phase: * * Current phase of shutdown. **/ static QuiescePhase quiesce_phase = QUIESCE_PHASE_NOT_QUIESCED; /** * quiesce_reason: * * Human-readable string denoting what triggered the quiesce. **/ static char *quiesce_reason = NULL; /** * max_kill_timeout: * * Maxiumum kill_timeout value calculated from all running jobs used to * determine how long to wait before exiting. **/ static time_t max_kill_timeout = 0; /** * quiesce_phase_time: * * Time that a particular phase started. **/ static time_t quiesce_phase_time = 0; /** * quiesce_start_time: * * Time quiesce commenced. **/ static time_t quiesce_start_time = 0; /** * session_end_jobs: * * TRUE if any job specifies a 'start on' including SESSION_END_EVENT. * **/ static int session_end_jobs = FALSE; static int quiesce_event_match (Event *event) __attribute__ ((warn_unused_result)); /* External definitions */ extern int disable_respawn; /** * quiesce: * * @requester: where the quiesce request originated. * * Commence Session Init shutdown. **/ void quiesce (QuiesceRequester requester) { nih_local char **env = NULL; Event *event; job_class_init (); /* Quiesce already in progress */ if (quiesce_phase != QUIESCE_PHASE_NOT_QUIESCED) return; quiesce_requester = requester; /* System shutdown skips the wait phase to ensure all running * jobs get signalled. * * Note that jobs which choose to start on SESSION_END_EVENT may * not complete (or even start), but no guarantee is possible in * the system shutdown scenario since Session Inits must not * hold up the system. */ quiesce_phase = (requester == QUIESCE_REQUESTER_SYSTEM) ? QUIESCE_PHASE_KILL : QUIESCE_PHASE_WAIT; quiesce_reason = (requester == QUIESCE_REQUESTER_SESSION) ? _("logout") : _("shutdown"); nih_info (_("Quiescing due to %s request"), quiesce_reason); quiesce_start_time = quiesce_phase_time = time (NULL); /* Stop existing jobs from respawning */ disable_respawn = TRUE; /* Signal that the session is ending. This may start new jobs. * * Note that the event doesn't actually get emitted until the * next time the main loop gets a chance to run. */ env = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (environ_set (&env, NULL, NULL, TRUE, "TYPE=%s", quiesce_reason)); event = NIH_MUST (event_new (NULL, SESSION_END_EVENT, env)); /* Check if any jobs care about the session end event. If not, * the wait phase can be avoided entirely resulting in a much * faster shutdown. * * Note that simply checking if running instances exist is not * sufficient since if a job cares about the session end event, * it won't yet have started but needs to be given a chance to * run. */ if (quiesce_phase == QUIESCE_PHASE_WAIT) { session_end_jobs = quiesce_event_match (event); if (session_end_jobs) { /* Some as-yet unscheduled jobs care about the * session end event. They will be started the * next time through the main loop and will be * waited for (hence the quiesce phase is not * changed). * * However, already-running jobs *can* be stopped * at this time since by definition they do not * care about the session end event and may just * as well die now to avoid slowing the shutdown. */ job_process_stop_all (); } else { nih_debug ("Skipping wait phase"); quiesce_phase = QUIESCE_PHASE_KILL; } } if (quiesce_phase == QUIESCE_PHASE_KILL) { /* We'll attempt to wait for this long, but system * policy may prevent it such that we just get killed * and job processes reparented to PID 1. */ max_kill_timeout = job_class_max_kill_timeout (); job_process_stop_all (); } /* Check every second to see if all jobs have finished. If so, * we can exit early. */ NIH_MUST (nih_timer_add_periodic (NULL, 1, (NihTimerCb)quiesce_wait_callback, NULL)); } /** * quiesce_wait_callback: * * @data: not used, * @timer: timer that caused us to be called. * * Callback used to check if all jobs have finished and if so * finalise Session Init shutdown. **/ void quiesce_wait_callback (void *data, NihTimer *timer) { time_t now; nih_assert (timer); nih_assert (quiesce_phase_time); nih_assert (quiesce_requester != QUIESCE_REQUESTER_INVALID); now = time (NULL); if (quiesce_phase == QUIESCE_PHASE_KILL) { nih_assert (max_kill_timeout); if ((now - quiesce_phase_time) > max_kill_timeout) goto timed_out; } else if (quiesce_phase == QUIESCE_PHASE_WAIT) { int timed_out = 0; timed_out = ((now - quiesce_phase_time) >= QUIESCE_DEFAULT_JOB_RUNTIME); if (timed_out || (session_end_jobs && ! job_process_jobs_running ()) || ! job_process_jobs_running ()) { quiesce_phase = QUIESCE_PHASE_KILL; /* reset for new phase */ quiesce_phase_time = time (NULL); max_kill_timeout = job_class_max_kill_timeout (); job_process_stop_all (); } } else { nih_assert_not_reached (); } if (! job_process_jobs_running ()) goto out; return; timed_out: quiesce_show_slow_jobs (); out: /* Note that we might skip the kill phase for the session * requestor if no jobs are actually running at this point. */ quiesce_phase = QUIESCE_PHASE_CLEANUP; quiesce_finalise (); /* Deregister */ nih_free (timer); } /** * quiesce_show_slow_jobs: * * List jobs that are still running after their expected end time. **/ void quiesce_show_slow_jobs (void) { job_class_init (); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; /* Note that instances get killed in a random order */ NIH_HASH_FOREACH (class->instances, job_iter) { const char *name; Job *job; job = (Job *)job_iter; name = job_name (job); nih_warn ("job %s failed to stop", name); } } } /** * quiesce_finalise: * * Request shutdown. **/ void quiesce_finalise (void) { static int finalising = FALSE; time_t diff; nih_assert (quiesce_start_time); nih_assert (quiesce_phase == QUIESCE_PHASE_CLEANUP); if (finalising) return; finalising = TRUE; diff = time (NULL) - quiesce_start_time; nih_info (_("Quiesce %s sequence took %s%d second%s"), quiesce_reason, ! (int)diff ? "<" : "", (int)diff ? (int)diff : 1, diff <= 1 ? "" : "s"); nih_main_loop_exit (0); } /** * quiesce_complete: * * Force quiesce phase to finish. **/ void quiesce_complete (void) { quiesce_phase = QUIESCE_PHASE_CLEANUP; quiesce_finalise (); } /** * quiesce_event_match: * @event: event. * * Identify if any jobs _may_ start when the session ends. * * A simple heuristic is used such that there is no guarantee that the * jobs entire start condition will be satisfied at session-end. * * Returns: TRUE if any class specifies @event in its start * condition, else FALSE. **/ static int quiesce_event_match (Event *event) { nih_assert (event); job_class_init (); NIH_HASH_FOREACH (job_classes, iter) { JobClass *class = (JobClass *)iter; if (! class->start_on) continue; /* Note that only the jobs start on condition is * relevant. */ NIH_TREE_FOREACH_POST (&class->start_on->node, iter) { EventOperator *oper = (EventOperator *)iter; switch (oper->type) { case EVENT_OR: case EVENT_AND: break; case EVENT_MATCH: /* Job may attempt to start as the session ends */ if (event_operator_match (oper, event, NULL)) return TRUE; break; default: nih_assert_not_reached (); } } } return FALSE; } /** * quiesce_in_progress: * * Determine if shutdown is in progress. * * Returns: TRUE if quiesce is in progress, else FALSE. **/ int quiesce_in_progress (void) { return quiesce_phase != QUIESCE_PHASE_NOT_QUIESCED; } upstart-1.13.2/init/environ.h0000664000175000017500000000363712373101356013031 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_ENVIRON_H #define INIT_ENVIRON_H #include NIH_BEGIN_EXTERN char ** environ_add (char ***env, const void *parent, size_t *len, int replace, const char *str) __attribute__ ((warn_unused_result)); char ** environ_remove (char ***env, const void *parent, size_t *len, const char *str) __attribute__ ((warn_unused_result)); char ** environ_append (char ***env, const void *parent, size_t *len, int replace, char * const *new_env) __attribute__ ((warn_unused_result)); char ** environ_set (char ***env, const void *parent, size_t *len, int replace, const char *format, ...) __attribute__ ((warn_unused_result)); char * const *environ_lookup (char * const *env, const char *key, size_t len); const char * environ_get (char * const *env, const char *key); const char * environ_getn (char * const *env, const char *key, size_t len); int environ_all_valid (char * const *env); char * environ_expand (const void *parent, const char *string, char * const *env) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* INIT_ENVIRON_H */ upstart-1.13.2/init/errors.h0000664000175000017500000000621412373101356012657 00000000000000/* upstart * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_ERRORS_H #define INIT_ERRORS_H #include #include /* Allocated error numbers */ enum { UPSTART_ERROR_START = NIH_ERROR_APPLICATION_START, /* Errors while dealing with environment */ ENVIRON_ILLEGAL_PARAM, ENVIRON_UNKNOWN_PARAM, ENVIRON_EXPECTED_OPERATOR, ENVIRON_MISMATCHED_BRACES, /* Errors while handling job processes */ JOB_PROCESS_ERROR, JOB_PROCESS_INVALID_SETUID, JOB_PROCESS_INVALID_SETGID, /* Errors while parsing configuration files */ PARSE_ILLEGAL_INTERVAL, PARSE_ILLEGAL_EXIT, PARSE_ILLEGAL_SIGNAL, PARSE_ILLEGAL_UMASK, PARSE_ILLEGAL_NICE, PARSE_ILLEGAL_OOM, PARSE_ILLEGAL_LIMIT, PARSE_EXPECTED_EVENT, PARSE_EXPECTED_OPERATOR, PARSE_EXPECTED_VARIABLE, PARSE_MISMATCHED_PARENS, /* Errors while handling control requests */ CONTROL_NAME_TAKEN, /* Errors while manipulating cgroups */ CGROUP_ERROR }; /* Error strings for defined messages */ #define ENVIRON_ILLEGAL_PARAM_STR N_("Illegal parameter") #define ENVIRON_UNKNOWN_PARAM_STR N_("Unknown parameter") #define ENVIRON_EXPECTED_OPERATOR_STR N_("Expected operator") #define ENVIRON_MISMATCHED_BRACES_STR N_("Mismatched braces") #define JOB_PROCESS_INVALID_SETUID_STR N_("Invalid setuid user name does not exist") #define JOB_PROCESS_INVALID_SETGID_STR N_("Invalid setgid group name does not exist") #define JOB_PROCESS_SECURITY_STR N_("Failed to set security context") #define PARSE_ILLEGAL_INTERVAL_STR N_("Illegal interval, expected number of seconds") #define PARSE_ILLEGAL_EXIT_STR N_("Illegal exit status, expected integer") #define PARSE_ILLEGAL_SIGNAL_STR N_("Illegal signal status, expected integer") #define PARSE_ILLEGAL_UMASK_STR N_("Illegal file creation mask, expected octal integer") #define PARSE_ILLEGAL_NICE_STR N_("Illegal nice value, expected -20 to 19") #define PARSE_ILLEGAL_OOM_STR N_("Illegal oom adjustment, expected -16 to 15 or 'never'") #define PARSE_ILLEGAL_OOM_SCORE_STR N_("Illegal oom score adjustment, expected -999 to 1000 or 'never'") #define PARSE_ILLEGAL_LIMIT_STR N_("Illegal limit, expected 'unlimited' or integer") #define PARSE_EXPECTED_EVENT_STR N_("Expected event") #define PARSE_EXPECTED_OPERATOR_STR N_("Expected operator") #define PARSE_EXPECTED_VARIABLE_STR N_("Expected variable name before value") #define PARSE_MISMATCHED_PARENS_STR N_("Mismatched parentheses") #define CONTROL_NAME_TAKEN_STR N_("Name already taken") #endif /* INIT_ERRORS_H */ upstart-1.13.2/init/log.c0000664000175000017500000006177012373101356012127 00000000000000/* upstart * * log.c - persist job output to a log file. * * Copyright © 2011 Canonical Ltd. * Authors: Scott James Remnant , * James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include "log.h" #include "job_process.h" #include "session.h" #include "conf.h" #include "paths.h" static int log_file_open (Log *log); static int log_file_write (Log *log, const char *buf, size_t len); static void log_read_watch (Log *log); static void log_flush (Log *log); /** * log_flushed: * * TRUE if log_clear_unflushed() has been called successfully. **/ static int log_flushed = 0; /** * log_unflushed_files: * * List of NihListEntry objects containing Log objects which are no * longer associated with Job processes. * * All the entries in the list contain unflushed Log data. * * Used to capture job process output early in the boot process for * jobs that end before the log partition is mounted and writeable. **/ NihList *log_unflushed_files = NULL; /** * log_new: * * @parent: parent for new job class, * @path: full path to on-disk log file, * @fd: file descriptor associated with jobs stdout and stderr which * will be read from, * @uid: user id associated with this logger. * * Allocates and returns a new Log structure with the given @path * and @session. * * If @parent is not NULL, it should be a pointer to another object which * will be used as a parent for the returned job class. When all parents * of the returned job class are freed, the returned log will also be * freed. * * Note that @fd must refer to a valid and open pty(7) file * descriptor. * * Returns: newly allocated Log structure or NULL on error. **/ Log * log_new (const void *parent, const char *path, int fd, uid_t uid) { Log *log; size_t len; nih_assert (path); nih_assert (fd > 0); /* User job logging not currently available */ if (uid) return NULL; len = strlen (path); if (! len) return NULL; /* Ensure path is within bounds. * * PATH_MAX refers to a _relative path_. We should never * need to worry about that (large) value since we expect the * log directory to be an absolute path, but it pays to be * careful. * * Absolute paths have a different limit. */ if (path[0] == '/') { if (len+1 > _POSIX_PATH_MAX) return NULL; } else { if (len+1 > PATH_MAX) return NULL; } log = nih_new (parent, Log); if (! log) return NULL; log_unflushed_init (); log->fd = -1; log->uid = uid; log->unflushed = NULL; log->io = NULL; log->detached = 0; log->remote_closed = 0; log->open_errno = 0; log->path = nih_strndup (log, path, len); if (! log->path) goto error; log->unflushed = nih_io_buffer_new (log); if (! log->unflushed) goto error; log->io = nih_io_reopen (log, fd, NIH_IO_STREAM, (NihIoReader)log_io_reader, NULL, (NihIoErrorHandler)log_io_error_handler, log); if (! log->io) { /* Consume */ NihError *err = nih_error_get (); nih_free (err); goto error; } nih_alloc_set_destructor (log, log_destroy); return log; error: nih_free (log); return NULL; } /** * log_destroy: * * @log: Log. * * Called automatically when Log is being destroyed. * * XXX: Note that the fd associated with the jobs stdout and stderr (as * passed to log_new()) *MUST* be closed by the time this function is * called since it will continue to read from the fd until an error is * detected. This behaviour is required to ensure all job output is * read. * * Returns: 0 always. **/ int log_destroy (Log *log) { nih_assert (log); /* User job logging not currently available */ nih_assert (log->uid == 0); log_flush (log); /* Force file to flush */ if (log->fd != -1) close (log->fd); log->fd = -1; return 0; } /** * log_flush: * * @log: Log. * * Ensure that no job output data is buffered and attempt to flush all * unflushed data to disk. * * It is safe to call this function multiple times and may in fact be * necessary if the log file cannot be written for any reason. * * Note no return value since there isn't much that can be done at * the point this function is called should the flushing operations * fail. **/ static void log_flush (Log *log) { int ret; int flags; nih_assert (log); /* User job logging not currently available */ nih_assert (log->uid == 0); /* Job probably attempted to write data _only_ before the logger * could access the disk. Last ditch attempt to persist the * data. * * If any failures occur at this stage, we are powerless. */ if (log->unflushed->len) { if (log_file_open (log) < 0) goto out; ret = log_file_write (log, NULL, 0); if (ret < 0) { close (log->fd); log->fd = -1; goto out; } } if (log->io) { nih_assert (log->io->watch); /* If the job associated with this log produces output _after_ * nih_io_handle_fds() has been called in any loop of the main * loop and just before the job is destroyed, we will miss it. * * Therefore, attempt to read from the watch fd until we get an error. */ if (! log->remote_closed) log_read_watch (log); flags = fcntl (log->io->watch->fd, F_GETFL); if (flags < 0 && errno == EBADF) { /* The watch fd is now known to be invalid, so disable * the error handler to avoid an infinite loop where the * error handler attempts to free the NihIo, which would * error, causing the error handler to be called * _ad infinitum_. * * Note that the NihIo is freed via * nih_io_destroy(). */ log->io->error_handler = NULL; nih_free (log->io); log->io = NULL; } } /* Force file to flush */ if (log->fd != -1) close (log->fd); out: log->fd = -1; } /** * log_io_reader: * * @log: Log associated with this @io, * @io: NihIo with data to be read, * @buf: buffer data is available in, * @len: bytes in @buf available for reading. * * Called automatically when data is available to read on the fd * encapsulated in @io. * * Notes for user jobs: * * User jobs by necessity are handled differently to system jobs. Since * a user job must log their data to files owned by a non-root user, the * safest technique is for a process running as that user to create the * log file. If we simply redirected the jobs standard streams, this * would be simple: the job process itself could write the files. * However, since we want to give the impression the job is connected to * a real terminal by using a pseudo-tty, we necessarily need "some * other" process to handle the jobs logging as the user in question. * * Since most jobs do not produce any output it would be highly * inefficient to spawn such a logger process as soon as every user job * starts. Therefore the approach taken is the lazy one: create a user * logger process _when the job first produces output_. To avoid * terrible performance this process will then hang around until the job * has finished. * * Note that only the initial amount of data read from a user job is * necessarily buffered within init itself. This initial amount is very * small due to the default applied by nih_io_watcher_read(). * All subsequent job output is buffered within USER_LOGGER. **/ void log_io_reader (Log *log, NihIo *io, const char *buf, size_t len) { int ret; nih_assert (log); nih_assert (log->path); nih_assert (io); nih_assert (log->io == io); nih_assert (buf); nih_assert (len); /* User job logging not currently available */ nih_assert (log->uid == 0); /* Just in case we try to write more than read can inform us * about (this should really be a build-time assertion). */ nih_assert (sizeof (size_t) == sizeof (ssize_t)); ret = log_file_open (log); if (ret < 0) { if (log->open_errno != ENOSPC) { /* Add new data to unflushed buffer */ if (nih_io_buffer_push (log->unflushed, buf, len) < 0) return; } /* Note that we always discard when out of space */ nih_io_buffer_shrink (io->recv_buf, len); /* No point attempting to write if we cannot * open the file. */ return; } ret = log_file_write (log, buf, len); if (ret < 0) nih_warn ("%s %s", _("Failed to write to log file"), log->path); } /** * log_io_error_handler: * * @log: Log associated with this @io, * @io: NihIo. * * Called automatically when reading the jobs stdout/stderr causes * an error. This will occur when the parent attempts a read after * the child has exited abnormally. Note that this error is expected, * but we must provide this handler to nih_io_reopen() since we need * to consume the error to ensure NIH ignores it. */ void log_io_error_handler (Log *log, NihIo *io) { NihError *err; nih_assert (log); nih_assert (io); /* User job logging not currently available */ nih_assert (log->uid == 0); /* Consume */ err = nih_error_get (); nih_assert (err->number == EIO); nih_free (err); /* Ensure the NihIo is closed */ nih_free (log->io); log->io = NULL; log->remote_closed = 1; } /** * log_file_open: * @log: Log. * * Opens log file associated with @log if not already open. * * Returns: 0 on success, -1 on failure. **/ static int log_file_open (Log *log) { struct stat statbuf; int ret = -1; int mode = LOG_DEFAULT_MODE; mode_t old; int flags = (O_CREAT | O_APPEND | O_WRONLY | O_CLOEXEC | O_NOFOLLOW | O_NONBLOCK); nih_assert (log); nih_assert (log->path); /* User job logging not currently available */ nih_assert (log->uid == 0); memset (&statbuf, '\0', sizeof (struct stat)); ret = fstat (log->fd, &statbuf); /* Already open */ if (log->fd > -1 && (! ret && statbuf.st_nlink)) return 0; /* File was deleted. This isn't a problem for * the logger as it is happy to keep writing the * unlinked file, but it *is* a problem for * users who expect to see some data. Therefore, * close the file and attempt to rewrite it. * * This behaviour also allows tools such as logrotate(8) * to operate without disrupting the logger. */ if (log->fd > -1 && ! statbuf.st_nlink) { close (log->fd); log->fd = -1; } nih_assert (log->fd == -1); /* Impose some sane defaults. */ old = umask (LOG_DEFAULT_UMASK); /* Non-blocking to avoid holding up the main loop. Without * this, we'd probably need to spawn a thread to handle * job logging. */ log->fd = open (log->path, flags, mode); /* Restore */ umask (old); log->open_errno = errno; /* Open may have failed due to path being unaccessible * (disk might not be mounted yet). */ if (log->fd < 0) return -1; return 0; } /** * log_file_write: * * @log: Log, * @buf: buffer data is available in, * @len: bytes in @buf available for reading. * * Performs actual write to log file associated with @log. Note that * @buf can be NULL. If so, only unbuffered data will be written. * If @buf is NULL, @len is ignored. * * Special case: the filesystem is full. We have a few options, * none of them ideal. Part of the problem is that we cannot know * whether the problem *will be* transitory or not. * * Options: * * (a) Ignore the problem by simply continuing * to buffer unflushed data (unsafe: * eventually we'll run out of core and crash). * (b) Retain existing unflushed buffer, but * disable further appends (not reasonable * since if space does become available, the * most recent data will have been * discarded). * (c) Discard all unflushed data and store *all* * new data as unflushed (potentially unsafe * - in low disk space situations, programs may * produce *more* log messages to * stdout/stderr). * (d) Retain the last 'n' bytes of * data (unflushed + new), where 'n' is some * fixed value (ring buffer) What heuristic can * we use to decide upon 'n'? Since this is * output, 1024 bytes at 80 bytes per line * gives a reasonable amount of context. However, * if space later becomes available, there will * be mysterious gaps in the log files. * (e) Discard all new data (not ideal, but safe) * * In the interests of self-preservation, we have to assume the * problem is *not* transitory and as such we opt for the safest * option, namely option 'e' since: * * - We cannot cache all data (option 'a') as it could * result in a crash. * - Any other option which caches data will result in * a corrupted log file should space later become * available. * * Returns: 0 on success, -1 on failure. **/ static int log_file_write (Log *log, const char *buf, size_t len) { ssize_t wlen = 0; NihIo *io; int saved; nih_assert (log); nih_assert (log->path); nih_assert (log->unflushed); nih_assert (log->fd != -1); /* User job logging not currently available */ nih_assert (log->uid == 0); io = log->io; /* Flush any data we previously failed to write */ if (log->unflushed->len) { wlen = write (log->fd, log->unflushed->buf, log->unflushed->len); saved = errno; if (wlen < 0) { /* Failed to flush the unflushed data, so unlikely to be * able to flush the new data. Hence, add the new data * to the unflushed buffer. * * If this fails, we still want to indicate an error * condition, so no explicit return check. * * Note that data is always discarded when out of * space. */ if (saved != ENOSPC && len && nih_io_buffer_push (log->unflushed, buf, len) < 0) goto error; if (len) nih_io_buffer_shrink (io->recv_buf, len); /* Still need to indicate that the write failed */ goto error; } nih_io_buffer_shrink (log->unflushed, (size_t)wlen); } /* Only managed a partial write for the unflushed data, * so don't attempt to write the new data as that would * leave a gap in the log. Just store the new data for * next time. */ if (log->unflushed->len) { if (! len) goto error; /* Save new data */ if (nih_io_buffer_push (log->unflushed, buf, len) < 0) goto error; nih_io_buffer_shrink (io->recv_buf, len); goto error; } if (! buf || ! len) return 0; /* Write the new data */ wlen = write (log->fd, buf, len); saved = errno; if (wlen < 0) { if (saved != ENOSPC && nih_io_buffer_push (log->unflushed, buf, len) < 0) goto error; nih_io_buffer_shrink (io->recv_buf, len); goto error; } /* Shrink buffer by amount of data written (which handles * partial writes) */ nih_io_buffer_shrink (io->recv_buf, (size_t)wlen); return 0; error: close (log->fd); log->fd = -1; return -1; } /** * log_read_watch: * * @log: Log. * * Attempt a final read from the watch descriptor to ensure we've * drained all the data from the job. * * This can only legitimately be called after the associated primary job * process has finished. **/ void log_read_watch (Log *log) { NihIo *io; ssize_t len; int saved; nih_assert (log); /* Must not be called if there is unflushed data as the log * would then not be written in order. */ io = log->io; if (! io) return; /* Slurp up any remaining data from the job that is cached in * the kernel. Keep reading until we get EOF or an error * condition. */ while (1) { /* Ensure we have some space to read data from the job */ if (nih_io_buffer_resize (io->recv_buf, LOG_READ_SIZE) < 0) break; errno = 0; /* Append to buffer */ len = read (io->watch->fd, io->recv_buf->buf + io->recv_buf->len, io->recv_buf->size - io->recv_buf->len); saved = errno; if (len > 0) io->recv_buf->len += len; if (io->recv_buf->len) log_io_reader (log, io, io->recv_buf->buf, io->recv_buf->len); /* This scenario indicates the process that has now * ended has leaked one or more file descriptors to a * child process, and that child process is still * running. We know this since EAGAIN/EWOULDBLOCK * indicate there _may_ be further data to read in the * future, but that isn't possible as the process we care * about has now ended. Thus a leakage must have * occured such that data may be available in the future * _from some other process_ that is holding the fd(s) open. * * For daemons, this is generally a bug (see for example bug 926468). * * Only display the message in debug mode though since * it is not unusual for script sections to leak fds. */ if (len < 0 && (saved == EAGAIN || saved == EWOULDBLOCK)) { nih_debug ("%s %s", "Process associated with log leaked a file descriptor", log->path); } /* Either the job process (remote) end of the pty has * been closed, or there really is no (more) data to be read. * * If an error occurs, it is likely to be EIO (remote * end closed) or EBADF (fd invalid if exec(3) failed). * But erring on the side of caution, any unusual error * causes the loop to be exited. */ if (len <= 0) { if (saved == EINTR) continue; /* Job process has ended and we've drained all the data the job * produced, so remote end must have closed. * * This cannot be handled entirely by log_io_error_handler() * since the job may produce some output prior to disks being * writeable, then end without producing further output. * In this scenario the error handler is never called. * */ if (saved && saved != EAGAIN && saved != EWOULDBLOCK) log->remote_closed = 1; close (log->fd); log->fd = -1; break; } } } /** * log_unflushed_init: * * Initialise the log_unflushed_files list. **/ void log_unflushed_init (void) { if (! log_unflushed_files) log_unflushed_files = NIH_MUST (nih_list_new (NULL)); } /** * log_handle_unflushed: * @parent: parent of log, * @log: log. * * Potentially add specified log to list of unflushed log files * (for processing when a disk becomes writeable). * * This function should be called for each log object at the time the * associated process exits to ensure that all data from that process is * captured to the log. * * Returns: 0 on success (log added to list), 1 if log does not need to * be added to the list, or -1 on error. **/ int log_handle_unflushed (void *parent, Log *log) { NihListEntry *elem; nih_assert (log); nih_assert (log->detached == 0); log_read_watch (log); if (! log->unflushed->len) return 1; if ((log->open_errno != EROFS && log->open_errno != EPERM && log->open_errno != EACCES) || log_flushed) return 1; log_unflushed_init (); /* re-parent */ nih_ref (log, log_unflushed_files); nih_unref (log, parent); elem = nih_list_entry_new (log); if (! elem) { /* If memory is low, we discard the unflushed * data buffer too. */ nih_unref (log, log_unflushed_files); return -1; } /* Indicate separation from parent */ log->detached = 1; elem->data = log; nih_list_add_after (log_unflushed_files, &elem->entry); return 0; } /* log_clear_unflushed: * * Attempt to flush all unflushed log buffers to persistent storage. * * Call once the log disk partition is mounted as read-write. * * Returns: 0 on success, -1 on error. */ int log_clear_unflushed (void) { log_unflushed_init (); NIH_LIST_FOREACH_SAFE (log_unflushed_files, iter) { NihListEntry *elem; Log *log; elem = (NihListEntry *)iter; log = elem->data; /* To be added to this list, log should have been * detached from its parent job. */ nih_assert (log->detached); /* We expect 'an' error (as otherwise why would the log be * in this list?), but don't assert EROFS specifically * as a precaution (since an attempt to flush the log at * another time may result in some other errno value). */ nih_assert (log->open_errno); if (log->remote_closed) { /* Parent job has ended and unflushed data * exists. */ nih_assert (log->unflushed->len); } else { /* Parent job itself has ended, but job spawned one or * more processes that are still running and * which might still produce output (the error * handler has therefore not been called). */ nih_assert (log->io); } if (log_file_open (log) != 0) return -1; if (log_file_write (log, NULL, 0) < 0) return -1; /* This will handle any remaining unflushed log data */ nih_free (log); } log_flushed = 1; return 0; } /** * log_serialise: * @log: log to serialise. * * Convert @log into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised Log object, or NULL on error. **/ json_object * log_serialise (Log *log) { json_object *json; nih_local char *unflushed_hex = NULL; json = json_object_new_object (); if (! json) return NULL; if (! log || (! log->io && log->unflushed && ! log->unflushed->len)) goto placeholder; /* Attempt to flush any cached data */ if (log->unflushed && log->unflushed->len) { /* Don't check return values since if this fails and * unflushed data remains, we encode it below. */ if (log->fd < 0) (void)log_file_open (log); if (log->fd != -1) (void)log_file_write (log, NULL, 0); } /* Job associated with log has ended. If we failed to write * unflushed data above, it will now be lost as we cannot * create a valid serialisation without an associated NihIo. */ if (! log->io) goto placeholder; if (! state_set_json_int_var_from_obj (json, log, fd)) goto error; nih_assert (log->io->watch); if (! state_set_json_int_var (json, "io_watch_fd", log->io->watch->fd)) goto error; if (! state_set_json_string_var_from_obj (json, log, path)) goto error; /* log->io itself is not encoded */ if (! state_set_json_int_var_from_obj (json, log, uid)) goto error; /* Encode unflushed data as hex to ensure any embedded * nulls are handled. */ if (log->unflushed && log->unflushed->len) { unflushed_hex = state_data_to_hex (NULL, log->unflushed->buf, log->unflushed->len); if (! unflushed_hex) goto error; if (! state_set_json_string_var (json, "unflushed", unflushed_hex)) goto error; } if (! state_set_json_int_var_from_obj (json, log, detached)) goto error; if (! state_set_json_int_var_from_obj (json, log, remote_closed)) goto error; if (! state_set_json_int_var_from_obj (json, log, open_errno)) goto error; return json; placeholder: /* Create a "placeholder" log object for non-existent * log objects and for those that are no longer usable. */ if (! state_set_json_string_var (json, "path", NULL)) goto error; return json; error: json_object_put (json); return NULL; } /** * log_deserialise: * @json: JSON-serialised Log object to deserialise. * * Convert @json into a Log object. * * Returns: Log object, or NULL on error. **/ Log * log_deserialise (const void *parent, json_object *json) { Log *log; nih_local char *unflushed_hex = NULL; nih_local char *unflushed = NULL; int ret; size_t len; nih_local char *path = NULL; int io_watch_fd = -1; uid_t uid = (uid_t)-1; nih_assert (json); log_unflushed_init (); if (! state_check_json_type (json, object)) return NULL; if (! state_get_json_string_var (json, "path", NULL, path)) return NULL; if (! path) { /* placeholder log object */ return NULL; } if (! state_get_json_int_var (json, "io_watch_fd", io_watch_fd)) return NULL; nih_assert (io_watch_fd != -1); /* re-apply CLOEXEC flag to stop job fd being leaked to children */ if (state_modify_cloexec (io_watch_fd, TRUE) < 0) return NULL; if (! state_get_json_int_var (json, "uid", uid)) return NULL; log = log_new (parent, path, io_watch_fd, uid); if (! log) return NULL; if (! state_get_json_int_var_to_obj (json, log, fd)) goto error; /* Re-apply CLOEXEC flag to stop log file fd being leaked to children. * * Note we discard return value since if this fails, * we would never close the fd. */ if (log->fd != -1) (void)state_modify_cloexec (log->fd, TRUE); log->unflushed = nih_io_buffer_new (log); if (! log->unflushed) goto error; if (json_object_object_get_ex (json, "unflushed", NULL)) { if (! state_get_json_string_var_strict (json, "unflushed", NULL, unflushed_hex)) goto error; ret = state_hex_to_data (NULL, unflushed_hex, strlen (unflushed_hex), &unflushed, &len); if (ret < 0) goto error; if (nih_io_buffer_push (log->unflushed, unflushed, len) < 0) goto error; } if (! state_get_json_int_var_to_obj (json, log, detached)) goto error; if (! state_get_json_int_var_to_obj (json, log, remote_closed)) goto error; if (! state_get_json_int_var_to_obj (json, log, open_errno)) goto error; return log; error: nih_free (log); return NULL; } upstart-1.13.2/init/conf.c0000664000175000017500000014551012373101356012266 00000000000000/* upstart * * conf.c - configuration management * * Copyright 2009,2010,2011,2012,2013 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "parse_job.h" #include "parse_conf.h" #include "conf.h" #include "errors.h" #include "paths.h" #include "environ.h" /* Prototypes for static functions */ static int conf_source_reload_file (ConfSource *source) __attribute__ ((warn_unused_result)); static int conf_source_reload_dir (ConfSource *source) __attribute__ ((warn_unused_result)); static int conf_file_filter (ConfSource *source, const char *path, int is_dir); static int conf_dir_filter (ConfSource *source, const char *path, int is_dir); static void conf_create_modify_handler (ConfSource *source, NihWatch *watch, const char *path, struct stat *statbuf); static void conf_delete_handler (ConfSource *source, NihWatch *watch, const char *path); static int conf_file_visitor (ConfSource *source, const char *dirname, const char *path, struct stat *statbuf) __attribute__ ((warn_unused_result)); static int conf_reload_path (ConfSource *source, const char *path, const char *override_path) __attribute__ ((warn_unused_result)); static inline int is_conf_file (const char *path) __attribute__ ((warn_unused_result)); static inline int is_conf_file_std (const char *path) __attribute__ ((warn_unused_result)); static inline int is_conf_file_override(const char *path) __attribute__ ((warn_unused_result)); static inline char *toggle_conf_name (const void *parent, const char *path) __attribute__ ((warn_unused_result)); static inline char * conf_to_job_name (const char *source_path, const char *conf_path) __attribute__ ((warn_unused_result)); static char * conf_get_best_override (const char *name, const ConfSource *last_source) __attribute__ ((warn_unused_result)); /** * user_mode: * * If TRUE, upstart runs in user session mode. **/ int user_mode = FALSE; /** * session_file: * * Full path to file containing UPSTART_SESSION details (only set when * user_mode in operation). * * File is created on startup and removed on clean shutdown. **/ const char *session_file = NULL; /** * conf_sources: * * This list holds the list of known sources of configuration; each item * is a ConfSource structure. The order of this list dictates the priority * of the sources, with the first one having the highest priority. **/ NihList *conf_sources = NULL; extern json_object *json_conf_sources; /** * is_conf_file_std: * @path: path to check. * * Determine if specified path contains a legitimate * configuration file name. * * Returns: TRUE if @path contains a valid configuration file name, * else FALSE. * **/ static inline int is_conf_file_std (const char *path) { nih_assert (path != NULL); char *ptr = strrchr (path, '.'); if (ptr && IS_CONF_EXT_STD (ptr)) return TRUE; return FALSE; } /** * is_conf_file_override: * @path: path to check. * * Determine if specified path contains a legitimate * override file name. * * Returns: TRUE if @path contains a valid override file name, * else FALSE. * **/ static inline int is_conf_file_override (const char *path) { nih_assert (path != NULL); char *ptr = strrchr (path, '.'); if (ptr && IS_CONF_EXT_OVERRIDE (ptr)) return TRUE; return FALSE; } /** * is_conf_file: * @path: path to check. * * Determine if specified path contains a legitimate * configuration file or override file name. * * Returns: TRUE if @path contains a valid configuration * file or override file name, else FALSE. * **/ static inline int is_conf_file (const char *path) { nih_assert (path != NULL); char *ptr = strrchr (path, '.'); if (ptr && (ptr > path) && (ptr[-1] != '/') && IS_CONF_EXT (ptr)) return TRUE; return FALSE; } /** * conf_to_job_name: * @source_path: path to ConfSource * @conf_path: path to configuration file * * Constructs the job name for a given @conf_path. Removes * @source_path directory name from the front of @conf_path and * extension from the end. * * Returns: newly-allocated name. * **/ static inline char * conf_to_job_name (const char * source_path, const char * conf_path) { const char *start, *end; char *name = NULL; int source_len; nih_assert (source_path != NULL); nih_assert (conf_path != NULL); start = conf_path; source_len = strlen (source_path); if (! strncmp (start, source_path, source_len)) start += source_len; while (*start == '/') start++; end = strrchr (start, '.'); if (end && IS_CONF_EXT (end)) name = NIH_MUST (nih_strndup (NULL, start, end - start)); else name = NIH_MUST (nih_strdup (NULL, start)); return name; } /** * conf_get_best_override: * @conf_file: conf_file object * * Given a @conf_file iterate over all config sources & find the * first applicable override file. It will not look for override files * beyond the @conf_file's ConfSource. * * Returns: newly allocated path to override file or NULL. **/ static char * conf_get_best_override (const char *name, const ConfSource *last_source) { char *try_path=NULL; struct stat statbuf; nih_assert (name != NULL); nih_assert (last_source != NULL); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; /* Look at directories only */ if (source->type == CONF_FILE) continue; /* Reclaim memory */ if (try_path) nih_free (try_path); /* construct path */ try_path = NIH_MUST (nih_sprintf (NULL, "%s/%s%s", source->path, name, CONF_EXT_OVERRIDE)); /* Found it! */ if (lstat (try_path, &statbuf) == 0 && S_ISREG (statbuf.st_mode)) return try_path; /* Warning, you have reached the end of the conveyor! * Ignore overrides beyond .conf itself. */ if (source == last_source) break; } if (try_path) nih_free (try_path); return NULL; } /** * Convert a configuration file name to an override file name and vice * versa. * * For example, if @path is "foo.conf", this function will return * "foo.override", whereas if @path is "foo.override", it will return * "foo.conf". * * @parent: parent of returned path, * @path: path to a configuration file. * * Returns: newly allocated toggled path, or NULL on error. **/ static inline char * toggle_conf_name (const void *parent, const char *path) { char *new_path; char *ext; char *new_ext; size_t len; ext = strrchr (path, '.'); if (!ext) return NULL; new_ext = IS_CONF_EXT_STD (ext) ? CONF_EXT_OVERRIDE : CONF_EXT_STD; len = strlen (new_ext); new_path = NIH_MUST (nih_strndup (parent, path, (ext - path) + len)); memcpy (new_path + (ext - path), new_ext, len); return new_path; } /** * conf_init: * * Initialise the conf_sources list. **/ void conf_init (void) { if (! conf_sources) conf_sources = NIH_MUST (nih_list_new (NULL)); } /** * conf_destroy: * * Clear: the conf_sources list. **/ void conf_destroy (void) { if (conf_sources) nih_free (conf_sources); } /** * conf_source_new: * @parent: parent of new block, * @path: path to source, * @type: type of source. * * Allocates and returns a new ConfSource structure for the given @path; * @type indicates whether this @path is a file or directory and what type * of files are within the directory. * * The returned structure is automatically added to the conf_sources list. * * Configuration is not parsed immediately, instead you must call * conf_source_reload() on this source to set up any watches and load the * current configuration. Normally you would set up all of the sources and * then call conf_reload() which will load them all. * * If @parent is not NULL, it should be a pointer to another allocated * block which will be used as the parent for this block. When @parent * is freed, the returned block will be freed too. * * Returns: newly allocated ConfSource structure or NULL if * insufficient memory. **/ ConfSource * conf_source_new (const void *parent, const char *path, ConfSourceType type) { ConfSource *source; nih_assert (path != NULL); conf_init (); source = nih_new (parent, ConfSource); if (! source) return NULL; nih_list_init (&source->entry); source->path = nih_strdup (source, path); if (! source->path) { nih_free (source); return NULL; } source->type = type; source->watch = NULL; source->session = NULL; source->flag = FALSE; source->files = nih_hash_string_new (source, 0); if (! source->files) { nih_free (source); return NULL; } nih_alloc_set_destructor (source, nih_list_destroy); nih_list_add (conf_sources, &source->entry); return source; } /** * conf_file_new: * @source: configuration source, * @path: path to file. * * Allocates and returns a new ConfFile structure for the given @source, * with @path indicating which file it is. * * The returned structure is automatically placed in the @source's files hash * and the flag of the returned ConfFile will be set to that of the @source. * * Returns: newly allocated ConfFile structure or NULL if insufficient memory. **/ ConfFile * conf_file_new (ConfSource *source, const char *path) { ConfFile *file; nih_assert (source != NULL); nih_assert (path != NULL); file = nih_new (source, ConfFile); if (! file) return NULL; nih_list_init (&file->entry); file->path = nih_strdup (file, path); if (! file->path) { nih_free (file); return NULL; } file->source = source; file->flag = source->flag; file->data = NULL; nih_alloc_set_destructor (file, conf_file_destroy); nih_hash_add (source->files, &file->entry); return file; } /** * conf_reload: * * Reloads configuration sources. * * Watches on new configuration sources are established so that future * changes will be automatically detected with inotify. Then for both * new and existing sources, the current state is parsed. * * All ConfFiles are recreated as part of the reload. If the JobClass * associated with a ConfSource has no Job instances, the JobClass is * recreated and added to the job_classes hash. * * However, if a JobClass has running instances at reload time, although * a new ConfSource *and* a new JobClass are created, the new JobClass * (called the "best") will *NOT* be added to the job_classes hash until * the last running instance has finished. At this point, the "registered" * JobClass will be removed from the hash (when job_class_reconsider() * is called by job_change_state()) and replaced by the "best" (newest) * JobClass. * * Any errors are logged through the usual mechanism, and not returned, * since some configuration may have been parsed; and it's possible to * parse no configuration without error. **/ void conf_reload (void) { conf_init (); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; if (conf_source_reload (source) < 0) { NihError *err; err = nih_error_get (); if (err->number != ENOENT) nih_error ("%s: %s: %s", source->path, _("Unable to load configuration"), err->message); nih_free (err); } } } /** * conf_source_reload: * @source: configuration source to reload. * * Reloads the given configuration @source. * * If not already established, an inotify watch is created so that future * changes to this source are automatically detected and parsed. For files, * this watch is actually on the parent directory, since we need to watch * out for editors that rename over the top, etc. * * We then parse the current state of the source. The flag member is * toggled first, and this is propagated to all new and modified files and * items that we find as a result of parsing. Once done, we scan for * anything with the wrong flag, and delete them. * * Returns: zero on success, negative value on raised error. **/ int conf_source_reload (ConfSource *source) { NihList deleted; int ret; nih_assert (source != NULL); nih_info (_("Loading configuration from %s"), source->path); /* Toggle the flag so we can detect deleted files and items. */ source->flag = (! source->flag); /* Reload the source itself. */ switch (source->type) { case CONF_FILE: ret = conf_source_reload_file (source); break; case CONF_DIR: case CONF_JOB_DIR: ret = conf_source_reload_dir (source); break; default: nih_assert_not_reached (); } /* Scan for files that have been deleted since the last time we * reloaded; these are simple to detect, as they will have the wrong * flag. * * We take them out of the files list and then we can delete the * attached jobs and free the file. We can't just do this from * the one loop because to delete the jobs, we need to be able * to iterate the sources and files. */ nih_list_init (&deleted); NIH_HASH_FOREACH_SAFE (source->files, iter) { ConfFile *file = (ConfFile *)iter; if (file->flag != source->flag) nih_list_add (&deleted, &file->entry); } NIH_LIST_FOREACH_SAFE (&deleted, iter) { ConfFile *file = (ConfFile *)iter; nih_info (_("Handling deletion of %s"), file->path); nih_unref (file, source); } return ret; } /** * conf_source_reload_file: * @source: configuration source to reload. * * Reloads the configuration file specified by @source. * * If not already established, an inotify watch is created on the parent * directory so that future changes to the file are automatically detected * and parsed. It is the parent directory because we need to watch out for * editors that rename over the top, etc. * * Returns: zero on success, negative value on raised error. **/ static int conf_source_reload_file (ConfSource *source) { NihError *err = NULL; nih_local char *override_path = NULL; struct stat statbuf; nih_assert (source != NULL); nih_assert (source->type == CONF_FILE); /* this function should only be called for standard * configuration files. */ if (! source->watch) { nih_local char *dpath = NULL; char *dname; dpath = NIH_MUST (nih_strdup (NULL, source->path)); dname = dirname (dpath); source->watch = nih_watch_new (source, dname, FALSE, FALSE, (NihFileFilter)conf_file_filter, (NihCreateHandler)conf_create_modify_handler, (NihModifyHandler)conf_create_modify_handler, (NihDeleteHandler)conf_delete_handler, source); /* If successful mark the file descriptor close-on-exec, * otherwise stash the error for comparison with a later * failure to parse the file. */ if (source->watch) { nih_io_set_cloexec (source->watch->fd); } else { err = nih_error_steal (); } } /* Parse the file itself. If this fails, then we can discard the * inotify error, since this one will be better. */ if (conf_reload_path (source, source->path, NULL) < 0) { if (err) nih_free (err); return -1; } /* We were able to parse the file, but were not able to set up an * inotify watch. This isn't critical, so we just warn about it, * unless this is simply that inotify isn't supported, in which case * we do nothing. */ if (err) { if (err->number != ENOSYS) nih_warn ("%s: %s: %s", source->path, _("Unable to watch configuration file"), err->message); nih_free (err); } if (! is_conf_file_std (source->path)) return 0; override_path = toggle_conf_name (NULL, source->path); if (lstat (override_path, &statbuf) != 0) return 0; nih_debug ("Updating configuration for %s from %s", source->path, override_path); if (conf_reload_path (source, source->path, override_path) < 0) { if (err) nih_free (err); return -1; } return 0; } /** * conf_source_reload_dir: * @source: configuration source to reload. * * Reloads the configuration directory specified by @source. * * If not already established, an inotify watch is created on the directory * so that future changes to the structure or files within it are * automatically parsed. This has the side-effect of parsing the current * tree. * * Otherwise we walk the tree ourselves and parse all files that we find, * propagating the value of the flag member to all files so that deletion * can be detected by the calling function. * * Returns: zero on success, negative value on raised error. **/ static int conf_source_reload_dir (ConfSource *source) { NihError *err = NULL; nih_assert (source != NULL); nih_assert (source->type != CONF_FILE); if (! source->watch) { source->watch = nih_watch_new (source, source->path, TRUE, TRUE, (NihFileFilter)conf_dir_filter, (NihCreateHandler)conf_create_modify_handler, (NihModifyHandler)conf_create_modify_handler, (NihDeleteHandler)conf_delete_handler, source); /* If successful, the directory tree will have been walked * already; so just mark the file descriptor close-on-exec * and return; otherwise we'll try and walk ourselves, so * stash the error for comparison. */ if (source->watch) { nih_io_set_cloexec (source->watch->fd); return 0; } else { err = nih_error_steal (); } } /* We're either performing a mandatory reload, or we failed to set * up an inotify watch; walk the directory tree the old fashioned * way. If this fails too, then we can discard the inotify error * since this one will be better. */ if (nih_dir_walk (source->path, (NihFileFilter)conf_dir_filter, (NihFileVisitor)conf_file_visitor, NULL, source) < 0) { if (err) nih_free (err); return -1; } /* We were able to walk the directory, but were not able to set up * an inotify watch. This isn't critical, so we just warn about it, * unless this is simply that inotify isn't supported, in which case * we do nothing. */ if (err) { if (err->number != ENOSYS) nih_warn ("%s: %s: %s", source->path, _("Unable to watch configuration directory"), err->message); nih_free (err); } return 0; } /** * conf_file_filter: * @source: configuration source, * @path: path to check, * @is_dir: TRUE if @path is a directory. * * When we watch the parent directory of a file for changes, we receive * notification about all changes to that directory. We only care about * those that affect the path in @source, and the path that we're watching, * so we use this function to filter out all others. * * Returns: FALSE if @path matches @source, TRUE otherwise. **/ static int conf_file_filter (ConfSource *source, const char *path, int is_dir) { nih_assert (source != NULL); nih_assert (path != NULL); if (! strcmp (source->path, path)) return FALSE; if (! strcmp (source->watch->path, path)) return FALSE; return TRUE; } /** * conf_dir_filter: * @source: configuration source, * @path: path to check, * @is_dir: TRUE of @path is a directory. * * This is the file filter used for the jobs directory, we only care * about paths with particular extensions (see IS_CONF_EXT). * * Directories that match the nih_file_ignore() function are also ignored. * * Returns: FALSE if @path ends in ".conf" or ".override", * or is the original source, TRUE otherwise. **/ static int conf_dir_filter (ConfSource *source, const char *path, int is_dir) { nih_assert (source != NULL); nih_assert (path != NULL); if (! strcmp (source->path, path)) return FALSE; if (is_dir) return nih_file_ignore (NULL, path); if (is_conf_file (path)) return FALSE; return TRUE; } /** * conf_load_path_with_override: * @source: configuration source * @conf_path: path to config file * * Loads given @conf_path as a config file in a given @source. Then it * finds an override file. If an override file is found it applies it * as well. **/ static void conf_load_path_with_override (ConfSource *source, const char *conf_path) { int ret = 0; const char *error_path = NULL; char *override_path = NULL; nih_local char *job_name = NULL; nih_assert (source != NULL); nih_assert (conf_path != NULL); /* reload conf file */ nih_debug ("Loading configuration file %s", conf_path); ret = conf_reload_path (source, conf_path, NULL); if (ret < 0) { error_path = conf_path; goto error; } job_name = conf_to_job_name (source->path, conf_path); override_path = conf_get_best_override (job_name, source); if (! override_path) return; /* overlay override settings */ nih_debug ("Loading override file %s for %s", conf_path, override_path); ret = conf_reload_path (source, conf_path, override_path); if (ret < 0) { error_path = override_path; goto error; } nih_free (override_path); return; error: { NihError *err; err = nih_error_get (); nih_error ("%s: %s: %s", error_path, _("Error while loading configuration file"), err->message); nih_free (err); if (override_path) nih_free (override_path); return; } } /** * conf_create_modify_handler: * @source: configuration source, * @watch: NihWatch for source, * @path: full path to modified file, * @statbuf: stat of @path. * * This function will be called whenever a file is created in a directory * that we're watching, moved into the directory we're watching, or is * modified. This works for both directory and file sources, since the * watch for the latter is on the parent and filtered to only return the * path that we're interested in. * * After checking that it was a regular file that was changed, we reload it; * we expect this to fail sometimes since the file may be only partially * written. **/ static void conf_create_modify_handler (ConfSource *source, NihWatch *watch, const char *path, struct stat *statbuf) { ConfFile *file = NULL; char *config_path = NULL; nih_local char *job_name = NULL; nih_assert (source != NULL); nih_assert (watch != NULL); nih_assert (path != NULL); /* note that symbolic links are ignored */ if (statbuf && ! S_ISREG (statbuf->st_mode)) return; /* ignore non-config file changes */ if (! is_conf_file (path)) return; /* For config file, load it and it's override file */ if (is_conf_file_std (path)) { conf_load_path_with_override (source, path); return; } /* For override files, reload all matching conf+override combos */ job_name = conf_to_job_name (source->path, path); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; if (source->type == CONF_FILE) continue; config_path = NIH_MUST (nih_sprintf (NULL, "%s/%s%s", source->path, job_name, CONF_EXT_STD)); file = (ConfFile *)nih_hash_lookup (source->files, config_path); if (file) { /* Find its override file and reload both */ conf_load_path_with_override (source, config_path); } nih_free (config_path); } return; } /** * conf_delete_handler: * @source: configuration source, * @watch: NihWatch for source, * @path: full path to deleted file. * * This function will be called whenever a file is removed or moved out * of a directory that we're watching. This works for both directory and * file sources, since the watch for the latter is on the parent and * filtered to only return the path that we're interested in. * * We lookup the file in our hash table, and if we can find it, perform * the usual deletion of it. **/ static void conf_delete_handler (ConfSource *source, NihWatch *watch, const char *path) { ConfFile *file; nih_local char *new_path = NULL; nih_assert (source != NULL); nih_assert (watch != NULL); nih_assert (path != NULL); /* Lookup the file in the source. If we haven't parsed it, this * could actually mean that it was the top-level directory itself * that was deleted, in which case we free the watch, otherwise * it's probably a directory or something, so just ignore it. */ file = (ConfFile *)nih_hash_lookup (source->files, path); /* Note we have to be careful to consider deletion of directories too. * This is handled implicitly by the override check which will return * false if passed a directory in this case. */ if (! file && ! is_conf_file_override (path)) { if (! strcmp (watch->path, path)) { nih_warn ("%s: %s", source->path, _("Configuration directory deleted")); nih_unref (source->watch, source); source->watch = NULL; } return; } /* non-override files (and directories) are the simple case, so handle * them and leave. */ if (! is_conf_file_override (path)) { nih_unref (file, source); return; } /* Deleting override file is about the same as changing one. * We need to iterate across all matching jobs and reload them * with new "best" override file, if any. */ nih_debug ("Reloading configuration for matching configs on deletion of override (%s)", path); conf_create_modify_handler (source, watch, path, NULL); } /** * conf_file_visitor: * @source: configuration source, * @dirname: top-level directory being walked, * @path: path found in directory, * @statbuf: stat of @path. * * This function is called when walking a directory tree for each file * found within it. * * After checking that it's a regular file, we reload it. * * Returns: always zero. **/ static int conf_file_visitor (ConfSource *source, const char *dirname, const char *path, struct stat *statbuf) { nih_assert (source != NULL); nih_assert (dirname != NULL); nih_assert (path != NULL); nih_assert (statbuf != NULL); if (! S_ISREG (statbuf->st_mode)) return 0; if (is_conf_file_std (path)) conf_load_path_with_override (source, path); return 0; } /** * conf_reload_path: * @source: configuration source, * @path: path of conf file to be reloaded. * @override_path: if not NULL and @path refers to a path associated with @source, * overlay the contents of @path into the existing @source entry for * @path. If FALSE, discard any existing knowledge of @path. * * This function is used to parse the file at @path (or @override_path) in the * context of the given configuration @source. Necessary ConfFile structures * are allocated and attached to @source as appropriate. CONF_FILE sources * always have a single ConfFile when the file exists. * * If the file has been parsed before, then the existing item is deleted and * freed if the file fails to load, or after the new item has been parsed. * Items are only reused between reloads if @override_path is * non-NULL. * * Physical errors are returned, parse errors are not. * * Returns: zero on success, negative value on raised error. **/ static int conf_reload_path (ConfSource *source, const char *path, const char *override_path) { ConfFile *file = NULL; ConfFile *orig = NULL; nih_local char *buf = NULL; nih_local char *name = NULL; size_t len, pos, lineno; NihError *err = NULL; const char *path_to_load; nih_assert (source != NULL); nih_assert (path != NULL); path_to_load = (override_path ? override_path : path); /* If there is no corresponding override file, look up the old * conf file in memory, and then free it. In cases of failure, * we discard it anyway, so there's no particular reason * to keep it around anymore. * * Notes: * * - If @override_path has been specified, do not free the file * if found, since we want to _update_ the existing entry. * - Freeing a ConfFile does _not_ necessarily free its associated * JobClass. */ orig = (ConfFile *)nih_hash_lookup (source->files, path); if (! override_path && orig) { /* Found an existing ConfFile. We will free this, but * just not yet since iff that ConfFiles associated JobClass * does not have any running instances, freeing the * ConfFile will cause the original JobClass associated * with this ConfFile to be destroyed. But if the JobClass * had referenced any events via it's 'start on' EventOperator tree, * the JobClasses destruction could lead to the Events * being destroyed _before_ the about-to-be-created * replacement JobClass gets a chance to reference those * same events (assuming its 'start on' EventOperator tree * contains nodes specifying the same event names as * those in the original JobClasses). * * As such, we simply remove the ConfFile from its * parent ConfSources hash, create the new ConfFile and * JobClass, give the new JobClass a chance to be the * registered JobClass, and finally allow the original * ConfFile to be destroyed. * * If this is not done, reloading a configuration * mid-way through the boot sequence could lead to a * hung system as the new JobClasses will wait forever * for events to be emitted that have already been * destroyed. */ nih_list_remove (&orig->entry); } /* Read the file into memory for parsing, if this fails we don't * bother creating a new ConfFile structure for it and bail out * now. */ buf = nih_file_read (NULL, path_to_load, &len); if (! buf) { if (! override_path && orig) { /* Failed to reload the file from disk in all * likelihood because the configuration file was * deleted. * * Allow the ConfFile to be cleaned up taking * its JobClass (and possibly events that * JobClass was referencing) with it. */ nih_unref (orig, source); } return -1; } /* Create a new ConfFile structure (if no @override_path specified) */ file = (ConfFile *)nih_hash_lookup (source->files, path); if (! file) file = NIH_MUST (conf_file_new (source, path)); pos = 0; lineno = 1; switch (source->type) { case CONF_FILE: case CONF_DIR: /* Simple file of options; usually no item attached to it. */ if (override_path) { nih_debug ("Updating configuration for %s from %s", path, override_path); } else { nih_debug ("Loading configuration from %s %s", (source->type == CONF_DIR ? "directory" : "file"), path); } if (parse_conf (file, buf, len, &pos, &lineno) < 0) err = nih_error_get (); break; case CONF_JOB_DIR: name = conf_to_job_name (source->path, path); /* Create a new job item and parse the buffer to produce * the job definition. */ if (override_path) { nih_debug ("Updating %s (%s) with %s", name, path, override_path); } else { nih_debug ("Loading %s from %s", name, path); } file->job = parse_job (NULL, source->session, file->job, name, buf, len, &pos, &lineno); /* Allow the original ConfFile which has now been replaced to be * destroyed which will also cause the original JobClass to be * freed. */ if (file->job) { job_class_consider (file->job); } else { err = nih_error_get (); } break; default: nih_assert_not_reached (); } /* Finally, allow the original ConfFile to be destroyed without * affecting the new JobClass. */ if (! override_path && orig) nih_unref (orig, source); /* Deal with any parsing errors that occurred; we don't consider * these to be hard failures, which means we can warn about them * here and give the path and line number along with the warning. */ if (err) { switch (err->number) { case NIH_CONFIG_EXPECTED_TOKEN: case NIH_CONFIG_UNEXPECTED_TOKEN: case NIH_CONFIG_TRAILING_SLASH: case NIH_CONFIG_UNTERMINATED_QUOTE: case NIH_CONFIG_UNTERMINATED_BLOCK: case NIH_CONFIG_UNKNOWN_STANZA: case PARSE_ILLEGAL_INTERVAL: case PARSE_ILLEGAL_EXIT: case PARSE_ILLEGAL_UMASK: case PARSE_ILLEGAL_NICE: case PARSE_ILLEGAL_OOM: case PARSE_ILLEGAL_LIMIT: case PARSE_EXPECTED_EVENT: case PARSE_EXPECTED_OPERATOR: case PARSE_EXPECTED_VARIABLE: case PARSE_MISMATCHED_PARENS: nih_error ("%s:%zi: %s", path_to_load, lineno, err->message); nih_free (err); err = NULL; break; } } /* If we had any unknown error from parsing the file, raise it again * and return an error condition. */ if (err) return -1; return 0; } /** * conf_file_destroy: * @file: configuration file to be destroyed. * * Handles the replacement and deletion of a configuration file, ensuring * that @file is removed from the containing linked list and that the item * attached to it is destroyed if not currently in use. * * Normally used or called from an nih_alloc() destructor so that the list * item is automatically removed from its containing list when freed. * * Returns: zero. **/ int conf_file_destroy (ConfFile *file) { nih_assert (file != NULL); nih_list_destroy (&file->entry); switch (file->source->type) { case CONF_FILE: case CONF_DIR: break; case CONF_JOB_DIR: if (! file->job) break; /* Mark the job to be deleted when it stops, in case * it cannot be deleted here. */ file->job->deleted = TRUE; /* Check whether the job is the current one with that name; * if it is, try and replace it. If it wasn't the current * job, or isn't after replacement, we can free it now. */ if (job_class_reconsider (file->job)) { nih_debug ("Destroyed unused job %s", file->job->name); nih_free (file->job); } break; default: nih_assert_not_reached (); } return 0; } /** * conf_select_job: * @name: name of job class to locate, * @session: session class name belongs to. * * Select the best available class of a job named @name from the registered * configuration sources. * * Returns: Best available job class or NULL if none available. **/ JobClass * conf_select_job (const char *name, const Session *session) { nih_assert (name != NULL); conf_init (); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; if (source->type != CONF_JOB_DIR) continue; if (source->session != session) continue; NIH_HASH_FOREACH (source->files, file_iter) { ConfFile *file = (ConfFile *)file_iter; if (! file->job) continue; if (! strcmp (file->job->name, name)) return file->job; } } return NULL; } /** * conf_source_serialise: * @source: ConfSource to serialise. * * Convert @source into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised ConfSource object, or NULL on error. **/ json_object * conf_source_serialise (const ConfSource *source) { json_object *json; json_object *json_files; int session_index; nih_assert (source); nih_assert (conf_sources); json = json_object_new_object (); if (! json) return NULL; json_files = json_object_new_array (); if (! json_files) goto error; session_index = session_get_index (source->session); if (session_index < 0) goto error; if (! state_set_json_int_var (json, "session", session_index)) goto error; if (! state_set_json_string_var_from_obj (json, source, path)) goto error; if (! state_set_json_enum_var (json, conf_source_type_enum_to_str, "type", source->type)) goto error; /* 'watch' does not need to be serialised - it gets recreated * when conf_source_new() is called on deserialisation. */ if (! state_set_json_int_var_from_obj (json, source, flag)) goto error; /* Add array of ConfFile names to represent the files hash */ NIH_HASH_FOREACH (source->files, file_iter) { ConfFile *file = (ConfFile *)file_iter; json_object *json_conf_file; json_conf_file = conf_file_serialise (file); if (! json_conf_file) goto error; json_object_array_add (json_files, json_conf_file); } json_object_object_add (json, "conf_files", json_files); return json; error: json_object_put (json); return NULL; } /** * conf_source_serialise_all: * * Convert existing ConfSource objects to JSON representation. * * Returns: JSON object containing array of ConfSource objects, * or NULL on error. **/ json_object * conf_source_serialise_all (void) { json_object *json; conf_init (); json = json_object_new_array (); if (! json) return NULL; NIH_LIST_FOREACH (conf_sources, iter) { json_object *json_source; ConfSource *source = (ConfSource *)iter; json_source = conf_source_serialise (source); if (! json_source) goto error; json_object_array_add (json, json_source); } return json; error: json_object_put (json); return NULL; } /** * conf_source_deserialise: * @parent: parent, * @json: JSON-serialised ConfSource object to deserialise. * * Create ConfSource from provided JSON and add to the * conf sources list. * * Returns: ConfSource object, or NULL on error. **/ ConfSource * conf_source_deserialise (void *parent, json_object *json) { ConfSource *source = NULL; ConfSourceType type = -1; Session *session; int session_index = -1; nih_local char *path = NULL; nih_assert (json); if (! state_check_json_type (json, object)) goto error; if (! state_get_json_int_var (json, "session", session_index)) goto error; if (session_index < 0) goto error; session = session_from_index (session_index); if (! state_get_json_string_var_strict (json, "path", NULL, path)) goto error; if (! state_get_json_enum_var (json, conf_source_type_str_to_enum, "type", type)) goto error; source = conf_source_new (parent, path, type); if (! source) goto error; source->session = session; if (! state_get_json_int_var_to_obj (json, source, flag)) goto error; if (conf_file_deserialise_all (source, json) < 0) goto error; return source; error: if (source) nih_free (source); return NULL; } /** * conf_source_deserialise_all: * * @json: root of JSON-serialised state. * * Convert JSON representation of ConfSources back into ConfSource objects. * * Returns: 0 on success, -1 on error. **/ int conf_source_deserialise_all (json_object *json) { ConfSource *source = NULL; nih_assert (json); conf_init (); nih_assert (NIH_LIST_EMPTY (conf_sources)); if (! json_object_object_get_ex (json, "conf_sources", &json_conf_sources)) goto error; if (! state_check_json_type (json_conf_sources, array)) goto error; for (int i = 0; i < json_object_array_length (json_conf_sources); i++) { json_object *json_source; json_source = json_object_array_get_idx (json_conf_sources, i); if (! json_source) goto error; if (! state_check_json_type (json_source, object)) goto error; source = conf_source_deserialise (NULL, json_source); if (! source) continue; } return 0; error: if (source) nih_free (source); return -1; } /** * conf_source_type_enum_to_str: * * @type: ConfSourceType. * * Convert ConfSourceType to a string representation. * * Returns: string representation of @type, or NULL if not known. **/ const char * conf_source_type_enum_to_str (ConfSourceType type) { state_enum_to_str (CONF_FILE, type); state_enum_to_str (CONF_DIR, type); state_enum_to_str (CONF_JOB_DIR, type); return NULL; } /** * conf_source_type_str_to_enum: * * @type: string ConfSourceType value. * * Convert @expect back into an enum value. * * Returns: ConfSourceType representing @type, or -1 if not known. **/ ConfSourceType conf_source_type_str_to_enum (const char *type) { nih_assert (type); state_str_to_enum (CONF_FILE, type); state_str_to_enum (CONF_DIR, type); state_str_to_enum (CONF_JOB_DIR, type); return -1; } /** * conf_file_serialise: * @file: ConfFile to serialise. * * Convert @file into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised ConfFile object, or NULL on error. **/ json_object * conf_file_serialise (const ConfFile *file) { json_object *json; json_object *json_job_class; JobClass *registered; int session_index; ssize_t conf_source_index; nih_assert (file); json = json_object_new_object (); if (! json) return NULL; if (! state_set_json_string_var_from_obj (json, file, path)) goto error; conf_source_index = conf_source_get_index (file->source); if (conf_source_index < 0) goto error; if (! state_set_json_int_var (json, "conf_source", conf_source_index)) goto error; if (! state_set_json_int_var_from_obj (json, file, flag)) goto error; if (! file->job) { /* File exists on disk but contains invalid * (unparseable) syntax, and hence no associated JobClass. * Thus, simply encode the ConfFile without a class. * * Deserialisation is handled automatically since * JobClasses are deserialised by directly iterating * through all JobClass'es found in the JSON. Here, * there simply won't be a JobClass to deserialise. */ goto out; } /* * Ignore the "best" JobClass associated with this ConfFile * (file->job) since it won't be serialised. * * Instead look up the currently registered JobClass and * reference that. This ensures that best == registered for the * re-exec. This may change though immediately after re-exec * when conf_reload() gets called. * * See job_class_serialise_all() for further details. */ registered = job_class_get_registered (file->job->name, file->job->session); if (! registered) goto error; /* Create a reference to the registered job class in the JSON by * encoding the name and session index. We do this rather than * simply encoding an index number for the JobClass since * job_classes is a hash and it is safer should a re-exec * result from an upgrade to NIH, say, where its hashing * algorithm changed meaning the index may be unreliable once * the job_classes hash was created post-re-exec. */ json_job_class = json_object_new_object (); if (! json_job_class) goto error; if (! state_set_json_string_var (json_job_class, "name", registered->name)) goto error; session_index = session_get_index (registered->session); if (session_index < 0) goto error; if (! state_set_json_int_var (json_job_class, "session", session_index)) goto error; json_object_object_add (json, "job_class", json_job_class); out: return json; error: json_object_put (json); return NULL; } /** * conf_file_deserialise: * @source: ConfSource, * @json: JSON-serialised ConfFile object to deserialise. * * Create ConfFile from provided JSON and add to the * conf sources list. * * Returns: ConfFile object, or NULL on error. **/ ConfFile * conf_file_deserialise (ConfSource *source, json_object *json) { ConfFile *file = NULL; nih_local char *path = NULL; nih_assert (json); if (! state_check_json_type (json, object)) goto error; if (! state_get_json_string_var_strict (json, "path", NULL, path)) goto error; file = conf_file_new (source, path); if (! file) goto error; /* Note that the associated JobClass is not handled at this * stage: it can't be since the JobClasses haven't been deserialised * yet. As such, the ConfFile->JobClass link is dealt with in * job_class_deserialise_all(). */ file->job = NULL; if (! state_get_json_int_var_to_obj (json, file, flag)) goto error; return file; error: if (file) nih_free (file); return NULL; } /** * conf_file_deserialise_all: * * @source: ConfSource, * @json: root of JSON-serialised state. * * Convert JSON representation of ConfFiles back into ConfFile objects. * * Returns: 0 on success, -1 on error. **/ int conf_file_deserialise_all (ConfSource *source, json_object *json) { json_object *json_conf_files; ConfFile *file = NULL; nih_assert (source); nih_assert (json); conf_init (); if (! json_object_object_get_ex (json, "conf_files", &json_conf_files)) goto error; if (! state_check_json_type (json_conf_files, array)) goto error; for (int i = 0; i < json_object_array_length (json_conf_files); i++) { json_object *json_file; json_file = json_object_array_get_idx (json_conf_files, i); if (! json_file) goto error; if (! state_check_json_type (json_file, object)) goto error; file = conf_file_deserialise (source, json_file); if (! file) goto error; } return 0; error: if (file) nih_free (file); return -1; } /** * conf_source_get_index: * * @source: ConfSource to search for. * * Returns: index of @source in the conf sources list, * or -1 if not found. **/ ssize_t conf_source_get_index (const ConfSource *source) { ssize_t i = 0; nih_assert (source); conf_init (); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *s = (ConfSource *)iter; if (! strcmp (source->path, s->path) && source->session == s->session) return i; i++; } return -1; } /** * conf_file_find: * * @name: name of ConfFile (without dirname and extension), * @session: session ConfFile belongs to. * * Find the ConfFile with name @name in session @session. * * Returns: ConfFile or NULL if not found. **/ ConfFile * conf_file_find (const char *name, const Session *session) { nih_local char *basename = NULL; nih_assert (name); conf_init (); /* There can only be one ConfFile per session with the same * basename. */ basename = NIH_MUST (nih_sprintf (NULL, "/%s%s", name, CONF_EXT_STD)); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; if (source->session != session) continue; NIH_HASH_FOREACH (source->files, file_iter) { ConfFile *file = (ConfFile *)file_iter; char *match; char *slash; match = strstr (file->path, basename); slash = strrchr (file->path, '/'); if (match && match == slash) return file; } } return NULL; } #ifdef DEBUG void debug_show_event_operator (EventOperator *oper) { nih_local char *env = NULL; nih_assert (oper); if (oper->env) env = state_collapse_env ((const char **)oper->env); nih_debug ("EventOperator %p: type='%s', value=%d, name='%s', event='%s', env='%s'", oper, oper->type == EVENT_MATCH ? "EVENT_MATCH" : oper->type == EVENT_AND ? "EVENT_AND" : "EVENT_OR", oper->value, oper->name, oper->event ? oper->event->name : "", env ? env : ""); } void debug_show_event_operators (EventOperator *root) { nih_assert (root); NIH_TREE_FOREACH_POST (&root->node, iter) { EventOperator *oper = (EventOperator *)iter; debug_show_event_operator (oper); } } size_t debug_count_list_entries (const NihList *list) { size_t i = 0; NIH_LIST_FOREACH (list, iter) { i++; } return i; } size_t debug_count_hash_entries (const NihHash *hash) { size_t i = 0; NIH_HASH_FOREACH_SAFE (hash, iter) { i++; } return i; } void debug_show_job_class (const JobClass *class) { nih_local char *start_on = NULL; nih_local char *stop_on = NULL; nih_assert (class); nih_debug ("JobClass %p: name='%s', path='%s', task=%d, " "respawn=%d, console=%x, deleted=%d, debug=%d", class, class->name, class->path, class->task, class->respawn, class->console, class->deleted, class->debug); if (class->start_on) start_on = event_operator_collapse (class->start_on); if (class->stop_on) stop_on = event_operator_collapse (class->stop_on); nih_debug ("\tstart_on=%p (%s), stop_on=%p (%s), emits=%p, process=%p", class->start_on, start_on ? start_on : "", class->stop_on, stop_on ? stop_on : "", class->emits, class->process); for (int i = 0; i < PROCESS_LAST; i++) { if (class->process[i]) { nih_debug ("Process[%d]=%p: script=%d, cmd='%s'", i, class->process[i], class->process[i]->script, class->process[i]->command); } else { nih_debug ("Process[%d]=%p", i, class->process[i]); } } nih_debug ("\tauthor='%s', description='%s'", class->author, class->description); if (class->env && *class->env) { nih_local char *env = state_collapse_env ((const char **)class->env); nih_debug ("\tenv:%s", env); } else { nih_debug ("\tenv: none."); } if (class->export && *class->export) { nih_local char *export = state_collapse_env ((const char **)class->export); nih_debug ("\texport:%s", export); } else { nih_debug ("\texport: none"); } debug_show_jobs (class->instances); } void debug_show_job_classes (void) { nih_debug ("job_classes:"); NIH_HASH_FOREACH_SAFE (job_classes, iter) { JobClass *job = (JobClass *)iter; debug_show_job_class (job); } } void debug_show_job (const Job *job) { nih_local char *env = NULL; nih_local char *start_env = NULL; nih_local char *stop_env = NULL; nih_local char *stop_on = NULL; nih_assert (job); if (job->env) env = state_collapse_env ((const char **)job->env); if (job->start_env) start_env = state_collapse_env ((const char **)job->start_env); if (job->stop_env) stop_env = state_collapse_env ((const char **)job->stop_env); if (job->stop_on) stop_on = event_operator_collapse (job->stop_on); nih_debug ("Job %p: name=%s, class=%p (%s), path=%s, env='%s'" "start_env='%s', stop_env='%s', stop_on='%s', " "goal=%d, state=%d, failed=%d, exit_status=%d", job, job->name ? job->name : "", job->class, job->class->name, job->path, env ? env : "", start_env ? start_env : "", stop_env ? stop_env : "", stop_on ? stop_on : "", job->goal, job->state, job->failed, job->exit_status); } void debug_show_jobs (const NihHash *instances) { if (! instances) return; nih_debug ("jobs:"); NIH_HASH_FOREACH (instances, iter) { Job *job = (Job *)iter; debug_show_job (job); } } void debug_show_event (const Event *event) { nih_assert (event); nih_debug ("Event %p: name='%s', progress=%x, failed=%d, " "blockers=%d, blocking=%p", event, event->name, event->progress, event->failed, event->blockers, (void *)&event->blocking); } void debug_show_events (void) { nih_assert (events); NIH_LIST_FOREACH (events, iter) { Event *event = (Event *)iter; debug_show_event (event); } } void debug_show_conf_file (const ConfFile *file) { nih_assert (file); nih_debug ("ConfFile %p: path='%s', source=%p, flag=%x, job=%p", file, file->path, file->source, file->flag, file->job); /* Some ConfFile objects won't have any JobClass details, for example, * the ConfFile object associated with "/etc/init.conf". */ if (! file->job) { nih_debug ("ConfFile %p: job: no JobClass object.", file); return; } nih_debug ("ConfFile %p: job:", file); debug_show_job_class (file->job); } void debug_show_conf_source (const ConfSource *source) { nih_assert (source); nih_debug ("ConfSource %p: path='%s', type=%x, flag=%x", source, source->path, source->type, source->flag); nih_debug ("ConfSource %p files (%d):", source, (int)debug_count_hash_entries (source->files)); NIH_HASH_FOREACH (source->files, file_iter) { ConfFile *file = (ConfFile *)file_iter; debug_show_conf_file (file); } } void debug_show_conf_sources (void) { nih_assert (conf_sources); nih_debug ("conf_sources:"); NIH_LIST_FOREACH (conf_sources, iter) { ConfSource *source = (ConfSource *)iter; debug_show_conf_source (source); } } #endif /* DEBUG */ upstart-1.13.2/init/parse_conf.c0000664000175000017500000000447612373101356013465 00000000000000/* upstart * * parse_conf.c - general configuration parsing * * Copyright © 2009 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include "conf.h" #include "parse_conf.h" /** * stanzas: * * This is the table of known configuration stanzas and the functions * that handle parsing them. **/ static NihConfigStanza stanzas[] = { NIH_CONFIG_LAST }; /** * parse_conf: * @conffile: configuration file being parsed, * @file: file or string to parse, * @len: length of @file, * @pos: offset within @file, * @lineno: line number. * * This function is used to parse a job definition from @file, taking the * name from the stanza itself. A block is expected containing a sequence * of stanzas is expected, defining the parameters of the job. * * The necessary configuration item is allocated and attached to the file * automatically. * * Returns: zero on success, negative value on raised error. **/ int parse_conf (ConfFile *conffile, const char *file, size_t len, size_t *pos, size_t *lineno) { nih_assert (conffile != NULL); nih_assert (file != NULL); nih_assert (pos != NULL); /* If we update 'stanzas' to allow content in init.conf, this * function must be updated in a similar manner to parse_job() * to handle overrides files. */ nih_assert (sizeof(stanzas) / sizeof(stanzas[0]) == 1); if (nih_config_parse_file (file, len, pos, lineno, stanzas, conffile) < 0) return -1; return 0; } upstart-1.13.2/init/state.c0000664000175000017500000014106312373101356012460 00000000000000/* upstart * * state.c - serialisation and deserialisation support. * * Copyright 2012 Canonical Ltd. * Author: James Hunt . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include "paths.h" #include "state.h" #include "session.h" #include "event.h" #include "job_class.h" #include "job.h" #include "environ.h" #include "blocked.h" #include "conf.h" #include "control.h" #ifdef ENABLE_CGROUPS #include "cgroup.h" #endif /* ENABLE_CGROUPS */ json_object *json_sessions = NULL; json_object *json_events = NULL; json_object *json_classes = NULL; json_object *json_conf_sources = NULL; extern char *log_dir; extern char *control_bus_address; #ifdef ENABLE_CGROUPS extern char *cgroup_manager_address; #endif /* ENABLE_CGROUPS */ /** * args_copy: * * Copy of original argv used when re-executing to ensure same * command-line is used. Required since we clear the actual args for * ps(1) et al. */ char **args_copy = NULL; /** * restart: * * This is set to TRUE if we're being re-exec'd by an existing init * process. **/ int restart = FALSE; /** * write_state_file: * * If TRUE, write STATE_FILE on every re-exec. **/ int write_state_file = FALSE; /* Prototypes for static functions */ static void state_write_file (NihIoBuffer *buffer); /** * state_read: * * @fd: Open file descriptor to read JSON from. * * Read JSON-encoded state from specified file descriptor and recreate * all internal objects based on JSON representation. The read will * timeout, resulting in a failure after STATE_WAIT_SECS seconds * indicating a problem with the child. * * Returns: 0 on success, or -1 on error. **/ int state_read (int fd) { int nfds; int ret; fd_set readfds; struct timeval timeout; nih_assert (fd != -1); state_get_timeout (timeout.tv_sec); timeout.tv_usec = 0; nfds = 1 + fd; while (TRUE) { FD_ZERO (&readfds); FD_SET (fd, &readfds); ret = select (nfds, &readfds, NULL, NULL, timeout.tv_sec < 0 ? NULL : &timeout); if (ret < 0 && (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK)) return -1; if (FD_ISSET (fd, &readfds)) break; } nih_assert (ret == 1); /* Now, read the data */ if (state_read_objects (fd) < 0) return -1; return 0; } /** * state_write: * * @fd: Open file descriptor to write JSON to, * @state_data: JSON string representing internal object state, * @len: length of @state_data. * * Write internal state to specified file descriptor in JSON format. * * Signals are assumed to be blocked when this call is made. * * Note the timeout - it is possible that the new PID 1 instance may be * unable to read from its end of the file descriptor, either due to * some error scenario or more likely due to it not supporting stateful * re-exec. Hence, we must have a way to detect this and abort the * child. * * Returns: 0 on success, or -1 on error. **/ int state_write (int fd, const char *state_data, size_t len) { int nfds; int ret; fd_set writefds; struct timeval timeout; nih_assert (fd != -1); nih_assert (state_data); nih_assert (len); /* must be called from child process */ nih_assert (getpid () != (pid_t)1); state_get_timeout (timeout.tv_sec); timeout.tv_usec = 0; nfds = 1 + fd; while (TRUE) { FD_ZERO (&writefds); FD_SET (fd, &writefds); ret = select (nfds, NULL, &writefds, NULL, timeout.tv_sec < 0 ? NULL : &timeout); if (ret < 0 && (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK)) return -1; if (FD_ISSET (fd, &writefds)) break; } nih_assert (ret == 1); if (state_write_objects (fd, state_data, len) < 0) return -1; return 0; } /** * state_read_objects: * * @fd: file descriptor to read serialisation data from. * * Read serialisation data from specified file descriptor. * @fd is assumed to be open and readable. * * Returns: 0 on success, -1 on error. **/ int state_read_objects (int fd) { ssize_t ret; int initial_size = 4096; nih_local NihIoBuffer *buffer = NULL; nih_local char *buf = NULL; nih_assert (fd != -1); buffer = nih_io_buffer_new (NULL); buf = nih_alloc (NULL, initial_size); if (! buf) goto error; /* Read the JSON data into the buffer */ do { if (nih_io_buffer_resize (buffer, initial_size) < 0) goto error; ret = read (fd, buf, initial_size); if (ret < 0) { if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) goto error; continue; } else if (! ret) break; if (nih_io_buffer_push (buffer, buf, ret) < 0) goto error; } while (TRUE); /* Recreate internal state from JSON */ if (state_from_string (buffer->buf) < 0) goto error; if (write_state_file || getenv (STATE_FILE_ENV)) state_write_file (buffer); return 0; error: /* Failed to reconstruct internal state so attempt to write * the JSON state data to a file to allow for manual post * re-exec analysis. */ if (buffer->len && log_dir) state_write_file (buffer); return -1; } /** * state_write_file: * * @buffer: NihIoBuffer containing JSON data. * * Write JSON data contained in @buffer to STATE_FILE below log_dir. * * Failures are ignored since this is designed to be called in an error * scenario anyway. **/ void state_write_file (NihIoBuffer *buffer) { int fd; ssize_t bytes; nih_local char *state_file = NULL; nih_assert (buffer); state_file = nih_sprintf (NULL, "%s/%s", log_dir, STATE_FILE); if (! state_file) return; /* Note the very restrictive permissions */ fd = open (state_file, (O_CREAT|O_WRONLY|O_TRUNC), S_IRUSR); if (fd < 0) return; while (TRUE) { bytes = write (fd, buffer->buf, buffer->len); if (! bytes) break; else if (bytes > 0) nih_io_buffer_shrink (buffer, (size_t)bytes); else if (bytes < 0 && errno != EINTR) break; } close (fd); } /** * state_write_objects: * * @fd: file descriptor to write serialisation data on, * @state_data: JSON string representing internal object state, * @len: length of @state_data. * * Write serialisation data to specified file descriptor. * @fd is assumed to be open and valid to write to. * * Returns: 0 on success, -1 on error. **/ int state_write_objects (int fd, const char *state_data, size_t len) { ssize_t ret; nih_assert (fd != -1); nih_assert (state_data); nih_assert (len); ret = write (fd, state_data, len); return (ret < 0 ? -1 : 0); } /** * state_to_string: * * @json_string; newly-allocated string, * @len: length of @json_string. * * Serialise internal data structures to a JSON string. * * Returns: 0 on success, -1 on error. **/ int state_to_string (char **json_string, size_t *len) { json_object *json; json_object *json_job_environ; json_object *json_control_bus_address; const char *value; #ifdef ENABLE_CGROUPS json_object *json_cgroup_manager_address; #endif /* ENABLE_CGROUPS */ nih_assert (json_string); nih_assert (len); json = json_object_new_object (); if (! json) return -1; json_sessions = session_serialise_all (); if (! json_sessions) { nih_error ("%s Sessions", _("Failed to serialise")); goto error; } json_object_object_add (json, "sessions", json_sessions); json_events = event_serialise_all (); if (! json_events) { nih_error ("%s Events", _("Failed to serialise")); goto error; } json_object_object_add (json, "events", json_events); json_control_bus_address = control_serialise_bus_address (); /* Take care to distinguish between memory failure and an * as-yet-not-set control bus address. */ if (! json_control_bus_address && control_bus_address) { nih_error ("%s %s", _("Failed to serialise"), _("control bus address")); goto error; } json_object_object_add (json, "control_bus_address", json_control_bus_address); #ifdef ENABLE_CGROUPS json_cgroup_manager_address = cgroup_manager_serialise (); /* Take care to distinguish between memory failure and an * as-yet-not-set cgroup manager address. */ if (! json_cgroup_manager_address && cgroup_manager_address) { nih_error ("%s %s", _("Failed to serialise"), _("cgroup manager address")); goto error; } json_object_object_add (json, "cgroup_manager_address", json_cgroup_manager_address); #endif /* ENABLE_CGROUPS */ json_job_environ = job_class_serialise_job_environ (); if (! json_job_environ) { nih_error ("%s global job environment", _("Failed to serialise")); goto error; } json_object_object_add (json, "job_environment", json_job_environ); json_classes = job_class_serialise_all (); if (! json_classes) { nih_error ("%s JobClasses", _("Failed to serialise")); goto error; } json_object_object_add (json, "job_classes", json_classes); json_conf_sources = conf_source_serialise_all (); if (! json_conf_sources) { nih_error ("%s ConfSources", _("Failed to serialise")); goto error; } json_object_object_add (json, "conf_sources", json_conf_sources); /* Note that the returned value is managed by json-c! */ value = json_object_to_json_string (json); if (! value) goto error; *len = strlen (value); *json_string = NIH_MUST (nih_strndup (NULL, value, *len)); json_object_put (json); return 0; error: json_object_put (json); return -1; } /** * state_from_string: * * @state: JSON-encoded state. * * Convert JSON string back to an internal representation. * * Returns: 0 on success, -1 on error. **/ int state_from_string (const char *state) { int ret = -1; json_object *json; json_object *json_job_environ; json_object *json_control_bus_address; enum json_tokener_error error; #ifdef ENABLE_CGROUPS json_object *json_cgroup_manager_address; #endif /* ENABLE_CGROUPS */ nih_assert (state); /* This function is called before conf_source_new (), so setup * the environment. */ conf_init (); json = json_tokener_parse_verbose (state, &error); if (! json) { nih_error ("%s: %s", _("Detected invalid serialisation data"), json_tokener_error_desc (error)); return ret; } if (! state_check_json_type (json, object)) goto out; if (session_deserialise_all (json) < 0) { nih_error ("%s Sessions", _("Failed to deserialise")); goto out; } if (event_deserialise_all (json) < 0) { nih_error ("%s Events", _("Failed to deserialise")); goto out; } ret = json_object_object_get_ex (json, "control_bus_address", &json_control_bus_address); if (json_control_bus_address) { if (control_deserialise_bus_address (json_control_bus_address) < 0) { nih_error ("%s control details", _("Failed to deserialise")); goto out; } } else if (! ret) { /* Probably deserialising from older format that doesn't * encode control details. */ nih_warn ("%s", _("No control details present in state data")); } #ifdef ENABLE_CGROUPS ret = json_object_object_get_ex (json, "cgroup_manager_address", &json_cgroup_manager_address); if (json_cgroup_manager_address) { if (cgroup_manager_deserialise (json_cgroup_manager_address) < 0) { nih_error ("%s %s", _("Failed to deserialise"), _("cgroup manager address")); goto out; } } else if (! ret) { nih_warn ("No %s in state data", _("cgroup manager address")); } #endif /* ENABLE_CGROUPS */ /* Again, we cannot error here since older JSON state data did * not encode ConfSource or ConfFile objects. */ if (json_object_object_get_ex (json, "conf_sources", NULL)) { if (conf_source_deserialise_all (json) < 0) { nih_error ("%s ConfSources", _("Failed to deserialise")); goto out; } } else { nih_warn ("%s", _("No ConfSources present in state data")); } if (json_object_object_get_ex (json, "job_environment", &json_job_environ)) { if (job_class_deserialise_job_environ (json_job_environ) < 0) { nih_error ("%s global job environment", _("Failed to deserialise")); goto out; } } else { nih_warn ("%s", _("No global job environment data present in state data")); } if (job_class_deserialise_all (json) < 0) { nih_error ("%s JobClasses", _("Failed to deserialise")); goto out; } if (state_deserialise_resolve_deps (json) < 0) { nih_error (_("Failed to resolve deserialisation dependencies")); goto out; } ret = 0; out: /* Only need to free the root JSON node */ json_object_put (json); return ret; } /** * state_modify_cloexec: * * @fd: file descriptor, * @set: set close-on-exec flag if TRUE, clear if FALSE. * * Set or clear the close-on-exec file descriptor flag. * * Returns: 0 on success, -1 on error. **/ int state_modify_cloexec (int fd, int set) { long flags; int ret; nih_assert (fd >= 0); flags = fcntl (fd, F_GETFD); if (flags < 0) return -1; if (set) flags |= FD_CLOEXEC; else flags &= ~FD_CLOEXEC; ret = fcntl (fd, F_SETFD, flags); if (ret < 0) return -1; return 0; } /** * state_fd_valid: * @fd: file descriptor. * * Return TRUE if @fd is valid, else FALSE. **/ int state_fd_valid (int fd) { int flags = 0; if (fd < 0) return FALSE; errno = 0; flags = fcntl (fd, F_GETFL); if (flags < 0) return FALSE; /* redundant really */ if (errno == EBADF) return FALSE; return TRUE; } /** * state_serialise_str_array: * * @array: string array to serialise. * * Convert string array @array into a JSON array object. * * Returns: JSON-serialised @array, or NULL on error. **/ json_object * state_serialise_str_array (char ** const array) { char * const *elem; json_object *json; json_object *json_element; int i; nih_assert (array); json = json_object_new_array (); if (! json) return NULL; for (elem = array, i = 0; elem && *elem; ++elem, ++i) { json_element = json_object_new_string (*elem); if (! json_element) goto error; if (json_object_array_put_idx (json, i, json_element) < 0) goto error; } return json; error: json_object_put (json); return NULL; } /** * _state_deserialise_str_array: * * @parent: parent object for new array (may be NULL), * @json: JSON array object representing a string array, * @array: string array, * @len: length of returned array, * @env: TRUE if @json represents an array of environment * variables, FALSE for simple strings. * * Convert JSON array object @json into a string array. * * If @len is >0, @array will contain the newly-allocated array. * If @len is zero, the contents of @array are undefined. * * Returns: 0 on success, -1 on error. **/ int _state_deserialise_str_array (void *parent, json_object *json, char ***array, size_t *len, int env) { nih_assert (json); nih_assert (array); nih_assert (len); if (! state_check_json_type (json, array)) return -1; *len = json_object_array_length (json); if (! *len) return 0; *array = nih_str_array_new (parent); if (! *array) return -1; for (size_t i = 0; i < *len; i++) { json_object *json_element; const char *element; char **new; json_element = json_object_array_get_idx (json, i); if (! json_element) goto error; if (! state_check_json_type (json_element, string)) goto error; element = json_object_get_string (json_element); if (! element) goto error; if (env) { new = environ_add (array, parent, NULL, TRUE, element); if (! new) goto error; *array = new; } else { new = nih_str_array_add (array, parent, NULL, element); if (! new) goto error; *array = new; } } return 0; error: nih_free (*array); *array = NULL; return -1; } /** * state_serialise_int32_array: * * @array: array of 32-bit integers, * @count: number of values in @array, * * Convert integer array @array into a JSON array object. * * Returns: JSON-serialised @array, or NULL on error. **/ json_object * state_serialise_int32_array (int32_t *array, int count) { json_object *json; json_object *json_element; int i; nih_assert (count >= 0); json = json_object_new_array (); if (! json) return NULL; if (! count || ! array) return json; for (i = 0; i < count; ++i) { json_element = json_object_new_int (array[i]); if (! json_element) goto error; if (json_object_array_put_idx (json, i, json_element) < 0) goto error; } return json; error: json_object_put (json); return NULL; } /** * state_serialise_int64_array: * * @array: array of 64-bit integers, * @count: number of values in @array, * * Convert integer array @array into a JSON array object. * * Returns: JSON-serialised @array, or NULL on error. **/ json_object * state_serialise_int64_array (int64_t *array, int count) { json_object *json; json_object *json_element; int i; nih_assert (count >= 0); json = json_object_new_array (); if (! json) return NULL; if (! count || ! array) return json; for (i = 0; i < count; ++i) { json_element = json_object_new_int64 (array[i]); if (! json_element) goto error; if (json_object_array_put_idx (json, i, json_element) < 0) goto error; } return json; error: json_object_put (json); return NULL; } /** * state_deserialise_int32_array: * * @parent: parent object for new array, * @json: JSON array object representing an integer array, * @array: array of 32-bit integers, * @len: length of @array. * * Convert JSON array object @json into an array of 32-bit integers. * * If @len is >0, @array will contain the newly-allocated array. * If @len is zero, the contents of @array are undefined. * * Returns: 0 on success, -1 on error. **/ int state_deserialise_int32_array (void *parent, json_object *json, int32_t **array, size_t *len) { nih_assert (parent); nih_assert (json); nih_assert (array); nih_assert (len); if (! state_check_json_type (json, array)) return -1; *len = json_object_array_length (json); if (! *len) return 0; *array = nih_realloc (*array, parent, (*len) * sizeof (int32_t)); if (! *array) return -1; for (size_t i = 0; i < *len; i++) { json_object *json_element; json_element = json_object_array_get_idx (json, i); if (! json_element) goto error; if (! state_check_json_type (json_element, int)) goto error; errno = 0; (*array)[i] = json_object_get_int (json_element); if (! (*array)[i] && errno == EINVAL) goto error; } return 0; error: nih_free (*array); return -1; } /** * state_deserialise_int64_array: * * @parent: parent object for new array, * @json: JSON array object representing an integer array, * @array: array of 64-bit integers, * @len: length of @array. * * Convert JSON array object @json into an array of 64-bit integers. * * If @len is >0, @array will contain the newly-allocated array. * If @len is zero, the contents of @array are undefined. * * Returns: 0 on success, -1 on error. **/ int state_deserialise_int64_array (void *parent, json_object *json, int64_t **array, size_t *len) { nih_assert (parent); nih_assert (json); nih_assert (array); nih_assert (len); if (! state_check_json_type (json, array)) return -1; *len = json_object_array_length (json); if (! *len) return 0; *array = nih_realloc (*array, parent, (*len) * sizeof (int64_t)); if (! *array) return -1; for (size_t i = 0; i < *len; i++) { json_object *json_element; json_element = json_object_array_get_idx (json, i); if (! json_element) goto error; if (! state_check_json_type (json_element, int)) goto error; errno = 0; (*array)[i] = json_object_get_int64 (json_element); if (! (*array)[i] && errno == EINVAL) goto error; } return 0; error: nih_free (*array); return -1; } /** * state_rlimit_serialise: * @limit: rlimit to serialise. * * Convert @limit into a JSON representation for serialisation. * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised rlimit structure, or NULL on error. **/ json_object * state_rlimit_serialise (const struct rlimit *rlimit) { json_object *json; nih_assert (rlimit); json = json_object_new_object (); if (! json) return NULL; if (! state_set_json_int_var_from_obj (json, rlimit, rlim_cur)) goto error; if (! state_set_json_int_var_from_obj (json, rlimit, rlim_max)) goto error; return json; error: json_object_put (json); return NULL; } /** * state_rlimit_serialise_all: * * @rlimits: array of rlimit structures. * * Convert array of rlimit structures to JSON representation. * * Returns: JSON object containing array of rlimits, or NULL on error. */ json_object * state_rlimit_serialise_all (struct rlimit * const *rlimits) { json_object *json; json_object *json_rlimit; struct rlimit dummy = { 0x0, 0x0 }; nih_assert (rlimits); json = json_object_new_array (); if (! json) return NULL; for (int i = 0; i < RLIMIT_NLIMITS; i++) { /* We must encode a blank entry for missing array elements * to ensure correct ordering of limits on deserialisation. */ json_rlimit = state_rlimit_serialise (rlimits[i] ? rlimits[i] : &dummy); if (! json_rlimit) goto error; if (json_object_array_add (json, json_rlimit) < 0) goto error; } return json; error: json_object_put (json); return NULL; } /** * state_rlimit_deserialise: * * @json: JSON-serialised rlimit structure to deserialise. * * Convert @json into an rlimit structure. * * Caller must manually nih_ref() returned object to a parent object. * * Returns: struct rlimit, or NULL on error. **/ struct rlimit * state_rlimit_deserialise (json_object *json) { struct rlimit *rlimit = NULL; nih_assert (json); if (! state_check_json_type (json, object)) goto error; rlimit = nih_new (NULL, struct rlimit); if (! rlimit) return NULL; memset (rlimit, '\0', sizeof (struct rlimit)); if (! state_get_json_int_var_to_obj (json, rlimit, rlim_cur)) goto error; if (! state_get_json_int_var_to_obj (json, rlimit, rlim_max)) goto error; return rlimit; error: nih_free (rlimit); return NULL; } /** * state_rlimit_deserialise_all: * * @json: root of JSON-serialised state, * @parent: parent of @, * @limits: pre-allocated pointer array to hold rlimits array. * * Convert JSON representation of rlimits back into * an array of rlimit structures. * * Returns: 0 on success, -1 on error. **/ int state_rlimit_deserialise_all (json_object *json, const void *parent, struct rlimit *(*rlimits)[]) { json_object *json_limits; struct rlimit *rlimit; int i = 0; nih_assert (json); nih_assert (parent); nih_assert (rlimits); if (! json_object_object_get_ex (json, "limits", &json_limits)) goto error; if (! state_check_json_type (json_limits, array)) goto error; for (i = 0; i < json_object_array_length (json_limits); i++) { json_object *json_rlimit; nih_assert (i <= RLIMIT_NLIMITS); json_rlimit = json_object_array_get_idx (json_limits, i); if (! json_rlimit) goto error; if (! state_check_json_type (json_rlimit, object)) goto error; rlimit = state_rlimit_deserialise (json_rlimit); if (! rlimit) goto error; if (! rlimit->rlim_cur && ! rlimit->rlim_max) { /* This limit was simply a placeholder so * don't set it. Arguably, it is possible to set * a limit of zero, but that is non-sensical with * the exception of the nice and rtprio limits, * which conveniently the kernel defaults to zero * anyway ;-) */ nih_free (rlimit); (*rlimits)[i] = NULL; continue; } (*rlimits)[i] = rlimit; nih_ref ((*rlimits)[i], parent); } return 0; error: /* Clean up what we can */ for (; i >= 0; i--) if ((*rlimits)[i]) nih_free ((*rlimits)[i]); return -1; } /** * state_collapse_env: * * @env: string array. * * Convert @env into a flattened string, quoting values as required. * * Returns: newly-allocated flattened string representing @env on * success, or NULL on error. **/ char * state_collapse_env (const char **env) { char *p; char *flattened = NULL; const char **elem; if (! env) return NULL; for (elem = env; elem && *elem; ++elem) { p = strchr (*elem, '='); /* If an environment variable contains an equals and whitespace * in the value part, quote the value. */ if (p && strpbrk (p, " \t")) { /* append name and equals */ NIH_MUST (nih_strcat_sprintf (&flattened, NULL, "%s%.*s", elem == env ? "" : " ", (int)((p - *elem) + 1), *elem)); p++; /* add quoted value */ if (p) { NIH_MUST (nih_strcat_sprintf (&flattened, NULL, "\"%s\"", p)); } } else { /* either a simple 'name' environment variable, * or a name/value pair without space in the * value part. */ NIH_MUST (nih_strcat_sprintf (&flattened, NULL, "%s%s", elem == env ? "" : " ", *elem)); } } return flattened; } /** * state_get_json_type: * * @short_type: name of JSON type without the prefix. * * Convert JSON short-type name to a full JSON type. * * This function is only required due to JSON-C's integer handling: * RFC 4627, the JSON "memo" (not a spec!) alludes to JSON being a * subset of ECMA-262, and yet no mention is made of the maximum integer * size. ECMA-262 defines a 'Number' to be a 64-bit entity, but older * versions of JSON-C defined a number to be the same size as a native * integer (which might be 32-bit or 64-bit). Version 0.10 rectified * this by storing all integer types as 64-bit internally but it does * not define * * Returns: JSON type. **/ inline enum json_type state_get_json_type (const char *short_type) { nih_assert (short_type); #define state_make_type_check(var, short_type) \ else if (! strcmp (var, #short_type)) \ return (json_type_ ## short_type) if (! strcmp (short_type, "int64")) return json_type_int; state_make_type_check (short_type, null); state_make_type_check (short_type, boolean); state_make_type_check (short_type, double); state_make_type_check (short_type, int); state_make_type_check (short_type, object); state_make_type_check (short_type, array); state_make_type_check (short_type, string); #undef state_make_type_check nih_assert_not_reached (); /* keep compiler happy */ return json_type_null; } /** * state_deserialise_resolve_deps: * * @json: root of JSON-serialised state. * * Resolve circular dependencies between Events and Jobs (via their * parent JobClass) and update JSON accordingly to allow deserialisation * of such dependencies. * * Returns: 0 on success, -1 on error. **/ int state_deserialise_resolve_deps (json_object *json) { int session_index = -1; nih_assert (json); /* XXX: Sessions, Events, JobClasses, Jobs and DBusConnections * must have previously been deserialised before invoking * this function. */ nih_assert (json_sessions); nih_assert (json_events); nih_assert (json_classes); for (int i = 0; i < json_object_array_length (json_events); i++) { json_object *json_event; Event *event = NULL; json_event = json_object_array_get_idx (json_events, i); if (! json_event) goto error; if (! state_check_json_type (json_event, object)) goto error; event = event_from_index (i); if (! event) goto error; if (state_deserialise_blocking (event, &event->blocking, json_event) < 0) goto error; } for (int i = 0; i < json_object_array_length (json_classes); i++) { json_object *json_class; json_object *json_jobs; JobClass *class = NULL; nih_local char *class_name = NULL; Session *session; session_index = -1; json_class = json_object_array_get_idx (json_classes, i); if (! json_class) goto error; if (! state_check_json_type (json_class, object)) goto error; if (! state_get_json_int_var (json_class, "session", session_index)) goto error; if (session_index > 0) { /* Although ConfSources are now serialised, * skip JobClasses with associated user/chroot * sessions to avoid behavioural changes for * the time being. */ continue; } session = session_from_index (session_index); /* All (non-NULL) sessions should already exist */ if (session_index > 0 && ! session) goto error; if (! state_get_json_string_var_strict (json_class, "name", NULL, class_name)) goto error; /* lookup class associated with JSON class index */ class = job_class_get_registered (class_name, session); if (! class) goto error; /* Sessions have been ignored, but handle the impossible * anyway. */ if (class->session) goto error; if (! state_get_json_var_full (json_class, "jobs", array, json_jobs)) goto error; /* look for jobs in JSON with associated blocked entries */ for (int j = 0; j < json_object_array_length (json_jobs); j++) { json_object *json_blocking; json_object *json_job; Job *job = NULL; nih_local char *job_name = NULL; json_job = json_object_array_get_idx (json_jobs, j); if (! json_job) goto error; if (! state_check_json_type (json_job, object)) goto error; if (! json_object_object_get_ex (json_job, "blocking", &json_blocking)) continue; if (! state_get_json_string_var_strict (json_job, "name", NULL, job_name)) goto error; /* lookup job */ job = job_find (class->session, NULL, class->name, job_name); if (! job) goto error; /* recreate blocked entries */ if (state_deserialise_blocking (job, &job->blocking, json_job) < 0) goto error; } } return 0; error: return -1; } /** * state_serialise_blocked: * * @blocked: Blocked object. * * Convert a Blocked object into JSON comprising a 'type' * field and a 'data' field. The 'data' field is type-specific: * * - blocked jobs encode the Job instance ('name') * and JobClass name ('class'). * * - blocked events encode the event index number ('index'). * * - all D-Bus blocked types encode the marshalled D-Bus * message ('msg-data'), the D-Bus message serial * number ('msg-id') and the D-Bus connection associated with this * D-Bus message ('msg-connection'). * * Returns: JSON-serialised Blocked object, or NULL on error. **/ json_object * state_serialise_blocked (const Blocked *blocked) { json_object *json; json_object *json_blocked_data; int session_index; nih_assert (blocked); json = json_object_new_object (); if (! json) return NULL; json_blocked_data = json_object_new_object (); if (! json_blocked_data) goto error; switch (blocked->type) { case BLOCKED_JOB: { /* Need to encode JobClass name and Job name to make * it unique. */ if (! state_set_json_string_var (json_blocked_data, "class", blocked->job->class->name)) goto error; session_index = session_get_index (blocked->job->class->session); if (session_index < 0) goto error; /* Encode parent classes session index to aid in * finding the correct job on deserialisation. */ if (! state_set_json_int_var (json_blocked_data, "session", session_index)) goto error; if (! state_set_json_string_var (json_blocked_data, "name", blocked->job->name)) goto error; json_object_object_add (json, "data", json_blocked_data); } break; case BLOCKED_EVENT: { int event_index = 0; event_index = event_to_index (blocked->event); if (event_index < 0) goto error; if (! state_set_json_int_var (json_blocked_data, "index", event_index)) goto error; json_object_object_add (json, "data", json_blocked_data); } break; default: /* Handle the D-Bus types by encoding the D-Bus message * serial number and marshalled message data. * * This scenario occurs when "initctl emit foo" blocks - * the D-Bus message is "in-flight" but blocked on some * event. Therefore, we must serialise the entire D-Bus * message and reconstruct it on deserialisation. */ { DBusMessage *message; DBusConnection *connection; char *dbus_message_data_raw = NULL; char *dbus_message_data_str = NULL; int len = 0; int conn_index; dbus_uint32_t serial; message = blocked->message->message; connection = blocked->message->connection; serial = dbus_message_get_serial (message); if (! state_set_json_int_var (json_blocked_data, "msg-id", serial)) goto error; if (! dbus_message_marshal (message, &dbus_message_data_raw, &len)) goto error; dbus_message_data_str = state_data_to_hex (NULL, dbus_message_data_raw, len); if (! dbus_message_data_str) goto error; /* returned memory is managed by D-Bus, not NIH */ dbus_free (dbus_message_data_raw); if (! state_set_json_string_var (json_blocked_data, "msg-data", dbus_message_data_str)) goto error; conn_index = control_conn_to_index (connection); if (conn_index < 0) goto error; if (! state_set_json_int_var (json_blocked_data, "msg-connection", conn_index)) goto error; json_object_object_add (json, "data", json_blocked_data); } break; } if (! state_set_json_enum_var (json, blocked_type_enum_to_str, "type", blocked->type)) goto error; return json; error: json_object_put (json); return NULL; } /** * state_serialise_blocking: * * @blocking: list of Blocked objects. * * Convert a list of Blocked objects into JSON. * * Returns: JSON-serialised Blocked list, or NULL on error. **/ json_object * state_serialise_blocking (const NihList *blocking) { json_object *json; json = json_object_new_array (); if (! json) return NULL; if (! blocking) return json; NIH_LIST_FOREACH (blocking, iter) { Blocked *blocked = (Blocked *)iter; json_object *json_blocked; /* FIXME: D-Bus blocked objects not serialisable until D-Bus provides * dbus_connection_open_from_fd() to allow deserialisation. */ if (blocked->type != BLOCKED_EVENT && blocked->type != BLOCKED_JOB) { nih_warn ("D-Bus blocked objects not being serialised yet"); continue; } json_blocked = state_serialise_blocked (blocked); if (! json_blocked) goto error; if (json_object_array_add (json, json_blocked) < 0) goto error; } return json; error: json_object_put (json); return NULL; } /** * state_deserialise_blocked: * * @parent: parent, * @json: JSON data representing a blocking array entry, * @list: list to add Blocked entry to. * * Create a single Blocked entry based on data found in JSON and add to * @list. * * Returns: new Blocked object, or NULL on error. **/ Blocked * state_deserialise_blocked (void *parent, json_object *json, NihList *list) { json_object *json_blocked_data; Blocked *blocked = NULL; nih_local char *blocked_type_str = NULL; BlockedType blocked_type; int ret; nih_assert (parent); nih_assert (json); nih_assert (list); nih_assert (control_conns); if (! state_get_json_string_var_strict (json, "type", NULL, blocked_type_str)) goto error; blocked_type = blocked_type_str_to_enum (blocked_type_str); if (blocked_type == (BlockedType)-1) goto error; if (! json_object_object_get_ex (json, "data", &json_blocked_data)) goto error; switch (blocked_type) { case BLOCKED_JOB: { nih_local char *job_name = NULL; nih_local char *job_class_name = NULL; Job *job; Session *session; int session_index; if (! state_get_json_string_var_strict (json_blocked_data, "name", NULL, job_name)) goto error; if (! state_get_json_string_var_strict (json_blocked_data, "class", NULL, job_class_name)) goto error; /* On error, assume NULL session since the likelihood * is we're upgrading from Upstart 1.6 that did not set * the 'session' JSON object. */ if (! state_get_json_int_var (json_blocked_data, "session", session_index)) session_index = 0; if (session_index < 0) goto error; session = session_from_index (session_index); job = job_find (session, NULL, job_class_name, job_name); if (! job) goto error; blocked = NIH_MUST (blocked_new (parent, BLOCKED_JOB, job)); nih_list_add (list, &blocked->entry); } break; case BLOCKED_EVENT: { Event *event = NULL; int event_index = -1; if (! state_get_json_int_var (json_blocked_data, "index", event_index)) goto error; event = event_from_index (event_index); if (! event) goto error; blocked = NIH_MUST (blocked_new (parent, BLOCKED_EVENT, event)); nih_list_add (list, &blocked->entry); /* Event must already exist and should have * blockers associated for it to have a blocked * object pointing at it. */ nih_assert (blocked->event->blockers); } break; default: /* Handle D-Bus types by demarshalling deserialised D-Bus * message and then setting the D-Bus serial number. */ { DBusMessage *dbus_msg = NULL; DBusConnection *dbus_conn = NULL; NihDBusMessage *nih_dbus_msg = NULL; DBusError error; dbus_uint32_t serial = 0; size_t raw_len; nih_local char *dbus_message_data_str = NULL; nih_local char *dbus_message_data_raw = NULL; int conn_index = -1; if (! state_get_json_string_var_strict (json_blocked_data, "msg-data", NULL, dbus_message_data_str)) goto error; if (! state_get_json_int_var (json_blocked_data, "msg-id", serial)) goto error; ret = state_hex_to_data (NULL, dbus_message_data_str, strlen (dbus_message_data_str), &dbus_message_data_raw, &raw_len); if (ret < 0) goto error; if (! state_get_json_int_var (json_blocked_data, "msg-connection", conn_index)) goto error; dbus_conn = control_conn_from_index (conn_index); if (! dbus_conn) goto error; dbus_error_init (&error); dbus_msg = dbus_message_demarshal (dbus_message_data_raw, (int)raw_len, &error); if (! dbus_msg || dbus_error_is_set (&error)) { nih_error ("%s: %s", _("failed to demarshal D-Bus message"), error.message); dbus_error_free (&error); goto error; } dbus_message_set_serial (dbus_msg, serial); /* FIXME: * * *EITHER*: * * a) call nih_dbus_message_new() then *deref* * both the DBusMessage and the DBusConnection * (since they've *ALREADY* been refed by the * pre-re-exec call to nih_dbus_message_new(), * * b) Create nih_dbus_message_renew (const void * *parent, DBusConnection *connection, * DBusMessage * message) that creates a * NihDBusMessage, but does *NOT* ref() the * msg+connection (again). */ /* FIXME: parent is incorrect?!? */ nih_dbus_msg = nih_dbus_message_new (NULL, dbus_conn, dbus_msg); if (! nih_dbus_msg) goto error; blocked = NIH_MUST (blocked_new (parent, blocked_type, nih_dbus_msg)); nih_list_add (list, &blocked->entry); } break; } return blocked; error: if (blocked) nih_free (blocked); return NULL; } /** * state_deserialise_blocking: * * @parent: parent, * @list: list to add new blocked entries to, * @json: JSON representing object containing a blocking entry. * * Recreate Blocked objects from JSON encoded blocking array and add to * specified list. * * Returns: 0 on success, or -1 on error. **/ int state_deserialise_blocking (void *parent, NihList *list, json_object *json) { json_object *json_blocking; nih_assert (parent); nih_assert (list); nih_assert (json); if (! json_object_object_get_ex (json, "blocking", &json_blocking)) { /* parent is not blocking anything */ return 0; } for (int i = 0; i < json_object_array_length (json_blocking); i++) { json_object * json_blocked; json_blocked = json_object_array_get_idx (json_blocking, i); if (! json_blocked) goto error; /* Don't error in this scenario to allow for possibility * that version of Upstart that performed the * serialisation did not correctly handle user and * chroot jobs. */ if (! state_deserialise_blocked (parent, json_blocked, list)) ; } return 0; error: return -1; } /** * state_data_to_hex: * * @parent: parent, * @data: data to convert, * @len: length of @data. * * Convert @data to a hex-encoded string. * * Returns: newly-allocated hex-encoded string, * or NULL on error. **/ char * state_data_to_hex (void *parent, const void *data, size_t len) { unsigned char *p; char *encoded = NULL; size_t i; nih_assert (data); nih_assert (len); for (i = 0, p = (unsigned char *)data; i < len; i++, p++) { if (! nih_strcat_sprintf (&encoded, parent, "%02x", *p)) goto error; } return encoded; error: if (encoded) nih_free (encoded); return NULL; } /** * state_hex_to_data: * * @parent: parent, * @hex_data: hex data to convert, * @hex_len: length of @hex, * @data: newly-allocated data, * @data_len: length of @data. * * Convert hex-encoded data @hex back into its * natural representation. * * Returns: 0 on success, -1 on error. **/ int state_hex_to_data (void *parent, const void *hex_data, size_t hex_len, char **data, size_t *data_len) { char *p; char *d; char *decoded; size_t new_len; nih_assert (hex_data); nih_assert (hex_len); nih_assert (data); nih_assert (data_len); nih_assert (! (hex_len % 2)); new_len = hex_len / 2; *data = decoded = nih_alloc (parent, new_len); if (! decoded) return 0; memset (decoded, '\0', new_len); d = (char *)decoded; for (size_t i = 0; i < hex_len; i += 2, d++) { char byte; char str[3] = { '\0' }; char *endptr; p = ((char *)hex_data)+i; str[0] = *p; str[1] = *(p+1); errno = 0; byte = strtol (str, &endptr, 16); if (errno || *endptr) goto error; *d = byte; } *data_len = (size_t)(d - decoded); nih_assert (*data_len == new_len); return 0; error: nih_free (*data); return -1; } /** * perform_reexec: * * Perform a bare re-exec. * * Note that unless the appropriate command-line option has * _already_ been specified in @args_copy, all internal state will be lost. **/ void perform_reexec (void) { NihError *err; const char *loglevel = NULL; /* Although we have a copy of the original arguments (which may * have included an option to modify the log level), we need to * handle the case where the log priority has been changed at * runtime which potentially invalidates the original command-line * option value. * * Fortuitously, this can be handled easily: NIH option parsing * semantics allow any option to be specified multiple times - * the last value seen is used. Therefore, we just append the * current log-level option and ignore any existing (earlier) * log level options. * * Note that should Upstart be re-exec'ed too many times, * eventually an unexpected log level may result if the * command-line becomes too large (and thus truncates). * * The correct way to handle this would be to prune now invalid * options from the command-line to ensure it does not continue * to increase. That said, if we hit the limit, worse things * are probably going on so for now we'll settle for the * simplistic approach. */ if (nih_log_priority <= NIH_LOG_DEBUG) { loglevel = "--debug"; } else if (nih_log_priority <= NIH_LOG_INFO) { loglevel = "--verbose"; } else if (nih_log_priority >= NIH_LOG_ERROR) { loglevel = "--error"; } else { /* User has not modified default log level of * NIH_LOG_MESSAGE. */ loglevel = NULL; } if (loglevel) NIH_MUST (nih_str_array_add (&args_copy, NULL, NULL, loglevel)); /* if the currently running instance wasn't invoked as * part of a re-exec, ensure that the next instance is (since * otherwise, why would this function be being called!? :) */ if (! restart) NIH_MUST (nih_str_array_add (&args_copy, NULL, NULL, "--restart")); execvp (args_copy[0], args_copy); nih_error_raise_system (); err = nih_error_get (); nih_error (_("Failed to re-execute %s: %s"), args_copy[0], err->message); nih_free (err); } /** * stateful_reexec: * * Perform re-exec with state-passing. UPSTART must be capable of * stateful re-exec for this routine to be called. Any failures * result in a basic re-exec being performed where all state * will be lost. * * The process involves the initial Upstart instance (PID 1) creating a * pipe and then forking. The child then writes its serialised state * over the pipe back to PID 1 which has now re-exec'd itself. * * Once the state has been passed, the child can exit. **/ void stateful_reexec (void) { int fds[2] = { -1, -1 }; pid_t pid; sigset_t mask, oldmask; nih_local char *state_data = NULL; size_t len; /* Block signals while we work. We're the last signal handler * installed so this should mean that they're all handled now. * * The child must make sure that it unblocks these again when * it's ready. */ sigfillset (&mask); sigprocmask (SIG_BLOCK, &mask, &oldmask); if (state_to_string (&state_data, &len) < 0) { nih_error ("%s - %s", _("Failed to generate serialisation data"), _("reverting to stateless re-exec")); goto reexec; } if (pipe (fds) < 0) goto reexec; nih_info (_("Performing stateful re-exec")); /* retain the D-Bus connection across the re-exec */ control_prepare_reexec (); /* Clear CLOEXEC flag for any job log objects prior to re-exec */ job_class_prepare_reexec (); pid = fork (); if (pid < 0) goto reexec; else if (pid > 0) { nih_local char *arg = NULL; /* Parent */ close (fds[1]); /* Tidy up from any previous re-exec */ clean_args (&args_copy); /* Tell the new instance where to read the * serialisation data from. * * Note that if the "new" instance is actually an older * version of Upstart (that does not understand stateful * re-exec), due to the way NIH handles command-line * paring, this option will be ignored and the new instance * will therefore not be able to read the state and overall * a stateless re-exec will therefore be performed. */ arg = NIH_MUST (nih_strdup (NULL, "--state-fd")); NIH_MUST (nih_str_array_add (&args_copy, NULL, NULL, arg)); arg = NIH_MUST (nih_sprintf (NULL, "%d", fds[0])); NIH_MUST (nih_str_array_add (&args_copy, NULL, NULL, arg)); } else { /* Child */ close (fds[0]); nih_info (_("Passing state from PID %d to parent"), (int)getpid ()); /* D-Bus name and the private control server connection must be * relinquished now to allow parent to acquire them. */ if (control_bus_release_name () < 0) { NihError *err; err = nih_error_get (); nih_error (_("Failed to release D-Bus name: %s"), err->message); nih_free (err); } control_server_close (); if (state_write (fds[1], state_data, len) < 0) { nih_error ("%s", _("Failed to write serialisation data")); exit (1); } /* The baton has now been passed */ exit (0); } reexec: /* Attempt stateful re-exec */ perform_reexec (); /* We should never end up here since it likely indicates the * new init binary is damaged. * * All we can do is restore the signal handler and drop back into * the main loop. */ /* Restore */ sigprocmask (SIG_SETMASK, &oldmask, NULL); } /** * clean_args: * * @argsp: pointer to pointer to array of string arguments. * * Remove any existing state fd and log-level-altering arguments. * * This stops command-line exhaustion if stateful re-exec is * performed many times. **/ void clean_args (char ***argsp) { int i; char **args; nih_assert (argsp); for (args = *argsp, i = 0; args && args[i]; i++) { int tmp = i; if (! strcmp (args[i], "--state-fd")) { /* Remove existing entry and fd value */ nih_free (args[tmp]); nih_free (args[tmp+1]); /* shuffle up the remaining args */ for (int j = tmp+2; args[j]; tmp++, j++) args[tmp] = args[j]; args[tmp] = NULL; /* reconsider the newly-shuffled index entry */ i--; } else if ((! strcmp (args[i], "--debug")) || (! strcmp (args[i], "--verbose")) || (! strcmp (args[i], "--error"))) { nih_free (args[i]); /* shuffle up the remaining args */ for (int j = tmp+1; args[j]; tmp++, j++) args[tmp] = args[j]; args[tmp] = NULL; /* reconsider the newly-shuffled index entry */ i--; } } } upstart-1.13.2/init/job_class.h0000664000175000017500000002772312373101356013312 00000000000000/* upstart * * Copyright © 2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_JOB_CLASS_H #define INIT_JOB_CLASS_H #include #include #include #include #include #include #include #include #include "process.h" #include "event_operator.h" #include "session.h" /** * ExpectType: * * This is used to determine what to expect to happen before moving the job * from the spawned state. EXPECT_NONE means that we don't expect anything * so the job will move directly out of the spawned state without waiting. **/ typedef enum expect_type { EXPECT_NONE, EXPECT_STOP, EXPECT_DAEMON, EXPECT_FORK } ExpectType; /** * ConsoleType: * * This is used to identify how a job would like its standard input, output * and error file descriptors arranged. The options are: * - CONSOLE_NONE: to have these all mapped to /dev/null, * - CONSOLE_OUTPUT: the console device (non-owning process), * - CONSOLE_OWNER: the console device (owning process), * - CONSOLE_LOG: stdin is mapped to /dev/null and standard output and error * are redirected to the built-in logger (this is the default). **/ typedef enum console_type { CONSOLE_NONE, CONSOLE_OUTPUT, CONSOLE_OWNER, CONSOLE_LOG } ConsoleType; /** * JOB_DEFAULT_KILL_TIMEOUT: * * The default length of time to wait after sending a process the TERM * signal before sending the KILL signal if it hasn't terminated. **/ #define JOB_DEFAULT_KILL_TIMEOUT 5 /** * JOB_DEFAULT_RESPAWN_LIMIT: * * The default number of times in JOB_DEFAULT_RESPAWN_INTERVAL seconds that * we permit a process to respawn before stoping it **/ #define JOB_DEFAULT_RESPAWN_LIMIT 10 /** * JOB_DEFAULT_RESPAWN_INTERVAL: * * The default number of seconds before resetting the respawn timer. **/ #define JOB_DEFAULT_RESPAWN_INTERVAL 5 /** * JOB_DEFAULT_UMASK: * * The default file creation mark for processes. **/ #define JOB_DEFAULT_UMASK 022 /** * JOB_NICE_INVALID: * * The nice level for processes when no nice level is set. **/ #define JOB_NICE_INVALID -21 /** * JOB_DEFAULT_OOM_SCORE_ADJ: * * The default OOM score adjustment for processes. **/ #define JOB_DEFAULT_OOM_SCORE_ADJ 0 /** * JOB_DEFAULT_ENVIRONMENT: * * Environment variables to always copy from our own environment, these * can be overriden in the job definition or by events since they have the * lowest priority. **/ #define JOB_DEFAULT_ENVIRONMENT \ "PATH", \ "TERM" /** * JobClass: * @entry: list header, * @name: unique name, * @path: path of D-Bus object, * @session: attached session, * @instance: pattern to uniquely identify multiple instances, * @instances: hash table of active instances, * @description: description; intended for humans, * @author: author; intended for humans, * @version: version; intended for humans, * @env: NULL-terminated array of default environment variables, * @export: NULL-terminated array of environment exported to events, * @start_on: event operator expression that can start an instance, * @stop_on: event operator expression that stops instances, * @emits: NULL-terminated array of events that may be emitted by instances, * @process: processes to be run, * @expect: what to expect before entering the next state after spawned, * @task: start requests are not unblocked until instances have finished, * @kill_timeout: time to wait between sending TERM and KILL signals, * @kill_signal: first signal to send (usually SIGTERM), * @reload_signal: reload signal to send (usually SIGHUP), * @respawn: instances should be restarted if main process fails, * @respawn_limit: number of respawns in @respawn_interval that we permit, * @respawn_interval: barrier for @respawn_limit, * @normalexit: array of exit codes that prevent a respawn, * @normalexit_len: length of @normalexit array, * @console: how to arrange processes' stdin/out/err file descriptors, * @umask: file mode creation mask, * @nice: process priority, * @oom_score_adj: OOM killer score adjustment, * @limits: resource limits indexed by resource, * @chroot: root directory of process (implies @chdir if not set), * @chdir: working directory of process, * @setuid: user name to drop to before starting process, * @setgid: group name to drop to before starting process, * @deleted: whether job should be deleted when finished, * @usage: usage text - how to control job, * @apparmor_switch: AppArmor profile to switch to before starting job, * @cgroups: list of CGroup objects representing the cgroups the * job is required to run in, * @cgmanager_wait: TRUE if job waiting for cgroup manager to be * available. * * This structure holds the configuration of a known task or service that * should be tracked by the init daemon; as tasks and services are * fundamentally identical except for when they "finish", they are both * collated together and only differ in the value of @task. **/ typedef struct job_class { NihList entry; char *name; char *path; Session * session; char *instance; NihHash *instances; char *description; char *author; char *version; char **env; char **export; EventOperator *start_on; EventOperator *stop_on; char **emits; Process **process; ExpectType expect; int task; time_t kill_timeout; int kill_signal; int reload_signal; int respawn; int respawn_limit; time_t respawn_interval; int *normalexit; size_t normalexit_len; ConsoleType console; mode_t umask; int nice; int oom_score_adj; struct rlimit *limits[RLIMIT_NLIMITS]; char *chroot; char *chdir; char *setuid; char *setgid; int deleted; int debug; char *usage; char *apparmor_switch; NihList cgroups; int cgmanager_wait; } JobClass; NIH_BEGIN_EXTERN extern NihHash *job_classes; void job_class_init (void); void job_class_environment_init (void); void job_class_environment_reset (void); void job_class_environment_clear (void); int job_class_environment_set (const char *var, int replace); int job_class_environment_unset (const char *name); char ** job_class_environment_get_all (const void *parent) __attribute__ ((warn_unused_result)); const char *job_class_environment_get (const char *name) __attribute__ ((warn_unused_result)); JobClass * job_class_new (const void *parent, const char *name, Session *session) __attribute__ ((warn_unused_result)); int job_class_consider (JobClass *class); int job_class_reconsider (JobClass *class); void job_class_add_safe (JobClass *class); void job_class_register (JobClass *class, DBusConnection *conn, int signal); void job_class_unregister (JobClass *class, DBusConnection *conn); char **job_class_environment (const void *parent, JobClass *class, size_t *len) __attribute__ ((warn_unused_result)); int job_class_get_instance (JobClass *class, NihDBusMessage *message, char * const *env, char **instance) __attribute__ ((warn_unused_result)); int job_class_get_instance_by_name (JobClass *class, NihDBusMessage *message, const char *name, char **instance) __attribute__ ((warn_unused_result)); int job_class_get_all_instances (JobClass *class, NihDBusMessage *message, char ***instances) __attribute__ ((warn_unused_result)); int job_class_start (JobClass *class, NihDBusMessage *message, char * const *env, int wait) __attribute__ ((warn_unused_result)); int job_class_stop (JobClass *class, NihDBusMessage *message, char * const *env, int wait) __attribute__ ((warn_unused_result)); int job_class_restart (JobClass *class, NihDBusMessage *message, char * const *env, int wait) __attribute__ ((warn_unused_result)); int job_class_get_name (JobClass *class, NihDBusMessage *message, char **name) __attribute__ ((warn_unused_result)); int job_class_get_description (JobClass *class, NihDBusMessage *message, char **description) __attribute__ ((warn_unused_result)); int job_class_get_author (JobClass *class, NihDBusMessage *message, char **author) __attribute__ ((warn_unused_result)); int job_class_get_version (JobClass *class, NihDBusMessage *message, char **version) __attribute__ ((warn_unused_result)); int job_class_get_start_on (JobClass *class, NihDBusMessage *message, char ****start_on); int job_class_get_stop_on (JobClass *class, NihDBusMessage *message, char ****stop_on); int job_class_get_emits (JobClass *class, NihDBusMessage *message, char ***emits); int job_class_get_usage (JobClass *class, NihDBusMessage *message, char **usage); const char * job_class_console_type_enum_to_str (ConsoleType console) __attribute__ ((warn_unused_result)); ConsoleType job_class_console_type_str_to_enum (const char *name) __attribute__ ((warn_unused_result)); const char * job_class_expect_type_enum_to_str (ExpectType expect) __attribute__ ((warn_unused_result)); ExpectType job_class_expect_type_str_to_enum (const char *name) __attribute__ ((warn_unused_result)); ConsoleType job_class_console_type (const char *console) __attribute__ ((warn_unused_result)); json_object *job_class_serialise (JobClass *class) __attribute__ ((warn_unused_result)); JobClass *job_class_deserialise (json_object *json) __attribute__ ((warn_unused_result)); json_object * job_class_serialise_all (void) __attribute__ ((warn_unused_result)); int job_class_deserialise_all (json_object *json) __attribute__ ((warn_unused_result)); JobClass * job_class_get (const char *name, Session *session) __attribute__ ((warn_unused_result)); json_object * job_class_serialise_job_environ (void) __attribute__ ((warn_unused_result)); int job_class_deserialise_job_environ (json_object *json) __attribute__ ((warn_unused_result)); void job_class_prepare_reexec (void); time_t job_class_max_kill_timeout (void) __attribute__ ((warn_unused_result)); JobClass *job_class_get_registered (const char *name, const Session *session) __attribute__ ((warn_unused_result)); void job_class_event_block (void *parent, JobClass *old, JobClass *new); ssize_t job_class_get_index (const JobClass *class) __attribute__ ((warn_unused_result)); int job_class_induct_job (JobClass *class) __attribute__ ((warn_unused_result)); #ifdef ENABLE_CGROUPS int job_class_induct_jobs (void) __attribute__ ((warn_unused_result)); int job_class_cgroups (JobClass *class) __attribute__ ((warn_unused_result)); #endif /* ENABLE_CGROUPS */ NIH_END_EXTERN #endif /* INIT_JOB_CLASS_H */ upstart-1.13.2/init/paths.h0000664000175000017500000001245512373101356012466 00000000000000/* upstart * * Copyright © 2010-2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_PATHS_H #define INIT_PATHS_H /** * PATH: * * This is the default PATH set by the init process itself. **/ #ifndef PATH #define _PATH "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin" #ifdef EXTRA_PATH #define PATH _PATH ":" EXTRA_PATH #else #define PATH _PATH #endif #endif /** * CONSOLE: * * This is the console device we give to processes that want one. **/ #ifndef CONSOLE #define CONSOLE "/dev/console" #endif /** * DEV_NULL: * * This is the console device we give to processes that do not want any * console. **/ #ifndef DEV_NULL #define DEV_NULL "/dev/null" #endif /** * CONFFILE: * * Init daemon configuration file. **/ #ifndef CONFFILE #define CONFFILE "/etc/init.conf" #endif /** * CONFDIR: * * Default top-level directory of the system configuration files. **/ #ifndef CONFDIR #define CONFDIR "/etc/init" #endif /** * USERCONFDIR: * * Sub-directory of user's home directory for their jobs. **/ #ifndef USERCONFDIR #define USERCONFDIR ".init" #endif /** * CONFDIR_ENV: * * If this environment variable is set, read configuration files * from the location specified, rather than CONFDIR. * * Value is expected to be the full path to an alternative job * configuration directory. **/ #ifndef CONFDIR_ENV #define CONFDIR_ENV "UPSTART_CONFDIR" #endif /** * STATE_FILE_ENV: * * If set, write STATE_FILE on any re-exec. **/ #ifndef STATE_FILE_ENV #define STATE_FILE_ENV "UPSTART_WRITE_STATEFILE" #endif /** * INIT_XDG_SUBDIR: * * This is the name of the sub folder we will use when constructing * config source dirs with XDG compliant folders. **/ #ifndef INIT_XDG_SUBDIR #define INIT_XDG_SUBDIR "upstart" #endif /** * SYSTEM_USERCONFDIR: * * This is the path to system-wide user session jobs. **/ #ifndef SYSTEM_USERCONFDIR #define SYSTEM_USERCONFDIR "/usr/share/upstart/sessions" #endif /** * INIT_XDG_SESSION_SUBDIR: * * Directory below XDG_RUNTIME_DIR/INIT_XDG_SUBDIR used to * store session details. **/ #ifndef INIT_XDG_SESSION_SUBDIR #define INIT_XDG_SESSION_SUBDIR "sessions" #endif /** * SHELL: * * This is the shell binary used whenever we need special processing for * a command or when we need to run a script. **/ #ifndef SHELL #define SHELL "/bin/sh" #endif /** * SBINDIR: * * Directory containing system binaries. **/ #ifndef SBINDIR #define SBINDIR "/sbin" #endif /** * TELINIT: * * This is the telinit binary used when init is executed as an ordinary * process. **/ #ifndef TELINIT #define TELINIT SBINDIR "/telinit" #endif /** * JOB_LOGDIR: * * Directory that jobs which specify CONSOLE_LOG will have their output * logged to. * **/ #ifndef JOB_LOGDIR #define JOB_LOGDIR "/var/log/upstart" #endif /** * LOGDIR_ENV: * * Environment variable that if set specifies an alternative directory * to JOB_LOGDIR to write log files to. * **/ #ifndef LOGDIR_ENV #define LOGDIR_ENV "UPSTART_LOGDIR" #endif /** * SESSION_ENV: * * Environment variable that is set when running as a Session Init. **/ #ifndef SESSION_ENV #define SESSION_ENV "UPSTART_SESSION" #endif /** * CONF_EXT_STD: * * File extension for standard configuration files. **/ #define CONF_EXT_STD ".conf" /** * CONF_EXT_OVERRIDE: * * File extension for override files. * * Note that override files are not stored in the ConfSource 'files' hash: * all JobClass information from override files is added to the JobClass for * the corresponding (CONF_EXT_STD) object. **/ #define CONF_EXT_OVERRIDE ".override" /** * SESSION_EXT: * * File extension for session files. **/ #ifndef SESSION_EXT #define SESSION_EXT ".session" #endif /** * Determine if specified path extension representes a standard * configuration file. * * @period: pointer to last period in path to check. * * Returns 1 if specified path extension matches that for a * standard configuration file, else return 0. **/ #define IS_CONF_EXT_STD(period) \ (!strcmp (period, CONF_EXT_STD)) /** * Determine if specified path extension representes an * override file. * * @period: pointer to last period in path to check. * * Returns 1 if specified path extension matches that for * an override file, else return 0. **/ #define IS_CONF_EXT_OVERRIDE(period) \ (!strcmp (period, CONF_EXT_OVERRIDE)) /** * Determine if specified filename has a valid configuration * file name extension. * * @period: pointer to last period in filename. * * Returns: TRUE if extension beyond @period is one of the * recognized types, else FALSE. **/ #define IS_CONF_EXT(period) \ (IS_CONF_EXT_STD(period) || \ IS_CONF_EXT_OVERRIDE(period)) #endif /* INIT_PATHS_H */ upstart-1.13.2/init/session.c0000664000175000017500000002452212373101356013023 00000000000000/* upstart * * session.c - session segregation * * Copyright © 2010,2011 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "session.h" #include "conf.h" #include "paths.h" extern json_object *json_sessions; /* Prototypes for static functions */ static json_object *session_serialise (const Session *session) __attribute__ ((warn_unused_result)); static Session *session_deserialise (json_object *json) __attribute__ ((warn_unused_result)); /** * sessions: * * This list holds the list of known sessions; each item is a Session * structure. **/ NihList *sessions = NULL; /** * chroot_sessions: * * If TRUE, enable chroot sessions, we default to a * "traditional" (pre-session support) system. **/ int chroot_sessions = FALSE; /* Prototypes for static functions */ static void session_create_conf_source (Session *sesson, int deserialised); /** * session_init: * * Initialise the sessions list. **/ void session_init (void) { if (! sessions) sessions = NIH_MUST (nih_list_new (NULL)); } /** * session_destroy: * * Clean up the sessions list. **/ void session_destroy (void) { if (sessions) nih_free (sessions); } /** * session_new: * @parent: parent, * @chroot: full chroot path. * * Create a new chroot session. * * Returns: new Session, or NULL on error. **/ Session * session_new (const void *parent, const char *chroot) { Session *session; nih_assert (chroot); session_init (); session = nih_new (parent, Session); if (! session) return NULL; nih_list_init (&session->entry); session->chroot = nih_strdup (session, chroot); if (! session->chroot) { nih_free (session); return NULL; } session->conf_path = NULL; nih_alloc_set_destructor (session, nih_list_destroy); nih_list_add (sessions, &session->entry); return session; } /** * session_from_dbus: * @parent: parent, * @message: D-Bus message. * * Create a new session, based on the specified D-Bus message. * * Returns: new Session, or NULL on error. **/ Session * session_from_dbus (const void *parent, NihDBusMessage *message) { DBusError dbus_error; unsigned long unix_process_id; char root[PATH_MAX]; Session *session; nih_local char *conf_path = NULL; nih_local char *symlink = NULL; ssize_t len; nih_assert (message != NULL); /* Handle explicit command-line request and alternative request * method (primarily for test framework) to disable session support. */ if (! chroot_sessions || getenv ("UPSTART_NO_SESSIONS")) return NULL; session_init (); dbus_error_init (&dbus_error); /* Query origin pid of the caller */ if (! dbus_connection_get_unix_process_id (message->connection, &unix_process_id)) { return NULL; } /* Look up the root path for retrieved pid */ symlink = NIH_MUST (nih_sprintf (NULL, "/proc/%lu/root", unix_process_id)); len = readlink (symlink, root, sizeof (root)-1); if (len < 0) return NULL; root[len] = '\0'; /* Path is not inside a chroot */ if (! strcmp (root, "/")) return NULL; /* Now find in the existing Sessions list */ NIH_LIST_FOREACH_SAFE (sessions, iter) { Session *session = (Session *)iter; if (strcmp (session->chroot, root)) /* ignore sessions relating to other chroots */ continue; if (! session->conf_path) session_create_conf_source (session, FALSE); return session; } /* Didn't find one, make a new one */ session = NIH_MUST (session_new (parent, root)); session_create_conf_source (session, FALSE); return session; } /** * session_create_conf_source: * @session: Session, * @deserialised: TRUE if ConfSource is to be created from a deserialised * session object. * * Create a new ConfSource object and associate the specified Session * with it. **/ static void session_create_conf_source (Session *session, int deserialised) { ConfSource *source; nih_assert (session != NULL); nih_assert (deserialised ? session->conf_path != NULL : session->conf_path == NULL); session_init (); if (! deserialised) { session->conf_path = NIH_MUST (nih_strdup (NULL, session->chroot)); NIH_MUST (nih_strcat (&session->conf_path, NULL, CONFDIR)); } source = NIH_MUST (conf_source_new (session, session->conf_path, CONF_JOB_DIR)); source->session = session; if (conf_source_reload (source) < 0) { NihError *err; err = nih_error_get (); if (err->number != ENOENT) nih_error ("%s: %s: %s", source->path, _("Unable to load configuration"), err->message); nih_free (err); nih_free (source); return; } } /** * session_serialise: * @session: session to serialise. * * Convert @session into a JSON representation for serialisation. * * Caller must free returned value using json_object_put(). * * Returns: JSON-serialised Session object, or NULL on error. **/ static json_object * session_serialise (const Session *session) { json_object *json; json_object *conf_path = NULL; json_object *chroot = NULL; nih_assert (session); nih_assert (session->chroot); nih_assert (session->conf_path); session_init (); json = json_object_new_object (); if (! json) return NULL; chroot = json_object_new_string (session->chroot); if (! chroot) goto error; json_object_object_add (json, "chroot", chroot); conf_path = json_object_new_string (session->conf_path); if (! conf_path) goto error; json_object_object_add (json, "conf_path", conf_path); return json; error: json_object_put (json); return NULL; } /** * session_serialise_all: * * Convert existing Session objects to JSON representation. * * Returns: JSON object containing array of Sessions, or NULL on error. **/ json_object * session_serialise_all (void) { json_object *json; json_object *json_session; session_init (); json = json_object_new_array (); if (! json) return NULL; NIH_LIST_FOREACH (sessions, iter) { Session *session = (Session *)iter; json_session = session_serialise (session); if (! json_session) goto error; if (json_object_array_add (json, json_session) < 0) goto error; } return json; error: json_object_put (json); return NULL; } /** * session_deserialise: * @json: JSON-serialised Session object to deserialise. * * Convert @json into a Session object. * * NOTE: Any user sessions seen when re-execing from an older version * of Upstart are implicitly ignored. * * Returns: Session object, or NULL on error. **/ static Session * session_deserialise (json_object *json) { Session *session = NULL; nih_local const char *chroot = NULL; nih_assert (json); if (! state_check_json_type (json, object)) return NULL; /* Note no check on value returned since chroot may be NULL */ if (! state_get_json_string_var (json, "chroot", NULL, chroot)) return NULL; if (! chroot) return NULL; /* Create a new session */ session = NIH_MUST (session_new (NULL, chroot)); if (! state_get_json_string_var_to_obj (json, session, conf_path)) goto error; return session; error: nih_free (session); return NULL; } /** * session_deserialise_all: * * @json: root of JSON-serialised state. * * Convert JSON representation of sessions back into Session objects. * * Returns: 0 on success, -1 on error. **/ int session_deserialise_all (json_object *json) { Session *session; nih_assert (json); session_init (); nih_assert (NIH_LIST_EMPTY (sessions)); if (! json_object_object_get_ex (json, "sessions", &json_sessions)) goto error; if (! state_check_json_type (json_sessions, array)) goto error; for (int i = 0; i < json_object_array_length (json_sessions); i++) { json_object *json_session; json_session = json_object_array_get_idx (json_sessions, i); if (! json_session) goto error; if (! state_check_json_type (json_session, object)) goto error; session = session_deserialise (json_session); if (! session) goto error; /* Note that we do not call session_create_conf_source() * to create a conf source for each session. * * Once we support the deserialisation of chroots, this * will need to happen. However, currently making this * call will result in the creation of JobClasses for * each ConfFile associated with a Session. This is * pointless since those session-specific JobClasses * are never used. */ } return 0; error: return -1; } /** * session_get_index: * * @session: session. * * Determine JSON-serialised array index for specified @session. * * Returns: zero-based array index for @session, or -1 on error. **/ int session_get_index (const Session *session) { int i; /* Handle NULL session (which is not encoded) */ if (! session) return 0; /* Sessions are serialised in order, so just return the list * index. */ i = 1; NIH_LIST_FOREACH (sessions, iter) { Session *s = (Session *)iter; if (s == session) return i; ++i; } return -1; } /** * session_from_index: * * @idx: zero-based index. * * Lookup session by index number. * * Returns: Session (which may be the NULL session). **/ Session * session_from_index (int idx) { int i; Session *session; nih_assert (idx >= 0); /* NULL session */ if (! idx) return NULL; i = 1; NIH_LIST_FOREACH (sessions, iter) { session = (Session *)iter; if (i == idx) return session; ++i; } /* TODO xnox 20130719 shouldn't we return -1 on error, just * like session_get_index() above? */ nih_assert_not_reached (); } upstart-1.13.2/HACKING0000664000175000017500000001123512373101356011215 00000000000000The upstart source tree is available using Bazaar with the following URL, if you plan to hack on upstart please work off this branch. http://bazaar.launchpad.net/~scott/upstart/trunk Releases are available from: http://upstart.ubuntu.com/download/ upstart uses Launchpad's bug tracking system: http://bugs.launchpad.net/upstart/ If you want to contribute code or bug fixes, please either provide the URL to your own Bazaar branch or use the ‘unified’ diff format (diff -pu) and attach the patch to a bug. Please supply a suggested ChangeLog entry with your patch. Maintainer tools ---------------- The source tree for upstart uses the GNU Build System (sometimes known as the GNU Autotools). You will need the following versions installed. * GNU Autoconf 2.61 * GNU Automake 1.10 * GNU Libtool 2.2.4 * GNU Gettext 0.16.1 After checking out upstart from Bazaar you will need to use these tools to generate the build files. The correct way to do this is to simply run ‘autoreconf -i’ from the top-level source directory. libnih ------ Upstart normally uses the pre-installed version of libnih, however it's possible to use a version from a source tree alongside Upstart by passing the path of that tree to the configure script using the --with-local-libnih option. Configure options ----------------- There are some configure script options that you may find useful when hacking on upstart. * --enable-compiler-warnings: (GCC only) adds extra CFLAGS to increase the source checking and treat all warnings as errors. * --disable-compiler-optimisations: ensures that no compiler optimisations are performed during compilation, easing debugging. * --disable-linker-optimisations: disables the usual linker optimisations, slightly decreasing build time. * --enable-compiler-coverage: (GCC only) enables coverage file generation, useful for test suites. Coding style ------------ The coding style for upstart is roughly K&R with function names in column 0, and variable names aligned in declarations. The right results can be almost achieved by doing the following. * GNU Emacs: if you're not using auto-newline, the following should do the right thing: (defun upstart-c-mode-common-hook () (c-set-style "k&r") (setq indent-tabs-mode t c-basic-offset 8)) * VIM: the default works except for the case labels in switch statements. Set the following option to fix that: setlocal cinoptions=:0 * Indent: can be used to reformat code in a different style: indent -kr -i8 -psl Documentation ------------- All functions, typedefs, structures and file-level variables, whether exported or not, must be preceded by a documentation comment detailing their usage and behaviour. The format of that command is as follows: /** * function_name: * @foo: first parameter description, * @bar: second parameter description, * @baz: third parameter description. * * Describe the function here, when you reference parameters * use the form above, e.g. give @foo or @bar. * * Other functions should be referenced by function-call * syntax, e.g. call other_function() afterwards. * * Returns: if there is a return value, include this line and * give the possible values returned. **/ Structures should detail their members instead of function parameters. Function Attributes ------------------- Functions that allocate a structure and return it should use the "warn_unused_result" and "malloc" attributes, even if the structure is placed in a linked list. The former ensures a failure to allocate memory is checked by the caller, and the latter allows some optimisation. Functions that raise errors, or call other functions that raise errors, must indicate that an error has been raised in their return value and also use the "warn_unused_result" attribute to ensure that the caller doesn't ignore the error. Functions that can return to indicate insufficient memory, even if they don't return a pointer, should also use the "warn_unused_result" attribute; unless it would be common to ignore this (e.g. shrinking a buffer). Test Cases ---------- Where possible, all code should be covered by test cases checking the behaviour of that code. It's particularly important that any bug fixes be accompanied by a test case which fails without the fix and succeeds with it. Tests should be placed in C files under the tests/ directory, and use the macros defined in the nih/test.h header. See the existing test examples to see how. Any functions that allocate memory, or call any functions that allocate memory (those marked with the "malloc" attribute) should be tested using the TEST_ALLOC_FAIL macro to ensure that the case of insufficient memory is handled properly. upstart-1.13.2/test/0000775000175000017500000000000012402042411011250 500000000000000upstart-1.13.2/test/Makefile.in0000664000175000017500000010767212402042375013263 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test_util_check_env$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) @ENABLE_CGROUPS_TRUE@am__append_1 = $(CGMANAGER_LIBS) subdir = test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libtest_util_common_a_AR = $(AR) $(ARFLAGS) libtest_util_common_a_LIBADD = am_libtest_util_common_a_OBJECTS = test_util_common.$(OBJEXT) libtest_util_common_a_OBJECTS = $(am_libtest_util_common_a_OBJECTS) am__EXEEXT_1 = test_util_check_env$(EXEEXT) am_test_util_check_env_OBJECTS = test_util_check_env.$(OBJEXT) test_util_check_env_OBJECTS = $(am_test_util_check_env_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_CGROUPS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) test_util_check_env_DEPENDENCIES = libtest_util_common.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_2) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtest_util_common_a_SOURCES) \ $(test_util_check_env_SOURCES) DIST_SOURCES = $(libtest_util_common_a_SOURCES) \ $(test_util_check_env_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INITCTL_BINARY = $(abs_top_builddir)/util/initctl UPSTART_BINARY = $(abs_top_builddir)/init/init AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) AM_LIBADD = $(CGMANAGER_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS) AM_CPPFLAGS = \ -DLOCALEDIR="\"$(localedir)\"" \ -DSBINDIR="\"$(sbindir)\"" \ -DUPSTART_BINARY="\"$(UPSTART_BINARY)\"" \ -DINITCTL_BINARY="\"$(INITCTL_BINARY)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ -I$(top_srcdir)/intl check_LIBRARIES = libtest_util_common.a libtest_util_common_a_SOURCES = \ test_util_common.c \ test_util_common.h @ENABLE_TAP_OUTPUT_FALSE@LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver @ENABLE_TAP_OUTPUT_TRUE@LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh test_util_check_env_SOURCES = tests/test_util_check_env.c test_util_check_env_LDADD = libtest_util_common.a $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(am__append_1) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLIBRARIES: -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) libtest_util_common.a: $(libtest_util_common_a_OBJECTS) $(libtest_util_common_a_DEPENDENCIES) $(EXTRA_libtest_util_common_a_DEPENDENCIES) $(AM_V_at)-rm -f libtest_util_common.a $(AM_V_AR)$(libtest_util_common_a_AR) libtest_util_common.a $(libtest_util_common_a_OBJECTS) $(libtest_util_common_a_LIBADD) $(AM_V_at)$(RANLIB) libtest_util_common.a clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test_util_check_env$(EXEEXT): $(test_util_check_env_OBJECTS) $(test_util_check_env_DEPENDENCIES) $(EXTRA_test_util_check_env_DEPENDENCIES) @rm -f test_util_check_env$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_util_check_env_OBJECTS) $(test_util_check_env_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_util_check_env.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_util_common.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< test_util_check_env.o: tests/test_util_check_env.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_util_check_env.o -MD -MP -MF $(DEPDIR)/test_util_check_env.Tpo -c -o test_util_check_env.o `test -f 'tests/test_util_check_env.c' || echo '$(srcdir)/'`tests/test_util_check_env.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_util_check_env.Tpo $(DEPDIR)/test_util_check_env.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_util_check_env.c' object='test_util_check_env.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_util_check_env.o `test -f 'tests/test_util_check_env.c' || echo '$(srcdir)/'`tests/test_util_check_env.c test_util_check_env.obj: tests/test_util_check_env.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_util_check_env.obj -MD -MP -MF $(DEPDIR)/test_util_check_env.Tpo -c -o test_util_check_env.obj `if test -f 'tests/test_util_check_env.c'; then $(CYGPATH_W) 'tests/test_util_check_env.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_util_check_env.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_util_check_env.Tpo $(DEPDIR)/test_util_check_env.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_util_check_env.c' object='test_util_check_env.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_util_check_env.obj `if test -f 'tests/test_util_check_env.c'; then $(CYGPATH_W) 'tests/test_util_check_env.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_util_check_env.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_LIBRARIES) $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_util_check_env.log: test_util_check_env$(EXEEXT) @p='test_util_check_env$(EXEEXT)'; \ b='test_util_check_env'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am recheck tags tags-am uninstall \ uninstall-am .PHONY: tests tests: $(check_PROGRAMS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/test/Makefile.am0000664000175000017500000000215312373101356013240 00000000000000## Process this file with automake to produce Makefile.in INITCTL_BINARY = $(abs_top_builddir)/util/initctl UPSTART_BINARY = $(abs_top_builddir)/init/init AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) AM_LIBADD = $(CGMANAGER_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS) AM_CPPFLAGS = \ -DLOCALEDIR="\"$(localedir)\"" \ -DSBINDIR="\"$(sbindir)\"" \ -DUPSTART_BINARY="\"$(UPSTART_BINARY)\"" \ -DINITCTL_BINARY="\"$(INITCTL_BINARY)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ -I$(top_srcdir)/intl check_LIBRARIES = libtest_util_common.a libtest_util_common_a_SOURCES = \ test_util_common.c \ test_util_common.h if ENABLE_TAP_OUTPUT LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh else LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver endif TESTS = test_util_check_env check_PROGRAMS = $(TESTS) .PHONY: tests tests: $(check_PROGRAMS) test_util_check_env_SOURCES = tests/test_util_check_env.c test_util_check_env_LDADD = \ libtest_util_common.a \ $(NIH_LIBS) $(NIH_DBUS_LIBS) if ENABLE_CGROUPS test_util_check_env_LDADD += $(CGMANAGER_LIBS) endif upstart-1.13.2/test/test_util_common.h0000664000175000017500000007315012373101356014746 00000000000000#ifndef TEST_UTIL_COMMON_H #define TEST_UTIL_COMMON_H #include #include #include #include #include #include #include #include #include #include #include /** * TEST_DIR_MODE: * * Mode to use when creating test directories. **/ #define TEST_DIR_MODE 0750 #define BUFFER_SIZE 1024 /** * TEST_EXIT_TIME: * * Maximum time we expect upstart to wait in the QUIESCE_PHASE_WAIT * phase. **/ #define TEST_EXIT_TIME 5 /** * TEST_QUIESCE_KILL_PHASE: * * Maximum time we expect upstart to wait in the QUIESCE_PHASE_KILL * phase. **/ #define TEST_QUIESCE_KILL_PHASE 5 #define TEST_QUIESCE_TOTAL_WAIT_TIME (TEST_EXIT_TIME + TEST_QUIESCE_KILL_PHASE) /** * TEST_MAIN_LOOP_TIMEOUT_SECS: * * Number of seconds to wait until the main loop is exited in error. * * To avoid a test failure, all main loops must exit within this * number of seconds. **/ #define TEST_MAIN_LOOP_TIMEOUT_SECS 5 /* A 'reasonable' path, but which also contains a marker at the end so * we know when we're looking at a PATH these tests have set. */ #define TEST_INITCTL_DEFAULT_PATH "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/wibble" /* Default value for TERM if not already set */ #define TEST_INITCTL_DEFAULT_TERM "linux" #ifdef ENABLE_CGROUPS #define CGMANAGER_DBUS_SOCK "unix:path=/sys/fs/cgroup/cgmanager/sock" #endif /* ENABLE_CGROUPS */ /* TEST_ENSURE_CLEAN_ENV: * * Ensure the environment is as pristine as possible (to avoid follow-on * errors caused by not freeing objects in a previous test, say) */ #define TEST_ENSURE_CLEAN_ENV() \ { \ setvbuf(stdout, NULL, _IONBF, 0); \ \ if (job_classes) { \ TEST_HASH_EMPTY (job_classes); \ } \ \ if (conf_sources) { \ TEST_LIST_EMPTY (conf_sources); \ } \ \ if (nih_io_watches) { \ TEST_LIST_EMPTY (nih_io_watches); \ } \ \ if (nih_timers) { \ TEST_LIST_EMPTY (nih_timers); \ } \ \ if (events) { \ TEST_LIST_EMPTY (events); \ } \ } /** * TEST_WATCH_LOOP: * * Loop for NihIo object Updates, and process them until no watches * left. */ #define TEST_WATCH_LOOP() \ { \ /* Loop until we've fed all of the data. */ \ int first = TRUE; \ for (;;) { \ fd_set readfds, writefds, exceptfds; \ int nfds; \ \ nfds = 0; \ FD_ZERO (&readfds); \ FD_ZERO (&writefds); \ FD_ZERO (&exceptfds); \ \ nih_io_select_fds (&nfds, &readfds, \ &writefds, &exceptfds); \ if (! nfds) { \ if (first) \ TEST_FAILED ("expected to have " \ "data to feed."); \ break; \ } \ first = FALSE; \ \ select (nfds, &readfds, &writefds, &exceptfds, NULL); \ \ nih_io_handle_fds (&readfds, &writefds, &exceptfds); \ } \ } /** * _TEST_WATCH_UPDATE: * @force: if TRUE, force an update, * @timeout: struct timeval pointer, or NULL if no timeout required. * * Request NIH look for a file event relating to any NihIo objects, * with an optional timeout. Behaviour can be forced via @force. **/ #define _TEST_WATCH_UPDATE(force, timeout) \ { \ int nfds = 0; \ int ret = 0; \ fd_set readfds, writefds, exceptfds; \ \ FD_ZERO (&readfds); \ FD_ZERO (&writefds); \ FD_ZERO (&exceptfds); \ \ nih_io_select_fds (&nfds, &readfds, &writefds, &exceptfds); \ if (! force) { \ ret = select (nfds, &readfds, &writefds, \ &exceptfds, timeout); \ } \ if (force || ret > 0) \ nih_io_handle_fds (&readfds, &writefds, &exceptfds); \ } /** * TEST_WATCH_UPDATE: * * Request NIH look for a file event relating to any NihIo objects, * */ #define TEST_WATCH_UPDATE() \ _TEST_WATCH_UPDATE (0, NULL) /** * TEST_WATCH_UPDATE_TIMEOUT: * @timeout: struct timeval pointer. * * Request NIH look for a file event relating to any NihIo objects * within time period @timeout. **/ #define TEST_WATCH_UPDATE_TIMEOUT(timeout) \ _TEST_WATCH_UPDATE (0, timeout) /** * TEST_WATCH_UPDATE_TIMEOUT_SECS: * @secs: seconds to wait before timeout. * * Request NIH look for a file event relating to any NihIo objects * within @secs timeout. **/ #define TEST_WATCH_UPDATE_TIMEOUT_SECS(secs) \ { \ struct timeval _t; \ _t.tv_sec = secs; \ _t.tv_usec = 0; \ _TEST_WATCH_UPDATE (0, &_t); \ } /** * TEST_FORCE_WATCH_UPDATE: * * Force NIH to look for a file event relating to any NihIo objects. **/ #define TEST_FORCE_WATCH_UPDATE() \ _TEST_WATCH_UPDATE (1, NULL) /** * ENSURE_DIRECTORY_EMPTY: * @path: Full path to a directory. * * Ensure specified directory is empty. **/ #define ENSURE_DIRECTORY_EMPTY(path) \ { \ DIR *dp = NULL; \ struct dirent *file = NULL; \ int count = 0; \ \ dp = opendir (path); \ TEST_NE_P (dp, NULL); \ \ while((file = readdir (dp))) { \ if (!strcmp (".", file->d_name) || \ !strcmp ("..", file->d_name)) \ continue; \ count++; \ } \ \ closedir (dp); \ \ TEST_EQ (count, 0); \ } /** * TEST_RESET_MAIN_LOOP: * * Reset main loop and associated test variables. **/ #define TEST_RESET_MAIN_LOOP() \ if (nih_main_loop_functions) { \ nih_free (nih_main_loop_functions); \ nih_main_loop_functions = NULL; \ } \ if (nih_child_watches) { \ nih_free (nih_child_watches); \ nih_child_watches = NULL; \ } \ if (nih_timers) { \ nih_free (nih_timers); \ nih_timers = NULL; \ } \ nih_child_init (); \ nih_main_loop_init (); \ nih_timer_init (); \ nih_io_init () /** * obj_string_check: * * @a: first object, * @b: second object, * @name: name of string element. * * Compare string element @name in objects @a and @b. * * Returns: 0 if strings are identical * (or both NULL), else 1. **/ #define obj_string_check(a, b, name) \ string_check ((a)->name, (b)->name) /** * obj_num_check: * * @a: first object, * @b: second object. * @name: name of numeric element. * * Compare numeric element @name in objects @a and @b. * * Returns: 0 if @a and @b are identical, else 1. **/ #define obj_num_check(a, b, name) \ (a->name != b->name) /** * TEST_CMP_INT_ARRAYS: * @a: first array, * @b: second array, * @sizea: size of @a, * @sizeb: size of @b. * * Compare integer arrays @a and @b for equivalence. * * Returns: 0 if arrays are identical, else -1. **/ #define TEST_CMP_INT_ARRAYS(a, b, sizea, sizeb) \ ({int ret = 0; \ size_t __i; \ if (sizea == sizeb) { \ for (__i = 0; \ __i < sizea; \ __i++) { \ if ((a)[__i] != (b)[__i]) { \ ret = -1; \ break; \ } \ } \ } else \ ret = -1; \ ret;}) /** * TEST_CMP_STR_ARRAYS: * @a: first string array, * @b: second string array, * @sizea: length of @a, * @sizeb: length of @b. * * Compare string arrays @a and @b for equivalence. * * Returns: 0 if arrays are identical, else -1. **/ #define TEST_CMP_STR_ARRAYS(a, b, sizea, sizeb) \ ({ int ret = 0; \ if (sizea == sizeb) { \ for (size_t __i = 0; \ __i < sizea; \ __i++) { \ if (strcmp (a[__i], b[__i])) { \ ret = -1; \ break; \ } \ } \ } else \ ret = -1; \ ret;}) /** * TEST_TWO_LISTS_FOREACH: * @list1: entry in the first list to iterate, * @list2: entry in the second list to iterate, * @iter1: name of iterator variable for @list1, * @iter2: name of iterator variable for @list2. * * Dual version of NIH_LIST_FOREACH() which iterates * two lists in tandem. **/ #define TEST_TWO_LISTS_FOREACH(list1, list2, iter1, iter2) \ for (NihList *iter1 = (list1)->next, \ *iter2 = (list2)->next; \ iter1 != (list1) && iter2 != (list2); \ iter1 = iter1->next, \ iter2 = iter2->next) /** * TEST_TWO_HASHES_FOREACH: * @hash1: entry in the first hash to iterate, * @hash2: entry in the second hash to iterate, * @iter1: name of iterator variable for @hash1, * @iter2: name of iterator variable for @hash2. * * Dual version of NIH_HASH_FOREACH() which iterates * two hashes in tandem. **/ #define TEST_TWO_HASHES_FOREACH(hash1, hash2, iter1, iter2) \ for (size_t _##iter##_i = 0; _##iter##_i < (hash1)->size; \ _##iter##_i++) \ TEST_TWO_LISTS_FOREACH (&(hash1)->bins[_##iter##_i], \ &(hash2)->bins[_##iter##_i], \ iter1, iter2) /** * TEST_TWO_TREES_FOREACH: * @tree1: root of the first tree to iterate, * @tree2: root of the second tree to iterate, * @iter1: name of iterator variable for @tree1, * @iter2: name of iterator variable for @tree2. * * Dual version of NIH_TREE_FOREACH() which walks * two trees in tandem. **/ #define TEST_TWO_TREES_FOREACH(tree1, tree2, iter1, iter2) \ for (NihTree *iter1 = nih_tree_next (tree1, NULL), \ *iter2 = nih_tree_next (tree2, NULL); \ iter1 != NULL && iter2 != NULL; \ iter1 = nih_tree_next (tree1, iter1), \ iter2 = nih_tree_next (tree2, iter2)) /** * TEST_ARRAY_SIZE: * @array: array. * * Determine size of specified array. * * Returns: array size. **/ #define TEST_ARRAY_SIZE(array) \ (sizeof (array) / sizeof (array[0])) /** * START_UPSTART: * * @pid: pid_t that will contain pid of running instance on success, * @user_mode: TRUE for Session Init (or FALSE to use D-Bus * session bus). * * Start an instance of Upstart and return PID in @pid. **/ #define START_UPSTART(pid, user_mode) \ start_upstart_common (&(pid), user_mode, FALSE, NULL, NULL, NULL) /** * KILL_UPSTART: * * @pid: pid of upstart to kill, * @signo: signal number to send to @pid, * @wait: TRUE to wait for @pid to die. * * Send specified signal to upstart process @pid. **/ #define KILL_UPSTART(pid, signo, wait) \ { \ int status; \ assert (pid); \ assert (signo); \ \ assert0 (kill (pid, signo)); \ if (wait) { \ TEST_EQ (waitpid (pid, &status, 0), pid); \ TEST_TRUE (WIFSIGNALED (status)); \ TEST_TRUE (WTERMSIG (status) == signo); \ } \ /* reset since a subsequent start could specify a different \ * user_mode value. \ */ \ test_user_mode = FALSE; \ } /** * STOP_UPSTART: * * @pid: pid of upstart to kill. * * Stop upstart process @pid. **/ #define STOP_UPSTART(pid) \ KILL_UPSTART (pid, SIGKILL, TRUE) /** * REEXEC_UPSTART: * * @pid: pid of upstart, * @user: TRUE if @pid refers to a Session Init, else FALSE. * * Force upstart to perform a re-exec. **/ #define REEXEC_UPSTART(pid, user) \ if (user) { \ session_init_reexec (pid); \ } else { \ KILL_UPSTART (pid, SIGTERM, FALSE); \ } \ wait_for_upstart (user ? pid : FALSE) /** * RUN_COMMAND: * * @parent: pointer to parent object, * @cmd: string representing command to run, * @result: "char ***" pointer which will contain an array of string * values corresponding to lines of standard output generated by @cmd, * @len: size_t pointer which will be set to length of @result. * * Run a command and return its standard output. It is the callers * responsibility to free @result. Errors from running @cmd are fatal. * * Note: trailing '\n' characters are removed in returned command * output. **/ #define RUN_COMMAND(parent, cmd, result, len) \ { \ FILE *f; \ char buffer[BUFFER_SIZE]; \ char **ret; \ \ assert (cmd[0]); \ \ *(result) = nih_str_array_new (parent); \ TEST_NE_P (*result, NULL); \ *(len) = 0; \ \ f = popen (cmd, "r"); \ TEST_NE_P (f, NULL); \ \ while (fgets (buffer, BUFFER_SIZE, f)) { \ size_t l = strlen (buffer)-1; \ \ if ( buffer[l] == '\n') \ buffer[l] = '\0'; \ ret = nih_str_array_add (result, parent, len, \ buffer); \ TEST_NE_P (ret, NULL); \ } \ \ TEST_NE (pclose (f), -1); \ } /** * CREATE_FILE: * * @dirname: directory name (assumed to already exist), * @name: name of file to create (no leading slash), * @contents: string contents of @name. * * Create a file in the specified directory with the specified * contents. * * Notes: A newline character is added in the case where @contents does * not end with one. **/ #define CREATE_FILE(dirname, name, contents) \ { \ FILE *f; \ char filename[PATH_MAX]; \ \ assert (dirname[0]); \ assert (name[0]); \ \ strcpy (filename, dirname); \ if ( name[0] != '/' ) \ strcat (filename, "/"); \ strcat (filename, name); \ f = fopen (filename, "w"); \ TEST_NE_P (f, NULL); \ fprintf (f, "%s", contents); \ if ( contents[strlen(contents)-1] != '\n') \ fprintf (f, "\n"); \ fclose (f); \ } /** * DELETE_FILE: * * @dirname: directory in which file to delete exists, * @name: name of file in @dirname to delete. * * Delete specified file. * **/ #define DELETE_FILE(dirname, name) \ { \ char filename[PATH_MAX]; \ \ assert (dirname[0]); \ assert (name[0]); \ \ strcpy (filename, dirname); \ if ( name[0] != '/' ) \ strcat (filename, "/"); \ strcat (filename, name); \ \ TEST_EQ (unlink (filename), 0); \ } /** * _WAIT_FOR_FILE(): * * @path: full path to file to look for, * @sleep_secs: number of seconds to sleep per loop, * @loops: number of times to check for file. * * Wait for a reasonable period of time for @path to be created. * * Abort if file does not appear within (sleep_secs * loops) seconds. * * XXX:WARNING: this is intrinsically racy since although the file has * been _created_, it has not necessarily been fully written at the * point this macro signifies success. For that we need inotify or * similar. **/ #define _WAIT_FOR_FILE(path, sleep_secs, loops) \ { \ int ok; \ struct stat statbuf; \ \ assert (path[0]); \ \ /* Wait for log to be created */ \ ok = FALSE; \ for (int i = 0; i < loops; i++) { \ sleep (sleep_secs); \ if (! stat (path, &statbuf)) { \ ok = TRUE; \ break; \ } \ } \ TEST_EQ (ok, TRUE); \ } /** * WAIT_FOR_FILE(): * * @path: full path to file to look for. * * Wait for a "reasonable period of time" for @path to be created. * * Abort if file does not appear within. **/ #define WAIT_FOR_FILE(path) \ _WAIT_FOR_FILE (path, 1, 5) /** * TEST_STR_MATCH: * @_string: string to check, * @_pattern: pattern to expect. * * Check that @_string matches the glob pattern @_pattern, which * should include the terminating newline if one is expected. * * Notes: Analagous to TEST_FILE_MATCH(). **/ #define TEST_STR_MATCH(_string, _pattern) \ do { \ if (fnmatch ((_pattern), _string, 0)) \ TEST_FAILED ("wrong string value, " \ "expected '%s' got '%s'", \ (_pattern), _string); \ } while (0) /** * _TEST_STR_ARRAY_CONTAINS: * * @_array: string array, * @_pattern: pattern to expect, * @_invert: invert meaning. * * Check that atleast 1 element in @_array matches @_pattern. * * If @_invert is TRUE, ensure @_pattern is _NOT_ found in @_array. **/ #define _TEST_STR_ARRAY_CONTAINS(_array, _pattern, _invert) \ do { \ char **p; \ int got = FALSE; \ \ for (p = _array; p && *p; p++) { \ \ if (! fnmatch ((_pattern), *p, 0)) { \ got = TRUE; \ break; \ } \ } \ \ if (_invert) { \ if (got) { \ TEST_FAILED ("wrong content in array " \ "%p (%s), '%s' found unexpectedly", \ (_array), #_array, (_pattern)); \ } \ } else { \ if (! got) { \ TEST_FAILED ("wrong content in array " \ "%p (%s), '%s' not found", \ (_array), #_array, (_pattern)); \ } \ } \ } while (0) /** * _TEST_FILE_CONTAINS: * @_file: FILE to read from, * @_pattern: pattern to expect, * @_invert: invert meaning. * * Check that any subsequent line in file @_file matches the glob pattern * @_pattern, which should include the terminating newline if one is expected. * * If @_invert is TRUE, ensure @_pattern is _NOT_ found in @_file. **/ #define _TEST_FILE_CONTAINS(_file, _pattern, _invert) \ do { \ char buffer[1024]; \ int got = FALSE; \ int ret; \ while (fgets (buffer, sizeof (buffer), _file)) { \ \ ret = fnmatch ((_pattern), buffer, 0); \ \ if (! ret) { \ got = TRUE; \ break; \ } \ } \ \ if (_invert) { \ if (got) { \ TEST_FAILED ("wrong content in file " \ "%p (%s), '%s' found unexpectedly", \ (_file), #_file, (_pattern)); \ } \ } else { \ if (! got) { \ TEST_FAILED ("wrong content in file " \ "%p (%s), '%s' not found", \ (_file), #_file, (_pattern)); \ } \ } \ } while (0) /** * TEST_FILE_CONTAINS: * @_file: FILE to read from, * @_pattern: pattern to expect. * * Check that any subsequent line in file @_file matches the glob pattern * @_pattern, which should include the terminating newline if one is expected. * **/ #define TEST_FILE_CONTAINS(_file, _pattern) \ _TEST_FILE_CONTAINS(_file, _pattern, FALSE) /** * TEST_FILE_NOT_CONTAINS: * @_file: FILE to read from, * @_pattern: pattern NOT to expect. * * Check that no subsequent line in file @_file does NOT match the glob pattern * @_pattern, which should include the terminating newline if one is expected. * **/ #define TEST_FILE_NOT_CONTAINS(_file, _pattern) \ _TEST_FILE_CONTAINS(_file, _pattern, TRUE) /** * TEST_STR_ARRAY_CONTAINS: * * @_array: string array, * @_pattern: pattern to expect. * * Check that atleast 1 element in @_array matches @_pattern. **/ #define TEST_STR_ARRAY_CONTAINS(_array, _pattern) \ _TEST_STR_ARRAY_CONTAINS (_array, _pattern, FALSE) /** * TEST_STR_ARRAY_NOT_CONTAINS: * * @_array: string array, * @_pattern: pattern to expect. * * Check that no element in @_array matches @_pattern. **/ #define TEST_STR_ARRAY_NOT_CONTAINS(_array, _pattern) \ _TEST_STR_ARRAY_CONTAINS (_array, _pattern, TRUE) extern int test_user_mode; /** * NihTreeHandler: * @node: tree entry being visited, * @data: data pointer. * * A tree handler is a function called for each tree node * when iterating over a tree. * * Returns: TRUE if tree entry process correctly, else FALSE. **/ typedef int (*NihTreeHandler) (NihTree *node, void *data); /* Prototypes */ int set_upstart_session (pid_t session_init_pid) __attribute__ ((warn_unused_result)); void wait_for_upstart (int session_init_pid); void session_init_reexec (int session_init_pid); int have_timed_waitpid (void) __attribute__ ((warn_unused_result)); pid_t timed_waitpid (pid_t pid, time_t timeout) __attribute__ ((warn_unused_result)); char * get_initctl (void) __attribute__ ((warn_unused_result)); void _start_upstart (pid_t *pid, int user, char * const *args); void start_upstart_common (pid_t *pid, int user, int inherit_env, const char *confdir, const char *logdir, char * const *extra); void start_upstart (pid_t *pid); pid_t job_to_pid (const char *job) __attribute__ ((warn_unused_result)); int string_check (const char *a, const char *b) __attribute__ ((warn_unused_result)); const char *get_upstart_binary (void) __attribute__ ((warn_unused_result)); const char *get_initctl_binary (void) __attribute__ ((warn_unused_result)); int strcmp_compar (const void *a, const void *b) __attribute__ ((warn_unused_result)); char *get_session_file (const char *xdg_runtime_dir, pid_t pid) __attribute__ ((warn_unused_result)); int in_chroot (void) __attribute__ ((warn_unused_result)); int dbus_configured (void) __attribute__ ((warn_unused_result)); char *search_and_replace (void *parent, const char *str, const char *from, const char *to) __attribute__ ((warn_unused_result)); int file_exists (const char *path) __attribute__ ((warn_unused_result)); void test_common_setup (void); void test_common_cleanup (void); void timer_cb (void *data, NihTimer *timer); void test_job_process_handler (void *data, pid_t pid, NihChildEvents event, int status); void test_main_loop_func (void *data, NihMainLoopFunc *self); int fd_valid (int fd) __attribute__ ((warn_unused_result)); NihIoBuffer *read_from_fd (void *parent, int fd) __attribute__ ((warn_unused_result)); typedef int (*NihListHandler) (NihList *entry, void *data); int test_list_handler_generic (NihList *entry, void *data) __attribute__ ((unused, noinline)); int test_list_foreach (const NihList *list, size_t *len, NihListHandler handler, void *data) __attribute__((unused)); size_t test_list_count (const NihList *list) __attribute__((warn_unused_result, unused)); NihList *test_list_get_index (NihList *list, size_t count) __attribute__((warn_unused_result, unused)); int test_hash_foreach (const NihHash *hash, size_t *len, NihListHandler handler, void *data) __attribute__((unused)); size_t test_hash_count (const NihHash *hash) __attribute__((warn_unused_result, unused)); int test_tree_foreach (NihTree *tree, size_t *len, NihTreeHandler handler, void *data) __attribute__((unused)); size_t test_tree_count (NihTree *tree) __attribute__((warn_unused_result, unused)); int connect_to_cgmanager (void) __attribute__((warn_unused_result)); void disconnect_cgmanager (void); char *get_pid_cgroup (const char *controller, pid_t pid) __attribute__((warn_unused_result)); int setup_cgroup_sandbox (void) __attribute__((warn_unused_result)); #endif /* TEST_UTIL_COMMON_H */ upstart-1.13.2/test/tests/0000775000175000017500000000000012402042411012412 500000000000000upstart-1.13.2/test/tests/test_util_check_env.c0000664000175000017500000001076512373101356016543 00000000000000/* upstart * * test_util_check_env.c - meta test to ensure environment sane for * running tests. * * Copyright © 2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include "test_util_common.h" #ifndef OVERLAYFS_SUPER_MAGIC #define OVERLAYFS_SUPER_MAGIC 0x794c764f #endif /** * check_for_overlayfs: * * Determine if the mount point used by the tests for creating temporary * files is using overlayfs. * * Returns: TRUE if temporary work area is on overlayfs, else FALSE. **/ int check_for_overlayfs (void) { struct statfs statbuf; char path[PATH_MAX]; int found = FALSE; /* Create a file in the temporary work area */ TEST_FILENAME (path); fclose (fopen (path, "w")); /* Check it exits */ assert0 (statfs (path, &statbuf)); if (statbuf.f_type == OVERLAYFS_SUPER_MAGIC) { nih_warn ("Mountpoint for '%s' (needed by the Upstart tests) is an overlayfs " "filesystem, which does not support inotify.", path); found = TRUE; } assert0 (unlink (path)); return found; } #ifdef ENABLE_CGROUPS void print_my_cgroup(void) { char *str; str = get_pid_cgroup("freezer", getpid()); if (str) { nih_warn("I am in freezer cgroup: %s", str); TEST_EQ_STR(str, "/"); nih_free(str); } else { TEST_FAILED("Failed to get my freezer cgroup"); } } char *get_my_cgroup() { char line[1024], *ret = NULL; FILE *f = fopen("/proc/self/cgroup", "r"); while (fgets(line, 1024, f)) { char *p, *p2; if ((p = strchr(line, ':')) == NULL) continue; p++; if ((p2 = strchr(p, ':')) == NULL) continue; if (strncmp(p, "name=", 5) == 0) continue; ret = NIH_MUST( nih_strdup(NULL, p2+1) ); break; } fclose(f); return ret; } int check_cgroup_sandbox(void) { char *cg_prev = NULL, *cg_post = NULL; int ret = -1; cg_prev = get_my_cgroup(); if (!cg_prev) return -1; if (setup_cgroup_sandbox() < 0) { nih_free(cg_prev); return -1; } cg_post = get_my_cgroup(); if (!cg_post) { nih_free(cg_prev); return -1; } /* we should have moved cgroups, so the two should be different */ if (strcmp(cg_prev, cg_post) != 0) { nih_warn("setup_cgroup_sandbox moved me from %s to %s", cg_prev, cg_post); ret = 0; } nih_free(cg_prev); nih_free(cg_post); return ret; } #endif /* ENABLE_CGROUPS */ /** * test_checks: * * Perform any checks necessary before real tests are run. **/ void test_checks (void) { int ret; TEST_GROUP ("test environment"); /* * Warn (*) if overlayfs detected. * * (*) - Don't fail in the hope that one day someone might fix * overlayfs. */ TEST_FEATURE ("checking for overlayfs"); if (check_for_overlayfs ()) { nih_warn ("Found overlayfs mounts"); nih_warn ("This environment will probably cause tests to fail mysteriously!!"); nih_warn ("See bug LP:#882147 for further details."); } #ifdef ENABLE_CGROUPS if (file_exists ("/sys/fs/cgroup/cgmanager/sock")) { TEST_FEATURE ("checking for cgmanager"); ret = connect_to_cgmanager (); switch (ret) { case -2: nih_warn ("Found no cgroup manager"); goto out_skip; case -1: nih_warn ("Error connecting to cgmanager"); goto out_skip; case 0: print_my_cgroup (); break; default: nih_warn ("Unknown error from connect_to_cgmanager: %d", ret); goto out_skip; } TEST_FEATURE ("cgroup sandbox"); if (check_cgroup_sandbox() != 0) nih_warn ("Could not create cgroup sandbox"); } else { nih_warn ("Skipping CGManager tests, CGManager socket not found"); } out_skip: disconnect_cgmanager(); if (ret) nih_warn ("Skipping CGManager tests, CGManager not properly configured"); #endif /* ENABLE_CGROUPS */ } int main (int argc, char *argv[]) { test_checks (); return 0; } upstart-1.13.2/test/test_util_common.c0000664000175000017500000007701412373101356014744 00000000000000/* upstart * * test_util_common.c - common test utilities * * Copyright © 2012-2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbus/upstart.h" #include #ifdef ENABLE_CGROUPS #include #endif #include "test_util_common.h" #ifndef UPSTART_BINARY #error unable to find init binary as UPSTART_BINARY not defined #endif /* UPSTART_BINARY */ #ifndef INITCTL_BINARY #error unable to find initctl binary as INITCTL_BINARY not defined #endif /* INITCTL_BINARY */ static char *saved_xdg_config_home = NULL; static char *saved_xdg_runtime_dir = NULL; static char test_xdg_config_home[PATH_MAX]; static char test_xdg_runtime_dir[PATH_MAX]; #ifdef ENABLE_CGROUPS static NihDBusProxy *cgroup_manager; #endif /* ENABLE_CGROUPS */ /** * test_setup_called: * * Set to TRUE if test_setup() called. **/ static int test_setup_called = FALSE; static void selfpipe_write (int n); static void selfpipe_setup (void); /** * wait_for_upstart: * * @session_init_pid: pid of Session Init (which uses a private bus * rather than the session bus), else 0. * * Wait for Upstart to appear on D-Bus denoting its completion of * initialisation. Wait time is somewhat arbitrary (but more * than adequate!). **/ void wait_for_upstart (int session_init_pid) { nih_local NihDBusProxy *upstart = NULL; DBusConnection *connection; char *address; NihError *err; int running = FALSE; /* XXX: arbitrary value */ int attempts = 10; if (session_init_pid) { TEST_TRUE (set_upstart_session (session_init_pid)); address = getenv ("UPSTART_SESSION"); } else { address = getenv ("DBUS_SESSION_BUS_ADDRESS"); } TEST_TRUE (address); while (attempts) { attempts--; sleep (1); connection = nih_dbus_connect (address, NULL); if (! connection) { err = nih_error_get (); nih_free (err); continue; } upstart = nih_dbus_proxy_new (NULL, connection, NULL, DBUS_PATH_UPSTART, NULL, NULL); if (! upstart) { err = nih_error_get (); nih_free (err); dbus_connection_unref (connection); } else { running = TRUE; break; } } TEST_EQ (running, TRUE); } /** * session_init_reexec: * * @pid: pid of Session Init. * * Cause the Session Init running as pid @pid to re-exec. **/ void session_init_reexec (pid_t pid) { nih_local NihDBusProxy *upstart = NULL; char *address; DBusConnection *connection; DBusMessage *method_call; DBusMessageIter iter; DBusError error; TEST_TRUE (pid); TEST_TRUE (set_upstart_session (pid)); address = getenv ("UPSTART_SESSION"); TEST_TRUE (address); connection = nih_dbus_connect (address, NULL); TEST_NE_P (connection, NULL); upstart = nih_dbus_proxy_new (NULL, connection, NULL, DBUS_PATH_UPSTART, NULL, NULL); TEST_NE_P (upstart, NULL); method_call = dbus_message_new_method_call (upstart->name, upstart->path, "com.ubuntu.Upstart0_6", "Restart"); TEST_NE_P (method_call, NULL); dbus_message_set_auto_start (method_call, upstart->auto_start); dbus_message_iter_init_append (method_call, &iter); /* Send the message, and wait for the reply. */ dbus_error_init (&error); /* Don't bother checking reply - Upstart will sever the * connection anyway. */ (void)dbus_connection_send_with_reply_and_block (upstart->connection, method_call, -1, &error); dbus_message_unref (method_call); dbus_connection_unref (connection); } /* TRUE to denote that Upstart is running in user session mode * (FALSE to denote it's using the users D-Bus session bus). */ int test_user_mode = FALSE; /** * set_upstart_session: * * @session_init_pid: pid of Session Init. * * Attempt to "enter" an Upstart session by setting UPSTART_SESSION to * the value of the session running under pid @session_init_pid. * * Returns: TRUE if it was possible to enter the currently running * Upstart session, else FALSE. **/ int set_upstart_session (pid_t session_init_pid) { char *value; nih_local char *cmd = NULL; nih_local char **output = NULL; size_t lines = 0; int got = FALSE; int i; pid_t pid; /* XXX: arbitrary value */ int loops = 5; nih_assert (session_init_pid); /* list-sessions relies on this */ if (! getenv ("XDG_RUNTIME_DIR")) return FALSE; cmd = nih_sprintf (NULL, "%s list-sessions 2>&1", get_initctl_binary ()); TEST_NE_P (cmd, NULL); /* We expect the list-sessions command to return a valid session * within a reasonable period of time. */ for (i = 0; i < loops; i++) { sleep (1); RUN_COMMAND (NULL, cmd, &output, &lines); if (lines < 1) continue; /* Look for the specific session */ for (size_t line = 0; line < lines; lines++) { /* No pid in output */ if (! isdigit(output[line][0])) continue; pid = (pid_t)atoi(output[line]); nih_assert (pid > 0); if (pid != session_init_pid) continue; /* look for separator between pid and value of * UPSTART_SESSION. */ value = strstr (output[0], " "); if (! value) continue; /* jump over space */ value += 1; if (! value) continue; /* No socket address */ if (strstr (value, "unix:abstract") == value) { got = TRUE; goto out; } } } out: if (got != TRUE) return FALSE; assert0 (setenv ("UPSTART_SESSION", value, 1)); return TRUE; } /** * selfpipe: * * Used to allow a timed process wait. **/ static int selfpipe[2] = { -1, -1 }; static void selfpipe_write (int n) { assert (selfpipe[1] != -1); TEST_EQ (write (selfpipe[1], "", 1), 1); } /** * selfpipe_setup: * * Arrange for SIGCHLD to write to selfpipe such that we can select(2) * on child process status changes. **/ static void selfpipe_setup (void) { static struct sigaction act; int read_flags; int write_flags; assert (selfpipe[0] == -1); assert (! pipe (selfpipe)); /* Set non-blocking */ read_flags = fcntl (selfpipe[0], F_GETFL); write_flags = fcntl (selfpipe[1], F_GETFL); read_flags |= O_NONBLOCK; write_flags |= O_NONBLOCK; assert (fcntl (selfpipe[0], F_SETFL, read_flags) == 0); assert (fcntl (selfpipe[1], F_SETFL, write_flags) == 0); /* Don't leak */ assert (fcntl (selfpipe[0], F_SETFD, FD_CLOEXEC) == 0); assert (fcntl (selfpipe[1], F_SETFD, FD_CLOEXEC) == 0); memset (&act, 0, sizeof (act)); /* register SIGCHLD handler which will cause pipe write when child * changes state. */ act.sa_handler = selfpipe_write; sigaction (SIGCHLD, &act, NULL); } /** * have_timed_waitpid * * Return TRUE if precise timing information is available for timing * tests. **/ int have_timed_waitpid (void) { struct timespec res; if (clock_getres (CLOCK_MONOTONIC_RAW, &res) < 0) return FALSE; return TRUE; } /** * timed_waitpid: * * @pid: pid to wait for, * @timeout: seconds to wait for @pid to change state. * * Simplified waitpid(2) with timeout using a pipe to allow select(2) * with timeout to be used to wait for process state change. * * Returns: as waitpid(2). **/ pid_t timed_waitpid (pid_t pid, time_t timeout) { static char buffer[1]; fd_set read_fds; struct timeval tv; int status; int nfds; int ret; pid_t ret2; assert (pid); assert (timeout); if (selfpipe[0] == -1) selfpipe_setup (); FD_ZERO (&read_fds); FD_SET (selfpipe[0], &read_fds); nfds = 1 + selfpipe[0]; tv.tv_sec = timeout; tv.tv_usec = 0; /* wait for some activity */ ret = select (nfds, &read_fds, NULL, NULL, &tv); if (! ret) /* timed out */ return 0; /* discard any data written to pipe */ while (read (selfpipe[0], buffer, sizeof (buffer)) > 0) ; while (TRUE) { /* wait for status change or error */ ret2 = waitpid (pid, &status, WNOHANG); if (ret2 < 0) return -1; if (! ret2) /* give child a chance to change state */ sleep (1); if (ret2) { if (WIFEXITED (status)) return ret2; /* unexpected status change */ return -1; } } } /** * get_initctl(): * * Determine a suitable initctl command-line for testing purposes. * * Returns: Static string representing full path to initctl binary with * default option to allow communication with an Upstart started using * START_UPSTART(). **/ char * get_initctl (void) { static char path[PATH_MAX + 1024] = { 0 }; int ret; int env_valid; /* Sanity check calling environment */ if (test_user_mode) { env_valid = getenv ("UPSTART_SESSION") ? TRUE : FALSE; } else { env_valid = getenv ("DBUS_SESSION_BUS_ADDRESS") ? TRUE : FALSE; } nih_assert (env_valid); ret = sprintf (path, "%s %s", get_initctl_binary (), test_user_mode ? "--user" : "--session"); assert (ret > 0); return path; } /* * _start_upstart: * * @pid: PID of running instance, * @user: TRUE if upstart will run in User Session mode (FALSE to * use the users D-Bus session bus), * @args: optional list of arguments to specify. * * Start an instance of Upstart. * * If the instance fails to start, abort(3) is called. **/ void _start_upstart (pid_t *pid, int user, char * const *args) { nih_local char **argv = NULL; sigset_t child_set, orig_set; assert (pid); argv = NIH_MUST (nih_str_array_new (NULL)); NIH_MUST (nih_str_array_add (&argv, NULL, NULL, get_upstart_binary ())); if (args) NIH_MUST (nih_str_array_append (&argv, NULL, NULL, args)); sigfillset (&child_set); sigprocmask (SIG_BLOCK, &child_set, &orig_set); TEST_NE (*pid = fork (), -1); if (! *pid) { char *argv0; int fd; nih_signal_reset (); sigprocmask (SIG_SETMASK, &orig_set, NULL); if (! getenv ("UPSTART_TEST_VERBOSE")) { fd = open ("/dev/null", O_RDWR); assert (fd >= 0); assert (dup2 (fd, STDIN_FILENO) != -1); assert (dup2 (fd, STDOUT_FILENO) != -1); assert (dup2 (fd, STDERR_FILENO) != -1); } argv0 = argv[0]; assert (execvp (argv0, argv) != -1); } sigprocmask (SIG_SETMASK, &orig_set, NULL); wait_for_upstart (user ? *pid : 0); } /** * start_upstart_common: * * @pid: PID of running instance, * @user: TRUE if upstart should run in User Session mode (FALSE to * use the users D-Bus session bus), * @inherit_env: if TRUE, inherit parent environment, * @confdir: full path to configuration directory, * @logdir: full path to log directory, * @extra: optional extra arguments. * * Wrapper round _start_upstart() which specifies common options. **/ void start_upstart_common (pid_t *pid, int user, int inherit_env, const char *confdir, const char *logdir, char * const *extra) { nih_local char **args = NULL; assert (pid); args = NIH_MUST (nih_str_array_new (NULL)); if (user) { NIH_MUST (nih_str_array_add (&args, NULL, NULL, "--user")); test_user_mode = TRUE; } else { TEST_TRUE (getenv ("DBUS_SESSION_BUS_ADDRESS")); NIH_MUST (nih_str_array_add (&args, NULL, NULL, "--session")); } if (! inherit_env) { NIH_MUST (nih_str_array_add (&args, NULL, NULL, "--no-inherit-env")); } if (confdir) { NIH_MUST (nih_str_array_add (&args, NULL, NULL, "--confdir")); NIH_MUST (nih_str_array_add (&args, NULL, NULL, confdir)); } if (logdir) { NIH_MUST (nih_str_array_add (&args, NULL, NULL, "--logdir")); NIH_MUST (nih_str_array_add (&args, NULL, NULL, logdir)); } if (extra) NIH_MUST (nih_str_array_append (&args, NULL, NULL, extra)); _start_upstart (pid, user, args); } /** * start_upstart: * * @pid: PID of running instance. * * Wrapper round _start_upstart() which just runs an instance with no * options. **/ void start_upstart (pid_t *pid) { start_upstart_common (pid, FALSE, FALSE, NULL, NULL, NULL); } /** * job_to_pid: * * @job: job name. * * Determine pid of running job. * * WARNING: it is the callers responsibility to ensure that * @job is still running when this function is called!! * * Returns: pid of job, or -1 if not found. **/ pid_t job_to_pid (const char *job) { pid_t pid; regex_t regex; regmatch_t regmatch[2]; int ret; nih_local char *cmd = NULL; nih_local char *pattern = NULL; size_t lines; char **status; nih_local char *str_pid = NULL; assert (job); pattern = NIH_MUST (nih_sprintf (NULL, "^\\b%s\\b .*, process ([0-9]+)", job)); cmd = NIH_MUST (nih_sprintf (NULL, "%s status %s 2>&1", get_initctl (), job)); RUN_COMMAND (NULL, cmd, &status, &lines); TEST_EQ (lines, 1); ret = regcomp (®ex, pattern, REG_EXTENDED); assert0 (ret); ret = regexec (®ex, status[0], 2, regmatch, 0); if (ret == REG_NOMATCH) { ret = -1; goto out; } assert0 (ret); if (regmatch[1].rm_so == -1 || regmatch[1].rm_eo == -1) { ret = -1; goto out; } /* extract the pid */ NIH_MUST (nih_strncat (&str_pid, NULL, &status[0][regmatch[1].rm_so], regmatch[1].rm_eo - regmatch[1].rm_so)); nih_free (status); pid = (pid_t)atol (str_pid); /* check it's running */ ret = kill (pid, 0); if (! ret) ret = pid; out: regfree (®ex); return ret; } const char * get_upstart_binary (void) { static const char *upstart_binary = UPSTART_BINARY; TEST_TRUE (file_exists (upstart_binary)); return upstart_binary; } const char * get_initctl_binary (void) { static const char *initctl_binary = INITCTL_BINARY; TEST_TRUE (file_exists (initctl_binary)); return initctl_binary; } /** * string_check: * * @a: first string, * @b: second string. * * Compare @a and @b either or both of which may be NULL. * * Returns 0 if strings are identical or both NULL, else 1. **/ int string_check (const char *a, const char *b) { if (!a && !b) return 0; if (!a || !b) return 1; if (strcmp (a, b)) return 1; return 0; } /** * strcmp_compar: * * @a: first string, * @b: second string. * * String comparison function suitable for passing to qsort(3). * See the qsort(3) man page for further details. **/ int strcmp_compar (const void *a, const void *b) { return strcmp(*(char * const *)a, *(char * const *)b); } /** * get_session_file: * * @xdg_runtime_dir: Directory to treat as XDG_RUNTIME_DIR, * @pid: pid of running Session Init instance. * * Determine full path to a Session Inits session file. * * Note: No check on the existence of the session file is performed. * * Returns: Newly-allocated string representing full path to Session * Inits session file. **/ char * get_session_file (const char *xdg_runtime_dir, pid_t pid) { char *session_file; nih_assert (xdg_runtime_dir); nih_assert (pid); session_file = nih_sprintf (NULL, "%s/upstart/sessions/%d.session", xdg_runtime_dir, (int)pid); nih_assert (session_file); return session_file; } /** * in_chroot: * * Determine if running inside a chroot environment. * * Failures are fatal. * * Returns TRUE if within a chroot, else FALSE. **/ int in_chroot (void) { struct stat st; int i; char dir[] = "/"; i = stat(dir, &st); if ( i != 0 ) { fprintf (stderr, "ERROR: cannot stat '%s'\n", dir); exit (EXIT_FAILURE); } if ( st.st_ino == 2 ) return FALSE; return TRUE; } /** * dbus_configured * * Determine if D-Bus has been configured (with dbus-uuidgen). * * Returns TRUE if D-Bus appears to have been configured, * else FALSE. **/ int dbus_configured (void) { struct stat st; char path[] = "/var/lib/dbus/machine-id"; return !stat (path, &st); } /** * search_and_replace: * * @parent: parent for returned string, * @str: string to operate on, * @from: string to look for, * @to: string to replace @from with. * * Replace all occurences of @from in @str with @to. * * Returns: Newly-allocated string, or NULL on error or * if @str does not contain any occurences of @from. **/ char * search_and_replace (void *parent, const char *str, const char *from, const char *to) { const char *start; const char *match; char *new = NULL; size_t len; nih_assert (str); nih_assert (from); nih_assert (to); start = str; len = strlen (from); while (start && *start) { match = strstr (start, from); if (! match) { /* No more matches, so copy the remainder of the original string */ if (! nih_strcat (&new, parent, start)) return NULL; break; } /* Copy data from start of segment to the match */ if (! nih_strncat (&new, parent , start, match - start)) return NULL; /* Replace the string */ if (! nih_strcat (&new, parent, to)) return NULL; /* Make start move to 1 byte beyond the end of the match */ start = match + len; } return new; } /** * file_exists: * @path: file to check. * * Determine if specified file exists. * * Returns: TRUE if @path exists, else FALSE. **/ int file_exists (const char *path) { struct stat st; nih_assert (path); return ! stat (path, &st); } /** * test_common_setup: * * Perform test setup. * * Currently, only needed for those tests which require unique xdg * directories. * * If called, test must call test_common_cleanup() to cleanup. **/ void test_common_setup (void) { char *xdg_config_home; char *xdg_runtime_dir; /* Take care to avoid disrupting users environment by saving and * restoring these variable (assuming the tests all pass...). */ xdg_config_home = getenv ("XDG_CONFIG_HOME"); if (xdg_config_home) { nih_info ("Existing XDG_CONFIG_HOME found ('%s') - " "saving for later restore", xdg_config_home); saved_xdg_config_home = NIH_MUST (nih_strdup (NULL, xdg_config_home)); } TEST_FILENAME (test_xdg_config_home); assert0 (mkdir (test_xdg_config_home, TEST_DIR_MODE)); assert0 (setenv ("XDG_CONFIG_HOME", test_xdg_config_home, 1)); nih_info ("Using test XDG_CONFIG_HOME='%s'", test_xdg_config_home); xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR"); if (xdg_runtime_dir) { nih_info ("Existing XDG_RUNTIME_DIR found ('%s') - " "saving for later restore", xdg_runtime_dir); saved_xdg_runtime_dir = NIH_MUST (nih_strdup (NULL, xdg_runtime_dir)); } TEST_FILENAME (test_xdg_runtime_dir); assert0 (mkdir (test_xdg_runtime_dir, TEST_DIR_MODE)); assert0 (setenv ("XDG_RUNTIME_DIR", test_xdg_runtime_dir, 1)); nih_info ("Using test XDG_RUNTIME_DIR='%s'", test_xdg_runtime_dir); test_setup_called = TRUE; } /** * test_common_cleanup: * * Perform cleanup of test setup. * * Currently, only needed for those tests which require unique xdg * directories. * * If called, test must already have called test_common_setup(). **/ void test_common_cleanup (void) { nih_local char *path = NULL; char *xdg_config_home; char *xdg_runtime_dir; struct stat statbuf; if (! test_setup_called) { nih_error ("BUG: Called %s without first calling %s", __func__, "test_common_setup()"); abort (); } xdg_config_home = getenv ("XDG_CONFIG_HOME"); xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR"); if (saved_xdg_config_home) { nih_assert (test_xdg_config_home[0]); TEST_EQ_STR (test_xdg_config_home, xdg_config_home); if (stat (test_xdg_config_home, &statbuf)) { nih_error ("A test has removed XDG_CONFIG_HOME '%s'", test_xdg_config_home); abort (); } if (! S_ISDIR (statbuf.st_mode)) { nih_error ("XDG_CONFIG_HOME '%s' no longer a directory", test_xdg_config_home); abort (); } assert0 (rmdir (test_xdg_config_home)); assert0 (setenv ("XDG_CONFIG_HOME", saved_xdg_config_home, 1)); nih_info ("Restoring XDG_RUNTIME_DIR='%s'", saved_xdg_config_home); nih_free (saved_xdg_config_home); saved_xdg_config_home = NULL; } if (saved_xdg_runtime_dir) { nih_assert (test_xdg_runtime_dir[0]); TEST_EQ_STR (test_xdg_runtime_dir, xdg_runtime_dir); if (stat (test_xdg_runtime_dir, &statbuf)) { nih_error ("A test has removed XDG_RUNTIME_DIR '%s'", test_xdg_runtime_dir); abort (); } if (! S_ISDIR (statbuf.st_mode)) { nih_error ("XDG_RUNTIME_DIR '%s' no longer a directory", test_xdg_runtime_dir); abort (); } path = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions", xdg_runtime_dir)); if (! stat (path, &statbuf)) { nih_local char *cmd = NULL; /* Clean up if tests forgot to */ cmd = NIH_MUST (nih_sprintf (NULL, "rm -f %s/*.session 2>/dev/null", path)); assert0 (system (cmd)); /* Remove the directory tree the first Session Init created */ assert0 (rmdir (path)); path = NIH_MUST (nih_sprintf (NULL, "%s/upstart", xdg_runtime_dir)); assert0 (rmdir (path)); } assert0 (rmdir (test_xdg_runtime_dir)); assert0 (setenv ("XDG_RUNTIME_DIR", saved_xdg_runtime_dir, 1)); nih_info ("Restoring XDG_RUNTIME_DIR='%s'", saved_xdg_config_home); nih_free (saved_xdg_runtime_dir); saved_xdg_runtime_dir = NULL; } } /** * timer_cb: * * @data: unused, * @timer: timer. * * Exit main loop with an error value indicating that the expected main * loop events/actions were not performed within the expected time. **/ void timer_cb (void *data, NihTimer *timer) { nih_assert (timer); /* Return non-zero to denote failure */ nih_main_loop_exit (42); } /** * fd_valid: * @fd: file descriptor. * * Return 1 if @fd is valid, else 0. **/ int fd_valid (int fd) { int flags = 0; if (fd < 0) return 0; errno = 0; flags = fcntl (fd, F_GETFL); if (flags < 0) return 0; /* redundant really */ if (errno == EBADF) return 0; return 1; } /** * read_from_fd: * * @parent: parent, * @fd: open file descriptor. * * Read from the specified fd, close the fd and return the data. * * Returns: Newly-allocated NihIoBuffer representing data read from @fd. * **/ NihIoBuffer * read_from_fd (void *parent, int fd) { NihIoBuffer *buffer = NULL; ssize_t len; assert (fd >= 0); buffer = nih_io_buffer_new (parent); nih_assert (buffer); while (TRUE) { nih_assert (! nih_io_buffer_resize (buffer, 1024)); len = read (fd, buffer->buf + buffer->len, buffer->size - buffer->len); if (len < 0 && errno != EAGAIN && errno != EINTR) { break; } else if (! len) { break; } else if (len > 0) { buffer->len += len; } } close (fd); return buffer; } /** * test_list_handler_generic: * * Generic handler. * * Put a break point on this function in gdb to allow you to cast entry * as desired. **/ int test_list_handler_generic (NihList *entry, void *data) { nih_assert (entry); /* XXX: stop compiler optimising this function away */ asm (""); return 1; } /** * test_list_foreach: * @list: list, * @len: optional output parameter that will contain length of list, * @handler: optional function called for each list entry, * @data: optional data to pass to handler along with list entry. * * Iterate over specified list. * * One of @len or @handler may be NULL. * If @handler is NULL, list length will still be returned in @len. * If @handler returns 1, @len will be set to the number of list entries * processed successfully up to that point. * * Returns 0 on success (and when both @len and @handler are NULL), * or -1 if handler returns an error. **/ int test_list_foreach (const NihList *list, size_t *len, NihListHandler handler, void *data) { int ret; nih_assert (list); if (len) *len = 0; if (!len && !handler) return 0; NIH_LIST_FOREACH (list, iter) { if (handler) { ret = handler (iter, data); if (ret == FALSE) return -1; } if (len) ++*len; } return 0; } /** * test_list_count: * @list: list. * * Returns count of number of entries in @list. **/ size_t test_list_count (const NihList *list) { size_t len = 0; int ret; nih_assert (list); ret = test_list_foreach (list, &len, NULL, NULL); return (ret == -1 ? 0 : len); } NihList * test_list_get_index (NihList *list, size_t count) { size_t i = 0; nih_assert (list); NIH_LIST_FOREACH (list, iter) { if (i == count) return iter; i++; } return NULL; } /** * test_hash_foreach: * * @hash: hash, * @len: optional output parameter that will contain count of hash entries, * @handler: optional function called for each hash entry, * @data: optional data to pass to handler along with hash entry. * * Iterate over specified hash. * * One of @len or @handler may be NULL. * If @handler is NULL, count of hash entries will still be returned in @len. * If @handler returns 1, @len will be set to the number of hash entries * processed successfully up to that point. * * Returns 0 on success (and when both @len and @handler are NULL), * or -1 if handler returns an error. **/ int test_hash_foreach (const NihHash *hash, size_t *len, NihListHandler handler, void *data) { int ret; nih_assert (hash); if (len) *len = 0; if (!len && !handler) return 0; NIH_HASH_FOREACH (hash, iter) { if (handler) { ret = handler (iter, data); if (ret == FALSE) return -1; } if (len) ++*len; } return 0; } /** * test_hash_count: * * @hash: hash. * * Returns count of number of entries in @hash. **/ size_t test_hash_count (const NihHash *hash) { size_t len = 0; int ret; nih_assert (hash); ret = test_hash_foreach (hash, &len, NULL, NULL); return (ret == -1 ? 0 : len); } /** * test_tree_foreach: * * @tree: tree, * @len: optional output parameter that will contain count of tree nodes, * @handler: optional function called for each tree node, * @data: optional data to pass to handler along with tree node. * * Iterate over specified tree. * * One of @len or @handler may be NULL. * If @handler is NULL and @len is non-NULL, count of tree nodes will * still be returned in @len. * If @handler returns 1, @len will be set to the number of tree nodes * processed successfully up to that point. * * Returns 0 on success (and when both @len and @handler are NULL), * or -1 if handler returns an error. **/ int test_tree_foreach (NihTree *tree, size_t *len, NihTreeHandler handler, void *data) { int ret; nih_assert (tree); if (len) *len = 0; if (!len && !handler) return 0; NIH_TREE_FOREACH_FULL (tree, iter, NULL, data) { if (handler) { ret = handler (iter, data); if (!ret) return -1; } if (len) ++*len; } return 0; } /** * test_tree_count: * * @tree: tree. * * Returns count of number of entries in @tree. **/ size_t test_tree_count (NihTree *tree) { size_t len = 0; int ret; nih_assert (tree); ret = test_tree_foreach (tree, &len, NULL, NULL); return (ret == -1 ? 0 : len); } #ifdef ENABLE_CGROUPS /* * connect_to_cgmanager: * * Returns -2 if cgmanager is not running, -1 on other error, * and 0 on success */ int connect_to_cgmanager(void) { DBusError dbus_error; static DBusConnection *connection; dbus_error_init(&dbus_error); connection = dbus_connection_open_private(CGMANAGER_DBUS_SOCK, &dbus_error); if (!connection) { nih_error("Failed opening dbus connection: %s: %s", dbus_error.name, dbus_error.message); dbus_error_free(&dbus_error); return -2; } if (nih_dbus_setup(connection, NULL) < 0) { NihError *nerr; nerr = nih_error_get(); nih_error("Unable to open cgmanager connection at %s: %s", CGMANAGER_DBUS_SOCK, nerr->message); nih_free(nerr); dbus_error_free(&dbus_error); dbus_connection_unref(connection); return -1; } dbus_connection_set_exit_on_disconnect(connection, FALSE); dbus_error_free(&dbus_error); cgroup_manager = nih_dbus_proxy_new(NULL, connection, NULL /* p2p */, "/org/linuxcontainers/cgmanager", NULL, NULL); dbus_connection_unref(connection); if (!cgroup_manager) { NihError *nerr; nerr = nih_error_get(); nih_error("Error opening cgmanager proxy: %s", nerr->message); nih_free(nerr); return -1; } if (cgmanager_ping_sync(NULL, cgroup_manager, 0) != 0) { NihError *nerr; nerr = nih_error_get(); nih_error("Error pinging cgroup manager: %s", nerr->message); nih_free(nerr); disconnect_cgmanager(); return -1; } return 0; } void disconnect_cgmanager(void) { if (cgroup_manager) { dbus_connection_flush(cgroup_manager->connection); dbus_connection_close(cgroup_manager->connection); nih_free(cgroup_manager); } cgroup_manager = NULL; } /* * get_pid_cgroup: * * @controller: cgroup controller to query * @pid: pid whose cgroup to return * * The result must be nih_freed */ char * get_pid_cgroup(const char *controller, pid_t pid) { char *str; if (cgmanager_get_pid_cgroup_sync(NULL, cgroup_manager, controller, pid, &str) != 0) { NihError *nerr; nerr = nih_error_get(); nih_error("call to cgmanager_set_value_sync failed: %s", nerr->message); nih_free(nerr); return NULL; } return str; } /* * setup_cgroup_sandbox: * * Creates a unique cgroup, sets it to remove on empty, and enters the * current task into the new cgroup. */ int setup_cgroup_sandbox(void) { char tmpnam[32], line[1024], *cg; int32_t e; int ret = -1, fd = -1; FILE *cgf = NULL; pid_t mypid = getpid(); if (!cgroup_manager) { nih_error("%s: connect_to_cgmanager must be called first", __func__); goto out; } memset(tmpnam, 0, 32); strcpy(tmpnam, "/tmp/upstart-test-XXXXXX"); if ((fd = mkstemp(tmpnam)) < 0) { nih_error("%s: failed to create a tempfile", __func__); goto out; } unlink(tmpnam); cg = tmpnam+5; if ((cgf = fopen("/proc/cgroups", "r")) == NULL) { nih_error("%s: failed to read my cgroups", __func__); goto out; } while (fgets(line, 1024, cgf)) { char *p; if (line[0] == '#') continue; p = strchr(line, '\t'); if (!p) { nih_error("failed to find a \t"); continue; } *p = '\0'; if (cgmanager_create_sync(NULL, cgroup_manager, line, cg, &e) != 0) { NihError *nerr; nerr = nih_error_get(); nih_error("%s: failed to create cgroup %s:%s: %s", __func__, line, cg, nerr->message); nih_free(nerr); goto out; } if (e == 1) nih_warn("%s: boggle: cgroup %s:%s already existed", __func__, line, cg); if (cgmanager_remove_on_empty_sync(NULL, cgroup_manager, line, cg) != 0) { NihError *nerr; nerr = nih_error_get(); nih_warn("%s: failed to mark %s:%s remove-on-empty: %s", __func__, line, cg, nerr->message); nih_free(nerr); } if (cgmanager_move_pid_sync(NULL, cgroup_manager, line, cg, mypid) != 0) { NihError *nerr; nerr = nih_error_get(); nih_error("%s: failed to move myself to cgroup %s:%s: %s", __func__, line, cg, nerr->message); nih_free(nerr); goto out; } } ret = 0; out: if (fd != -1) close(fd); if (cgf) fclose(cgf); return ret; } #endif /* ENABLE_CGROUPS */ upstart-1.13.2/contrib/0000775000175000017500000000000012402042417011737 500000000000000upstart-1.13.2/contrib/bash_completion/0000775000175000017500000000000012402042417015105 500000000000000upstart-1.13.2/contrib/bash_completion/upstart0000664000175000017500000001275712373101356016473 00000000000000# bash-completion for the upstart event-based init replacement # (http://upstart.ubuntu.com / https://launchpad.net/upstart) # # We don't provide completion for 'init' itself for obvious reasons. have initctl && _upstart_jobs() { initctl list|awk '{print $1}'|sort -u } && _upstart_startable_jobs() { initctl list|cut -d\, -f1|awk '$2 == "stop/waiting" {print $1}' } && _upstart_stoppable_jobs() { initctl list|cut -d\, -f1|awk '$2 == "start/running" {print $1}' } && _upstart_events() { # note that we don't provide the internal events such as "starting" # (and those from mountall) since the user should be using the # associated command to emit such events. (cd /etc/init && \ egrep '^[[:space:]]*emits ' *.conf |\ cut -d: -f2- | sed 's/^[[:space:]]*emits //g' |\ tr ' ' '\n' | awk '{print $NF}' | grep -v ^$|sort -u) } && _upstart_initctl() { _get_comp_words_by_ref cur prev COMPREPLY=() case "$prev" in start) COMPREPLY=( $(compgen -W "-n --no-wait $(_upstart_startable_jobs)" -- ${cur}) ) return 0 ;; stop) COMPREPLY=( $(compgen -W "-n --no-wait $(_upstart_stoppable_jobs)" -- ${cur}) ) return 0 ;; emit) COMPREPLY=( $(compgen -W "-n --no-wait $(_upstart_events)" -- ${cur}) ) return 0 ;; -i|--ignore-events) # handle visualisation options after check-config command for cmd in check-config do cwords=${COMP_WORDS[@]##} filtered_cwords=${COMP_WORDS[@]##${cmd}} if [ "$filtered_cwords" != "$cwords" ] then COMPREPLY=( $(compgen -W "$(_upstart_jobs)" -- ${cur}) ) return 0 fi done ;; -e|--enumerate) # handle visualisation options after show-config command for cmd in show-config do cwords=${COMP_WORDS[@]##} filtered_cwords=${COMP_WORDS[@]##${cmd}} if [ "$filtered_cwords" != "$cwords" ] then COMPREPLY=( $(compgen -W "$(_upstart_jobs)" -- ${cur}) ) return 0 fi done ;; reload|restart) COMPREPLY=( $(compgen -W "-n --no-wait $(_upstart_stoppable_jobs)" -- ${cur}) ) return 0 ;; status) COMPREPLY=( $(compgen -W "$(_upstart_jobs)" -- ${cur}) ) return 0 ;; check-config) COMPREPLY=( $(compgen -W "-w --warn -i --ignore-events= $(_upstart_jobs)" -- ${cur}) ) return 0 ;; show-config) COMPREPLY=( $(compgen -W "-e --enumerate $(_upstart_jobs)" -- ${cur}) ) return 0 ;; -n|--no-wait) # allow 'no wait' for certain commands for cmd in start stop restart emit do cwords=${COMP_WORDS[@]##} filtered_cwords=${COMP_WORDS[@]##${cmd}} if [ "$filtered_cwords" != "$cwords" ] then case "$cmd" in start) COMPREPLY=( $(compgen -W "$(_upstart_startable_jobs)" -- ${cur}) ) ;; stop) COMPREPLY=( $(compgen -W "$(_upstart_stoppable_jobs)" -- ${cur}) ) ;; restart) COMPREPLY=( $(compgen -W "$(_upstart_stoppable_jobs)" -- ${cur}) ) ;; emit) COMPREPLY=( $(compgen -W "$(_upstart_events)" -- ${cur}) ) ;; esac return 0 fi done ;; --help|--version) COMPREPLY=() return 0 ;; esac opts="--help --version -q --quiet -v --verbose --session --system --dest=" cmds=$(initctl help|grep "^ [^ ]"|awk '{print $1}') COMPREPLY=( $(compgen -W "${opts} ${cmds}" -- ${cur}) ) } && complete -F _upstart_initctl initctl have start && _upstart_start() { COMPREPLY=() _get_comp_words_by_ref cur prev opts="--help --version -q --quiet -v --verbose --session --system --dest= \ -n --no-wait" case "$prev" in --help|--version) COMPREPLY=() return 0 ;; esac COMPREPLY=( $(compgen -W "$opts $(_upstart_startable_jobs)" -- ${cur}) ) return 0 } && complete -F _upstart_start start have stop && _upstart_stop() { COMPREPLY=() _get_comp_words_by_ref cur prev opts="--help --version -q --quiet -v --verbose --session --system --dest= \ -n --no-wait" case "$prev" in --help|--version) COMPREPLY=() return 0 ;; esac COMPREPLY=( $(compgen -W "$opts $(_upstart_stoppable_jobs)" -- ${cur}) ) return 0 } && complete -F _upstart_stop stop have restart && _upstart_restart() { COMPREPLY=() _get_comp_words_by_ref cur prev opts="--help --version -q --quiet -v --verbose --session --system --dest= \ -n --no-wait" case "$prev" in --help|--version) COMPREPLY=() return 0 ;; esac COMPREPLY=( $(compgen -W "$opts $(_upstart_stoppable_jobs)" -- ${cur}) ) return 0 } && complete -F _upstart_restart restart have status && _upstart_status() { COMPREPLY=() _get_comp_words_by_ref cur prev opts="--help --version -q -d --detail -e --enumerate --quiet -v --verbose --session --system --dest=" case "$prev" in --help|--version) COMPREPLY=() return 0 ;; esac COMPREPLY=( $(compgen -W "$opts $(_upstart_jobs)" -- ${cur}) ) return 0 } && complete -F _upstart_status status have reload && _upstart_reload() { COMPREPLY=() _get_comp_words_by_ref cur prev opts="--help --version -q --quiet -v --verbose --session --system --dest=" case "$prev" in --help|--version) COMPREPLY=() return 0 ;; esac COMPREPLY=( $(compgen -W "$opts $(_upstart_stoppable_jobs)" -- ${cur}) ) return 0 } && complete -F _upstart_reload reload upstart-1.13.2/contrib/Makefile.in0000664000175000017500000003171712402042374013737 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ vim/syntax/upstart.vim \ vim/ftdetect/upstart.vim \ bash_completion/upstart all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu contrib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/contrib/Makefile.am0000664000175000017500000000023112373101356013714 00000000000000## Process this file with automake to produce Makefile.in EXTRA_DIST = \ vim/syntax/upstart.vim \ vim/ftdetect/upstart.vim \ bash_completion/upstart upstart-1.13.2/contrib/vim/0000775000175000017500000000000012402042417012532 500000000000000upstart-1.13.2/contrib/vim/syntax/0000775000175000017500000000000012402042417014060 500000000000000upstart-1.13.2/contrib/vim/syntax/upstart.vim0000664000175000017500000000666512373101356016241 00000000000000" Vim syntax file " Language: Upstart job files " Maintainer: Michael Biebl " James Hunt " Last Change: 2011 Dec 15 " License: GPL v2 " Version: 0.5 " Remark: Syntax highlighting for Upstart (init(8)) job files. " " It is inspired by the initng syntax file and includes sh.vim to do the " highlighting of script blocks. if version < 600 syntax clear elseif exists("b:current_syntax") finish endif let is_bash = 1 syn include @Shell syntax/sh.vim syn case match syn match upstartComment /#.*$/ contains=upstartTodo syn keyword upstartTodo TODO FIXME contained syn region upstartString start=/"/ end=/"/ skip=/\\"/ syn region upstartScript matchgroup=upstartStatement start="script" end="end script" contains=@upstartShellCluster syn cluster upstartShellCluster contains=@Shell " one argument syn keyword upstartStatement description author version instance expect syn keyword upstartStatement pid kill normal console env exit export syn keyword upstartStatement umask nice oom chroot chdir exec setuid setgid syn keyword upstartStatement usage " two arguments syn keyword upstartStatement limit " one or more arguments (events) syn keyword upstartStatement emits syn keyword upstartStatement on start stop " flag, no parameter syn keyword upstartStatement respawn service instance manual debug task " prefix for exec or script syn keyword upstartOption pre-start post-start pre-stop post-stop " option for kill syn keyword upstartOption timeout signal " option for oom syn keyword upstartOption score never " options for console syn keyword upstartOption output owner none log " options for expect syn keyword upstartOption stop fork daemon none " options for limit syn keyword upstartOption unlimited core cpu data fsize memlock msgqueue nice syn keyword upstartOption nofile nproc rss rtprio sigpending stack " 'options' for start/stop on syn keyword upstartOption and or " Upstart itself and associated utilities syn keyword upstartEvent runlevel syn keyword upstartEvent started syn keyword upstartEvent starting syn keyword upstartEvent startup syn keyword upstartEvent stopped syn keyword upstartEvent stopping syn match upstartEvent /control-alt-delete/ syn match upstartEvent /keyboard-request/ syn match upstartEvent /power-status-changed/ " D-Bus syn match upstartEvent /dbus-activation/ " Display Manager (ie gdm/lightdm) syn match upstartEvent /desktop-session-start/ syn match upstartEvent /login-session-start/ syn match upstartEvent /desktop-shutdown/ " mountall syn keyword upstartEvent filesystem syn keyword upstartEvent mounted syn keyword upstartEvent mounting syn match upstartEvent /device-not-ready/ syn match upstartEvent /\(\\|\\|\\)-filesystems/ syn match upstartEvent /all-swaps/ " upstart-udev-bridge and ifup/down syn match upstartEvent /\<\i\{-1,}-device-\(\\|\\|\\|\\)/ syn match upstartEvent /static-network-up/ " SysV handling syn match upstartEvent /unmounted-remote-filesystems/ syn match upstartEvent /deconfiguring-networking/ " misc syn match upstartEvent /failsafe-boot/ syn match upstartEvent /recovery/ " upstart-socket-bridge syn keyword upstartEvent socket hi def link upstartComment Comment hi def link upstartTodo Todo hi def link upstartString String hi def link upstartStatement Statement hi def link upstartOption Type hi def link upstartEvent Define let b:current_syntax = "upstart" upstart-1.13.2/contrib/vim/ftdetect/0000775000175000017500000000000012402042417014334 500000000000000upstart-1.13.2/contrib/vim/ftdetect/upstart.vim0000664000175000017500000000016412373101356016501 00000000000000" Treat all /etc/init/*.conf files as upstart job files au BufNewFile,BufRead /etc/init/*.conf set filetype=upstart upstart-1.13.2/lib/0000775000175000017500000000000012402042416011044 500000000000000upstart-1.13.2/lib/Makefile.in0000664000175000017500000014177112402042374013047 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test_libupstart$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) @ENABLE_CGROUPS_TRUE@am__append_1 = $(CGMANAGER_LIBS) subdir = lib DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/libupstart.pc.in.in $(top_srcdir)/depcomp \ $(include_HEADERS) $(upstartinclude_HEADERS) \ $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = libupstart.pc.in CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(includedir)" "$(DESTDIR)$(upstartincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libupstart_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_libupstart_la_OBJECTS = am__objects_1 = com.ubuntu.Upstart.lo am__objects_2 = com.ubuntu.Upstart.Job.lo am__objects_3 = com.ubuntu.Upstart.Instance.lo nodist_libupstart_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) libupstart_la_OBJECTS = $(am_libupstart_la_OBJECTS) \ $(nodist_libupstart_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libupstart_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libupstart_la_LDFLAGS) $(LDFLAGS) -o $@ am__EXEEXT_1 = test_libupstart$(EXEEXT) am__objects_4 = am_test_libupstart_OBJECTS = test_libupstart.$(OBJEXT) \ $(am__objects_4) test_libupstart_OBJECTS = $(am_test_libupstart_OBJECTS) @ENABLE_CGROUPS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) test_libupstart_DEPENDENCIES = $(lib_LTLIBRARIES) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) \ $(top_builddir)/test/libtest_util_common.a \ $(am__DEPENDENCIES_2) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libupstart_la_SOURCES) $(nodist_libupstart_la_SOURCES) \ $(test_libupstart_SOURCES) DIST_SOURCES = $(libupstart_la_SOURCES) $(test_libupstart_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) HEADERS = $(include_HEADERS) $(upstartinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ VERSION_CURRENT = 1 VERSION_REVISION = 0 VERSION_AGE = 0 LIBUPSTART_VERSION = $(VERSION_CURRENT):$(VERSION_REVISION):$(VERSION_AGE) LIBUPSTART_VERSION_DOTTED = $(VERSION_CURRENT).$(VERSION_REVISION).$(VERSION_AGE) AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) AM_CPPFLAGS = \ -DLOCALEDIR="\"$(localedir)\"" \ -DSBINDIR="\"$(sbindir)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ -I$(top_srcdir)/intl \ -I$(top_srcdir)/test -iquote $(top_srcdir)/test lib_LTLIBRARIES = libupstart.la # The library is built from the autogenerated code. libupstart_la_SOURCES = upstart.h include_HEADERS = $(libupstart_la_SOURCES) upstartincludedir = $(includedir)/upstart upstartinclude_HEADERS = \ upstart/com.ubuntu.Upstart.h \ upstart/com.ubuntu.Upstart.Instance.h \ upstart/com.ubuntu.Upstart.Job.h \ upstart/upstart-dbus.h nodist_libupstart_la_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) libupstart_la_LIBADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ -lrt libupstart_la_LDFLAGS = \ -version-info $(LIBUPSTART_VERSION) \ -Wl,--version-script=$(srcdir)/libupstart.ver \ $(LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) -lrt # latest ABI abi_official = $(srcdir)/abi/$(host_cpu)-$(host_os)/libupstart_$(LIBUPSTART_VERSION_DOTTED).abi # disposable ABI descriptor for the currently-built library abi_build_XML = libupstart-abi.xml pkgconfigdir = $(prefix)/lib/pkgconfig pkgconfig_DATA = libupstart.pc EXTRA_DIST = \ libupstart.pc.in.in \ run_abi_checker.sh.in \ libupstart.ver \ $(srcdir)/abi \ $(abi_build_XML).in @ENABLE_TAP_OUTPUT_FALSE@LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver @ENABLE_TAP_OUTPUT_TRUE@LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh check_SCRIPTS = run_abi_checker.sh test_libupstart_SOURCES = tests/test_libupstart.c $(lib_LTLIBRARIES) test_libupstart_LDADD = $(lib_LTLIBRARIES) $(NIH_LIBS) \ $(NIH_DBUS_LIBS) $(DBUS_LIBS) \ $(top_builddir)/test/libtest_util_common.a -lrt \ $(am__append_1) com_ubuntu_Upstart_OUTPUTS = \ upstart/com.ubuntu.Upstart.c \ upstart/com.ubuntu.Upstart.h com_ubuntu_Upstart_XML = \ ../dbus/com.ubuntu.Upstart.xml com_ubuntu_Upstart_Job_OUTPUTS = \ upstart/com.ubuntu.Upstart.Job.c \ upstart/com.ubuntu.Upstart.Job.h com_ubuntu_Upstart_Job_XML = \ ../dbus/com.ubuntu.Upstart.Job.xml com_ubuntu_Upstart_Instance_OUTPUTS = \ upstart/com.ubuntu.Upstart.Instance.c \ upstart/com.ubuntu.Upstart.Instance.h com_ubuntu_Upstart_Instance_XML = \ ../dbus/com.ubuntu.Upstart.Instance.xml # These have to be built sources because we can't compile object files # without the header file existing first BUILT_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) \ upstart/upstart-dbus.h CLEANFILES = $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) $(abi_build_XML) \ $(pkgconfig_DATA) $(check_SCRIPTS) libupstart.pc.in all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libupstart.pc.in: $(top_builddir)/config.status $(srcdir)/libupstart.pc.in.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libupstart.la: $(libupstart_la_OBJECTS) $(libupstart_la_DEPENDENCIES) $(EXTRA_libupstart_la_DEPENDENCIES) $(AM_V_CCLD)$(libupstart_la_LINK) -rpath $(libdir) $(libupstart_la_OBJECTS) $(libupstart_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test_libupstart$(EXEEXT): $(test_libupstart_OBJECTS) $(test_libupstart_DEPENDENCIES) $(EXTRA_test_libupstart_DEPENDENCIES) @rm -f test_libupstart$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_libupstart_OBJECTS) $(test_libupstart_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Instance.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Job.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/com.ubuntu.Upstart.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_libupstart.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< com.ubuntu.Upstart.lo: upstart/com.ubuntu.Upstart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT com.ubuntu.Upstart.lo -MD -MP -MF $(DEPDIR)/com.ubuntu.Upstart.Tpo -c -o com.ubuntu.Upstart.lo `test -f 'upstart/com.ubuntu.Upstart.c' || echo '$(srcdir)/'`upstart/com.ubuntu.Upstart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/com.ubuntu.Upstart.Tpo $(DEPDIR)/com.ubuntu.Upstart.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upstart/com.ubuntu.Upstart.c' object='com.ubuntu.Upstart.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o com.ubuntu.Upstart.lo `test -f 'upstart/com.ubuntu.Upstart.c' || echo '$(srcdir)/'`upstart/com.ubuntu.Upstart.c com.ubuntu.Upstart.Job.lo: upstart/com.ubuntu.Upstart.Job.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT com.ubuntu.Upstart.Job.lo -MD -MP -MF $(DEPDIR)/com.ubuntu.Upstart.Job.Tpo -c -o com.ubuntu.Upstart.Job.lo `test -f 'upstart/com.ubuntu.Upstart.Job.c' || echo '$(srcdir)/'`upstart/com.ubuntu.Upstart.Job.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/com.ubuntu.Upstart.Job.Tpo $(DEPDIR)/com.ubuntu.Upstart.Job.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upstart/com.ubuntu.Upstart.Job.c' object='com.ubuntu.Upstart.Job.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o com.ubuntu.Upstart.Job.lo `test -f 'upstart/com.ubuntu.Upstart.Job.c' || echo '$(srcdir)/'`upstart/com.ubuntu.Upstart.Job.c com.ubuntu.Upstart.Instance.lo: upstart/com.ubuntu.Upstart.Instance.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT com.ubuntu.Upstart.Instance.lo -MD -MP -MF $(DEPDIR)/com.ubuntu.Upstart.Instance.Tpo -c -o com.ubuntu.Upstart.Instance.lo `test -f 'upstart/com.ubuntu.Upstart.Instance.c' || echo '$(srcdir)/'`upstart/com.ubuntu.Upstart.Instance.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/com.ubuntu.Upstart.Instance.Tpo $(DEPDIR)/com.ubuntu.Upstart.Instance.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='upstart/com.ubuntu.Upstart.Instance.c' object='com.ubuntu.Upstart.Instance.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o com.ubuntu.Upstart.Instance.lo `test -f 'upstart/com.ubuntu.Upstart.Instance.c' || echo '$(srcdir)/'`upstart/com.ubuntu.Upstart.Instance.c test_libupstart.o: tests/test_libupstart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_libupstart.o -MD -MP -MF $(DEPDIR)/test_libupstart.Tpo -c -o test_libupstart.o `test -f 'tests/test_libupstart.c' || echo '$(srcdir)/'`tests/test_libupstart.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libupstart.Tpo $(DEPDIR)/test_libupstart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_libupstart.c' object='test_libupstart.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_libupstart.o `test -f 'tests/test_libupstart.c' || echo '$(srcdir)/'`tests/test_libupstart.c test_libupstart.obj: tests/test_libupstart.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_libupstart.obj -MD -MP -MF $(DEPDIR)/test_libupstart.Tpo -c -o test_libupstart.obj `if test -f 'tests/test_libupstart.c'; then $(CYGPATH_W) 'tests/test_libupstart.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_libupstart.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libupstart.Tpo $(DEPDIR)/test_libupstart.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/test_libupstart.c' object='test_libupstart.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_libupstart.obj `if test -f 'tests/test_libupstart.c'; then $(CYGPATH_W) 'tests/test_libupstart.c'; else $(CYGPATH_W) '$(srcdir)/tests/test_libupstart.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-upstartincludeHEADERS: $(upstartinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(upstartinclude_HEADERS)'; test -n "$(upstartincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(upstartincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(upstartincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(upstartincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(upstartincludedir)" || exit $$?; \ done uninstall-upstartincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(upstartinclude_HEADERS)'; test -n "$(upstartincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(upstartincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) $(check_SCRIPTS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_libupstart.log: test_libupstart$(EXEEXT) @p='test_libupstart$(EXEEXT)'; \ b='test_libupstart'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am @HAVE_ABI_CHECKER_FALSE@all-local: all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) all-local installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(upstartincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-pkgconfigDATA \ install-upstartincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA uninstall-upstartincludeHEADERS .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ install-upstartincludeHEADERS installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA uninstall-upstartincludeHEADERS upstart/upstart-dbus.h: \ $(top_srcdir)/dbus/upstart.h \ upstart/com.ubuntu.Upstart.h \ upstart/com.ubuntu.Upstart.Instance.h \ upstart/com.ubuntu.Upstart.Job.h cp $< $@ $(abi_build_XML): $(abi_build_XML).in sed -e 's|[@]abs_builddir[@]|$(abs_builddir)|g' \ -e 's|[@]libupstart_version[@]|$(LIBUPSTART_VERSION_DOTTED)|g' \ $< > $@ libupstart.pc: libupstart.pc.in sed -e 's|[@]LIBUPSTART_VERSION_DOTTED[@]|$(LIBUPSTART_VERSION_DOTTED)|g' \ $< > $@ run_abi_checker.sh: run_abi_checker.sh.in libupstart.la $(abi_build_XML) sed -e 's|[@]abs_builddir[@]|$(abs_builddir)|g' \ -e 's|[@]abs_srcdir[@]|$(abs_srcdir)|g' \ -e 's|[@]libupstart[@]|$(lib_LTLIBRARIES)|g' \ -e 's|[@]libupstart_version[@]|$(LIBUPSTART_VERSION)|g' \ -e 's|[@]abi_build_XML[@]|$(abi_build_XML)|g' \ -e 's|[@]abi_official[@]|$(abi_official)|g' \ -e 's|[@]abi_compliance_checker[@]|$(ABI_COMPLIANCE_CHECKER)|g' \ $< > $@ chmod +x $@ # XXX: We have to use proxy mode for clients # XXX: (meaning we cannot use the library for init itself) $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML) mkdir -p upstart $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=upstart \ --default-interface=com.ubuntu.Upstart0_6 \ --output=$@ $< $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML) mkdir -p upstart $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job_class \ --default-interface=com.ubuntu.Upstart0_6.Job \ --output=$@ $< $(com_ubuntu_Upstart_Instance_OUTPUTS): $(com_ubuntu_Upstart_Instance_XML) mkdir -p upstart $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job \ --default-interface=com.ubuntu.Upstart0_6.Instance \ --output=$@ $< tests: $(check_PROGRAMS) clean-local: rm -f *.gcno *.gcda rm -rf upstart/ maintainer-clean-local: rm -f *.gcov # Run ABI compliance checker on every build to ensure the library ABI # has not been inadvertently broken due to dbus/*.xml being updated # without a version change. @HAVE_ABI_CHECKER_TRUE@all-local: run_abi_checker.sh @HAVE_ABI_CHECKER_TRUE@ $(builddir)/run_abi_checker.sh # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/lib/libupstart.ver0000664000175000017500000000010212373101356013672 00000000000000LIBUPSTART_1.0.0 { global: upstart_*; job_*; local: *; }; upstart-1.13.2/lib/Makefile.am0000664000175000017500000001252612373101356013034 00000000000000## Process this file with automake to produce Makefile.in VERSION_CURRENT = 1 VERSION_REVISION = 0 VERSION_AGE = 0 LIBUPSTART_VERSION = $(VERSION_CURRENT):$(VERSION_REVISION):$(VERSION_AGE) LIBUPSTART_VERSION_DOTTED = $(VERSION_CURRENT).$(VERSION_REVISION).$(VERSION_AGE) AM_CFLAGS = \ $(NIH_CFLAGS) \ $(NIH_DBUS_CFLAGS) \ $(DBUS_CFLAGS) AM_CPPFLAGS = \ -DLOCALEDIR="\"$(localedir)\"" \ -DSBINDIR="\"$(sbindir)\"" \ -I$(top_builddir) -I$(top_srcdir) -iquote$(builddir) -iquote$(srcdir) \ -I$(top_srcdir)/intl \ -I$(top_srcdir)/test -iquote $(top_srcdir)/test lib_LTLIBRARIES = libupstart.la # The library is built from the autogenerated code. libupstart_la_SOURCES = upstart.h include_HEADERS = $(libupstart_la_SOURCES) upstartincludedir = $(includedir)/upstart upstartinclude_HEADERS = \ upstart/com.ubuntu.Upstart.h \ upstart/com.ubuntu.Upstart.Instance.h \ upstart/com.ubuntu.Upstart.Job.h \ upstart/upstart-dbus.h upstart/upstart-dbus.h: \ $(top_srcdir)/dbus/upstart.h \ upstart/com.ubuntu.Upstart.h \ upstart/com.ubuntu.Upstart.Instance.h \ upstart/com.ubuntu.Upstart.Job.h cp $< $@ nodist_libupstart_la_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) libupstart_la_LIBADD = \ $(LTLIBINTL) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ -lrt libupstart_la_LDFLAGS = \ -version-info $(LIBUPSTART_VERSION) \ -Wl,--version-script=$(srcdir)/libupstart.ver \ $(LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) -lrt # latest ABI abi_official = $(srcdir)/abi/$(host_cpu)-$(host_os)/libupstart_$(LIBUPSTART_VERSION_DOTTED).abi # disposable ABI descriptor for the currently-built library abi_build_XML = libupstart-abi.xml $(abi_build_XML): $(abi_build_XML).in sed -e 's|[@]abs_builddir[@]|$(abs_builddir)|g' \ -e 's|[@]libupstart_version[@]|$(LIBUPSTART_VERSION_DOTTED)|g' \ $< > $@ libupstart.pc: libupstart.pc.in sed -e 's|[@]LIBUPSTART_VERSION_DOTTED[@]|$(LIBUPSTART_VERSION_DOTTED)|g' \ $< > $@ pkgconfigdir = $(prefix)/lib/pkgconfig pkgconfig_DATA = libupstart.pc EXTRA_DIST = \ libupstart.pc.in.in \ run_abi_checker.sh.in \ libupstart.ver \ $(srcdir)/abi \ $(abi_build_XML).in run_abi_checker.sh: run_abi_checker.sh.in libupstart.la $(abi_build_XML) sed -e 's|[@]abs_builddir[@]|$(abs_builddir)|g' \ -e 's|[@]abs_srcdir[@]|$(abs_srcdir)|g' \ -e 's|[@]libupstart[@]|$(lib_LTLIBRARIES)|g' \ -e 's|[@]libupstart_version[@]|$(LIBUPSTART_VERSION)|g' \ -e 's|[@]abi_build_XML[@]|$(abi_build_XML)|g' \ -e 's|[@]abi_official[@]|$(abi_official)|g' \ -e 's|[@]abi_compliance_checker[@]|$(ABI_COMPLIANCE_CHECKER)|g' \ $< > $@ chmod +x $@ if ENABLE_TAP_OUTPUT LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh else LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver endif TESTS = test_libupstart check_PROGRAMS = $(TESTS) check_SCRIPTS = run_abi_checker.sh test_libupstart_SOURCES = tests/test_libupstart.c $(lib_LTLIBRARIES) test_libupstart_LDADD = \ $(lib_LTLIBRARIES) \ $(NIH_LIBS) \ $(NIH_DBUS_LIBS) \ $(DBUS_LIBS) \ $(top_builddir)/test/libtest_util_common.a \ -lrt if ENABLE_CGROUPS test_libupstart_LDADD += $(CGMANAGER_LIBS) endif com_ubuntu_Upstart_OUTPUTS = \ upstart/com.ubuntu.Upstart.c \ upstart/com.ubuntu.Upstart.h com_ubuntu_Upstart_XML = \ ../dbus/com.ubuntu.Upstart.xml # XXX: We have to use proxy mode for clients # XXX: (meaning we cannot use the library for init itself) $(com_ubuntu_Upstart_OUTPUTS): $(com_ubuntu_Upstart_XML) mkdir -p upstart $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=upstart \ --default-interface=com.ubuntu.Upstart0_6 \ --output=$@ $< com_ubuntu_Upstart_Job_OUTPUTS = \ upstart/com.ubuntu.Upstart.Job.c \ upstart/com.ubuntu.Upstart.Job.h com_ubuntu_Upstart_Job_XML = \ ../dbus/com.ubuntu.Upstart.Job.xml $(com_ubuntu_Upstart_Job_OUTPUTS): $(com_ubuntu_Upstart_Job_XML) mkdir -p upstart $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job_class \ --default-interface=com.ubuntu.Upstart0_6.Job \ --output=$@ $< com_ubuntu_Upstart_Instance_OUTPUTS = \ upstart/com.ubuntu.Upstart.Instance.c \ upstart/com.ubuntu.Upstart.Instance.h com_ubuntu_Upstart_Instance_XML = \ ../dbus/com.ubuntu.Upstart.Instance.xml $(com_ubuntu_Upstart_Instance_OUTPUTS): $(com_ubuntu_Upstart_Instance_XML) mkdir -p upstart $(AM_V_GEN)$(NIH_DBUS_TOOL) \ --package=$(PACKAGE) \ --mode=proxy --prefix=job \ --default-interface=com.ubuntu.Upstart0_6.Instance \ --output=$@ $< # These have to be built sources because we can't compile object files # without the header file existing first BUILT_SOURCES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) \ upstart/upstart-dbus.h CLEANFILES = \ $(com_ubuntu_Upstart_OUTPUTS) \ $(com_ubuntu_Upstart_Job_OUTPUTS) \ $(com_ubuntu_Upstart_Instance_OUTPUTS) \ $(abi_build_XML) \ $(pkgconfig_DATA) CLEANFILES += $(check_SCRIPTS) libupstart.pc.in tests: $(check_PROGRAMS) clean-local: rm -f *.gcno *.gcda rm -rf upstart/ maintainer-clean-local: rm -f *.gcov # Run ABI compliance checker on every build to ensure the library ABI # has not been inadvertently broken due to dbus/*.xml being updated # without a version change. if HAVE_ABI_CHECKER all-local: run_abi_checker.sh $(builddir)/run_abi_checker.sh endif upstart-1.13.2/lib/tests/0000775000175000017500000000000012402042416012206 500000000000000upstart-1.13.2/lib/tests/test_libupstart.c0000664000175000017500000001162412373101356015534 00000000000000/* upstart * * test_libupstart.c - test suite for libupstart. * * Copyright © 2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #include #include #include #include #include #include #include #include #include "upstart.h" #include "test_util_common.h" /** * upstart_open: * @parent: parent object for new proxy. * * Opens a connection to the Upstart init daemon and returns a proxy * to the manager object. If @dest_name is not NULL, a connection is * instead opened to the system bus and the proxy linked to the * well-known name given. * * If @parent is not NULL, it should be a pointer to another object * which will be used as a parent for the returned proxy. When all * parents of the returned proxy are freed, the returned proxy will * also be freed. * * Returns: newly allocated D-Bus proxy or NULL on raised error. **/ NihDBusProxy * upstart_open (const void *parent) { DBusError dbus_error; DBusConnection *connection; NihDBusProxy * upstart; dbus_error_init (&dbus_error); connection = dbus_bus_get (DBUS_BUS_SYSTEM, &dbus_error); if (! connection) { nih_dbus_error_raise (dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); return NULL; } dbus_connection_set_exit_on_disconnect (connection, FALSE); dbus_error_free (&dbus_error); upstart = nih_dbus_proxy_new (parent, connection, DBUS_SERVICE_UPSTART, DBUS_PATH_UPSTART, NULL, NULL); if (! upstart) { dbus_connection_unref (connection); return NULL; } upstart->auto_start = FALSE; /* Drop initial reference now the proxy holds one */ dbus_connection_unref (connection); return upstart; } void test_libupstart (void) { nih_local NihDBusProxy *upstart = NULL; nih_local char *version = NULL; int ret; pid_t upstart_pid; pid_t dbus_pid; char xdg_runtime_dir[PATH_MAX]; nih_local char *orig_xdg_runtime_dir = NULL; nih_local char *session_file = NULL; nih_local char *path = NULL; TEST_GROUP ("libupstart"); TEST_FEATURE ("version"); TEST_FILENAME (xdg_runtime_dir); TEST_EQ (mkdir (xdg_runtime_dir, 0755), 0); /* Take care to avoid disrupting users environment by saving and * restoring this variable (assuming the tests all pass...). */ orig_xdg_runtime_dir = getenv ("XDG_RUNTIME_DIR"); if (orig_xdg_runtime_dir) orig_xdg_runtime_dir = NIH_MUST (nih_strdup (NULL, orig_xdg_runtime_dir)); assert0 (setenv ("XDG_RUNTIME_DIR", xdg_runtime_dir, 1)); /*******************************************************************/ /* Create a private Session Init instance to connect to */ TEST_DBUS (dbus_pid); START_UPSTART (upstart_pid, TRUE); upstart = upstart_open (NULL); TEST_NE_P (upstart, NULL); /* Basic test (that does not change the state of the system * running this test) to see if we can query version of running * Upstart instance. */ ret = upstart_get_version_sync (NULL, upstart, &version); TEST_EQ (ret, 0); nih_message ("Running instance version: '%s'", version); assert0 (fnmatch ("init (upstart*)", version, 0x0)); STOP_UPSTART (upstart_pid); TEST_DBUS_END (dbus_pid); /*******************************************************************/ if (orig_xdg_runtime_dir) { /* restore */ setenv ("XDG_RUNTIME_DIR", orig_xdg_runtime_dir, 1); } else { assert0 (unsetenv ("XDG_RUNTIME_DIR")); } session_file = get_session_file (xdg_runtime_dir, upstart_pid); unlink (session_file); /* Remove the directory tree the Session Init created */ path = NIH_MUST (nih_sprintf (NULL, "%s/upstart/sessions", xdg_runtime_dir)); assert0 (rmdir (path)); path = NIH_MUST (nih_sprintf (NULL, "%s/upstart", xdg_runtime_dir)); assert0 (rmdir (path)); assert0 (rmdir (xdg_runtime_dir)); } int main (int argc, char *argv[]) { if (in_chroot () && ! dbus_configured ()) { fprintf(stderr, "\n\n" "WARNING: not running %s tests as within " "chroot environment without D-Bus" "\n\n", __FILE__); } else { test_libupstart (); } return 0; } upstart-1.13.2/lib/libupstart.pc.in.in0000664000175000017500000000034212373101356014520 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libupstart Description: Upstart Utility Library Version: @LIBUPSTART_VERSION_DOTTED@ Libs: -L${libdir} -lupstart Cflags: -I${includedir} upstart-1.13.2/lib/upstart.h0000664000175000017500000000204312373101356012644 00000000000000/* upstart * * Copyright © 2013 Canonical Ltd. * Author: James Hunt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef LIB_UPSTART_H #define LIB_UPSTART_H #include NIH_BEGIN_EXTERN #include "upstart/upstart-dbus.h" #include "upstart/com.ubuntu.Upstart.h" #include "upstart/com.ubuntu.Upstart.Instance.h" #include "upstart/com.ubuntu.Upstart.Job.h" NIH_END_EXTERN #endif /* LIB_UPSTART_H */ upstart-1.13.2/lib/abi/0000775000175000017500000000000012373101356011605 500000000000000upstart-1.13.2/lib/abi/i686-linux-gnu/0000775000175000017500000000000012373101357014226 500000000000000upstart-1.13.2/lib/abi/i686-linux-gnu/libupstart_1.0.0.abi0000664000175000017500000175177412373101356017555 00000000000000$VAR1 = { 'ABI_COMPLIANCE_CHECKER_VERSION' => '1.97.7', 'ABI_DUMP_VERSION' => '2.16', 'Arch' => 'x86', 'Constants' => {}, 'DepSymbols' => { 'libc-2.17.so' => { '_Exit@@GLIBC_2.1.1' => 1, '_IO_2_1_stderr_@@GLIBC_2.1' => '-152', '_IO_2_1_stdin_@@GLIBC_2.1' => '-152', '_IO_2_1_stdout_@@GLIBC_2.1' => '-152', '_IO_adjust_column@@GLIBC_2.0' => 1, '_IO_adjust_wcolumn@@GLIBC_2.2' => 1, '_IO_default_doallocate@@GLIBC_2.0' => 1, '_IO_default_finish@@GLIBC_2.0' => 1, '_IO_default_pbackfail@@GLIBC_2.0' => 1, '_IO_default_uflow@@GLIBC_2.0' => 1, '_IO_default_xsgetn@@GLIBC_2.0' => 1, '_IO_default_xsputn@@GLIBC_2.0' => 1, '_IO_do_write@@GLIBC_2.1' => 1, '_IO_do_write@GLIBC_2.0' => 1, '_IO_doallocbuf@@GLIBC_2.0' => 1, '_IO_fclose@@GLIBC_2.1' => 1, '_IO_fclose@GLIBC_2.0' => 1, '_IO_fdopen@@GLIBC_2.1' => 1, '_IO_fdopen@GLIBC_2.0' => 1, '_IO_feof@@GLIBC_2.0' => 1, '_IO_ferror@@GLIBC_2.0' => 1, '_IO_fflush@@GLIBC_2.0' => 1, '_IO_fgetpos64@@GLIBC_2.2' => 1, '_IO_fgetpos64@GLIBC_2.1' => 1, '_IO_fgetpos@@GLIBC_2.2' => 1, '_IO_fgetpos@GLIBC_2.0' => 1, '_IO_fgets@@GLIBC_2.0' => 1, '_IO_file_attach@@GLIBC_2.1' => 1, '_IO_file_attach@GLIBC_2.0' => 1, '_IO_file_close@@GLIBC_2.0' => 1, '_IO_file_close_it@@GLIBC_2.1' => 1, '_IO_file_close_it@GLIBC_2.0' => 1, '_IO_file_doallocate@@GLIBC_2.0' => 1, '_IO_file_finish@@GLIBC_2.1' => 1, '_IO_file_fopen@@GLIBC_2.1' => 1, '_IO_file_fopen@GLIBC_2.0' => 1, '_IO_file_init@@GLIBC_2.1' => 1, '_IO_file_init@GLIBC_2.0' => 1, '_IO_file_jumps@@GLIBC_2.0' => '-84', '_IO_file_open@@GLIBC_2.0' => 1, '_IO_file_overflow@@GLIBC_2.1' => 1, '_IO_file_overflow@GLIBC_2.0' => 1, '_IO_file_read@@GLIBC_2.0' => 1, '_IO_file_seek@@GLIBC_2.0' => 1, '_IO_file_seekoff@@GLIBC_2.1' => 1, '_IO_file_seekoff@GLIBC_2.0' => 1, '_IO_file_setbuf@@GLIBC_2.1' => 1, '_IO_file_setbuf@GLIBC_2.0' => 1, '_IO_file_stat@@GLIBC_2.0' => 1, '_IO_file_sync@@GLIBC_2.1' => 1, '_IO_file_sync@GLIBC_2.0' => 1, '_IO_file_underflow@@GLIBC_2.1' => 1, '_IO_file_underflow@GLIBC_2.0' => 1, '_IO_file_write@@GLIBC_2.1' => 1, '_IO_file_write@GLIBC_2.0' => 1, '_IO_file_xsputn@@GLIBC_2.1' => 1, '_IO_file_xsputn@GLIBC_2.0' => 1, '_IO_flockfile@@GLIBC_2.0' => 1, '_IO_flush_all@@GLIBC_2.0' => 1, '_IO_flush_all_linebuffered@@GLIBC_2.0' => 1, '_IO_fopen@@GLIBC_2.1' => 1, '_IO_fopen@GLIBC_2.0' => 1, '_IO_fprintf@@GLIBC_2.0' => 1, '_IO_fputs@@GLIBC_2.0' => 1, '_IO_fread@@GLIBC_2.0' => 1, '_IO_free_backup_area@@GLIBC_2.0' => 1, '_IO_free_wbackup_area@@GLIBC_2.2' => 1, '_IO_fsetpos64@@GLIBC_2.2' => 1, '_IO_fsetpos64@GLIBC_2.1' => 1, '_IO_fsetpos@@GLIBC_2.2' => 1, '_IO_fsetpos@GLIBC_2.0' => 1, '_IO_ftell@@GLIBC_2.0' => 1, '_IO_ftrylockfile@@GLIBC_2.0' => 1, '_IO_funlockfile@@GLIBC_2.0' => 1, '_IO_fwrite@@GLIBC_2.0' => 1, '_IO_getc@@GLIBC_2.0' => 1, '_IO_getline@@GLIBC_2.0' => 1, '_IO_getline_info@@GLIBC_2.1' => 1, '_IO_gets@@GLIBC_2.0' => 1, '_IO_init@@GLIBC_2.0' => 1, '_IO_init_marker@@GLIBC_2.0' => 1, '_IO_init_wmarker@@GLIBC_2.2' => 1, '_IO_iter_begin@@GLIBC_2.2' => 1, '_IO_iter_end@@GLIBC_2.2' => 1, '_IO_iter_file@@GLIBC_2.2' => 1, '_IO_iter_next@@GLIBC_2.2' => 1, '_IO_least_wmarker@@GLIBC_2.2' => 1, '_IO_link_in@@GLIBC_2.0' => 1, '_IO_list_all@@GLIBC_2.0' => '-4', '_IO_list_lock@@GLIBC_2.2' => 1, '_IO_list_resetlock@@GLIBC_2.2' => 1, '_IO_list_unlock@@GLIBC_2.2' => 1, '_IO_marker_delta@@GLIBC_2.0' => 1, '_IO_marker_difference@@GLIBC_2.0' => 1, '_IO_padn@@GLIBC_2.0' => 1, '_IO_peekc_locked@@GLIBC_2.0' => 1, '_IO_popen@@GLIBC_2.1' => 1, '_IO_popen@GLIBC_2.0' => 1, '_IO_printf@@GLIBC_2.0' => 1, '_IO_proc_close@@GLIBC_2.1' => 1, '_IO_proc_close@GLIBC_2.0' => 1, '_IO_proc_open@@GLIBC_2.1' => 1, '_IO_proc_open@GLIBC_2.0' => 1, '_IO_putc@@GLIBC_2.0' => 1, '_IO_puts@@GLIBC_2.0' => 1, '_IO_remove_marker@@GLIBC_2.0' => 1, '_IO_seekmark@@GLIBC_2.0' => 1, '_IO_seekoff@@GLIBC_2.0' => 1, '_IO_seekpos@@GLIBC_2.0' => 1, '_IO_seekwmark@@GLIBC_2.2' => 1, '_IO_setb@@GLIBC_2.0' => 1, '_IO_setbuffer@@GLIBC_2.0' => 1, '_IO_setvbuf@@GLIBC_2.0' => 1, '_IO_sgetn@@GLIBC_2.0' => 1, '_IO_sprintf@@GLIBC_2.0' => 1, '_IO_sputbackc@@GLIBC_2.0' => 1, '_IO_sputbackwc@@GLIBC_2.2' => 1, '_IO_sscanf@@GLIBC_2.0' => 1, '_IO_stderr_@@GLIBC_2.0' => '-80', '_IO_stdin_@@GLIBC_2.0' => '-80', '_IO_stdout_@@GLIBC_2.0' => '-80', '_IO_str_init_readonly@@GLIBC_2.0' => 1, '_IO_str_init_static@@GLIBC_2.0' => 1, '_IO_str_overflow@@GLIBC_2.0' => 1, '_IO_str_pbackfail@@GLIBC_2.0' => 1, '_IO_str_seekoff@@GLIBC_2.0' => 1, '_IO_str_underflow@@GLIBC_2.0' => 1, '_IO_sungetc@@GLIBC_2.0' => 1, '_IO_sungetwc@@GLIBC_2.2' => 1, '_IO_switch_to_get_mode@@GLIBC_2.0' => 1, '_IO_switch_to_main_wget_area@@GLIBC_2.2' => 1, '_IO_switch_to_wbackup_area@@GLIBC_2.2' => 1, '_IO_switch_to_wget_mode@@GLIBC_2.2' => 1, '_IO_un_link@@GLIBC_2.0' => 1, '_IO_ungetc@@GLIBC_2.0' => 1, '_IO_unsave_markers@@GLIBC_2.0' => 1, '_IO_unsave_wmarkers@@GLIBC_2.2' => 1, '_IO_vfprintf@@GLIBC_2.0' => 1, '_IO_vfscanf@@GLIBC_2.0' => 1, '_IO_vsprintf@@GLIBC_2.0' => 1, '_IO_wdefault_doallocate@@GLIBC_2.2' => 1, '_IO_wdefault_finish@@GLIBC_2.2' => 1, '_IO_wdefault_pbackfail@@GLIBC_2.2' => 1, '_IO_wdefault_uflow@@GLIBC_2.2' => 1, '_IO_wdefault_xsgetn@@GLIBC_2.2' => 1, '_IO_wdefault_xsputn@@GLIBC_2.2' => 1, '_IO_wdo_write@@GLIBC_2.2' => 1, '_IO_wdoallocbuf@@GLIBC_2.2' => 1, '_IO_wfile_jumps@@GLIBC_2.2' => '-84', '_IO_wfile_overflow@@GLIBC_2.2' => 1, '_IO_wfile_seekoff@@GLIBC_2.2' => 1, '_IO_wfile_sync@@GLIBC_2.2' => 1, '_IO_wfile_underflow@@GLIBC_2.2' => 1, '_IO_wfile_xsputn@@GLIBC_2.2' => 1, '_IO_wmarker_delta@@GLIBC_2.2' => 1, '_IO_wsetb@@GLIBC_2.2' => 1, '_Unwind_Find_FDE@@GCC_3.0' => 1, '___brk_addr@@GLIBC_2.0' => '-4', '__abort_msg@@GLIBC_PRIVATE' => '-4', '__adjtimex@@GLIBC_2.0' => 1, '__after_morecore_hook@@GLIBC_2.0' => '-4', '__argz_count@@GLIBC_2.0' => 1, '__argz_next@@GLIBC_2.0' => 1, '__argz_stringify@@GLIBC_2.0' => 1, '__asprintf@@GLIBC_2.1' => 1, '__asprintf_chk@@GLIBC_2.8' => 1, '__assert@@GLIBC_2.2' => 1, '__assert_fail@@GLIBC_2.0' => 1, '__assert_perror_fail@@GLIBC_2.0' => 1, '__backtrace@@GLIBC_2.1' => 1, '__backtrace_symbols@@GLIBC_2.1' => 1, '__backtrace_symbols_fd@@GLIBC_2.1' => 1, '__bsd_getpgrp@@GLIBC_2.0' => 1, '__bzero@@GLIBC_2.0' => 1, '__check_rhosts_file@@GLIBC_2.0' => '-4', '__chk_fail@@GLIBC_2.3.4' => 1, '__clock_getcpuclockid@@GLIBC_PRIVATE' => 1, '__clock_getres@@GLIBC_PRIVATE' => 1, '__clock_gettime@@GLIBC_PRIVATE' => 1, '__clock_nanosleep@@GLIBC_PRIVATE' => 1, '__clock_settime@@GLIBC_PRIVATE' => 1, '__clone@@GLIBC_2.0' => 1, '__close@@GLIBC_2.0' => 1, '__cmpdi2@GLIBC_2.0' => 1, '__cmsg_nxthdr@@GLIBC_2.0' => 1, '__confstr_chk@@GLIBC_2.4' => 1, '__connect@@GLIBC_2.0' => 1, '__ctype32_b@GLIBC_2.0' => '-4', '__ctype32_tolower@GLIBC_2.2' => '-4', '__ctype32_toupper@GLIBC_2.2' => '-4', '__ctype_b@GLIBC_2.0' => '-4', '__ctype_b_loc@@GLIBC_2.3' => 1, '__ctype_get_mb_cur_max@@GLIBC_2.0' => 1, '__ctype_init@@GLIBC_PRIVATE' => 1, '__ctype_tolower@GLIBC_2.0' => '-4', '__ctype_tolower_loc@@GLIBC_2.3' => 1, '__ctype_toupper@GLIBC_2.0' => '-4', '__ctype_toupper_loc@@GLIBC_2.3' => 1, '__curbrk@@GLIBC_2.0' => '-4', '__cxa_at_quick_exit@@GLIBC_2.10' => 1, '__cxa_atexit@@GLIBC_2.1.3' => 1, '__cxa_finalize@@GLIBC_2.1.3' => 1, '__cyg_profile_func_enter@@GLIBC_2.2' => 1, '__cyg_profile_func_exit@@GLIBC_2.2' => 1, '__daylight@@GLIBC_2.0' => '-4', '__dcgettext@@GLIBC_2.0' => 1, '__default_morecore@@GLIBC_2.0' => 1, '__deregister_frame@@GLIBC_2.0' => 1, '__deregister_frame_info@@GLIBC_2.0' => 1, '__deregister_frame_info_bases@@GCC_3.0' => 1, '__dgettext@@GLIBC_2.0' => 1, '__divdi3@GLIBC_2.0' => 1, '__dprintf_chk@@GLIBC_2.8' => 1, '__dup2@@GLIBC_2.0' => 1, '__duplocale@@GLIBC_2.1' => 1, '__endmntent@@GLIBC_2.2' => 1, '__environ@@GLIBC_2.0' => '-4', '__errno_location@@GLIBC_2.0' => 1, '__fbufsize@@GLIBC_2.2' => 1, '__fcntl@@GLIBC_2.0' => 1, '__fdelt_chk@@GLIBC_2.15' => 1, '__fdelt_warn@@GLIBC_2.15' => 1, '__fentry__@@GLIBC_2.13' => 1, '__ffs@@GLIBC_2.0' => 1, '__fgets_chk@@GLIBC_2.4' => 1, '__fgets_unlocked_chk@@GLIBC_2.4' => 1, '__fgetws_chk@@GLIBC_2.4' => 1, '__fgetws_unlocked_chk@@GLIBC_2.4' => 1, '__finite@@GLIBC_2.0' => 1, '__finitef@@GLIBC_2.0' => 1, '__finitel@@GLIBC_2.0' => 1, '__fixunsdfdi@GLIBC_2.0' => 1, '__fixunsxfdi@GLIBC_2.0' => 1, '__flbf@@GLIBC_2.2' => 1, '__floatdidf@GLIBC_2.0' => 1, '__fork@@GLIBC_2.0' => 1, '__fortify_fail@@GLIBC_PRIVATE' => 1, '__fpending@@GLIBC_2.2' => 1, '__fprintf_chk@@GLIBC_2.3.4' => 1, '__fpu_control@@GLIBC_2.0' => '-2', '__fpurge@@GLIBC_2.2' => 1, '__frame_state_for@@GLIBC_2.0' => 1, '__fread_chk@@GLIBC_2.7' => 1, '__fread_unlocked_chk@@GLIBC_2.7' => 1, '__freadable@@GLIBC_2.2' => 1, '__freading@@GLIBC_2.2' => 1, '__free_hook@@GLIBC_2.0' => '-4', '__freelocale@@GLIBC_2.1' => 1, '__fsetlocking@@GLIBC_2.2' => 1, '__fwprintf_chk@@GLIBC_2.4' => 1, '__fwritable@@GLIBC_2.2' => 1, '__fwriting@@GLIBC_2.2' => 1, '__fxstat64@@GLIBC_2.2' => 1, '__fxstat64@GLIBC_2.1' => 1, '__fxstat@@GLIBC_2.0' => 1, '__fxstatat64@@GLIBC_2.4' => 1, '__fxstatat@@GLIBC_2.4' => 1, '__gai_sigqueue@@GLIBC_PRIVATE' => 1, '__gconv_get_alias_db@@GLIBC_PRIVATE' => 1, '__gconv_get_cache@@GLIBC_PRIVATE' => 1, '__gconv_get_modules_db@@GLIBC_PRIVATE' => 1, '__get_cpu_features@@GLIBC_PRIVATE' => 1, '__getauxval@@GLIBC_2.16' => 1, '__getcwd_chk@@GLIBC_2.4' => 1, '__getdelim@@GLIBC_2.0' => 1, '__getdomainname_chk@@GLIBC_2.4' => 1, '__getgroups_chk@@GLIBC_2.4' => 1, '__gethostname_chk@@GLIBC_2.4' => 1, '__getlogin_r_chk@@GLIBC_2.4' => 1, '__getmntent_r@@GLIBC_2.2' => 1, '__getpagesize@@GLIBC_2.0' => 1, '__getpgid@@GLIBC_2.0' => 1, '__getpid@@GLIBC_2.0' => 1, '__gets_chk@@GLIBC_2.3.4' => 1, '__gettimeofday@@GLIBC_2.0' => 1, '__getwd_chk@@GLIBC_2.4' => 1, '__gmtime_r@@GLIBC_2.0' => 1, '__h_errno_location@@GLIBC_2.0' => 1, '__internal_endnetgrent@@GLIBC_PRIVATE' => 1, '__internal_getnetgrent_r@@GLIBC_PRIVATE' => 1, '__internal_setnetgrent@@GLIBC_PRIVATE' => 1, '__isalnum_l@@GLIBC_2.1' => 1, '__isalpha_l@@GLIBC_2.1' => 1, '__isascii_l@@GLIBC_2.1' => 1, '__isblank_l@@GLIBC_2.1' => 1, '__iscntrl_l@@GLIBC_2.1' => 1, '__isctype@@GLIBC_2.3' => 1, '__isdigit_l@@GLIBC_2.1' => 1, '__isgraph_l@@GLIBC_2.1' => 1, '__isinf@@GLIBC_2.0' => 1, '__isinff@@GLIBC_2.0' => 1, '__isinfl@@GLIBC_2.0' => 1, '__islower_l@@GLIBC_2.1' => 1, '__isnan@@GLIBC_2.0' => 1, '__isnanf@@GLIBC_2.0' => 1, '__isnanl@@GLIBC_2.0' => 1, '__isoc99_fscanf@@GLIBC_2.7' => 1, '__isoc99_fwscanf@@GLIBC_2.7' => 1, '__isoc99_scanf@@GLIBC_2.7' => 1, '__isoc99_sscanf@@GLIBC_2.7' => 1, '__isoc99_swscanf@@GLIBC_2.7' => 1, '__isoc99_vfscanf@@GLIBC_2.7' => 1, '__isoc99_vfwscanf@@GLIBC_2.7' => 1, '__isoc99_vscanf@@GLIBC_2.7' => 1, '__isoc99_vsscanf@@GLIBC_2.7' => 1, '__isoc99_vswscanf@@GLIBC_2.7' => 1, '__isoc99_vwscanf@@GLIBC_2.7' => 1, '__isoc99_wscanf@@GLIBC_2.7' => 1, '__isprint_l@@GLIBC_2.1' => 1, '__ispunct_l@@GLIBC_2.1' => 1, '__isspace_l@@GLIBC_2.1' => 1, '__isupper_l@@GLIBC_2.1' => 1, '__iswalnum_l@@GLIBC_2.1' => 1, '__iswalpha_l@@GLIBC_2.1' => 1, '__iswblank_l@@GLIBC_2.1' => 1, '__iswcntrl_l@@GLIBC_2.1' => 1, '__iswctype@@GLIBC_2.0' => 1, '__iswctype_l@@GLIBC_2.1' => 1, '__iswdigit_l@@GLIBC_2.1' => 1, '__iswgraph_l@@GLIBC_2.1' => 1, '__iswlower_l@@GLIBC_2.1' => 1, '__iswprint_l@@GLIBC_2.1' => 1, '__iswpunct_l@@GLIBC_2.1' => 1, '__iswspace_l@@GLIBC_2.1' => 1, '__iswupper_l@@GLIBC_2.1' => 1, '__iswxdigit_l@@GLIBC_2.1' => 1, '__isxdigit_l@@GLIBC_2.1' => 1, '__ivaliduser@@GLIBC_2.0' => 1, '__key_decryptsession_pk_LOCAL@@GLIBC_2.1' => '-4', '__key_encryptsession_pk_LOCAL@@GLIBC_2.1' => '-4', '__key_gendes_LOCAL@@GLIBC_2.1' => '-4', '__libc_alloca_cutoff@@GLIBC_PRIVATE' => 1, '__libc_allocate_rtsig@@GLIBC_2.1' => 1, '__libc_allocate_rtsig_private@@GLIBC_PRIVATE' => 1, '__libc_calloc@@GLIBC_2.0' => 1, '__libc_clntudp_bufcreate@@GLIBC_PRIVATE' => 1, '__libc_current_sigrtmax@@GLIBC_2.1' => 1, '__libc_current_sigrtmax_private@@GLIBC_PRIVATE' => 1, '__libc_current_sigrtmin@@GLIBC_2.1' => 1, '__libc_current_sigrtmin_private@@GLIBC_PRIVATE' => 1, '__libc_dl_error_tsd@@GLIBC_PRIVATE' => 1, '__libc_dlclose@@GLIBC_PRIVATE' => 1, '__libc_dlopen_mode@@GLIBC_PRIVATE' => 1, '__libc_dlsym@@GLIBC_PRIVATE' => 1, '__libc_fatal@@GLIBC_PRIVATE' => 1, '__libc_fork@@GLIBC_PRIVATE' => 1, '__libc_free@@GLIBC_2.0' => 1, '__libc_freeres@@GLIBC_2.1' => 1, '__libc_ifunc_impl_list@@GLIBC_PRIVATE' => 1, '__libc_init_first@@GLIBC_2.0' => 1, '__libc_longjmp@@GLIBC_PRIVATE' => 1, '__libc_mallinfo@@GLIBC_2.0' => 1, '__libc_malloc@@GLIBC_2.0' => 1, '__libc_mallopt@@GLIBC_2.0' => 1, '__libc_memalign@@GLIBC_2.0' => 1, '__libc_msgrcv@@GLIBC_PRIVATE' => 1, '__libc_msgsnd@@GLIBC_PRIVATE' => 1, '__libc_pthread_init@@GLIBC_PRIVATE' => 1, '__libc_pvalloc@@GLIBC_2.0' => 1, '__libc_pwrite@@GLIBC_PRIVATE' => 1, '__libc_realloc@@GLIBC_2.0' => 1, '__libc_rpc_getport@@GLIBC_PRIVATE' => 1, '__libc_sa_len@@GLIBC_2.1' => 1, '__libc_secure_getenv@@GLIBC_PRIVATE' => 1, '__libc_siglongjmp@@GLIBC_PRIVATE' => 1, '__libc_start_main@@GLIBC_2.0' => 1, '__libc_system@@GLIBC_PRIVATE' => 1, '__libc_thread_freeres@@GLIBC_PRIVATE' => 1, '__libc_valloc@@GLIBC_2.0' => 1, '__longjmp_chk@@GLIBC_2.11' => 1, '__lseek@@GLIBC_2.0' => 1, '__lxstat64@@GLIBC_2.2' => 1, '__lxstat64@GLIBC_2.1' => 1, '__lxstat@@GLIBC_2.0' => 1, '__madvise@@GLIBC_PRIVATE' => 1, '__malloc_hook@@GLIBC_2.0' => '-4', '__malloc_initialize_hook@@GLIBC_2.0' => '-4', '__mbrlen@@GLIBC_2.0' => 1, '__mbrtowc@@GLIBC_2.0' => 1, '__mbsnrtowcs_chk@@GLIBC_2.4' => 1, '__mbsrtowcs_chk@@GLIBC_2.4' => 1, '__mbstowcs_chk@@GLIBC_2.4' => 1, '__memalign_hook@@GLIBC_2.0' => '-4', '__memcpy_by2@@GLIBC_2.1.1' => 1, '__memcpy_by4@@GLIBC_2.1.1' => 1, '__memcpy_c@@GLIBC_2.1.1' => 1, '__memcpy_chk@@GLIBC_2.3.4' => 1, '__memcpy_g@@GLIBC_2.1.1' => 1, '__memmove_chk@@GLIBC_2.3.4' => 1, '__mempcpy@@GLIBC_2.0' => 1, '__mempcpy_by2@@GLIBC_2.1.1' => 1, '__mempcpy_by4@@GLIBC_2.1.1' => 1, '__mempcpy_byn@@GLIBC_2.1.1' => 1, '__mempcpy_chk@@GLIBC_2.3.4' => 1, '__mempcpy_small@@GLIBC_2.1.1' => 1, '__memset_cc@@GLIBC_2.1.1' => 1, '__memset_ccn_by2@@GLIBC_2.1.1' => 1, '__memset_ccn_by4@@GLIBC_2.1.1' => 1, '__memset_cg@@GLIBC_2.1.1' => 1, '__memset_chk@@GLIBC_2.3.4' => 1, '__memset_gcn_by2@@GLIBC_2.1.1' => 1, '__memset_gcn_by4@@GLIBC_2.1.1' => 1, '__memset_gg@@GLIBC_2.1.1' => 1, '__moddi3@GLIBC_2.0' => 1, '__modify_ldt@@GLIBC_PRIVATE' => 1, '__monstartup@@GLIBC_2.0' => 1, '__morecore@@GLIBC_2.0' => '-4', '__nanosleep@@GLIBC_2.2.6' => 1, '__newlocale@@GLIBC_2.1' => 1, '__nl_langinfo_l@@GLIBC_2.2' => 1, '__nss_configure_lookup@@GLIBC_2.0' => 1, '__nss_database_lookup@@GLIBC_2.0' => 1, '__nss_disable_nscd@@GLIBC_PRIVATE' => 1, '__nss_group_lookup2@@GLIBC_PRIVATE' => 1, '__nss_group_lookup@@GLIBC_2.0' => 1, '__nss_hostname_digits_dots@@GLIBC_2.2.2' => 1, '__nss_hosts_lookup2@@GLIBC_PRIVATE' => 1, '__nss_hosts_lookup@@GLIBC_2.0' => 1, '__nss_lookup@@GLIBC_PRIVATE' => 1, '__nss_lookup_function@@GLIBC_PRIVATE' => 1, '__nss_next2@@GLIBC_PRIVATE' => 1, '__nss_next@@GLIBC_2.0' => 1, '__nss_passwd_lookup2@@GLIBC_PRIVATE' => 1, '__nss_passwd_lookup@@GLIBC_2.0' => 1, '__nss_services_lookup2@@GLIBC_PRIVATE' => 1, '__obstack_printf_chk@@GLIBC_2.8' => 1, '__obstack_vprintf_chk@@GLIBC_2.8' => 1, '__open64@@GLIBC_2.2' => 1, '__open64_2@@GLIBC_2.7' => 1, '__open@@GLIBC_2.0' => 1, '__open_2@@GLIBC_2.7' => 1, '__open_catalog@@GLIBC_PRIVATE' => 1, '__openat64_2@@GLIBC_2.7' => 1, '__openat_2@@GLIBC_2.7' => 1, '__overflow@@GLIBC_2.0' => 1, '__pipe@@GLIBC_2.0' => 1, '__poll@@GLIBC_2.1' => 1, '__poll_chk@@GLIBC_2.16' => 1, '__posix_getopt@@GLIBC_2.10' => 1, '__ppoll_chk@@GLIBC_2.16' => 1, '__pread64@@GLIBC_2.1' => 1, '__pread64_chk@@GLIBC_2.4' => 1, '__pread_chk@@GLIBC_2.4' => 1, '__printf_chk@@GLIBC_2.3.4' => 1, '__printf_fp@@GLIBC_2.0' => 1, '__profile_frequency@@GLIBC_2.0' => 1, '__progname@@GLIBC_2.0' => '-4', '__progname_full@@GLIBC_2.0' => '-4', '__ptsname_r_chk@@GLIBC_2.4' => 1, '__pwrite64@@GLIBC_2.1' => 1, '__rawmemchr@@GLIBC_2.1' => 1, '__rcmd_errstr@@GLIBC_2.0' => '-4', '__read@@GLIBC_2.0' => 1, '__read_chk@@GLIBC_2.4' => 1, '__readlink_chk@@GLIBC_2.4' => 1, '__readlinkat_chk@@GLIBC_2.5' => 1, '__realloc_hook@@GLIBC_2.0' => '-4', '__realpath_chk@@GLIBC_2.4' => 1, '__recv_chk@@GLIBC_2.4' => 1, '__recvfrom_chk@@GLIBC_2.4' => 1, '__register_atfork@@GLIBC_2.3.2' => 1, '__register_frame@@GLIBC_2.0' => 1, '__register_frame_info@@GLIBC_2.0' => 1, '__register_frame_info_bases@@GCC_3.0' => 1, '__register_frame_info_table@@GLIBC_2.0' => 1, '__register_frame_info_table_bases@@GCC_3.0' => 1, '__register_frame_table@@GLIBC_2.0' => 1, '__res_iclose@@GLIBC_PRIVATE' => 1, '__res_init@@GLIBC_2.2' => 1, '__res_maybe_init@@GLIBC_PRIVATE' => 1, '__res_nclose@@GLIBC_2.2' => 1, '__res_ninit@@GLIBC_2.2' => 1, '__res_randomid@@GLIBC_2.0' => 1, '__res_state@@GLIBC_2.2' => 1, '__rpc_thread_createerr@@GLIBC_2.2.3' => 1, '__rpc_thread_svc_fdset@@GLIBC_2.2.3' => 1, '__rpc_thread_svc_max_pollfd@@GLIBC_2.2.3' => 1, '__rpc_thread_svc_pollfd@@GLIBC_2.2.3' => 1, '__sbrk@@GLIBC_2.0' => 1, '__sched_cpualloc@@GLIBC_2.7' => 1, '__sched_cpucount@@GLIBC_2.6' => 1, '__sched_cpufree@@GLIBC_2.7' => 1, '__sched_get_priority_max@@GLIBC_2.0' => 1, '__sched_get_priority_min@@GLIBC_2.0' => 1, '__sched_getparam@@GLIBC_2.0' => 1, '__sched_getscheduler@@GLIBC_2.0' => 1, '__sched_setscheduler@@GLIBC_2.0' => 1, '__sched_yield@@GLIBC_2.0' => 1, '__secure_getenv@GLIBC_2.0' => 1, '__select@@GLIBC_2.0' => 1, '__send@@GLIBC_2.0' => 1, '__sendmmsg@@GLIBC_PRIVATE' => 1, '__setmntent@@GLIBC_2.2' => 1, '__setpgid@@GLIBC_2.0' => 1, '__sigaction@@GLIBC_2.0' => 1, '__sigaddset@@GLIBC_2.0' => 1, '__sigdelset@@GLIBC_2.0' => 1, '__sigismember@@GLIBC_2.0' => 1, '__signbit@@GLIBC_2.1' => 1, '__signbitf@@GLIBC_2.1' => 1, '__signbitl@@GLIBC_2.1' => 1, '__sigpause@@GLIBC_2.0' => 1, '__sigsetjmp@@GLIBC_2.0' => 1, '__sigsuspend@@GLIBC_2.1.3' => 1, '__snprintf_chk@@GLIBC_2.3.4' => 1, '__sprintf_chk@@GLIBC_2.3.4' => 1, '__stack_chk_fail@@GLIBC_2.4' => 1, '__statfs@@GLIBC_2.2' => 1, '__stpcpy@@GLIBC_2.0' => 1, '__stpcpy_chk@@GLIBC_2.3.4' => 1, '__stpcpy_g@@GLIBC_2.1.1' => 1, '__stpcpy_small@@GLIBC_2.1.1' => 1, '__stpncpy@@GLIBC_2.0' => 1, '__stpncpy_chk@@GLIBC_2.4' => 1, '__strcasecmp@@GLIBC_2.0' => 1, '__strcasecmp_l@@GLIBC_2.1' => 1, '__strcasestr@@GLIBC_2.1' => 1, '__strcat_c@@GLIBC_2.1.1' => 1, '__strcat_chk@@GLIBC_2.3.4' => 1, '__strcat_g@@GLIBC_2.1.1' => 1, '__strchr_c@@GLIBC_2.1.1' => 1, '__strchr_g@@GLIBC_2.1.1' => 1, '__strchrnul_c@@GLIBC_2.1.1' => 1, '__strchrnul_g@@GLIBC_2.1.1' => 1, '__strcmp_gg@@GLIBC_2.1.1' => 1, '__strcoll_l@@GLIBC_2.1' => 1, '__strcpy_chk@@GLIBC_2.3.4' => 1, '__strcpy_g@@GLIBC_2.1.1' => 1, '__strcpy_small@@GLIBC_2.1.1' => 1, '__strcspn_c1@@GLIBC_2.1.1' => 1, '__strcspn_c2@@GLIBC_2.1.1' => 1, '__strcspn_c3@@GLIBC_2.1.1' => 1, '__strcspn_cg@@GLIBC_2.1.1' => 1, '__strcspn_g@@GLIBC_2.1.1' => 1, '__strdup@@GLIBC_2.0' => 1, '__strerror_r@@GLIBC_2.0' => 1, '__strfmon_l@@GLIBC_2.1' => 1, '__strftime_l@@GLIBC_2.3' => 1, '__strlen_g@@GLIBC_2.1.1' => 1, '__strncasecmp_l@@GLIBC_2.1' => 1, '__strncat_chk@@GLIBC_2.3.4' => 1, '__strncat_g@@GLIBC_2.1.1' => 1, '__strncmp_g@@GLIBC_2.1.1' => 1, '__strncpy_by2@@GLIBC_2.1.1' => 1, '__strncpy_by4@@GLIBC_2.1.1' => 1, '__strncpy_byn@@GLIBC_2.1.1' => 1, '__strncpy_chk@@GLIBC_2.3.4' => 1, '__strncpy_gg@@GLIBC_2.1.1' => 1, '__strndup@@GLIBC_2.2' => 1, '__strpbrk_c2@@GLIBC_2.1.1' => 1, '__strpbrk_c3@@GLIBC_2.1.1' => 1, '__strpbrk_cg@@GLIBC_2.1.1' => 1, '__strpbrk_g@@GLIBC_2.1.1' => 1, '__strrchr_c@@GLIBC_2.1.1' => 1, '__strrchr_g@@GLIBC_2.1.1' => 1, '__strsep_1c@@GLIBC_2.1.1' => 1, '__strsep_2c@@GLIBC_2.1.1' => 1, '__strsep_3c@@GLIBC_2.1.1' => 1, '__strsep_g@@GLIBC_2.1.1' => 1, '__strspn_c1@@GLIBC_2.1.1' => 1, '__strspn_c2@@GLIBC_2.1.1' => 1, '__strspn_c3@@GLIBC_2.1.1' => 1, '__strspn_cg@@GLIBC_2.1.1' => 1, '__strspn_g@@GLIBC_2.1.1' => 1, '__strstr_cg@@GLIBC_2.1.1' => 1, '__strstr_g@@GLIBC_2.1.1' => 1, '__strtod_internal@@GLIBC_2.0' => 1, '__strtod_l@@GLIBC_2.1' => 1, '__strtof_internal@@GLIBC_2.0' => 1, '__strtof_l@@GLIBC_2.1' => 1, '__strtok_r@@GLIBC_2.0' => 1, '__strtok_r_1c@@GLIBC_2.1.1' => 1, '__strtol_internal@@GLIBC_2.0' => 1, '__strtol_l@@GLIBC_2.1' => 1, '__strtold_internal@@GLIBC_2.0' => 1, '__strtold_l@@GLIBC_2.1' => 1, '__strtoll_internal@@GLIBC_2.0' => 1, '__strtoll_l@@GLIBC_2.1' => 1, '__strtoq_internal@GLIBC_2.0' => 1, '__strtoul_internal@@GLIBC_2.0' => 1, '__strtoul_l@@GLIBC_2.1' => 1, '__strtoull_internal@@GLIBC_2.0' => 1, '__strtoull_l@@GLIBC_2.1' => 1, '__strtouq_internal@GLIBC_2.0' => 1, '__strverscmp@@GLIBC_2.1.1' => 1, '__strxfrm_l@@GLIBC_2.1' => 1, '__swprintf_chk@@GLIBC_2.4' => 1, '__sysconf@@GLIBC_2.2' => 1, '__sysctl@@GLIBC_2.2' => 1, '__syslog_chk@@GLIBC_2.4' => 1, '__sysv_signal@@GLIBC_2.0' => 1, '__timezone@@GLIBC_2.0' => '-4', '__toascii_l@@GLIBC_2.1' => 1, '__tolower_l@@GLIBC_2.1' => 1, '__toupper_l@@GLIBC_2.1' => 1, '__towctrans@@GLIBC_2.1' => 1, '__towctrans_l@@GLIBC_2.1' => 1, '__towlower_l@@GLIBC_2.1' => 1, '__towupper_l@@GLIBC_2.1' => 1, '__ttyname_r_chk@@GLIBC_2.4' => 1, '__tzname@@GLIBC_2.0' => '-8', '__ucmpdi2@GLIBC_2.0' => 1, '__udivdi3@GLIBC_2.0' => 1, '__uflow@@GLIBC_2.0' => 1, '__umoddi3@GLIBC_2.0' => 1, '__underflow@@GLIBC_2.0' => 1, '__uselocale@@GLIBC_2.3' => 1, '__vasprintf_chk@@GLIBC_2.8' => 1, '__vdprintf_chk@@GLIBC_2.8' => 1, '__vfork@@GLIBC_2.1.2' => 1, '__vfprintf_chk@@GLIBC_2.3.4' => 1, '__vfscanf@@GLIBC_2.0' => 1, '__vfwprintf_chk@@GLIBC_2.4' => 1, '__vprintf_chk@@GLIBC_2.3.4' => 1, '__vsnprintf@@GLIBC_2.0' => 1, '__vsnprintf_chk@@GLIBC_2.3.4' => 1, '__vsprintf_chk@@GLIBC_2.3.4' => 1, '__vsscanf@@GLIBC_2.0' => 1, '__vswprintf_chk@@GLIBC_2.4' => 1, '__vsyslog_chk@@GLIBC_2.4' => 1, '__vwprintf_chk@@GLIBC_2.4' => 1, '__wait@@GLIBC_2.0' => 1, '__waitpid@@GLIBC_2.0' => 1, '__wcpcpy_chk@@GLIBC_2.4' => 1, '__wcpncpy_chk@@GLIBC_2.4' => 1, '__wcrtomb_chk@@GLIBC_2.4' => 1, '__wcscasecmp_l@@GLIBC_2.1' => 1, '__wcscat_chk@@GLIBC_2.4' => 1, '__wcscoll_l@@GLIBC_2.1' => 1, '__wcscpy_chk@@GLIBC_2.4' => 1, '__wcsftime_l@@GLIBC_2.3' => 1, '__wcsncasecmp_l@@GLIBC_2.1' => 1, '__wcsncat_chk@@GLIBC_2.4' => 1, '__wcsncpy_chk@@GLIBC_2.4' => 1, '__wcsnrtombs_chk@@GLIBC_2.4' => 1, '__wcsrtombs_chk@@GLIBC_2.4' => 1, '__wcstod_internal@@GLIBC_2.0' => 1, '__wcstod_l@@GLIBC_2.1' => 1, '__wcstof_internal@@GLIBC_2.0' => 1, '__wcstof_l@@GLIBC_2.1' => 1, '__wcstol_internal@@GLIBC_2.0' => 1, '__wcstol_l@@GLIBC_2.1' => 1, '__wcstold_internal@@GLIBC_2.0' => 1, '__wcstold_l@@GLIBC_2.1' => 1, '__wcstoll_internal@@GLIBC_2.0' => 1, '__wcstoll_l@@GLIBC_2.1' => 1, '__wcstombs_chk@@GLIBC_2.4' => 1, '__wcstoul_internal@@GLIBC_2.0' => 1, '__wcstoul_l@@GLIBC_2.1' => 1, '__wcstoull_internal@@GLIBC_2.0' => 1, '__wcstoull_l@@GLIBC_2.1' => 1, '__wcsxfrm_l@@GLIBC_2.1' => 1, '__wctomb_chk@@GLIBC_2.4' => 1, '__wctrans_l@@GLIBC_2.2' => 1, '__wctype_l@@GLIBC_2.1' => 1, '__wmemcpy_chk@@GLIBC_2.4' => 1, '__wmemmove_chk@@GLIBC_2.4' => 1, '__wmempcpy_chk@@GLIBC_2.4' => 1, '__wmemset_chk@@GLIBC_2.4' => 1, '__woverflow@@GLIBC_2.2' => 1, '__wprintf_chk@@GLIBC_2.4' => 1, '__write@@GLIBC_2.0' => 1, '__wuflow@@GLIBC_2.2' => 1, '__wunderflow@@GLIBC_2.2' => 1, '__xmknod@@GLIBC_2.0' => 1, '__xmknodat@@GLIBC_2.4' => 1, '__xpg_basename@@GLIBC_2.0' => 1, '__xpg_sigpause@@GLIBC_2.2' => 1, '__xpg_strerror_r@@GLIBC_2.3.4' => 1, '__xstat64@@GLIBC_2.2' => 1, '__xstat64@GLIBC_2.1' => 1, '__xstat@@GLIBC_2.0' => 1, '_authenticate@@GLIBC_2.1' => 1, '_dl_addr@@GLIBC_PRIVATE' => 1, '_dl_mcount_wrapper@@GLIBC_2.1' => 1, '_dl_mcount_wrapper_check@@GLIBC_2.1' => 1, '_dl_open_hook@@GLIBC_PRIVATE' => '-4', '_dl_sym@@GLIBC_PRIVATE' => 1, '_dl_vsym@@GLIBC_PRIVATE' => 1, '_environ@@GLIBC_2.0' => '-4', '_exit@@GLIBC_2.0' => 1, '_flushlbf@@GLIBC_2.2' => 1, '_itoa_lower_digits@@GLIBC_PRIVATE' => '-36', '_libc_intl_domainname@@GLIBC_2.0' => '-5', '_longjmp@@GLIBC_2.0' => 1, '_mcleanup@@GLIBC_2.0' => 1, '_mcount@@GLIBC_2.0' => 1, '_nl_default_dirname@@GLIBC_2.0' => '-18', '_nl_domain_bindings@@GLIBC_2.0' => '-4', '_nl_msg_cat_cntr@@GLIBC_2.0' => '-4', '_nss_files_parse_grent@@GLIBC_PRIVATE' => 1, '_nss_files_parse_pwent@@GLIBC_PRIVATE' => 1, '_nss_files_parse_sgent@@GLIBC_PRIVATE' => 1, '_nss_files_parse_spent@@GLIBC_PRIVATE' => 1, '_null_auth@@GLIBC_2.0' => '-12', '_obstack@GLIBC_2.0' => '-4', '_obstack_allocated_p@@GLIBC_2.0' => 1, '_obstack_begin@@GLIBC_2.0' => 1, '_obstack_begin_1@@GLIBC_2.0' => 1, '_obstack_free@@GLIBC_2.0' => 1, '_obstack_memory_used@@GLIBC_2.0' => 1, '_obstack_newchunk@@GLIBC_2.0' => 1, '_res@GLIBC_2.0' => '-512', '_res_hconf@@GLIBC_2.2' => '-48', '_rpc_dtablesize@@GLIBC_2.0' => 1, '_seterr_reply@@GLIBC_2.0' => 1, '_setjmp@@GLIBC_2.0' => 1, '_sys_errlist@@GLIBC_2.12' => '-540', '_sys_errlist@GLIBC_2.0' => '-492', '_sys_errlist@GLIBC_2.1' => '-500', '_sys_errlist@GLIBC_2.3' => '-504', '_sys_errlist@GLIBC_2.4' => '-528', '_sys_nerr@@GLIBC_2.12' => '-4', '_sys_nerr@GLIBC_2.0' => '-4', '_sys_nerr@GLIBC_2.1' => '-4', '_sys_nerr@GLIBC_2.3' => '-4', '_sys_nerr@GLIBC_2.4' => '-4', '_sys_siglist@@GLIBC_2.3.3' => '-260', '_sys_siglist@GLIBC_2.0' => '-128', '_sys_siglist@GLIBC_2.1' => '-256', '_tolower@@GLIBC_2.0' => 1, '_toupper@@GLIBC_2.0' => 1, 'a64l@@GLIBC_2.0' => 1, 'abort@@GLIBC_2.0' => 1, 'abs@@GLIBC_2.0' => 1, 'accept4@@GLIBC_2.10' => 1, 'accept@@GLIBC_2.0' => 1, 'access@@GLIBC_2.0' => 1, 'acct@@GLIBC_2.0' => 1, 'addmntent@@GLIBC_2.0' => 1, 'addseverity@@GLIBC_2.1' => 1, 'adjtime@@GLIBC_2.0' => 1, 'adjtimex@@GLIBC_2.0' => 1, 'advance@@GLIBC_2.0' => 1, 'alarm@@GLIBC_2.0' => 1, 'aligned_alloc@@GLIBC_2.16' => 1, 'alphasort64@@GLIBC_2.2' => 1, 'alphasort64@GLIBC_2.1' => 1, 'alphasort@@GLIBC_2.0' => 1, 'argp_err_exit_status@@GLIBC_2.1' => '-4', 'argp_error@@GLIBC_2.1' => 1, 'argp_failure@@GLIBC_2.1' => 1, 'argp_help@@GLIBC_2.1' => 1, 'argp_parse@@GLIBC_2.1' => 1, 'argp_program_bug_address@@GLIBC_2.1' => '-4', 'argp_program_version@@GLIBC_2.1' => '-4', 'argp_program_version_hook@@GLIBC_2.1' => '-4', 'argp_state_help@@GLIBC_2.1' => 1, 'argp_usage@@GLIBC_2.1' => 1, 'argz_add@@GLIBC_2.0' => 1, 'argz_add_sep@@GLIBC_2.0' => 1, 'argz_append@@GLIBC_2.0' => 1, 'argz_count@@GLIBC_2.0' => 1, 'argz_create@@GLIBC_2.0' => 1, 'argz_create_sep@@GLIBC_2.0' => 1, 'argz_delete@@GLIBC_2.0' => 1, 'argz_extract@@GLIBC_2.0' => 1, 'argz_insert@@GLIBC_2.0' => 1, 'argz_next@@GLIBC_2.0' => 1, 'argz_replace@@GLIBC_2.0' => 1, 'argz_stringify@@GLIBC_2.0' => 1, 'asctime@@GLIBC_2.0' => 1, 'asctime_r@@GLIBC_2.0' => 1, 'asprintf@@GLIBC_2.0' => 1, 'atexit@GLIBC_2.0' => 1, 'atof@@GLIBC_2.0' => 1, 'atoi@@GLIBC_2.0' => 1, 'atol@@GLIBC_2.0' => 1, 'atoll@@GLIBC_2.0' => 1, 'authdes_create@@GLIBC_2.1' => 1, 'authdes_getucred@@GLIBC_2.1' => 1, 'authdes_pk_create@@GLIBC_2.1' => 1, 'authnone_create@@GLIBC_2.0' => 1, 'authunix_create@@GLIBC_2.0' => 1, 'authunix_create_default@@GLIBC_2.0' => 1, 'backtrace@@GLIBC_2.1' => 1, 'backtrace_symbols@@GLIBC_2.1' => 1, 'backtrace_symbols_fd@@GLIBC_2.1' => 1, 'basename@@GLIBC_2.0' => 1, 'bcmp@@GLIBC_2.0' => 1, 'bcopy@@GLIBC_2.0' => 1, 'bdflush@@GLIBC_2.0' => 1, 'bind@@GLIBC_2.0' => 1, 'bind_textdomain_codeset@@GLIBC_2.2' => 1, 'bindresvport@@GLIBC_2.0' => 1, 'bindtextdomain@@GLIBC_2.0' => 1, 'brk@@GLIBC_2.0' => 1, 'bsd_signal@@GLIBC_2.0' => 1, 'bsearch@@GLIBC_2.0' => 1, 'btowc@@GLIBC_2.0' => 1, 'bzero@@GLIBC_2.0' => 1, 'c16rtomb@@GLIBC_2.16' => 1, 'c32rtomb@@GLIBC_2.16' => 1, 'calloc@@GLIBC_2.0' => 1, 'callrpc@@GLIBC_2.0' => 1, 'canonicalize_file_name@@GLIBC_2.0' => 1, 'capget@@GLIBC_2.1' => 1, 'capset@@GLIBC_2.1' => 1, 'catclose@@GLIBC_2.0' => 1, 'catgets@@GLIBC_2.0' => 1, 'catopen@@GLIBC_2.0' => 1, 'cbc_crypt@@GLIBC_2.1' => 1, 'cfgetispeed@@GLIBC_2.0' => 1, 'cfgetospeed@@GLIBC_2.0' => 1, 'cfmakeraw@@GLIBC_2.0' => 1, 'cfree@@GLIBC_2.0' => 1, 'cfsetispeed@@GLIBC_2.0' => 1, 'cfsetospeed@@GLIBC_2.0' => 1, 'cfsetspeed@@GLIBC_2.0' => 1, 'chdir@@GLIBC_2.0' => 1, 'chflags@@GLIBC_2.0' => 1, 'chmod@@GLIBC_2.0' => 1, 'chown@@GLIBC_2.1' => 1, 'chown@GLIBC_2.0' => 1, 'chroot@@GLIBC_2.0' => 1, 'clearenv@@GLIBC_2.0' => 1, 'clearerr@@GLIBC_2.0' => 1, 'clearerr_unlocked@@GLIBC_2.0' => 1, 'clnt_broadcast@@GLIBC_2.0' => 1, 'clnt_create@@GLIBC_2.0' => 1, 'clnt_pcreateerror@@GLIBC_2.0' => 1, 'clnt_perrno@@GLIBC_2.0' => 1, 'clnt_perror@@GLIBC_2.0' => 1, 'clnt_spcreateerror@@GLIBC_2.0' => 1, 'clnt_sperrno@@GLIBC_2.0' => 1, 'clnt_sperror@@GLIBC_2.0' => 1, 'clntraw_create@@GLIBC_2.0' => 1, 'clnttcp_create@@GLIBC_2.0' => 1, 'clntudp_bufcreate@@GLIBC_2.0' => 1, 'clntudp_create@@GLIBC_2.0' => 1, 'clntunix_create@@GLIBC_2.1' => 1, 'clock@@GLIBC_2.0' => 1, 'clock_adjtime@@GLIBC_2.14' => 1, 'clock_getcpuclockid@@GLIBC_2.17' => 1, 'clock_getres@@GLIBC_2.17' => 1, 'clock_gettime@@GLIBC_2.17' => 1, 'clock_nanosleep@@GLIBC_2.17' => 1, 'clock_settime@@GLIBC_2.17' => 1, 'clone@@GLIBC_2.0' => 1, 'close@@GLIBC_2.0' => 1, 'closedir@@GLIBC_2.0' => 1, 'closelog@@GLIBC_2.0' => 1, 'confstr@@GLIBC_2.0' => 1, 'connect@@GLIBC_2.0' => 1, 'copysign@@GLIBC_2.0' => 1, 'copysignf@@GLIBC_2.0' => 1, 'copysignl@@GLIBC_2.0' => 1, 'creat64@@GLIBC_2.1' => 1, 'creat@@GLIBC_2.0' => 1, 'create_module@@GLIBC_2.0' => 1, 'ctermid@@GLIBC_2.0' => 1, 'ctime@@GLIBC_2.0' => 1, 'ctime_r@@GLIBC_2.0' => 1, 'cuserid@@GLIBC_2.0' => 1, 'daemon@@GLIBC_2.0' => 1, 'daylight@@GLIBC_2.0' => '-4', 'dcgettext@@GLIBC_2.0' => 1, 'dcngettext@@GLIBC_2.2' => 1, 'delete_module@@GLIBC_2.0' => 1, 'des_setparity@@GLIBC_2.1' => 1, 'dgettext@@GLIBC_2.0' => 1, 'difftime@@GLIBC_2.0' => 1, 'dirfd@@GLIBC_2.0' => 1, 'dirname@@GLIBC_2.0' => 1, 'div@@GLIBC_2.0' => 1, 'dl_iterate_phdr@@GLIBC_2.2.4' => 1, 'dngettext@@GLIBC_2.2' => 1, 'dprintf@@GLIBC_2.0' => 1, 'drand48@@GLIBC_2.0' => 1, 'drand48_r@@GLIBC_2.0' => 1, 'dup2@@GLIBC_2.0' => 1, 'dup3@@GLIBC_2.9' => 1, 'dup@@GLIBC_2.0' => 1, 'duplocale@@GLIBC_2.3' => 1, 'dysize@@GLIBC_2.0' => 1, 'eaccess@@GLIBC_2.4' => 1, 'ecb_crypt@@GLIBC_2.1' => 1, 'ecvt@@GLIBC_2.0' => 1, 'ecvt_r@@GLIBC_2.0' => 1, 'endaliasent@@GLIBC_2.0' => 1, 'endfsent@@GLIBC_2.0' => 1, 'endgrent@@GLIBC_2.0' => 1, 'endhostent@@GLIBC_2.0' => 1, 'endmntent@@GLIBC_2.0' => 1, 'endnetent@@GLIBC_2.0' => 1, 'endnetgrent@@GLIBC_2.0' => 1, 'endprotoent@@GLIBC_2.0' => 1, 'endpwent@@GLIBC_2.0' => 1, 'endrpcent@@GLIBC_2.0' => 1, 'endservent@@GLIBC_2.0' => 1, 'endsgent@@GLIBC_2.10' => 1, 'endspent@@GLIBC_2.0' => 1, 'endttyent@@GLIBC_2.0' => 1, 'endusershell@@GLIBC_2.0' => 1, 'endutent@@GLIBC_2.0' => 1, 'endutxent@@GLIBC_2.1' => 1, 'environ@@GLIBC_2.0' => '-4', 'envz_add@@GLIBC_2.0' => 1, 'envz_entry@@GLIBC_2.0' => 1, 'envz_get@@GLIBC_2.0' => 1, 'envz_merge@@GLIBC_2.0' => 1, 'envz_remove@@GLIBC_2.0' => 1, 'envz_strip@@GLIBC_2.0' => 1, 'epoll_create1@@GLIBC_2.9' => 1, 'epoll_create@@GLIBC_2.3.2' => 1, 'epoll_ctl@@GLIBC_2.3.2' => 1, 'epoll_pwait@@GLIBC_2.6' => 1, 'epoll_wait@@GLIBC_2.3.2' => 1, 'erand48@@GLIBC_2.0' => 1, 'erand48_r@@GLIBC_2.0' => 1, 'err@@GLIBC_2.0' => 1, 'error@@GLIBC_2.0' => 1, 'error_at_line@@GLIBC_2.0' => 1, 'error_message_count@@GLIBC_2.0' => '-4', 'error_one_per_line@@GLIBC_2.0' => '-4', 'error_print_progname@@GLIBC_2.0' => '-4', 'errx@@GLIBC_2.0' => 1, 'ether_aton@@GLIBC_2.0' => 1, 'ether_aton_r@@GLIBC_2.0' => 1, 'ether_hostton@@GLIBC_2.0' => 1, 'ether_line@@GLIBC_2.0' => 1, 'ether_ntoa@@GLIBC_2.0' => 1, 'ether_ntoa_r@@GLIBC_2.0' => 1, 'ether_ntohost@@GLIBC_2.0' => 1, 'euidaccess@@GLIBC_2.0' => 1, 'eventfd@@GLIBC_2.7' => 1, 'eventfd_read@@GLIBC_2.7' => 1, 'eventfd_write@@GLIBC_2.7' => 1, 'execl@@GLIBC_2.0' => 1, 'execle@@GLIBC_2.0' => 1, 'execlp@@GLIBC_2.0' => 1, 'execv@@GLIBC_2.0' => 1, 'execve@@GLIBC_2.0' => 1, 'execvp@@GLIBC_2.0' => 1, 'execvpe@@GLIBC_2.11' => 1, 'exit@@GLIBC_2.0' => 1, 'faccessat@@GLIBC_2.4' => 1, 'fallocate64@@GLIBC_2.11' => 1, 'fallocate@@GLIBC_2.10' => 1, 'fanotify_init@@GLIBC_2.13' => 1, 'fanotify_mark@@GLIBC_2.13' => 1, 'fattach@@GLIBC_2.1' => 1, 'fchdir@@GLIBC_2.0' => 1, 'fchflags@@GLIBC_2.0' => 1, 'fchmod@@GLIBC_2.0' => 1, 'fchmodat@@GLIBC_2.4' => 1, 'fchown@@GLIBC_2.0' => 1, 'fchownat@@GLIBC_2.4' => 1, 'fclose@@GLIBC_2.1' => 1, 'fclose@GLIBC_2.0' => 1, 'fcloseall@@GLIBC_2.0' => 1, 'fcntl@@GLIBC_2.0' => 1, 'fcvt@@GLIBC_2.0' => 1, 'fcvt_r@@GLIBC_2.0' => 1, 'fdatasync@@GLIBC_2.0' => 1, 'fdetach@@GLIBC_2.1' => 1, 'fdopen@@GLIBC_2.1' => 1, 'fdopen@GLIBC_2.0' => 1, 'fdopendir@@GLIBC_2.4' => 1, 'feof@@GLIBC_2.0' => 1, 'feof_unlocked@@GLIBC_2.0' => 1, 'ferror@@GLIBC_2.0' => 1, 'ferror_unlocked@@GLIBC_2.0' => 1, 'fexecve@@GLIBC_2.0' => 1, 'fflush@@GLIBC_2.0' => 1, 'fflush_unlocked@@GLIBC_2.0' => 1, 'ffs@@GLIBC_2.0' => 1, 'ffsl@@GLIBC_2.1' => 1, 'ffsll@@GLIBC_2.1' => 1, 'fgetc@@GLIBC_2.0' => 1, 'fgetc_unlocked@@GLIBC_2.1' => 1, 'fgetgrent@@GLIBC_2.0' => 1, 'fgetgrent_r@@GLIBC_2.0' => 1, 'fgetpos64@@GLIBC_2.2' => 1, 'fgetpos64@GLIBC_2.1' => 1, 'fgetpos@@GLIBC_2.2' => 1, 'fgetpos@GLIBC_2.0' => 1, 'fgetpwent@@GLIBC_2.0' => 1, 'fgetpwent_r@@GLIBC_2.0' => 1, 'fgets@@GLIBC_2.0' => 1, 'fgets_unlocked@@GLIBC_2.1' => 1, 'fgetsgent@@GLIBC_2.10' => 1, 'fgetsgent_r@@GLIBC_2.10' => 1, 'fgetspent@@GLIBC_2.0' => 1, 'fgetspent_r@@GLIBC_2.0' => 1, 'fgetwc@@GLIBC_2.2' => 1, 'fgetwc_unlocked@@GLIBC_2.2' => 1, 'fgetws@@GLIBC_2.2' => 1, 'fgetws_unlocked@@GLIBC_2.2' => 1, 'fgetxattr@@GLIBC_2.3' => 1, 'fileno@@GLIBC_2.0' => 1, 'fileno_unlocked@@GLIBC_2.0' => 1, 'finite@@GLIBC_2.0' => 1, 'finitef@@GLIBC_2.0' => 1, 'finitel@@GLIBC_2.0' => 1, 'flistxattr@@GLIBC_2.3' => 1, 'flock@@GLIBC_2.0' => 1, 'flockfile@@GLIBC_2.0' => 1, 'fmemopen@@GLIBC_2.2' => 1, 'fmtmsg@@GLIBC_2.1' => 1, 'fnmatch@@GLIBC_2.2.3' => 1, 'fnmatch@GLIBC_2.0' => 1, 'fopen64@@GLIBC_2.1' => 1, 'fopen@@GLIBC_2.1' => 1, 'fopen@GLIBC_2.0' => 1, 'fopencookie@@GLIBC_2.2' => 1, 'fopencookie@GLIBC_2.0' => 1, 'fork@@GLIBC_2.0' => 1, 'fpathconf@@GLIBC_2.0' => 1, 'fprintf@@GLIBC_2.0' => 1, 'fputc@@GLIBC_2.0' => 1, 'fputc_unlocked@@GLIBC_2.0' => 1, 'fputs@@GLIBC_2.0' => 1, 'fputs_unlocked@@GLIBC_2.1' => 1, 'fputwc@@GLIBC_2.2' => 1, 'fputwc_unlocked@@GLIBC_2.2' => 1, 'fputws@@GLIBC_2.2' => 1, 'fputws_unlocked@@GLIBC_2.2' => 1, 'fread@@GLIBC_2.0' => 1, 'fread_unlocked@@GLIBC_2.1' => 1, 'free@@GLIBC_2.0' => 1, 'freeaddrinfo@@GLIBC_2.0' => 1, 'freeifaddrs@@GLIBC_2.3' => 1, 'freelocale@@GLIBC_2.3' => 1, 'fremovexattr@@GLIBC_2.3' => 1, 'freopen64@@GLIBC_2.1' => 1, 'freopen@@GLIBC_2.0' => 1, 'frexp@@GLIBC_2.0' => 1, 'frexpf@@GLIBC_2.0' => 1, 'frexpl@@GLIBC_2.0' => 1, 'fscanf@@GLIBC_2.0' => 1, 'fseek@@GLIBC_2.0' => 1, 'fseeko64@@GLIBC_2.1' => 1, 'fseeko@@GLIBC_2.1' => 1, 'fsetpos64@@GLIBC_2.2' => 1, 'fsetpos64@GLIBC_2.1' => 1, 'fsetpos@@GLIBC_2.2' => 1, 'fsetpos@GLIBC_2.0' => 1, 'fsetxattr@@GLIBC_2.3' => 1, 'fstatfs64@@GLIBC_2.1' => 1, 'fstatfs@@GLIBC_2.0' => 1, 'fstatvfs64@@GLIBC_2.1' => 1, 'fstatvfs@@GLIBC_2.1' => 1, 'fsync@@GLIBC_2.0' => 1, 'ftell@@GLIBC_2.0' => 1, 'ftello64@@GLIBC_2.1' => 1, 'ftello@@GLIBC_2.1' => 1, 'ftime@@GLIBC_2.0' => 1, 'ftok@@GLIBC_2.0' => 1, 'ftruncate64@@GLIBC_2.1' => 1, 'ftruncate@@GLIBC_2.0' => 1, 'ftrylockfile@@GLIBC_2.0' => 1, 'fts_children@@GLIBC_2.0' => 1, 'fts_close@@GLIBC_2.0' => 1, 'fts_open@@GLIBC_2.0' => 1, 'fts_read@@GLIBC_2.0' => 1, 'fts_set@@GLIBC_2.0' => 1, 'ftw64@@GLIBC_2.1' => 1, 'ftw@@GLIBC_2.0' => 1, 'funlockfile@@GLIBC_2.0' => 1, 'futimens@@GLIBC_2.6' => 1, 'futimes@@GLIBC_2.3' => 1, 'futimesat@@GLIBC_2.4' => 1, 'fwide@@GLIBC_2.2' => 1, 'fwprintf@@GLIBC_2.2' => 1, 'fwrite@@GLIBC_2.0' => 1, 'fwrite_unlocked@@GLIBC_2.1' => 1, 'fwscanf@@GLIBC_2.2' => 1, 'gai_strerror@@GLIBC_2.1' => 1, 'gcvt@@GLIBC_2.0' => 1, 'get_avphys_pages@@GLIBC_2.0' => 1, 'get_current_dir_name@@GLIBC_2.0' => 1, 'get_kernel_syms@@GLIBC_2.0' => 1, 'get_myaddress@@GLIBC_2.0' => 1, 'get_nprocs@@GLIBC_2.0' => 1, 'get_nprocs_conf@@GLIBC_2.0' => 1, 'get_phys_pages@@GLIBC_2.0' => 1, 'getaddrinfo@@GLIBC_2.0' => 1, 'getaliasbyname@@GLIBC_2.0' => 1, 'getaliasbyname_r@@GLIBC_2.1.2' => 1, 'getaliasbyname_r@GLIBC_2.0' => 1, 'getaliasent@@GLIBC_2.0' => 1, 'getaliasent_r@@GLIBC_2.1.2' => 1, 'getaliasent_r@GLIBC_2.0' => 1, 'getauxval@@GLIBC_2.16' => 1, 'getc@@GLIBC_2.0' => 1, 'getc_unlocked@@GLIBC_2.0' => 1, 'getchar@@GLIBC_2.0' => 1, 'getchar_unlocked@@GLIBC_2.0' => 1, 'getcontext@@GLIBC_2.1' => 1, 'getcwd@@GLIBC_2.0' => 1, 'getdate@@GLIBC_2.1' => 1, 'getdate_err@@GLIBC_2.1' => '-4', 'getdate_r@@GLIBC_2.1' => 1, 'getdelim@@GLIBC_2.0' => 1, 'getdirentries64@@GLIBC_2.2' => 1, 'getdirentries@@GLIBC_2.0' => 1, 'getdomainname@@GLIBC_2.0' => 1, 'getdtablesize@@GLIBC_2.0' => 1, 'getegid@@GLIBC_2.0' => 1, 'getenv@@GLIBC_2.0' => 1, 'geteuid@@GLIBC_2.0' => 1, 'getfsent@@GLIBC_2.0' => 1, 'getfsfile@@GLIBC_2.0' => 1, 'getfsspec@@GLIBC_2.0' => 1, 'getgid@@GLIBC_2.0' => 1, 'getgrent@@GLIBC_2.0' => 1, 'getgrent_r@@GLIBC_2.1.2' => 1, 'getgrent_r@GLIBC_2.0' => 1, 'getgrgid@@GLIBC_2.0' => 1, 'getgrgid_r@@GLIBC_2.1.2' => 1, 'getgrgid_r@GLIBC_2.0' => 1, 'getgrnam@@GLIBC_2.0' => 1, 'getgrnam_r@@GLIBC_2.1.2' => 1, 'getgrnam_r@GLIBC_2.0' => 1, 'getgrouplist@@GLIBC_2.2.4' => 1, 'getgroups@@GLIBC_2.0' => 1, 'gethostbyaddr@@GLIBC_2.0' => 1, 'gethostbyaddr_r@@GLIBC_2.1.2' => 1, 'gethostbyaddr_r@GLIBC_2.0' => 1, 'gethostbyname2@@GLIBC_2.0' => 1, 'gethostbyname2_r@@GLIBC_2.1.2' => 1, 'gethostbyname2_r@GLIBC_2.0' => 1, 'gethostbyname@@GLIBC_2.0' => 1, 'gethostbyname_r@@GLIBC_2.1.2' => 1, 'gethostbyname_r@GLIBC_2.0' => 1, 'gethostent@@GLIBC_2.0' => 1, 'gethostent_r@@GLIBC_2.1.2' => 1, 'gethostent_r@GLIBC_2.0' => 1, 'gethostid@@GLIBC_2.0' => 1, 'gethostname@@GLIBC_2.0' => 1, 'getifaddrs@@GLIBC_2.3' => 1, 'getipv4sourcefilter@@GLIBC_2.3.4' => 1, 'getitimer@@GLIBC_2.0' => 1, 'getline@@GLIBC_2.0' => 1, 'getloadavg@@GLIBC_2.2' => 1, 'getlogin@@GLIBC_2.0' => 1, 'getlogin_r@@GLIBC_2.0' => 1, 'getmntent@@GLIBC_2.0' => 1, 'getmntent_r@@GLIBC_2.0' => 1, 'getmsg@@GLIBC_2.1' => 1, 'getnameinfo@@GLIBC_2.1' => 1, 'getnetbyaddr@@GLIBC_2.0' => 1, 'getnetbyaddr_r@@GLIBC_2.1.2' => 1, 'getnetbyaddr_r@GLIBC_2.0' => 1, 'getnetbyname@@GLIBC_2.0' => 1, 'getnetbyname_r@@GLIBC_2.1.2' => 1, 'getnetbyname_r@GLIBC_2.0' => 1, 'getnetent@@GLIBC_2.0' => 1, 'getnetent_r@@GLIBC_2.1.2' => 1, 'getnetent_r@GLIBC_2.0' => 1, 'getnetgrent@@GLIBC_2.0' => 1, 'getnetgrent_r@@GLIBC_2.0' => 1, 'getnetname@@GLIBC_2.1' => 1, 'getopt@@GLIBC_2.0' => 1, 'getopt_long@@GLIBC_2.0' => 1, 'getopt_long_only@@GLIBC_2.0' => 1, 'getpagesize@@GLIBC_2.0' => 1, 'getpass@@GLIBC_2.0' => 1, 'getpeername@@GLIBC_2.0' => 1, 'getpgid@@GLIBC_2.0' => 1, 'getpgrp@@GLIBC_2.0' => 1, 'getpid@@GLIBC_2.0' => 1, 'getpmsg@@GLIBC_2.1' => 1, 'getppid@@GLIBC_2.0' => 1, 'getpriority@@GLIBC_2.0' => 1, 'getprotobyname@@GLIBC_2.0' => 1, 'getprotobyname_r@@GLIBC_2.1.2' => 1, 'getprotobyname_r@GLIBC_2.0' => 1, 'getprotobynumber@@GLIBC_2.0' => 1, 'getprotobynumber_r@@GLIBC_2.1.2' => 1, 'getprotobynumber_r@GLIBC_2.0' => 1, 'getprotoent@@GLIBC_2.0' => 1, 'getprotoent_r@@GLIBC_2.1.2' => 1, 'getprotoent_r@GLIBC_2.0' => 1, 'getpt@@GLIBC_2.1' => 1, 'getpublickey@@GLIBC_2.0' => 1, 'getpw@@GLIBC_2.0' => 1, 'getpwent@@GLIBC_2.0' => 1, 'getpwent_r@@GLIBC_2.1.2' => 1, 'getpwent_r@GLIBC_2.0' => 1, 'getpwnam@@GLIBC_2.0' => 1, 'getpwnam_r@@GLIBC_2.1.2' => 1, 'getpwnam_r@GLIBC_2.0' => 1, 'getpwuid@@GLIBC_2.0' => 1, 'getpwuid_r@@GLIBC_2.1.2' => 1, 'getpwuid_r@GLIBC_2.0' => 1, 'getresgid@@GLIBC_2.0' => 1, 'getresuid@@GLIBC_2.0' => 1, 'getrlimit64@@GLIBC_2.2' => 1, 'getrlimit64@GLIBC_2.1' => 1, 'getrlimit@@GLIBC_2.2' => 1, 'getrlimit@GLIBC_2.0' => 1, 'getrpcbyname@@GLIBC_2.0' => 1, 'getrpcbyname_r@@GLIBC_2.1.2' => 1, 'getrpcbyname_r@GLIBC_2.0' => 1, 'getrpcbynumber@@GLIBC_2.0' => 1, 'getrpcbynumber_r@@GLIBC_2.1.2' => 1, 'getrpcbynumber_r@GLIBC_2.0' => 1, 'getrpcent@@GLIBC_2.0' => 1, 'getrpcent_r@@GLIBC_2.1.2' => 1, 'getrpcent_r@GLIBC_2.0' => 1, 'getrpcport@@GLIBC_2.0' => 1, 'getrusage@@GLIBC_2.0' => 1, 'gets@@GLIBC_2.0' => 1, 'getsecretkey@@GLIBC_2.0' => 1, 'getservbyname@@GLIBC_2.0' => 1, 'getservbyname_r@@GLIBC_2.1.2' => 1, 'getservbyname_r@GLIBC_2.0' => 1, 'getservbyport@@GLIBC_2.0' => 1, 'getservbyport_r@@GLIBC_2.1.2' => 1, 'getservbyport_r@GLIBC_2.0' => 1, 'getservent@@GLIBC_2.0' => 1, 'getservent_r@@GLIBC_2.1.2' => 1, 'getservent_r@GLIBC_2.0' => 1, 'getsgent@@GLIBC_2.10' => 1, 'getsgent_r@@GLIBC_2.10' => 1, 'getsgnam@@GLIBC_2.10' => 1, 'getsgnam_r@@GLIBC_2.10' => 1, 'getsid@@GLIBC_2.0' => 1, 'getsockname@@GLIBC_2.0' => 1, 'getsockopt@@GLIBC_2.0' => 1, 'getsourcefilter@@GLIBC_2.3.4' => 1, 'getspent@@GLIBC_2.0' => 1, 'getspent_r@@GLIBC_2.1.2' => 1, 'getspent_r@GLIBC_2.0' => 1, 'getspnam@@GLIBC_2.0' => 1, 'getspnam_r@@GLIBC_2.1.2' => 1, 'getspnam_r@GLIBC_2.0' => 1, 'getsubopt@@GLIBC_2.0' => 1, 'gettext@@GLIBC_2.0' => 1, 'gettimeofday@@GLIBC_2.0' => 1, 'getttyent@@GLIBC_2.0' => 1, 'getttynam@@GLIBC_2.0' => 1, 'getuid@@GLIBC_2.0' => 1, 'getusershell@@GLIBC_2.0' => 1, 'getutent@@GLIBC_2.0' => 1, 'getutent_r@@GLIBC_2.0' => 1, 'getutid@@GLIBC_2.0' => 1, 'getutid_r@@GLIBC_2.0' => 1, 'getutline@@GLIBC_2.0' => 1, 'getutline_r@@GLIBC_2.0' => 1, 'getutmp@@GLIBC_2.1.1' => 1, 'getutmpx@@GLIBC_2.1.1' => 1, 'getutxent@@GLIBC_2.1' => 1, 'getutxid@@GLIBC_2.1' => 1, 'getutxline@@GLIBC_2.1' => 1, 'getw@@GLIBC_2.0' => 1, 'getwc@@GLIBC_2.2' => 1, 'getwc_unlocked@@GLIBC_2.2' => 1, 'getwchar@@GLIBC_2.2' => 1, 'getwchar_unlocked@@GLIBC_2.2' => 1, 'getwd@@GLIBC_2.0' => 1, 'getxattr@@GLIBC_2.3' => 1, 'glob64@@GLIBC_2.2' => 1, 'glob64@GLIBC_2.1' => 1, 'glob@@GLIBC_2.0' => 1, 'glob_pattern_p@@GLIBC_2.0' => 1, 'globfree64@@GLIBC_2.1' => 1, 'globfree@@GLIBC_2.0' => 1, 'gmtime@@GLIBC_2.0' => 1, 'gmtime_r@@GLIBC_2.0' => 1, 'gnu_dev_major@@GLIBC_2.3.3' => 1, 'gnu_dev_makedev@@GLIBC_2.3.3' => 1, 'gnu_dev_minor@@GLIBC_2.3.3' => 1, 'gnu_get_libc_release@@GLIBC_2.1' => 1, 'gnu_get_libc_version@@GLIBC_2.1' => 1, 'grantpt@@GLIBC_2.1' => 1, 'group_member@@GLIBC_2.0' => 1, 'gsignal@@GLIBC_2.0' => 1, 'gtty@@GLIBC_2.0' => 1, 'h_errlist@@GLIBC_2.0' => '-20', 'h_nerr@@GLIBC_2.0' => '-4', 'hasmntopt@@GLIBC_2.0' => 1, 'hcreate@@GLIBC_2.0' => 1, 'hcreate_r@@GLIBC_2.0' => 1, 'hdestroy@@GLIBC_2.0' => 1, 'hdestroy_r@@GLIBC_2.0' => 1, 'herror@@GLIBC_2.0' => 1, 'host2netname@@GLIBC_2.1' => 1, 'hsearch@@GLIBC_2.0' => 1, 'hsearch_r@@GLIBC_2.0' => 1, 'hstrerror@@GLIBC_2.0' => 1, 'htonl@@GLIBC_2.0' => 1, 'htons@@GLIBC_2.0' => 1, 'iconv@@GLIBC_2.1' => 1, 'iconv_close@@GLIBC_2.1' => 1, 'iconv_open@@GLIBC_2.1' => 1, 'if_freenameindex@@GLIBC_2.1' => 1, 'if_indextoname@@GLIBC_2.1' => 1, 'if_nameindex@@GLIBC_2.1' => 1, 'if_nametoindex@@GLIBC_2.1' => 1, 'imaxabs@@GLIBC_2.1.1' => 1, 'imaxdiv@@GLIBC_2.1.1' => 1, 'in6addr_any@@GLIBC_2.1' => '-16', 'in6addr_loopback@@GLIBC_2.1' => '-16', 'index@@GLIBC_2.0' => 1, 'inet6_opt_append@@GLIBC_2.5' => 1, 'inet6_opt_find@@GLIBC_2.5' => 1, 'inet6_opt_finish@@GLIBC_2.5' => 1, 'inet6_opt_get_val@@GLIBC_2.5' => 1, 'inet6_opt_init@@GLIBC_2.5' => 1, 'inet6_opt_next@@GLIBC_2.5' => 1, 'inet6_opt_set_val@@GLIBC_2.5' => 1, 'inet6_option_alloc@@GLIBC_2.3.3' => 1, 'inet6_option_append@@GLIBC_2.3.3' => 1, 'inet6_option_find@@GLIBC_2.3.3' => 1, 'inet6_option_init@@GLIBC_2.3.3' => 1, 'inet6_option_next@@GLIBC_2.3.3' => 1, 'inet6_option_space@@GLIBC_2.3.3' => 1, 'inet6_rth_add@@GLIBC_2.5' => 1, 'inet6_rth_getaddr@@GLIBC_2.5' => 1, 'inet6_rth_init@@GLIBC_2.5' => 1, 'inet6_rth_reverse@@GLIBC_2.5' => 1, 'inet6_rth_segments@@GLIBC_2.5' => 1, 'inet6_rth_space@@GLIBC_2.5' => 1, 'inet_addr@@GLIBC_2.0' => 1, 'inet_aton@@GLIBC_2.0' => 1, 'inet_lnaof@@GLIBC_2.0' => 1, 'inet_makeaddr@@GLIBC_2.0' => 1, 'inet_netof@@GLIBC_2.0' => 1, 'inet_network@@GLIBC_2.0' => 1, 'inet_nsap_addr@@GLIBC_2.0' => 1, 'inet_nsap_ntoa@@GLIBC_2.0' => 1, 'inet_ntoa@@GLIBC_2.0' => 1, 'inet_ntop@@GLIBC_2.0' => 1, 'inet_pton@@GLIBC_2.0' => 1, 'init_module@@GLIBC_2.0' => 1, 'initgroups@@GLIBC_2.0' => 1, 'initstate@@GLIBC_2.0' => 1, 'initstate_r@@GLIBC_2.0' => 1, 'innetgr@@GLIBC_2.0' => 1, 'inotify_add_watch@@GLIBC_2.4' => 1, 'inotify_init1@@GLIBC_2.9' => 1, 'inotify_init@@GLIBC_2.4' => 1, 'inotify_rm_watch@@GLIBC_2.4' => 1, 'insque@@GLIBC_2.0' => 1, 'ioctl@@GLIBC_2.0' => 1, 'ioperm@@GLIBC_2.0' => 1, 'iopl@@GLIBC_2.0' => 1, 'iruserok@@GLIBC_2.0' => 1, 'iruserok_af@@GLIBC_2.2' => 1, 'isalnum@@GLIBC_2.0' => 1, 'isalnum_l@@GLIBC_2.3' => 1, 'isalpha@@GLIBC_2.0' => 1, 'isalpha_l@@GLIBC_2.3' => 1, 'isascii@@GLIBC_2.0' => 1, 'isastream@@GLIBC_2.1' => 1, 'isatty@@GLIBC_2.0' => 1, 'isblank@@GLIBC_2.0' => 1, 'isblank_l@@GLIBC_2.3' => 1, 'iscntrl@@GLIBC_2.0' => 1, 'iscntrl_l@@GLIBC_2.3' => 1, 'isctype@@GLIBC_2.3' => 1, 'isdigit@@GLIBC_2.0' => 1, 'isdigit_l@@GLIBC_2.3' => 1, 'isfdtype@@GLIBC_2.0' => 1, 'isgraph@@GLIBC_2.0' => 1, 'isgraph_l@@GLIBC_2.3' => 1, 'isinf@@GLIBC_2.0' => 1, 'isinff@@GLIBC_2.0' => 1, 'isinfl@@GLIBC_2.0' => 1, 'islower@@GLIBC_2.0' => 1, 'islower_l@@GLIBC_2.3' => 1, 'isnan@@GLIBC_2.0' => 1, 'isnanf@@GLIBC_2.0' => 1, 'isnanl@@GLIBC_2.0' => 1, 'isprint@@GLIBC_2.0' => 1, 'isprint_l@@GLIBC_2.3' => 1, 'ispunct@@GLIBC_2.0' => 1, 'ispunct_l@@GLIBC_2.3' => 1, 'isspace@@GLIBC_2.0' => 1, 'isspace_l@@GLIBC_2.3' => 1, 'isupper@@GLIBC_2.0' => 1, 'isupper_l@@GLIBC_2.3' => 1, 'iswalnum@@GLIBC_2.0' => 1, 'iswalnum_l@@GLIBC_2.3' => 1, 'iswalpha@@GLIBC_2.0' => 1, 'iswalpha_l@@GLIBC_2.3' => 1, 'iswblank@@GLIBC_2.1' => 1, 'iswblank_l@@GLIBC_2.3' => 1, 'iswcntrl@@GLIBC_2.0' => 1, 'iswcntrl_l@@GLIBC_2.3' => 1, 'iswctype@@GLIBC_2.0' => 1, 'iswctype_l@@GLIBC_2.3' => 1, 'iswdigit@@GLIBC_2.0' => 1, 'iswdigit_l@@GLIBC_2.3' => 1, 'iswgraph@@GLIBC_2.0' => 1, 'iswgraph_l@@GLIBC_2.3' => 1, 'iswlower@@GLIBC_2.0' => 1, 'iswlower_l@@GLIBC_2.3' => 1, 'iswprint@@GLIBC_2.0' => 1, 'iswprint_l@@GLIBC_2.3' => 1, 'iswpunct@@GLIBC_2.0' => 1, 'iswpunct_l@@GLIBC_2.3' => 1, 'iswspace@@GLIBC_2.0' => 1, 'iswspace_l@@GLIBC_2.3' => 1, 'iswupper@@GLIBC_2.0' => 1, 'iswupper_l@@GLIBC_2.3' => 1, 'iswxdigit@@GLIBC_2.0' => 1, 'iswxdigit_l@@GLIBC_2.3' => 1, 'isxdigit@@GLIBC_2.0' => 1, 'isxdigit_l@@GLIBC_2.3' => 1, 'jrand48@@GLIBC_2.0' => 1, 'jrand48_r@@GLIBC_2.0' => 1, 'key_decryptsession@@GLIBC_2.1' => 1, 'key_decryptsession_pk@@GLIBC_2.1' => 1, 'key_encryptsession@@GLIBC_2.1' => 1, 'key_encryptsession_pk@@GLIBC_2.1' => 1, 'key_gendes@@GLIBC_2.1' => 1, 'key_get_conv@@GLIBC_2.1' => 1, 'key_secretkey_is_set@@GLIBC_2.1' => 1, 'key_setnet@@GLIBC_2.1' => 1, 'key_setsecret@@GLIBC_2.1' => 1, 'kill@@GLIBC_2.0' => 1, 'killpg@@GLIBC_2.0' => 1, 'klogctl@@GLIBC_2.0' => 1, 'l64a@@GLIBC_2.0' => 1, 'labs@@GLIBC_2.0' => 1, 'lchmod@@GLIBC_2.3.2' => 1, 'lchown@@GLIBC_2.0' => 1, 'lckpwdf@@GLIBC_2.0' => 1, 'lcong48@@GLIBC_2.0' => 1, 'lcong48_r@@GLIBC_2.0' => 1, 'ldexp@@GLIBC_2.0' => 1, 'ldexpf@@GLIBC_2.0' => 1, 'ldexpl@@GLIBC_2.0' => 1, 'ldiv@@GLIBC_2.0' => 1, 'lfind@@GLIBC_2.0' => 1, 'lgetxattr@@GLIBC_2.3' => 1, 'link@@GLIBC_2.0' => 1, 'linkat@@GLIBC_2.4' => 1, 'listen@@GLIBC_2.0' => 1, 'listxattr@@GLIBC_2.3' => 1, 'llabs@@GLIBC_2.0' => 1, 'lldiv@@GLIBC_2.0' => 1, 'llistxattr@@GLIBC_2.3' => 1, 'llseek@@GLIBC_2.0' => 1, 'loc1@@GLIBC_2.0' => '-4', 'loc2@@GLIBC_2.0' => '-4', 'localeconv@@GLIBC_2.2' => 1, 'localeconv@GLIBC_2.0' => 1, 'localtime@@GLIBC_2.0' => 1, 'localtime_r@@GLIBC_2.0' => 1, 'lockf64@@GLIBC_2.1' => 1, 'lockf@@GLIBC_2.0' => 1, 'locs@@GLIBC_2.0' => '-4', 'longjmp@@GLIBC_2.0' => 1, 'lrand48@@GLIBC_2.0' => 1, 'lrand48_r@@GLIBC_2.0' => 1, 'lremovexattr@@GLIBC_2.3' => 1, 'lsearch@@GLIBC_2.0' => 1, 'lseek64@@GLIBC_2.1' => 1, 'lseek@@GLIBC_2.0' => 1, 'lsetxattr@@GLIBC_2.3' => 1, 'lutimes@@GLIBC_2.3' => 1, 'madvise@@GLIBC_2.0' => 1, 'makecontext@@GLIBC_2.1' => 1, 'mallinfo@@GLIBC_2.0' => 1, 'malloc@@GLIBC_2.0' => 1, 'malloc_get_state@@GLIBC_2.0' => 1, 'malloc_info@@GLIBC_2.10' => 1, 'malloc_set_state@@GLIBC_2.0' => 1, 'malloc_stats@@GLIBC_2.0' => 1, 'malloc_trim@@GLIBC_2.0' => 1, 'malloc_usable_size@@GLIBC_2.0' => 1, 'mallopt@@GLIBC_2.0' => 1, 'mallwatch@@GLIBC_2.0' => '-4', 'mblen@@GLIBC_2.0' => 1, 'mbrlen@@GLIBC_2.0' => 1, 'mbrtoc16@@GLIBC_2.16' => 1, 'mbrtoc32@@GLIBC_2.16' => 1, 'mbrtowc@@GLIBC_2.0' => 1, 'mbsinit@@GLIBC_2.0' => 1, 'mbsnrtowcs@@GLIBC_2.0' => 1, 'mbsrtowcs@@GLIBC_2.0' => 1, 'mbstowcs@@GLIBC_2.0' => 1, 'mbtowc@@GLIBC_2.0' => 1, 'mcheck@@GLIBC_2.0' => 1, 'mcheck_check_all@@GLIBC_2.2' => 1, 'mcheck_pedantic@@GLIBC_2.2' => 1, 'mcount@@GLIBC_2.0' => 1, 'memalign@@GLIBC_2.0' => 1, 'memccpy@@GLIBC_2.0' => 1, 'memchr@@GLIBC_2.0' => 1, 'memcmp@@GLIBC_2.0' => 1, 'memcpy@@GLIBC_2.0' => 1, 'memfrob@@GLIBC_2.0' => 1, 'memmem@@GLIBC_2.0' => 1, 'memmove@@GLIBC_2.0' => 1, 'mempcpy@@GLIBC_2.1' => 1, 'memrchr@@GLIBC_2.2' => 1, 'memset@@GLIBC_2.0' => 1, 'mincore@@GLIBC_2.2' => 1, 'mkdir@@GLIBC_2.0' => 1, 'mkdirat@@GLIBC_2.4' => 1, 'mkdtemp@@GLIBC_2.2' => 1, 'mkfifo@@GLIBC_2.0' => 1, 'mkfifoat@@GLIBC_2.4' => 1, 'mkostemp64@@GLIBC_2.7' => 1, 'mkostemp@@GLIBC_2.7' => 1, 'mkostemps64@@GLIBC_2.11' => 1, 'mkostemps@@GLIBC_2.11' => 1, 'mkstemp64@@GLIBC_2.2' => 1, 'mkstemp@@GLIBC_2.0' => 1, 'mkstemps64@@GLIBC_2.11' => 1, 'mkstemps@@GLIBC_2.11' => 1, 'mktemp@@GLIBC_2.0' => 1, 'mktime@@GLIBC_2.0' => 1, 'mlock@@GLIBC_2.0' => 1, 'mlockall@@GLIBC_2.0' => 1, 'mmap64@@GLIBC_2.1' => 1, 'mmap@@GLIBC_2.0' => 1, 'modf@@GLIBC_2.0' => 1, 'modff@@GLIBC_2.0' => 1, 'modfl@@GLIBC_2.0' => 1, 'modify_ldt@@GLIBC_2.1' => 1, 'moncontrol@@GLIBC_2.2' => 1, 'monstartup@@GLIBC_2.0' => 1, 'mount@@GLIBC_2.0' => 1, 'mprobe@@GLIBC_2.0' => 1, 'mprotect@@GLIBC_2.0' => 1, 'mrand48@@GLIBC_2.0' => 1, 'mrand48_r@@GLIBC_2.0' => 1, 'mremap@@GLIBC_2.0' => 1, 'msgctl@@GLIBC_2.2' => 1, 'msgctl@GLIBC_2.0' => 1, 'msgget@@GLIBC_2.0' => 1, 'msgrcv@@GLIBC_2.0' => 1, 'msgsnd@@GLIBC_2.0' => 1, 'msync@@GLIBC_2.0' => 1, 'mtrace@@GLIBC_2.0' => 1, 'munlock@@GLIBC_2.0' => 1, 'munlockall@@GLIBC_2.0' => 1, 'munmap@@GLIBC_2.0' => 1, 'muntrace@@GLIBC_2.0' => 1, 'name_to_handle_at@@GLIBC_2.14' => 1, 'nanosleep@@GLIBC_2.0' => 1, 'netname2host@@GLIBC_2.1' => 1, 'netname2user@@GLIBC_2.1' => 1, 'newlocale@@GLIBC_2.3' => 1, 'nfsservctl@@GLIBC_2.0' => 1, 'nftw64@@GLIBC_2.3.3' => 1, 'nftw64@GLIBC_2.1' => 1, 'nftw@@GLIBC_2.3.3' => 1, 'nftw@GLIBC_2.1' => 1, 'ngettext@@GLIBC_2.2' => 1, 'nice@@GLIBC_2.0' => 1, 'nl_langinfo@@GLIBC_2.0' => 1, 'nl_langinfo_l@@GLIBC_2.3' => 1, 'nrand48@@GLIBC_2.0' => 1, 'nrand48_r@@GLIBC_2.0' => 1, 'ntohl@@GLIBC_2.0' => 1, 'ntohs@@GLIBC_2.0' => 1, 'ntp_adjtime@@GLIBC_2.1' => 1, 'ntp_gettime@@GLIBC_2.1' => 1, 'ntp_gettimex@@GLIBC_2.12' => 1, 'obstack_alloc_failed_handler@@GLIBC_2.0' => '-4', 'obstack_exit_failure@@GLIBC_2.0' => '-4', 'obstack_free@@GLIBC_2.0' => 1, 'obstack_printf@@GLIBC_2.0' => 1, 'obstack_vprintf@@GLIBC_2.0' => 1, 'on_exit@@GLIBC_2.0' => 1, 'open64@@GLIBC_2.1' => 1, 'open@@GLIBC_2.0' => 1, 'open_by_handle_at@@GLIBC_2.14' => 1, 'open_memstream@@GLIBC_2.0' => 1, 'open_wmemstream@@GLIBC_2.4' => 1, 'openat64@@GLIBC_2.4' => 1, 'openat@@GLIBC_2.4' => 1, 'opendir@@GLIBC_2.0' => 1, 'openlog@@GLIBC_2.0' => 1, 'optarg@@GLIBC_2.0' => '-4', 'opterr@@GLIBC_2.0' => '-4', 'optind@@GLIBC_2.0' => '-4', 'optopt@@GLIBC_2.0' => '-4', 'parse_printf_format@@GLIBC_2.0' => 1, 'passwd2des@@GLIBC_2.1' => 1, 'pathconf@@GLIBC_2.0' => 1, 'pause@@GLIBC_2.0' => 1, 'pclose@@GLIBC_2.1' => 1, 'pclose@GLIBC_2.0' => 1, 'perror@@GLIBC_2.0' => 1, 'personality@@GLIBC_2.0' => 1, 'pipe2@@GLIBC_2.9' => 1, 'pipe@@GLIBC_2.0' => 1, 'pivot_root@@GLIBC_2.2.1' => 1, 'pmap_getmaps@@GLIBC_2.0' => 1, 'pmap_getport@@GLIBC_2.0' => 1, 'pmap_rmtcall@@GLIBC_2.0' => 1, 'pmap_set@@GLIBC_2.0' => 1, 'pmap_unset@@GLIBC_2.0' => 1, 'poll@@GLIBC_2.0' => 1, 'popen@@GLIBC_2.1' => 1, 'popen@GLIBC_2.0' => 1, 'posix_fadvise64@@GLIBC_2.3.3' => 1, 'posix_fadvise64@GLIBC_2.2' => 1, 'posix_fadvise@@GLIBC_2.2' => 1, 'posix_fallocate64@@GLIBC_2.3.3' => 1, 'posix_fallocate64@GLIBC_2.2' => 1, 'posix_fallocate@@GLIBC_2.2' => 1, 'posix_madvise@@GLIBC_2.2' => 1, 'posix_memalign@@GLIBC_2.2' => 1, 'posix_openpt@@GLIBC_2.2.1' => 1, 'posix_spawn@@GLIBC_2.15' => 1, 'posix_spawn@GLIBC_2.2' => 1, 'posix_spawn_file_actions_addclose@@GLIBC_2.2' => 1, 'posix_spawn_file_actions_adddup2@@GLIBC_2.2' => 1, 'posix_spawn_file_actions_addopen@@GLIBC_2.2' => 1, 'posix_spawn_file_actions_destroy@@GLIBC_2.2' => 1, 'posix_spawn_file_actions_init@@GLIBC_2.2' => 1, 'posix_spawnattr_destroy@@GLIBC_2.2' => 1, 'posix_spawnattr_getflags@@GLIBC_2.2' => 1, 'posix_spawnattr_getpgroup@@GLIBC_2.2' => 1, 'posix_spawnattr_getschedparam@@GLIBC_2.2' => 1, 'posix_spawnattr_getschedpolicy@@GLIBC_2.2' => 1, 'posix_spawnattr_getsigdefault@@GLIBC_2.2' => 1, 'posix_spawnattr_getsigmask@@GLIBC_2.2' => 1, 'posix_spawnattr_init@@GLIBC_2.2' => 1, 'posix_spawnattr_setflags@@GLIBC_2.2' => 1, 'posix_spawnattr_setpgroup@@GLIBC_2.2' => 1, 'posix_spawnattr_setschedparam@@GLIBC_2.2' => 1, 'posix_spawnattr_setschedpolicy@@GLIBC_2.2' => 1, 'posix_spawnattr_setsigdefault@@GLIBC_2.2' => 1, 'posix_spawnattr_setsigmask@@GLIBC_2.2' => 1, 'posix_spawnp@@GLIBC_2.15' => 1, 'posix_spawnp@GLIBC_2.2' => 1, 'ppoll@@GLIBC_2.4' => 1, 'prctl@@GLIBC_2.0' => 1, 'pread64@@GLIBC_2.1' => 1, 'pread@@GLIBC_2.1' => 1, 'preadv64@@GLIBC_2.10' => 1, 'preadv@@GLIBC_2.10' => 1, 'printf@@GLIBC_2.0' => 1, 'printf_size@@GLIBC_2.1' => 1, 'printf_size_info@@GLIBC_2.1' => 1, 'prlimit64@@GLIBC_2.13' => 1, 'prlimit@@GLIBC_2.13' => 1, 'process_vm_readv@@GLIBC_2.15' => 1, 'process_vm_writev@@GLIBC_2.15' => 1, 'profil@@GLIBC_2.0' => 1, 'program_invocation_name@@GLIBC_2.0' => '-4', 'program_invocation_short_name@@GLIBC_2.0' => '-4', 'pselect@@GLIBC_2.0' => 1, 'psiginfo@@GLIBC_2.10' => 1, 'psignal@@GLIBC_2.0' => 1, 'pthread_attr_destroy@@GLIBC_2.0' => 1, 'pthread_attr_getdetachstate@@GLIBC_2.0' => 1, 'pthread_attr_getinheritsched@@GLIBC_2.0' => 1, 'pthread_attr_getschedparam@@GLIBC_2.0' => 1, 'pthread_attr_getschedpolicy@@GLIBC_2.0' => 1, 'pthread_attr_getscope@@GLIBC_2.0' => 1, 'pthread_attr_init@@GLIBC_2.1' => 1, 'pthread_attr_init@GLIBC_2.0' => 1, 'pthread_attr_setdetachstate@@GLIBC_2.0' => 1, 'pthread_attr_setinheritsched@@GLIBC_2.0' => 1, 'pthread_attr_setschedparam@@GLIBC_2.0' => 1, 'pthread_attr_setschedpolicy@@GLIBC_2.0' => 1, 'pthread_attr_setscope@@GLIBC_2.0' => 1, 'pthread_cond_broadcast@@GLIBC_2.3.2' => 1, 'pthread_cond_broadcast@GLIBC_2.0' => 1, 'pthread_cond_destroy@@GLIBC_2.3.2' => 1, 'pthread_cond_destroy@GLIBC_2.0' => 1, 'pthread_cond_init@@GLIBC_2.3.2' => 1, 'pthread_cond_init@GLIBC_2.0' => 1, 'pthread_cond_signal@@GLIBC_2.3.2' => 1, 'pthread_cond_signal@GLIBC_2.0' => 1, 'pthread_cond_timedwait@@GLIBC_2.3.2' => 1, 'pthread_cond_timedwait@GLIBC_2.0' => 1, 'pthread_cond_wait@@GLIBC_2.3.2' => 1, 'pthread_cond_wait@GLIBC_2.0' => 1, 'pthread_condattr_destroy@@GLIBC_2.0' => 1, 'pthread_condattr_init@@GLIBC_2.0' => 1, 'pthread_equal@@GLIBC_2.0' => 1, 'pthread_exit@@GLIBC_2.0' => 1, 'pthread_getschedparam@@GLIBC_2.0' => 1, 'pthread_mutex_destroy@@GLIBC_2.0' => 1, 'pthread_mutex_init@@GLIBC_2.0' => 1, 'pthread_mutex_lock@@GLIBC_2.0' => 1, 'pthread_mutex_unlock@@GLIBC_2.0' => 1, 'pthread_self@@GLIBC_2.0' => 1, 'pthread_setcancelstate@@GLIBC_2.0' => 1, 'pthread_setcanceltype@@GLIBC_2.0' => 1, 'pthread_setschedparam@@GLIBC_2.0' => 1, 'ptrace@@GLIBC_2.0' => 1, 'ptsname@@GLIBC_2.1' => 1, 'ptsname_r@@GLIBC_2.1' => 1, 'putc@@GLIBC_2.0' => 1, 'putc_unlocked@@GLIBC_2.0' => 1, 'putchar@@GLIBC_2.0' => 1, 'putchar_unlocked@@GLIBC_2.0' => 1, 'putenv@@GLIBC_2.0' => 1, 'putgrent@@GLIBC_2.1' => 1, 'putmsg@@GLIBC_2.1' => 1, 'putpmsg@@GLIBC_2.1' => 1, 'putpwent@@GLIBC_2.0' => 1, 'puts@@GLIBC_2.0' => 1, 'putsgent@@GLIBC_2.10' => 1, 'putspent@@GLIBC_2.0' => 1, 'pututline@@GLIBC_2.0' => 1, 'pututxline@@GLIBC_2.1' => 1, 'putw@@GLIBC_2.0' => 1, 'putwc@@GLIBC_2.2' => 1, 'putwc_unlocked@@GLIBC_2.2' => 1, 'putwchar@@GLIBC_2.2' => 1, 'putwchar_unlocked@@GLIBC_2.2' => 1, 'pvalloc@@GLIBC_2.0' => 1, 'pwrite64@@GLIBC_2.1' => 1, 'pwrite@@GLIBC_2.1' => 1, 'pwritev64@@GLIBC_2.10' => 1, 'pwritev@@GLIBC_2.10' => 1, 'qecvt@@GLIBC_2.0' => 1, 'qecvt_r@@GLIBC_2.0' => 1, 'qfcvt@@GLIBC_2.0' => 1, 'qfcvt_r@@GLIBC_2.0' => 1, 'qgcvt@@GLIBC_2.0' => 1, 'qsort@@GLIBC_2.0' => 1, 'qsort_r@@GLIBC_2.8' => 1, 'query_module@@GLIBC_2.0' => 1, 'quick_exit@@GLIBC_2.10' => 1, 'quotactl@@GLIBC_2.0' => 1, 'raise@@GLIBC_2.0' => 1, 'rand@@GLIBC_2.0' => 1, 'rand_r@@GLIBC_2.0' => 1, 'random@@GLIBC_2.0' => 1, 'random_r@@GLIBC_2.0' => 1, 'rawmemchr@@GLIBC_2.1' => 1, 'rcmd@@GLIBC_2.0' => 1, 'rcmd_af@@GLIBC_2.2' => 1, 're_comp@@GLIBC_2.0' => 1, 're_compile_fastmap@@GLIBC_2.0' => 1, 're_compile_pattern@@GLIBC_2.0' => 1, 're_exec@@GLIBC_2.0' => 1, 're_match@@GLIBC_2.0' => 1, 're_match_2@@GLIBC_2.0' => 1, 're_max_failures@@GLIBC_2.0' => '-4', 're_search@@GLIBC_2.0' => 1, 're_search_2@@GLIBC_2.0' => 1, 're_set_registers@@GLIBC_2.0' => 1, 're_set_syntax@@GLIBC_2.0' => 1, 're_syntax_options@@GLIBC_2.0' => '-4', 'read@@GLIBC_2.0' => 1, 'readahead@@GLIBC_2.3' => 1, 'readdir64@@GLIBC_2.2' => 1, 'readdir64@GLIBC_2.1' => 1, 'readdir64_r@@GLIBC_2.2' => 1, 'readdir64_r@GLIBC_2.1' => 1, 'readdir@@GLIBC_2.0' => 1, 'readdir_r@@GLIBC_2.0' => 1, 'readlink@@GLIBC_2.0' => 1, 'readlinkat@@GLIBC_2.4' => 1, 'readv@@GLIBC_2.0' => 1, 'realloc@@GLIBC_2.0' => 1, 'realpath@@GLIBC_2.3' => 1, 'realpath@GLIBC_2.0' => 1, 'reboot@@GLIBC_2.0' => 1, 'recv@@GLIBC_2.0' => 1, 'recvfrom@@GLIBC_2.0' => 1, 'recvmmsg@@GLIBC_2.12' => 1, 'recvmsg@@GLIBC_2.0' => 1, 'regcomp@@GLIBC_2.0' => 1, 'regerror@@GLIBC_2.0' => 1, 'regexec@@GLIBC_2.3.4' => 1, 'regexec@GLIBC_2.0' => 1, 'regfree@@GLIBC_2.0' => 1, 'register_printf_function@@GLIBC_2.0' => 1, 'register_printf_modifier@@GLIBC_2.10' => 1, 'register_printf_specifier@@GLIBC_2.10' => 1, 'register_printf_type@@GLIBC_2.10' => 1, 'registerrpc@@GLIBC_2.0' => 1, 'remap_file_pages@@GLIBC_2.3.3' => 1, 'remove@@GLIBC_2.0' => 1, 'removexattr@@GLIBC_2.3' => 1, 'remque@@GLIBC_2.0' => 1, 'rename@@GLIBC_2.0' => 1, 'renameat@@GLIBC_2.4' => 1, 'res_init@GLIBC_2.0' => 1, 'revoke@@GLIBC_2.0' => 1, 'rewind@@GLIBC_2.0' => 1, 'rewinddir@@GLIBC_2.0' => 1, 'rexec@@GLIBC_2.0' => 1, 'rexec_af@@GLIBC_2.2' => 1, 'rexecoptions@@GLIBC_2.0' => '-4', 'rindex@@GLIBC_2.0' => 1, 'rmdir@@GLIBC_2.0' => 1, 'rpc_createerr@@GLIBC_2.0' => '-16', 'rpmatch@@GLIBC_2.0' => 1, 'rresvport@@GLIBC_2.0' => 1, 'rresvport_af@@GLIBC_2.2' => 1, 'rtime@@GLIBC_2.1' => 1, 'ruserok@@GLIBC_2.0' => 1, 'ruserok_af@@GLIBC_2.2' => 1, 'ruserpass@@GLIBC_2.0' => 1, 'sbrk@@GLIBC_2.0' => 1, 'scalbln@@GLIBC_2.1' => 1, 'scalblnf@@GLIBC_2.1' => 1, 'scalblnl@@GLIBC_2.1' => 1, 'scalbn@@GLIBC_2.0' => 1, 'scalbnf@@GLIBC_2.0' => 1, 'scalbnl@@GLIBC_2.0' => 1, 'scandir64@@GLIBC_2.2' => 1, 'scandir64@GLIBC_2.1' => 1, 'scandir@@GLIBC_2.0' => 1, 'scandirat64@@GLIBC_2.15' => 1, 'scandirat@@GLIBC_2.15' => 1, 'scanf@@GLIBC_2.0' => 1, 'sched_get_priority_max@@GLIBC_2.0' => 1, 'sched_get_priority_min@@GLIBC_2.0' => 1, 'sched_getaffinity@@GLIBC_2.3.4' => 1, 'sched_getaffinity@GLIBC_2.3.3' => 1, 'sched_getcpu@@GLIBC_2.6' => 1, 'sched_getparam@@GLIBC_2.0' => 1, 'sched_getscheduler@@GLIBC_2.0' => 1, 'sched_rr_get_interval@@GLIBC_2.0' => 1, 'sched_setaffinity@@GLIBC_2.3.4' => 1, 'sched_setaffinity@GLIBC_2.3.3' => 1, 'sched_setparam@@GLIBC_2.0' => 1, 'sched_setscheduler@@GLIBC_2.0' => 1, 'sched_yield@@GLIBC_2.0' => 1, 'secure_getenv@@GLIBC_2.17' => 1, 'seed48@@GLIBC_2.0' => 1, 'seed48_r@@GLIBC_2.0' => 1, 'seekdir@@GLIBC_2.0' => 1, 'select@@GLIBC_2.0' => 1, 'semctl@@GLIBC_2.2' => 1, 'semctl@GLIBC_2.0' => 1, 'semget@@GLIBC_2.0' => 1, 'semop@@GLIBC_2.0' => 1, 'semtimedop@@GLIBC_2.3.3' => 1, 'send@@GLIBC_2.0' => 1, 'sendfile64@@GLIBC_2.3' => 1, 'sendfile@@GLIBC_2.1' => 1, 'sendmmsg@@GLIBC_2.14' => 1, 'sendmsg@@GLIBC_2.0' => 1, 'sendto@@GLIBC_2.0' => 1, 'setaliasent@@GLIBC_2.0' => 1, 'setbuf@@GLIBC_2.0' => 1, 'setbuffer@@GLIBC_2.0' => 1, 'setcontext@@GLIBC_2.0' => 1, 'setdomainname@@GLIBC_2.0' => 1, 'setegid@@GLIBC_2.0' => 1, 'setenv@@GLIBC_2.0' => 1, 'seteuid@@GLIBC_2.0' => 1, 'setfsent@@GLIBC_2.0' => 1, 'setfsgid@@GLIBC_2.0' => 1, 'setfsuid@@GLIBC_2.0' => 1, 'setgid@@GLIBC_2.0' => 1, 'setgrent@@GLIBC_2.0' => 1, 'setgroups@@GLIBC_2.0' => 1, 'sethostent@@GLIBC_2.0' => 1, 'sethostid@@GLIBC_2.0' => 1, 'sethostname@@GLIBC_2.0' => 1, 'setipv4sourcefilter@@GLIBC_2.3.4' => 1, 'setitimer@@GLIBC_2.0' => 1, 'setjmp@@GLIBC_2.0' => 1, 'setlinebuf@@GLIBC_2.0' => 1, 'setlocale@@GLIBC_2.0' => 1, 'setlogin@@GLIBC_2.0' => 1, 'setlogmask@@GLIBC_2.0' => 1, 'setmntent@@GLIBC_2.0' => 1, 'setnetent@@GLIBC_2.0' => 1, 'setnetgrent@@GLIBC_2.0' => 1, 'setns@@GLIBC_2.14' => 1, 'setpgid@@GLIBC_2.0' => 1, 'setpgrp@@GLIBC_2.0' => 1, 'setpriority@@GLIBC_2.0' => 1, 'setprotoent@@GLIBC_2.0' => 1, 'setpwent@@GLIBC_2.0' => 1, 'setregid@@GLIBC_2.0' => 1, 'setresgid@@GLIBC_2.0' => 1, 'setresuid@@GLIBC_2.0' => 1, 'setreuid@@GLIBC_2.0' => 1, 'setrlimit64@@GLIBC_2.1' => 1, 'setrlimit@@GLIBC_2.2' => 1, 'setrlimit@GLIBC_2.0' => 1, 'setrpcent@@GLIBC_2.0' => 1, 'setservent@@GLIBC_2.0' => 1, 'setsgent@@GLIBC_2.10' => 1, 'setsid@@GLIBC_2.0' => 1, 'setsockopt@@GLIBC_2.0' => 1, 'setsourcefilter@@GLIBC_2.3.4' => 1, 'setspent@@GLIBC_2.0' => 1, 'setstate@@GLIBC_2.0' => 1, 'setstate_r@@GLIBC_2.0' => 1, 'settimeofday@@GLIBC_2.0' => 1, 'setttyent@@GLIBC_2.0' => 1, 'setuid@@GLIBC_2.0' => 1, 'setusershell@@GLIBC_2.0' => 1, 'setutent@@GLIBC_2.0' => 1, 'setutxent@@GLIBC_2.1' => 1, 'setvbuf@@GLIBC_2.0' => 1, 'setxattr@@GLIBC_2.3' => 1, 'sgetsgent@@GLIBC_2.10' => 1, 'sgetsgent_r@@GLIBC_2.10' => 1, 'sgetspent@@GLIBC_2.0' => 1, 'sgetspent_r@@GLIBC_2.0' => 1, 'shmat@@GLIBC_2.0' => 1, 'shmctl@@GLIBC_2.2' => 1, 'shmctl@GLIBC_2.0' => 1, 'shmdt@@GLIBC_2.0' => 1, 'shmget@@GLIBC_2.0' => 1, 'shutdown@@GLIBC_2.0' => 1, 'sigaction@@GLIBC_2.0' => 1, 'sigaddset@@GLIBC_2.0' => 1, 'sigaltstack@@GLIBC_2.0' => 1, 'sigandset@@GLIBC_2.0' => 1, 'sigblock@@GLIBC_2.0' => 1, 'sigdelset@@GLIBC_2.0' => 1, 'sigemptyset@@GLIBC_2.0' => 1, 'sigfillset@@GLIBC_2.0' => 1, 'siggetmask@@GLIBC_2.0' => 1, 'sighold@@GLIBC_2.1' => 1, 'sigignore@@GLIBC_2.1' => 1, 'siginterrupt@@GLIBC_2.0' => 1, 'sigisemptyset@@GLIBC_2.0' => 1, 'sigismember@@GLIBC_2.0' => 1, 'siglongjmp@@GLIBC_2.0' => 1, 'signal@@GLIBC_2.0' => 1, 'signalfd@@GLIBC_2.7' => 1, 'sigorset@@GLIBC_2.0' => 1, 'sigpause@@GLIBC_2.0' => 1, 'sigpending@@GLIBC_2.0' => 1, 'sigprocmask@@GLIBC_2.0' => 1, 'sigqueue@@GLIBC_2.1' => 1, 'sigrelse@@GLIBC_2.1' => 1, 'sigreturn@@GLIBC_2.0' => 1, 'sigset@@GLIBC_2.1' => 1, 'sigsetmask@@GLIBC_2.0' => 1, 'sigstack@@GLIBC_2.0' => 1, 'sigsuspend@@GLIBC_2.0' => 1, 'sigtimedwait@@GLIBC_2.1' => 1, 'sigvec@@GLIBC_2.0' => 1, 'sigwait@@GLIBC_2.0' => 1, 'sigwaitinfo@@GLIBC_2.1' => 1, 'sleep@@GLIBC_2.0' => 1, 'snprintf@@GLIBC_2.0' => 1, 'sockatmark@@GLIBC_2.2.4' => 1, 'socket@@GLIBC_2.0' => 1, 'socketpair@@GLIBC_2.0' => 1, 'splice@@GLIBC_2.5' => 1, 'sprintf@@GLIBC_2.0' => 1, 'sprofil@@GLIBC_2.2.3' => 1, 'srand48@@GLIBC_2.0' => 1, 'srand48_r@@GLIBC_2.0' => 1, 'srand@@GLIBC_2.0' => 1, 'srandom@@GLIBC_2.0' => 1, 'srandom_r@@GLIBC_2.0' => 1, 'sscanf@@GLIBC_2.0' => 1, 'ssignal@@GLIBC_2.0' => 1, 'sstk@@GLIBC_2.0' => 1, 'statfs64@@GLIBC_2.1' => 1, 'statfs@@GLIBC_2.0' => 1, 'statvfs64@@GLIBC_2.1' => 1, 'statvfs@@GLIBC_2.1' => 1, 'stderr@@GLIBC_2.0' => '-4', 'stdin@@GLIBC_2.0' => '-4', 'stdout@@GLIBC_2.0' => '-4', 'step@@GLIBC_2.0' => 1, 'stime@@GLIBC_2.0' => 1, 'stpcpy@@GLIBC_2.0' => 1, 'stpncpy@@GLIBC_2.0' => 1, 'strcasecmp@@GLIBC_2.0' => 1, 'strcasecmp_l@@GLIBC_2.3' => 1, 'strcasestr@@GLIBC_2.1' => 1, 'strcat@@GLIBC_2.0' => 1, 'strchr@@GLIBC_2.0' => 1, 'strchrnul@@GLIBC_2.1.1' => 1, 'strcmp@@GLIBC_2.0' => 1, 'strcoll@@GLIBC_2.0' => 1, 'strcoll_l@@GLIBC_2.3' => 1, 'strcpy@@GLIBC_2.0' => 1, 'strcspn@@GLIBC_2.0' => 1, 'strdup@@GLIBC_2.0' => 1, 'strerror@@GLIBC_2.0' => 1, 'strerror_l@@GLIBC_2.6' => 1, 'strerror_r@@GLIBC_2.0' => 1, 'strfmon@@GLIBC_2.0' => 1, 'strfmon_l@@GLIBC_2.3' => 1, 'strfry@@GLIBC_2.0' => 1, 'strftime@@GLIBC_2.0' => 1, 'strftime_l@@GLIBC_2.3' => 1, 'strlen@@GLIBC_2.0' => 1, 'strncasecmp@@GLIBC_2.0' => 1, 'strncasecmp_l@@GLIBC_2.3' => 1, 'strncat@@GLIBC_2.0' => 1, 'strncmp@@GLIBC_2.0' => 1, 'strncpy@@GLIBC_2.0' => 1, 'strndup@@GLIBC_2.0' => 1, 'strnlen@@GLIBC_2.0' => 1, 'strpbrk@@GLIBC_2.0' => 1, 'strptime@@GLIBC_2.0' => 1, 'strptime_l@@GLIBC_2.3.2' => 1, 'strrchr@@GLIBC_2.0' => 1, 'strsep@@GLIBC_2.0' => 1, 'strsignal@@GLIBC_2.0' => 1, 'strspn@@GLIBC_2.0' => 1, 'strstr@@GLIBC_2.0' => 1, 'strtod@@GLIBC_2.0' => 1, 'strtod_l@@GLIBC_2.3' => 1, 'strtof@@GLIBC_2.0' => 1, 'strtof_l@@GLIBC_2.3' => 1, 'strtoimax@@GLIBC_2.1' => 1, 'strtok@@GLIBC_2.0' => 1, 'strtok_r@@GLIBC_2.0' => 1, 'strtol@@GLIBC_2.0' => 1, 'strtol_l@@GLIBC_2.3' => 1, 'strtold@@GLIBC_2.0' => 1, 'strtold_l@@GLIBC_2.3' => 1, 'strtoll@@GLIBC_2.0' => 1, 'strtoll_l@@GLIBC_2.3' => 1, 'strtoq@@GLIBC_2.0' => 1, 'strtoul@@GLIBC_2.0' => 1, 'strtoul_l@@GLIBC_2.3' => 1, 'strtoull@@GLIBC_2.0' => 1, 'strtoull_l@@GLIBC_2.3' => 1, 'strtoumax@@GLIBC_2.1' => 1, 'strtouq@@GLIBC_2.0' => 1, 'strverscmp@@GLIBC_2.1' => 1, 'strxfrm@@GLIBC_2.0' => 1, 'strxfrm_l@@GLIBC_2.3' => 1, 'stty@@GLIBC_2.0' => 1, 'svc_exit@@GLIBC_2.0' => 1, 'svc_fdset@@GLIBC_2.0' => '-128', 'svc_getreq@@GLIBC_2.0' => 1, 'svc_getreq_common@@GLIBC_2.2' => 1, 'svc_getreq_poll@@GLIBC_2.2' => 1, 'svc_getreqset@@GLIBC_2.0' => 1, 'svc_max_pollfd@@GLIBC_2.2' => '-4', 'svc_pollfd@@GLIBC_2.2' => '-4', 'svc_register@@GLIBC_2.0' => 1, 'svc_run@@GLIBC_2.0' => 1, 'svc_sendreply@@GLIBC_2.0' => 1, 'svc_unregister@@GLIBC_2.0' => 1, 'svcauthdes_stats@@GLIBC_2.0' => '-12', 'svcerr_auth@@GLIBC_2.0' => 1, 'svcerr_decode@@GLIBC_2.0' => 1, 'svcerr_noproc@@GLIBC_2.0' => 1, 'svcerr_noprog@@GLIBC_2.0' => 1, 'svcerr_progvers@@GLIBC_2.0' => 1, 'svcerr_systemerr@@GLIBC_2.0' => 1, 'svcerr_weakauth@@GLIBC_2.0' => 1, 'svcfd_create@@GLIBC_2.0' => 1, 'svcraw_create@@GLIBC_2.0' => 1, 'svctcp_create@@GLIBC_2.0' => 1, 'svcudp_bufcreate@@GLIBC_2.0' => 1, 'svcudp_create@@GLIBC_2.0' => 1, 'svcudp_enablecache@@GLIBC_2.0' => 1, 'svcunix_create@@GLIBC_2.1' => 1, 'svcunixfd_create@@GLIBC_2.1' => 1, 'swab@@GLIBC_2.0' => 1, 'swapcontext@@GLIBC_2.1' => 1, 'swapoff@@GLIBC_2.0' => 1, 'swapon@@GLIBC_2.0' => 1, 'swprintf@@GLIBC_2.2' => 1, 'swscanf@@GLIBC_2.2' => 1, 'symlink@@GLIBC_2.0' => 1, 'symlinkat@@GLIBC_2.4' => 1, 'sync@@GLIBC_2.0' => 1, 'sync_file_range@@GLIBC_2.6' => 1, 'syncfs@@GLIBC_2.14' => 1, 'sys_errlist@@GLIBC_2.12' => '-540', 'sys_errlist@GLIBC_2.0' => '-492', 'sys_errlist@GLIBC_2.1' => '-500', 'sys_errlist@GLIBC_2.3' => '-504', 'sys_errlist@GLIBC_2.4' => '-528', 'sys_nerr@@GLIBC_2.12' => '-4', 'sys_nerr@GLIBC_2.0' => '-4', 'sys_nerr@GLIBC_2.1' => '-4', 'sys_nerr@GLIBC_2.3' => '-4', 'sys_nerr@GLIBC_2.4' => '-4', 'sys_sigabbrev@@GLIBC_2.3.3' => '-260', 'sys_sigabbrev@GLIBC_2.0' => '-128', 'sys_sigabbrev@GLIBC_2.1' => '-256', 'sys_siglist@@GLIBC_2.3.3' => '-260', 'sys_siglist@GLIBC_2.0' => '-128', 'sys_siglist@GLIBC_2.1' => '-256', 'syscall@@GLIBC_2.0' => 1, 'sysconf@@GLIBC_2.0' => 1, 'sysctl@@GLIBC_2.0' => 1, 'sysinfo@@GLIBC_2.0' => 1, 'syslog@@GLIBC_2.0' => 1, 'system@@GLIBC_2.0' => 1, 'sysv_signal@@GLIBC_2.1' => 1, 'tcdrain@@GLIBC_2.0' => 1, 'tcflow@@GLIBC_2.0' => 1, 'tcflush@@GLIBC_2.0' => 1, 'tcgetattr@@GLIBC_2.0' => 1, 'tcgetpgrp@@GLIBC_2.0' => 1, 'tcgetsid@@GLIBC_2.1' => 1, 'tcsendbreak@@GLIBC_2.0' => 1, 'tcsetattr@@GLIBC_2.0' => 1, 'tcsetpgrp@@GLIBC_2.0' => 1, 'tdelete@@GLIBC_2.0' => 1, 'tdestroy@@GLIBC_2.1' => 1, 'tee@@GLIBC_2.5' => 1, 'telldir@@GLIBC_2.0' => 1, 'tempnam@@GLIBC_2.0' => 1, 'textdomain@@GLIBC_2.0' => 1, 'tfind@@GLIBC_2.0' => 1, 'time@@GLIBC_2.0' => 1, 'timegm@@GLIBC_2.0' => 1, 'timelocal@@GLIBC_2.0' => 1, 'timerfd_create@@GLIBC_2.8' => 1, 'timerfd_gettime@@GLIBC_2.8' => 1, 'timerfd_settime@@GLIBC_2.8' => 1, 'times@@GLIBC_2.0' => 1, 'timespec_get@@GLIBC_2.16' => 1, 'timezone@@GLIBC_2.0' => '-4', 'tmpfile64@@GLIBC_2.1' => 1, 'tmpfile@@GLIBC_2.1' => 1, 'tmpfile@GLIBC_2.0' => 1, 'tmpnam@@GLIBC_2.0' => 1, 'tmpnam_r@@GLIBC_2.0' => 1, 'toascii@@GLIBC_2.0' => 1, 'tolower@@GLIBC_2.0' => 1, 'tolower_l@@GLIBC_2.3' => 1, 'toupper@@GLIBC_2.0' => 1, 'toupper_l@@GLIBC_2.3' => 1, 'towctrans@@GLIBC_2.0' => 1, 'towctrans_l@@GLIBC_2.3' => 1, 'towlower@@GLIBC_2.0' => 1, 'towlower_l@@GLIBC_2.3' => 1, 'towupper@@GLIBC_2.0' => 1, 'towupper_l@@GLIBC_2.3' => 1, 'tr_break@@GLIBC_2.0' => 1, 'truncate64@@GLIBC_2.1' => 1, 'truncate@@GLIBC_2.0' => 1, 'tsearch@@GLIBC_2.0' => 1, 'ttyname@@GLIBC_2.0' => 1, 'ttyname_r@@GLIBC_2.0' => 1, 'ttyslot@@GLIBC_2.0' => 1, 'twalk@@GLIBC_2.0' => 1, 'tzname@@GLIBC_2.0' => '-8', 'tzset@@GLIBC_2.0' => 1, 'ualarm@@GLIBC_2.0' => 1, 'ulckpwdf@@GLIBC_2.0' => 1, 'ulimit@@GLIBC_2.0' => 1, 'umask@@GLIBC_2.0' => 1, 'umount2@@GLIBC_2.1' => 1, 'umount@@GLIBC_2.0' => 1, 'uname@@GLIBC_2.0' => 1, 'ungetc@@GLIBC_2.0' => 1, 'ungetwc@@GLIBC_2.2' => 1, 'unlink@@GLIBC_2.0' => 1, 'unlinkat@@GLIBC_2.4' => 1, 'unlockpt@@GLIBC_2.1' => 1, 'unsetenv@@GLIBC_2.0' => 1, 'unshare@@GLIBC_2.4' => 1, 'updwtmp@@GLIBC_2.0' => 1, 'updwtmpx@@GLIBC_2.1' => 1, 'uselib@@GLIBC_2.0' => 1, 'uselocale@@GLIBC_2.3' => 1, 'user2netname@@GLIBC_2.1' => 1, 'usleep@@GLIBC_2.0' => 1, 'ustat@@GLIBC_2.0' => 1, 'utime@@GLIBC_2.0' => 1, 'utimensat@@GLIBC_2.6' => 1, 'utimes@@GLIBC_2.0' => 1, 'utmpname@@GLIBC_2.0' => 1, 'utmpxname@@GLIBC_2.1' => 1, 'valloc@@GLIBC_2.0' => 1, 'vasprintf@@GLIBC_2.0' => 1, 'vdprintf@@GLIBC_2.0' => 1, 'verr@@GLIBC_2.0' => 1, 'verrx@@GLIBC_2.0' => 1, 'versionsort64@@GLIBC_2.2' => 1, 'versionsort64@GLIBC_2.1' => 1, 'versionsort@@GLIBC_2.1' => 1, 'vfork@@GLIBC_2.0' => 1, 'vfprintf@@GLIBC_2.0' => 1, 'vfscanf@@GLIBC_2.0' => 1, 'vfwprintf@@GLIBC_2.2' => 1, 'vfwscanf@@GLIBC_2.2' => 1, 'vhangup@@GLIBC_2.0' => 1, 'vlimit@@GLIBC_2.0' => 1, 'vm86@@GLIBC_2.3.4' => 1, 'vm86@GLIBC_2.0' => 1, 'vmsplice@@GLIBC_2.5' => 1, 'vprintf@@GLIBC_2.0' => 1, 'vscanf@@GLIBC_2.0' => 1, 'vsnprintf@@GLIBC_2.0' => 1, 'vsprintf@@GLIBC_2.0' => 1, 'vsscanf@@GLIBC_2.0' => 1, 'vswprintf@@GLIBC_2.2' => 1, 'vswscanf@@GLIBC_2.2' => 1, 'vsyslog@@GLIBC_2.0' => 1, 'vtimes@@GLIBC_2.0' => 1, 'vwarn@@GLIBC_2.0' => 1, 'vwarnx@@GLIBC_2.0' => 1, 'vwprintf@@GLIBC_2.2' => 1, 'vwscanf@@GLIBC_2.2' => 1, 'wait3@@GLIBC_2.0' => 1, 'wait4@@GLIBC_2.0' => 1, 'wait@@GLIBC_2.0' => 1, 'waitid@@GLIBC_2.1' => 1, 'waitpid@@GLIBC_2.0' => 1, 'warn@@GLIBC_2.0' => 1, 'warnx@@GLIBC_2.0' => 1, 'wcpcpy@@GLIBC_2.0' => 1, 'wcpncpy@@GLIBC_2.0' => 1, 'wcrtomb@@GLIBC_2.0' => 1, 'wcscasecmp@@GLIBC_2.1' => 1, 'wcscasecmp_l@@GLIBC_2.3' => 1, 'wcscat@@GLIBC_2.0' => 1, 'wcschr@@GLIBC_2.0' => 1, 'wcschrnul@@GLIBC_2.2' => 1, 'wcscmp@@GLIBC_2.0' => 1, 'wcscoll@@GLIBC_2.0' => 1, 'wcscoll_l@@GLIBC_2.3' => 1, 'wcscpy@@GLIBC_2.0' => 1, 'wcscspn@@GLIBC_2.0' => 1, 'wcsdup@@GLIBC_2.0' => 1, 'wcsftime@@GLIBC_2.2' => 1, 'wcsftime_l@@GLIBC_2.3' => 1, 'wcslen@@GLIBC_2.0' => 1, 'wcsncasecmp@@GLIBC_2.1' => 1, 'wcsncasecmp_l@@GLIBC_2.3' => 1, 'wcsncat@@GLIBC_2.0' => 1, 'wcsncmp@@GLIBC_2.0' => 1, 'wcsncpy@@GLIBC_2.0' => 1, 'wcsnlen@@GLIBC_2.1' => 1, 'wcsnrtombs@@GLIBC_2.0' => 1, 'wcspbrk@@GLIBC_2.0' => 1, 'wcsrchr@@GLIBC_2.0' => 1, 'wcsrtombs@@GLIBC_2.0' => 1, 'wcsspn@@GLIBC_2.0' => 1, 'wcsstr@@GLIBC_2.0' => 1, 'wcstod@@GLIBC_2.0' => 1, 'wcstod_l@@GLIBC_2.3' => 1, 'wcstof@@GLIBC_2.0' => 1, 'wcstof_l@@GLIBC_2.3' => 1, 'wcstoimax@@GLIBC_2.1' => 1, 'wcstok@@GLIBC_2.0' => 1, 'wcstol@@GLIBC_2.0' => 1, 'wcstol_l@@GLIBC_2.3' => 1, 'wcstold@@GLIBC_2.0' => 1, 'wcstold_l@@GLIBC_2.3' => 1, 'wcstoll@@GLIBC_2.1' => 1, 'wcstoll_l@@GLIBC_2.3' => 1, 'wcstombs@@GLIBC_2.0' => 1, 'wcstoq@@GLIBC_2.0' => 1, 'wcstoul@@GLIBC_2.0' => 1, 'wcstoul_l@@GLIBC_2.3' => 1, 'wcstoull@@GLIBC_2.1' => 1, 'wcstoull_l@@GLIBC_2.3' => 1, 'wcstoumax@@GLIBC_2.1' => 1, 'wcstouq@@GLIBC_2.0' => 1, 'wcswcs@@GLIBC_2.1' => 1, 'wcswidth@@GLIBC_2.0' => 1, 'wcsxfrm@@GLIBC_2.0' => 1, 'wcsxfrm_l@@GLIBC_2.3' => 1, 'wctob@@GLIBC_2.0' => 1, 'wctomb@@GLIBC_2.0' => 1, 'wctrans@@GLIBC_2.0' => 1, 'wctrans_l@@GLIBC_2.3' => 1, 'wctype@@GLIBC_2.0' => 1, 'wctype_l@@GLIBC_2.3' => 1, 'wcwidth@@GLIBC_2.0' => 1, 'wmemchr@@GLIBC_2.0' => 1, 'wmemcmp@@GLIBC_2.0' => 1, 'wmemcpy@@GLIBC_2.0' => 1, 'wmemmove@@GLIBC_2.0' => 1, 'wmempcpy@@GLIBC_2.2' => 1, 'wmemset@@GLIBC_2.0' => 1, 'wordexp@@GLIBC_2.1' => 1, 'wordfree@@GLIBC_2.1' => 1, 'wprintf@@GLIBC_2.2' => 1, 'write@@GLIBC_2.0' => 1, 'writev@@GLIBC_2.0' => 1, 'wscanf@@GLIBC_2.2' => 1, 'xdecrypt@@GLIBC_2.1' => 1, 'xdr_accepted_reply@@GLIBC_2.0' => 1, 'xdr_array@@GLIBC_2.0' => 1, 'xdr_authdes_cred@@GLIBC_2.1' => 1, 'xdr_authdes_verf@@GLIBC_2.1' => 1, 'xdr_authunix_parms@@GLIBC_2.0' => 1, 'xdr_bool@@GLIBC_2.0' => 1, 'xdr_bytes@@GLIBC_2.0' => 1, 'xdr_callhdr@@GLIBC_2.0' => 1, 'xdr_callmsg@@GLIBC_2.0' => 1, 'xdr_char@@GLIBC_2.0' => 1, 'xdr_cryptkeyarg2@@GLIBC_2.0' => 1, 'xdr_cryptkeyarg@@GLIBC_2.0' => 1, 'xdr_cryptkeyres@@GLIBC_2.0' => 1, 'xdr_des_block@@GLIBC_2.0' => 1, 'xdr_double@@GLIBC_2.0' => 1, 'xdr_enum@@GLIBC_2.0' => 1, 'xdr_float@@GLIBC_2.0' => 1, 'xdr_free@@GLIBC_2.0' => 1, 'xdr_getcredres@@GLIBC_2.1' => 1, 'xdr_hyper@@GLIBC_2.1.1' => 1, 'xdr_int16_t@@GLIBC_2.1' => 1, 'xdr_int32_t@@GLIBC_2.1' => 1, 'xdr_int64_t@@GLIBC_2.1.1' => 1, 'xdr_int8_t@@GLIBC_2.1' => 1, 'xdr_int@@GLIBC_2.0' => 1, 'xdr_key_netstarg@@GLIBC_2.0' => 1, 'xdr_key_netstres@@GLIBC_2.0' => 1, 'xdr_keybuf@@GLIBC_2.0' => 1, 'xdr_keystatus@@GLIBC_2.0' => 1, 'xdr_long@@GLIBC_2.0' => 1, 'xdr_longlong_t@@GLIBC_2.1.1' => 1, 'xdr_netnamestr@@GLIBC_2.1' => 1, 'xdr_netobj@@GLIBC_2.0' => 1, 'xdr_opaque@@GLIBC_2.0' => 1, 'xdr_opaque_auth@@GLIBC_2.0' => 1, 'xdr_pmap@@GLIBC_2.0' => 1, 'xdr_pmaplist@@GLIBC_2.0' => 1, 'xdr_pointer@@GLIBC_2.0' => 1, 'xdr_quad_t@@GLIBC_2.3.4' => 1, 'xdr_reference@@GLIBC_2.0' => 1, 'xdr_rejected_reply@@GLIBC_2.0' => 1, 'xdr_replymsg@@GLIBC_2.0' => 1, 'xdr_rmtcall_args@@GLIBC_2.0' => 1, 'xdr_rmtcallres@@GLIBC_2.0' => 1, 'xdr_short@@GLIBC_2.0' => 1, 'xdr_sizeof@@GLIBC_2.1' => 1, 'xdr_string@@GLIBC_2.0' => 1, 'xdr_u_char@@GLIBC_2.0' => 1, 'xdr_u_hyper@@GLIBC_2.1.1' => 1, 'xdr_u_int@@GLIBC_2.0' => 1, 'xdr_u_long@@GLIBC_2.0' => 1, 'xdr_u_longlong_t@@GLIBC_2.1.1' => 1, 'xdr_u_quad_t@@GLIBC_2.3.4' => 1, 'xdr_u_short@@GLIBC_2.0' => 1, 'xdr_uint16_t@@GLIBC_2.1' => 1, 'xdr_uint32_t@@GLIBC_2.1' => 1, 'xdr_uint64_t@@GLIBC_2.1.1' => 1, 'xdr_uint8_t@@GLIBC_2.1' => 1, 'xdr_union@@GLIBC_2.0' => 1, 'xdr_unixcred@@GLIBC_2.1' => 1, 'xdr_vector@@GLIBC_2.0' => 1, 'xdr_void@@GLIBC_2.0' => 1, 'xdr_wrapstring@@GLIBC_2.0' => 1, 'xdrmem_create@@GLIBC_2.0' => 1, 'xdrrec_create@@GLIBC_2.0' => 1, 'xdrrec_endofrecord@@GLIBC_2.0' => 1, 'xdrrec_eof@@GLIBC_2.0' => 1, 'xdrrec_skiprecord@@GLIBC_2.0' => 1, 'xdrstdio_create@@GLIBC_2.0' => 1, 'xencrypt@@GLIBC_2.0' => 1, 'xprt_register@@GLIBC_2.0' => 1, 'xprt_unregister@@GLIBC_2.0' => 1 } }, 'GccVersion' => '4.7', 'Headers' => { 'com.ubuntu.Upstart.Instance.h' => 2, 'com.ubuntu.Upstart.Job.h' => 3, 'com.ubuntu.Upstart.h' => 1, 'upstart.h' => 0 }, 'Language' => 'C', 'LibraryName' => 'libupstart', 'LibraryVersion' => '1.0.0', 'NameSpaces' => {}, 'SkipHeaders' => {}, 'SkipNameSpaces' => {}, 'SkipSymbols' => {}, 'SkipTypes' => {}, 'SrcBin' => 1, 'SymbolInfo' => { '1033' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '70', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '1200' }, '3' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_stop' }, '1047' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '147', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '296' } }, 'Return' => '10', 'ShortName' => 'upstart_set_log_priority_sync' }, '1058' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '89', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '3' => { 'algn' => '4', 'name' => 'handler', 'type' => '752' }, '4' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '5' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_start' }, '1111' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '68', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'job_start_sync' }, '1126' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '145', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'value', 'type' => '296' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '1443' }, '3' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_set_log_priority' }, '1140' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '87', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'instances', 'type' => '97' } }, 'Return' => '10', 'ShortName' => 'job_class_get_all_instances_sync' }, '119' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '121', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '207' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_start_on' }, '1190' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '66', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '1281' }, '3' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_start' }, '1207' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '143', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'upstart_get_log_priority_sync' }, '1225' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '85', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '827' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_all_instances' }, '1272' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '63', 'Return' => '1348', 'ShortName' => 'job_interfaces' }, '1286' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '141', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '1515' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_get_log_priority' }, '1308' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '83', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '3' => { 'algn' => '4', 'name' => 'instance', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_class_get_instance_by_name_sync' }, '1349' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '62', 'Return' => '1179', 'ShortName' => 'job_com_ubuntu_Upstart0_6_Instance' }, '1364' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '139', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'upstart_get_version_sync' }, '1387' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '81', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '906' }, '3' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_instance_by_name' }, '14' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '131', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '97' } }, 'Return' => '10', 'ShortName' => 'job_class_get_emits_sync' }, '1439' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '137', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '1590' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_get_version' }, '1467' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '79', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'instance', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_class_get_instance_sync' }, '1512' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '135', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' } }, 'Return' => '10', 'ShortName' => 'upstart_end_session_sync' }, '153' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '119', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_class_get_usage_sync' }, '1540' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '77', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '993' }, '3' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_instance' }, '1583' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '133', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '1783' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_end_session' }, '1610' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '74', 'Return' => '1348', 'ShortName' => 'job_class_interfaces' }, '1651' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '131', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' } }, 'Return' => '10', 'ShortName' => 'upstart_notify_disk_writeable_sync' }, '1680' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '73', 'Return' => '1179', 'ShortName' => 'job_class_com_ubuntu_Upstart0_6_Job' }, '1715' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '129', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '1897' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_notify_disk_writeable' }, '1780' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '127', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '3' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '4' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '5' => { 'algn' => '4', 'name' => 'file', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'upstart_emit_event_with_file_sync' }, '1838' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '125', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '2' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '4' => { 'algn' => '4', 'name' => 'file', 'type' => '10' }, '5' => { 'algn' => '4', 'name' => 'handler', 'type' => '2011' }, '6' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '7' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '8' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_emit_event_with_file' }, '187' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '117', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '244' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_usage' }, '1894' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '123', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '3' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '4' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'upstart_emit_event_sync' }, '1950' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '121', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '2' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '4' => { 'algn' => '4', 'name' => 'handler', 'type' => '2065' }, '5' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '6' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '7' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_emit_event' }, '2004' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '119', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' } }, 'Return' => '10', 'ShortName' => 'upstart_reset_env_sync' }, '2058' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '117', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '2119' }, '3' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_reset_env' }, '2111' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '115', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'env', 'type' => '97' } }, 'Return' => '10', 'ShortName' => 'upstart_list_env_sync' }, '2164' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '113', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '2173' }, '3' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_list_env' }, '217' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '96', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'properties', 'type' => '408' } }, 'Return' => '10', 'ShortName' => 'job_get_all_sync' }, '2221' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '111', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'name', 'type' => '296' } }, 'Return' => '10', 'ShortName' => 'upstart_unset_env_sync' }, '2271' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '109', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' }, '2' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '3' => { 'algn' => '4', 'name' => 'handler', 'type' => '2229' }, '4' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '5' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_unset_env' }, '228' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '115', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_class_get_version_sync' }, '2320' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '107', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'var', 'type' => '296' }, '4' => { 'algn' => '4', 'name' => 'replace', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'upstart_set_env_sync' }, '2371' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '105', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' }, '2' => { 'algn' => '4', 'name' => 'var', 'type' => '296' }, '3' => { 'algn' => '4', 'name' => 'replace', 'type' => '10' }, '4' => { 'algn' => '4', 'name' => 'handler', 'type' => '2279' }, '5' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '6' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '7' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_set_env' }, '2423' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '103', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '4' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'upstart_get_env_sync' }, '2471' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '101', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'job_details', 'type' => '276' }, '2' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '3' => { 'algn' => '4', 'name' => 'handler', 'type' => '2329' }, '4' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '5' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_get_env' }, '2516' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '99', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' } }, 'Return' => '10', 'ShortName' => 'upstart_restart_sync' }, '2562' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '97', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '2379' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_restart' }, '259' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '94', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '406' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_get_all' }, '2606' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '95', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'state', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'upstart_get_state_sync' }, '2645' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '93', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '2430' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_get_state' }, '2686' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '91', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'jobs', 'type' => '97' } }, 'Return' => '10', 'ShortName' => 'upstart_get_all_jobs_sync' }, '270' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '113', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '290' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_version' }, '2734' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '89', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '2478' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_get_all_jobs' }, '2791' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '87', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '3' => { 'algn' => '4', 'name' => 'job', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'upstart_get_job_by_name_sync' }, '2850' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '85', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '2523' }, '3' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_get_job_by_name' }, '29' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '129', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '94' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_emits' }, '2903' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '83', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' } }, 'Return' => '10', 'ShortName' => 'upstart_reload_configuration_sync' }, '2949' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '81', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '2571' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_reload_configuration' }, '2991' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '78', 'Return' => '1348', 'ShortName' => 'upstart_interfaces' }, '3026' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '77', 'Return' => '1179', 'ShortName' => 'upstart_com_ubuntu_Upstart0_6' }, '304' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '92', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '532' } }, 'Return' => '10', 'ShortName' => 'job_get_processes_sync' }, '317' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '111', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_class_get_author_sync' }, '355' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '90', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '530' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_get_processes' }, '367' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '109', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '335' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_author' }, '4' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '135', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'properties', 'type' => '57' } }, 'Return' => '10', 'ShortName' => 'job_class_get_all_sync' }, '403' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '88', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_get_state_sync' }, '418' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '107', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_class_get_description_sync' }, '461' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '86', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '659' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_get_state' }, '47' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '127', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '158' } }, 'Return' => '10', 'ShortName' => 'job_class_get_stop_on_sync' }, '480' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '105', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '383' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_description' }, '527' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '84', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_get_goal_sync' }, '549' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '103', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_class_get_name_sync' }, '592' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '82', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '729' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_get_goal' }, '615' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '101', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '432' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_name' }, '656' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '80', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_get_name_sync' }, '66' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '125', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '156' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_stop_on' }, '676' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '99', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '4' => { 'algn' => '4', 'name' => 'instance', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_class_restart_sync' }, '7' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '133', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '52' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_get_all' }, '721' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '78', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '804' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_get_name' }, '744' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '97', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '3' => { 'algn' => '4', 'name' => 'handler', 'type' => '624' }, '4' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '5' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_restart' }, '794' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '76', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'job_restart_sync' }, '820' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '95', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'job_class_stop_sync' }, '873' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '74', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '1120' }, '3' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_restart' }, '885' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '151', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'properties', 'type' => '1212' } }, 'Return' => '10', 'ShortName' => 'upstart_get_all_sync' }, '899' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '93', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '3' => { 'algn' => '4', 'name' => 'handler', 'type' => '685' }, '4' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '5' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'job_class_stop' }, '91' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '123', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'value', 'type' => '158' } }, 'Return' => '10', 'ShortName' => 'job_class_get_start_on_sync' }, '957' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '72', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'job_stop_sync' }, '973' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '149', 'Param' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'handler', 'type' => '1210' }, '2' => { 'algn' => '4', 'name' => 'error_handler', 'type' => '79' }, '3' => { 'algn' => '4', 'name' => 'data', 'type' => '110' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '25', 'ShortName' => 'upstart_get_all' }, '985' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '91', 'Param' => { '0' => { 'algn' => '4', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '2' => { 'algn' => '4', 'name' => 'env', 'type' => '276' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '4' => { 'algn' => '4', 'name' => 'instance', 'type' => '126' } }, 'Return' => '10', 'ShortName' => 'job_class_start_sync' } }, 'SymbolVersion' => { 'job_class_com_ubuntu_Upstart0_6_Job' => 'job_class_com_ubuntu_Upstart0_6_Job@@LIBUPSTART_1.0.0', 'job_class_get_all' => 'job_class_get_all@@LIBUPSTART_1.0.0', 'job_class_get_all_instances' => 'job_class_get_all_instances@@LIBUPSTART_1.0.0', 'job_class_get_all_instances_sync' => 'job_class_get_all_instances_sync@@LIBUPSTART_1.0.0', 'job_class_get_all_sync' => 'job_class_get_all_sync@@LIBUPSTART_1.0.0', 'job_class_get_author' => 'job_class_get_author@@LIBUPSTART_1.0.0', 'job_class_get_author_sync' => 'job_class_get_author_sync@@LIBUPSTART_1.0.0', 'job_class_get_description' => 'job_class_get_description@@LIBUPSTART_1.0.0', 'job_class_get_description_sync' => 'job_class_get_description_sync@@LIBUPSTART_1.0.0', 'job_class_get_emits' => 'job_class_get_emits@@LIBUPSTART_1.0.0', 'job_class_get_emits_sync' => 'job_class_get_emits_sync@@LIBUPSTART_1.0.0', 'job_class_get_instance' => 'job_class_get_instance@@LIBUPSTART_1.0.0', 'job_class_get_instance_by_name' => 'job_class_get_instance_by_name@@LIBUPSTART_1.0.0', 'job_class_get_instance_by_name_sync' => 'job_class_get_instance_by_name_sync@@LIBUPSTART_1.0.0', 'job_class_get_instance_sync' => 'job_class_get_instance_sync@@LIBUPSTART_1.0.0', 'job_class_get_name' => 'job_class_get_name@@LIBUPSTART_1.0.0', 'job_class_get_name_sync' => 'job_class_get_name_sync@@LIBUPSTART_1.0.0', 'job_class_get_start_on' => 'job_class_get_start_on@@LIBUPSTART_1.0.0', 'job_class_get_start_on_sync' => 'job_class_get_start_on_sync@@LIBUPSTART_1.0.0', 'job_class_get_stop_on' => 'job_class_get_stop_on@@LIBUPSTART_1.0.0', 'job_class_get_stop_on_sync' => 'job_class_get_stop_on_sync@@LIBUPSTART_1.0.0', 'job_class_get_usage' => 'job_class_get_usage@@LIBUPSTART_1.0.0', 'job_class_get_usage_sync' => 'job_class_get_usage_sync@@LIBUPSTART_1.0.0', 'job_class_get_version' => 'job_class_get_version@@LIBUPSTART_1.0.0', 'job_class_get_version_sync' => 'job_class_get_version_sync@@LIBUPSTART_1.0.0', 'job_class_interfaces' => 'job_class_interfaces@@LIBUPSTART_1.0.0', 'job_class_restart' => 'job_class_restart@@LIBUPSTART_1.0.0', 'job_class_restart_sync' => 'job_class_restart_sync@@LIBUPSTART_1.0.0', 'job_class_start' => 'job_class_start@@LIBUPSTART_1.0.0', 'job_class_start_sync' => 'job_class_start_sync@@LIBUPSTART_1.0.0', 'job_class_stop' => 'job_class_stop@@LIBUPSTART_1.0.0', 'job_class_stop_sync' => 'job_class_stop_sync@@LIBUPSTART_1.0.0', 'job_com_ubuntu_Upstart0_6_Instance' => 'job_com_ubuntu_Upstart0_6_Instance@@LIBUPSTART_1.0.0', 'job_get_all' => 'job_get_all@@LIBUPSTART_1.0.0', 'job_get_all_sync' => 'job_get_all_sync@@LIBUPSTART_1.0.0', 'job_get_goal' => 'job_get_goal@@LIBUPSTART_1.0.0', 'job_get_goal_sync' => 'job_get_goal_sync@@LIBUPSTART_1.0.0', 'job_get_name' => 'job_get_name@@LIBUPSTART_1.0.0', 'job_get_name_sync' => 'job_get_name_sync@@LIBUPSTART_1.0.0', 'job_get_processes' => 'job_get_processes@@LIBUPSTART_1.0.0', 'job_get_processes_sync' => 'job_get_processes_sync@@LIBUPSTART_1.0.0', 'job_get_state' => 'job_get_state@@LIBUPSTART_1.0.0', 'job_get_state_sync' => 'job_get_state_sync@@LIBUPSTART_1.0.0', 'job_interfaces' => 'job_interfaces@@LIBUPSTART_1.0.0', 'job_restart' => 'job_restart@@LIBUPSTART_1.0.0', 'job_restart_sync' => 'job_restart_sync@@LIBUPSTART_1.0.0', 'job_start' => 'job_start@@LIBUPSTART_1.0.0', 'job_start_sync' => 'job_start_sync@@LIBUPSTART_1.0.0', 'job_stop' => 'job_stop@@LIBUPSTART_1.0.0', 'job_stop_sync' => 'job_stop_sync@@LIBUPSTART_1.0.0', 'upstart_com_ubuntu_Upstart0_6' => 'upstart_com_ubuntu_Upstart0_6@@LIBUPSTART_1.0.0', 'upstart_emit_event' => 'upstart_emit_event@@LIBUPSTART_1.0.0', 'upstart_emit_event_sync' => 'upstart_emit_event_sync@@LIBUPSTART_1.0.0', 'upstart_emit_event_with_file' => 'upstart_emit_event_with_file@@LIBUPSTART_1.0.0', 'upstart_emit_event_with_file_sync' => 'upstart_emit_event_with_file_sync@@LIBUPSTART_1.0.0', 'upstart_end_session' => 'upstart_end_session@@LIBUPSTART_1.0.0', 'upstart_end_session_sync' => 'upstart_end_session_sync@@LIBUPSTART_1.0.0', 'upstart_get_all' => 'upstart_get_all@@LIBUPSTART_1.0.0', 'upstart_get_all_jobs' => 'upstart_get_all_jobs@@LIBUPSTART_1.0.0', 'upstart_get_all_jobs_sync' => 'upstart_get_all_jobs_sync@@LIBUPSTART_1.0.0', 'upstart_get_all_sync' => 'upstart_get_all_sync@@LIBUPSTART_1.0.0', 'upstart_get_env' => 'upstart_get_env@@LIBUPSTART_1.0.0', 'upstart_get_env_sync' => 'upstart_get_env_sync@@LIBUPSTART_1.0.0', 'upstart_get_job_by_name' => 'upstart_get_job_by_name@@LIBUPSTART_1.0.0', 'upstart_get_job_by_name_sync' => 'upstart_get_job_by_name_sync@@LIBUPSTART_1.0.0', 'upstart_get_log_priority' => 'upstart_get_log_priority@@LIBUPSTART_1.0.0', 'upstart_get_log_priority_sync' => 'upstart_get_log_priority_sync@@LIBUPSTART_1.0.0', 'upstart_get_state' => 'upstart_get_state@@LIBUPSTART_1.0.0', 'upstart_get_state_sync' => 'upstart_get_state_sync@@LIBUPSTART_1.0.0', 'upstart_get_version' => 'upstart_get_version@@LIBUPSTART_1.0.0', 'upstart_get_version_sync' => 'upstart_get_version_sync@@LIBUPSTART_1.0.0', 'upstart_interfaces' => 'upstart_interfaces@@LIBUPSTART_1.0.0', 'upstart_list_env' => 'upstart_list_env@@LIBUPSTART_1.0.0', 'upstart_list_env_sync' => 'upstart_list_env_sync@@LIBUPSTART_1.0.0', 'upstart_notify_disk_writeable' => 'upstart_notify_disk_writeable@@LIBUPSTART_1.0.0', 'upstart_notify_disk_writeable_sync' => 'upstart_notify_disk_writeable_sync@@LIBUPSTART_1.0.0', 'upstart_reload_configuration' => 'upstart_reload_configuration@@LIBUPSTART_1.0.0', 'upstart_reload_configuration_sync' => 'upstart_reload_configuration_sync@@LIBUPSTART_1.0.0', 'upstart_reset_env' => 'upstart_reset_env@@LIBUPSTART_1.0.0', 'upstart_reset_env_sync' => 'upstart_reset_env_sync@@LIBUPSTART_1.0.0', 'upstart_restart' => 'upstart_restart@@LIBUPSTART_1.0.0', 'upstart_restart_sync' => 'upstart_restart_sync@@LIBUPSTART_1.0.0', 'upstart_set_env' => 'upstart_set_env@@LIBUPSTART_1.0.0', 'upstart_set_env_sync' => 'upstart_set_env_sync@@LIBUPSTART_1.0.0', 'upstart_set_log_priority' => 'upstart_set_log_priority@@LIBUPSTART_1.0.0', 'upstart_set_log_priority_sync' => 'upstart_set_log_priority_sync@@LIBUPSTART_1.0.0', 'upstart_unset_env' => 'upstart_unset_env@@LIBUPSTART_1.0.0', 'upstart_unset_env_sync' => 'upstart_unset_env_sync@@LIBUPSTART_1.0.0' }, 'Symbols' => { 'libupstart.so.1.0.0' => { 'job_class_com_ubuntu_Upstart0_6_Job' => '-16', 'job_class_com_ubuntu_Upstart0_6_Job@@LIBUPSTART_1.0.0' => '-16', 'job_class_get_all' => 1, 'job_class_get_all@@LIBUPSTART_1.0.0' => 1, 'job_class_get_all_instances' => 1, 'job_class_get_all_instances@@LIBUPSTART_1.0.0' => 1, 'job_class_get_all_instances_sync' => 1, 'job_class_get_all_instances_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_all_sync' => 1, 'job_class_get_all_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_author' => 1, 'job_class_get_author@@LIBUPSTART_1.0.0' => 1, 'job_class_get_author_sync' => 1, 'job_class_get_author_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_description' => 1, 'job_class_get_description@@LIBUPSTART_1.0.0' => 1, 'job_class_get_description_sync' => 1, 'job_class_get_description_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_emits' => 1, 'job_class_get_emits@@LIBUPSTART_1.0.0' => 1, 'job_class_get_emits_sync' => 1, 'job_class_get_emits_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_instance' => 1, 'job_class_get_instance@@LIBUPSTART_1.0.0' => 1, 'job_class_get_instance_by_name' => 1, 'job_class_get_instance_by_name@@LIBUPSTART_1.0.0' => 1, 'job_class_get_instance_by_name_sync' => 1, 'job_class_get_instance_by_name_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_instance_sync' => 1, 'job_class_get_instance_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_name' => 1, 'job_class_get_name@@LIBUPSTART_1.0.0' => 1, 'job_class_get_name_sync' => 1, 'job_class_get_name_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_start_on' => 1, 'job_class_get_start_on@@LIBUPSTART_1.0.0' => 1, 'job_class_get_start_on_sync' => 1, 'job_class_get_start_on_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_stop_on' => 1, 'job_class_get_stop_on@@LIBUPSTART_1.0.0' => 1, 'job_class_get_stop_on_sync' => 1, 'job_class_get_stop_on_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_usage' => 1, 'job_class_get_usage@@LIBUPSTART_1.0.0' => 1, 'job_class_get_usage_sync' => 1, 'job_class_get_usage_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_version' => 1, 'job_class_get_version@@LIBUPSTART_1.0.0' => 1, 'job_class_get_version_sync' => 1, 'job_class_get_version_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_interfaces' => '-8', 'job_class_interfaces@@LIBUPSTART_1.0.0' => '-8', 'job_class_restart' => 1, 'job_class_restart@@LIBUPSTART_1.0.0' => 1, 'job_class_restart_sync' => 1, 'job_class_restart_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_start' => 1, 'job_class_start@@LIBUPSTART_1.0.0' => 1, 'job_class_start_sync' => 1, 'job_class_start_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_stop' => 1, 'job_class_stop@@LIBUPSTART_1.0.0' => 1, 'job_class_stop_sync' => 1, 'job_class_stop_sync@@LIBUPSTART_1.0.0' => 1, 'job_com_ubuntu_Upstart0_6_Instance' => '-16', 'job_com_ubuntu_Upstart0_6_Instance@@LIBUPSTART_1.0.0' => '-16', 'job_get_all' => 1, 'job_get_all@@LIBUPSTART_1.0.0' => 1, 'job_get_all_sync' => 1, 'job_get_all_sync@@LIBUPSTART_1.0.0' => 1, 'job_get_goal' => 1, 'job_get_goal@@LIBUPSTART_1.0.0' => 1, 'job_get_goal_sync' => 1, 'job_get_goal_sync@@LIBUPSTART_1.0.0' => 1, 'job_get_name' => 1, 'job_get_name@@LIBUPSTART_1.0.0' => 1, 'job_get_name_sync' => 1, 'job_get_name_sync@@LIBUPSTART_1.0.0' => 1, 'job_get_processes' => 1, 'job_get_processes@@LIBUPSTART_1.0.0' => 1, 'job_get_processes_sync' => 1, 'job_get_processes_sync@@LIBUPSTART_1.0.0' => 1, 'job_get_state' => 1, 'job_get_state@@LIBUPSTART_1.0.0' => 1, 'job_get_state_sync' => 1, 'job_get_state_sync@@LIBUPSTART_1.0.0' => 1, 'job_interfaces' => '-8', 'job_interfaces@@LIBUPSTART_1.0.0' => '-8', 'job_restart' => 1, 'job_restart@@LIBUPSTART_1.0.0' => 1, 'job_restart_sync' => 1, 'job_restart_sync@@LIBUPSTART_1.0.0' => 1, 'job_start' => 1, 'job_start@@LIBUPSTART_1.0.0' => 1, 'job_start_sync' => 1, 'job_start_sync@@LIBUPSTART_1.0.0' => 1, 'job_stop' => 1, 'job_stop@@LIBUPSTART_1.0.0' => 1, 'job_stop_sync' => 1, 'job_stop_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_com_ubuntu_Upstart0_6' => '-16', 'upstart_com_ubuntu_Upstart0_6@@LIBUPSTART_1.0.0' => '-16', 'upstart_emit_event' => 1, 'upstart_emit_event@@LIBUPSTART_1.0.0' => 1, 'upstart_emit_event_sync' => 1, 'upstart_emit_event_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_emit_event_with_file' => 1, 'upstart_emit_event_with_file@@LIBUPSTART_1.0.0' => 1, 'upstart_emit_event_with_file_sync' => 1, 'upstart_emit_event_with_file_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_end_session' => 1, 'upstart_end_session@@LIBUPSTART_1.0.0' => 1, 'upstart_end_session_sync' => 1, 'upstart_end_session_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_all' => 1, 'upstart_get_all@@LIBUPSTART_1.0.0' => 1, 'upstart_get_all_jobs' => 1, 'upstart_get_all_jobs@@LIBUPSTART_1.0.0' => 1, 'upstart_get_all_jobs_sync' => 1, 'upstart_get_all_jobs_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_all_sync' => 1, 'upstart_get_all_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_env' => 1, 'upstart_get_env@@LIBUPSTART_1.0.0' => 1, 'upstart_get_env_sync' => 1, 'upstart_get_env_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_job_by_name' => 1, 'upstart_get_job_by_name@@LIBUPSTART_1.0.0' => 1, 'upstart_get_job_by_name_sync' => 1, 'upstart_get_job_by_name_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_log_priority' => 1, 'upstart_get_log_priority@@LIBUPSTART_1.0.0' => 1, 'upstart_get_log_priority_sync' => 1, 'upstart_get_log_priority_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_state' => 1, 'upstart_get_state@@LIBUPSTART_1.0.0' => 1, 'upstart_get_state_sync' => 1, 'upstart_get_state_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_version' => 1, 'upstart_get_version@@LIBUPSTART_1.0.0' => 1, 'upstart_get_version_sync' => 1, 'upstart_get_version_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_interfaces' => '-8', 'upstart_interfaces@@LIBUPSTART_1.0.0' => '-8', 'upstart_list_env' => 1, 'upstart_list_env@@LIBUPSTART_1.0.0' => 1, 'upstart_list_env_sync' => 1, 'upstart_list_env_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_notify_disk_writeable' => 1, 'upstart_notify_disk_writeable@@LIBUPSTART_1.0.0' => 1, 'upstart_notify_disk_writeable_sync' => 1, 'upstart_notify_disk_writeable_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_reload_configuration' => 1, 'upstart_reload_configuration@@LIBUPSTART_1.0.0' => 1, 'upstart_reload_configuration_sync' => 1, 'upstart_reload_configuration_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_reset_env' => 1, 'upstart_reset_env@@LIBUPSTART_1.0.0' => 1, 'upstart_reset_env_sync' => 1, 'upstart_reset_env_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_restart' => 1, 'upstart_restart@@LIBUPSTART_1.0.0' => 1, 'upstart_restart_sync' => 1, 'upstart_restart_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_set_env' => 1, 'upstart_set_env@@LIBUPSTART_1.0.0' => 1, 'upstart_set_env_sync' => 1, 'upstart_set_env_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_set_log_priority' => 1, 'upstart_set_log_priority@@LIBUPSTART_1.0.0' => 1, 'upstart_set_log_priority_sync' => 1, 'upstart_set_log_priority_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_unset_env' => 1, 'upstart_unset_env@@LIBUPSTART_1.0.0' => 1, 'upstart_unset_env_sync' => 1, 'upstart_unset_env_sync@@LIBUPSTART_1.0.0' => 1 } }, 'Target' => 'linux', 'TargetHeaders' => { 'com.ubuntu.Upstart.Instance.h' => 1, 'com.ubuntu.Upstart.Job.h' => 1, 'com.ubuntu.Upstart.h' => 1, 'upstart.h' => 1 }, 'TypeInfo' => { '10' => { 'Header' => '', 'Name' => 'int', 'Size' => '4', 'Tid' => '10', 'Type' => 'Intrinsic' }, '101' => { 'BaseType' => { 'Tid' => '165' }, 'Header' => 'dbus-connection.h', 'Name' => 'DBusConnection*', 'Size' => 4, 'Tid' => '101', 'Type' => 'Pointer' }, '1042' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '43', 'Name' => 'JobGoalChangedHandler', 'Size' => 4, 'Tid' => '1042', 'Type' => 'Typedef' }, '107' => { 'Name' => 'void(*)(void*,NihDBusMessage*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '107', 'Type' => 'FuncPtr' }, '1098' => { 'BaseType' => { 'Tid' => '1179' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusInterface const*', 'Size' => 4, 'Tid' => '1098', 'Type' => 'Pointer' }, '110' => { 'BaseType' => { 'Tid' => '55' }, 'Header' => '', 'Name' => 'void*', 'Size' => 4, 'Tid' => '110', 'Type' => 'Pointer' }, '1100' => { 'BaseType' => { 'Tid' => '863' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusProxySignal*', 'Size' => 4, 'Tid' => '1100', 'Type' => 'Pointer' }, '1102' => { 'Header' => 'dbus-message.h', 'Line' => '51', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'dummy1', 'type' => '110' }, '1' => { 'algn' => '4', 'name' => 'dummy2', 'type' => '110' }, '10' => { 'algn' => '4', 'name' => 'dummy11', 'type' => '10' }, '11' => { 'algn' => '4', 'name' => 'pad1', 'type' => '10' }, '12' => { 'algn' => '4', 'name' => 'pad2', 'type' => '10' }, '13' => { 'algn' => '4', 'name' => 'pad3', 'type' => '110' }, '2' => { 'algn' => '4', 'name' => 'dummy3', 'type' => '834' }, '3' => { 'algn' => '4', 'name' => 'dummy4', 'type' => '10' }, '4' => { 'algn' => '4', 'name' => 'dummy5', 'type' => '10' }, '5' => { 'algn' => '4', 'name' => 'dummy6', 'type' => '10' }, '6' => { 'algn' => '4', 'name' => 'dummy7', 'type' => '10' }, '7' => { 'algn' => '4', 'name' => 'dummy8', 'type' => '10' }, '8' => { 'algn' => '4', 'name' => 'dummy9', 'type' => '10' }, '9' => { 'algn' => '4', 'name' => 'dummy10', 'type' => '10' } }, 'Name' => 'DBusMessageIter', 'Size' => '56', 'Tid' => '1102', 'Type' => 'Struct' }, '112' => { 'BaseType' => { 'Tid' => '141' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '33', 'Name' => 'JobClassProperties', 'Size' => '32', 'Tid' => '112', 'Type' => 'Typedef' }, '1120' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '41', 'Name' => 'JobRestartReply', 'Size' => 4, 'Tid' => '1120', 'Type' => 'Typedef' }, '1179' => { 'BaseType' => { 'Tid' => '214' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusInterface const', 'Size' => '16', 'Tid' => '1179', 'Type' => 'Const' }, '1200' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '39', 'Name' => 'JobStopReply', 'Size' => 4, 'Tid' => '1200', 'Type' => 'Typedef' }, '1210' => { 'BaseType' => { 'Tid' => '1291' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '72', 'Name' => 'UpstartGetAllReply', 'Size' => 4, 'Tid' => '1210', 'Type' => 'Typedef' }, '1212' => { 'BaseType' => { 'Tid' => '1294' }, 'Header' => 'com.ubuntu.Upstart.h', 'Name' => 'UpstartProperties**', 'Size' => 4, 'Tid' => '1212', 'Type' => 'Pointer' }, '123' => { 'Name' => 'void(*)(void*,NihDBusMessage*,char*const*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' }, '2' => { 'type' => '276' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '123', 'Type' => 'FuncPtr' }, '126' => { 'BaseType' => { 'Tid' => '131' }, 'Header' => '', 'Name' => 'char**', 'Size' => 4, 'Tid' => '126', 'Type' => 'Pointer' }, '1264' => { 'BaseType' => { 'Tid' => '211' }, 'Header' => 'dbus_proxy.h', 'Line' => '72', 'Name' => 'NihDBusSignalHandler', 'Size' => 4, 'Tid' => '1264', 'Type' => 'Typedef' }, '1281' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '37', 'Name' => 'JobStartReply', 'Size' => 4, 'Tid' => '1281', 'Type' => 'Typedef' }, '1291' => { 'Name' => 'void(*)(void*,NihDBusMessage*,UpstartProperties const*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' }, '2' => { 'type' => '1592' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '1291', 'Type' => 'FuncPtr' }, '1294' => { 'BaseType' => { 'Tid' => '1372' }, 'Header' => 'com.ubuntu.Upstart.h', 'Name' => 'UpstartProperties*', 'Size' => 4, 'Tid' => '1294', 'Type' => 'Pointer' }, '131' => { 'BaseType' => { 'Tid' => '166' }, 'Header' => '', 'Name' => 'char*', 'Size' => 4, 'Tid' => '131', 'Type' => 'Pointer' }, '1348' => { 'BaseType' => { 'Tid' => '1098' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusInterface const*[]', 'Size' => 4, 'Tid' => '1348', 'Type' => 'Array' }, '1372' => { 'BaseType' => { 'Tid' => '1449' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '27', 'Name' => 'UpstartProperties', 'Size' => '8', 'Tid' => '1372', 'Type' => 'Typedef' }, '141' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '24', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'name', 'type' => '131' }, '1' => { 'algn' => '4', 'name' => 'description', 'type' => '131' }, '2' => { 'algn' => '4', 'name' => 'author', 'type' => '131' }, '3' => { 'algn' => '4', 'name' => 'version', 'type' => '131' }, '4' => { 'algn' => '4', 'name' => 'usage', 'type' => '131' }, '5' => { 'algn' => '4', 'name' => 'start_on', 'type' => '97' }, '6' => { 'algn' => '4', 'name' => 'stop_on', 'type' => '97' }, '7' => { 'algn' => '4', 'name' => 'emits', 'type' => '126' } }, 'Name' => 'job_class_properties', 'Size' => '32', 'Tid' => '141', 'Type' => 'Struct' }, '1443' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '70', 'Name' => 'UpstartSetLogPriorityReply', 'Size' => 4, 'Tid' => '1443', 'Type' => 'Typedef' }, '1449' => { 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '24', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'version', 'type' => '131' }, '1' => { 'algn' => '4', 'name' => 'log_priority', 'type' => '131' } }, 'Name' => 'upstart_properties', 'Size' => '8', 'Tid' => '1449', 'Type' => 'Struct' }, '1515' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '68', 'Name' => 'UpstartGetLogPriorityReply', 'Size' => 4, 'Tid' => '1515', 'Type' => 'Typedef' }, '156' => { 'BaseType' => { 'Tid' => '191' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '64', 'Name' => 'JobClassGetStopOnReply', 'Size' => 4, 'Tid' => '156', 'Type' => 'Typedef' }, '158' => { 'BaseType' => { 'Tid' => '97' }, 'Header' => '', 'Name' => 'char****', 'Size' => 4, 'Tid' => '158', 'Type' => 'Pointer' }, '1590' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '66', 'Name' => 'UpstartGetVersionReply', 'Size' => 4, 'Tid' => '1590', 'Type' => 'Typedef' }, '1592' => { 'BaseType' => { 'Tid' => '1659' }, 'Header' => 'com.ubuntu.Upstart.h', 'Name' => 'UpstartProperties const*', 'Size' => 4, 'Tid' => '1592', 'Type' => 'Pointer' }, '162' => { 'BaseType' => { 'Tid' => '195' }, 'Header' => 'dbus_interface.h', 'Line' => '31', 'Name' => 'NihDBusObject', 'Tid' => '162', 'Type' => 'Typedef' }, '165' => { 'Header' => 'dbus-connection.h', 'Line' => '51', 'Name' => 'DBusConnection', 'Tid' => '165', 'Type' => 'Struct' }, '1657' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '64', 'Name' => 'UpstartRestartedHandler', 'Size' => 4, 'Tid' => '1657', 'Type' => 'Typedef' }, '1659' => { 'BaseType' => { 'Tid' => '1372' }, 'Header' => 'com.ubuntu.Upstart.h', 'Name' => 'UpstartProperties const', 'Size' => '8', 'Tid' => '1659', 'Type' => 'Const' }, '166' => { 'Header' => '', 'Name' => 'char', 'Size' => '1', 'Tid' => '166', 'Type' => 'Intrinsic' }, '17' => { 'BaseType' => { 'Tid' => '34' }, 'Header' => '', 'Name' => 'void const*', 'Size' => 4, 'Tid' => '17', 'Type' => 'Pointer' }, '171' => { 'BaseType' => { 'Tid' => '209' }, 'Header' => 'dbus_message.h', 'Name' => 'NihDBusMessage*', 'Size' => 4, 'Tid' => '171', 'Type' => 'Pointer' }, '1720' => { 'BaseType' => { 'Tid' => '1786' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '62', 'Name' => 'UpstartEventEmittedHandler', 'Size' => 4, 'Tid' => '1720', 'Type' => 'Typedef' }, '1783' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '56', 'Name' => 'UpstartEndSessionReply', 'Size' => 4, 'Tid' => '1783', 'Type' => 'Typedef' }, '1786' => { 'Name' => 'void(*)(void*,NihDBusMessage*,char const*,char*const*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' }, '2' => { 'type' => '296' }, '3' => { 'type' => '276' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '1786', 'Type' => 'FuncPtr' }, '1789' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '60', 'Name' => 'UpstartJobRemovedHandler', 'Size' => 4, 'Tid' => '1789', 'Type' => 'Typedef' }, '1845' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '58', 'Name' => 'UpstartJobAddedHandler', 'Size' => 4, 'Tid' => '1845', 'Type' => 'Typedef' }, '1897' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '54', 'Name' => 'UpstartNotifyDiskWriteableReply', 'Size' => 4, 'Tid' => '1897', 'Type' => 'Typedef' }, '191' => { 'Name' => 'void(*)(void*,NihDBusMessage*,char**const*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' }, '2' => { 'type' => '372' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '191', 'Type' => 'FuncPtr' }, '195' => { 'Header' => 'dbus_interface.h', 'Line' => '31', 'Name' => 'nih_dbus_object', 'Tid' => '195', 'Type' => 'Struct' }, '2011' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '52', 'Name' => 'UpstartEmitEventWithFileReply', 'Size' => 4, 'Tid' => '2011', 'Type' => 'Typedef' }, '2065' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '50', 'Name' => 'UpstartEmitEventReply', 'Size' => 4, 'Tid' => '2065', 'Type' => 'Typedef' }, '207' => { 'BaseType' => { 'Tid' => '191' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '62', 'Name' => 'JobClassGetStartOnReply', 'Size' => 4, 'Tid' => '207', 'Type' => 'Typedef' }, '209' => { 'BaseType' => { 'Tid' => '247' }, 'Header' => 'dbus_message.h', 'Line' => '58', 'Name' => 'NihDBusMessage', 'Size' => '8', 'Tid' => '209', 'Type' => 'Typedef' }, '210' => { 'BaseType' => { 'Tid' => '250' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Name' => 'JobClassProperties const*', 'Size' => 4, 'Tid' => '210', 'Type' => 'Pointer' }, '211' => { 'Name' => 'void(*)(void*,NihDBusMessage*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '211', 'Type' => 'FuncPtr' }, '2119' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '48', 'Name' => 'UpstartResetEnvReply', 'Size' => 4, 'Tid' => '2119', 'Type' => 'Typedef' }, '214' => { 'BaseType' => { 'Tid' => '252' }, 'Header' => 'dbus_interface.h', 'Line' => '284', 'Name' => 'NihDBusInterface', 'Size' => '16', 'Tid' => '214', 'Type' => 'Typedef' }, '2173' => { 'BaseType' => { 'Tid' => '123' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '46', 'Name' => 'UpstartListEnvReply', 'Size' => 4, 'Tid' => '2173', 'Type' => 'Typedef' }, '2229' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '44', 'Name' => 'UpstartUnsetEnvReply', 'Size' => 4, 'Tid' => '2229', 'Type' => 'Typedef' }, '2279' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '42', 'Name' => 'UpstartSetEnvReply', 'Size' => 4, 'Tid' => '2279', 'Type' => 'Typedef' }, '2329' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '40', 'Name' => 'UpstartGetEnvReply', 'Size' => 4, 'Tid' => '2329', 'Type' => 'Typedef' }, '2379' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '38', 'Name' => 'UpstartRestartReply', 'Size' => 4, 'Tid' => '2379', 'Type' => 'Typedef' }, '2430' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '36', 'Name' => 'UpstartGetStateReply', 'Size' => 4, 'Tid' => '2430', 'Type' => 'Typedef' }, '244' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '60', 'Name' => 'JobClassGetUsageReply', 'Size' => 4, 'Tid' => '244', 'Type' => 'Typedef' }, '247' => { 'Header' => 'dbus_message.h', 'Line' => '55', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'connection', 'type' => '101' }, '1' => { 'algn' => '4', 'name' => 'message', 'type' => '340' } }, 'Name' => 'nih_dbus_message', 'Size' => '8', 'Tid' => '247', 'Type' => 'Struct' }, '2478' => { 'BaseType' => { 'Tid' => '123' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '34', 'Name' => 'UpstartGetAllJobsReply', 'Size' => 4, 'Tid' => '2478', 'Type' => 'Typedef' }, '25' => { 'BaseType' => { 'Tid' => '60' }, 'Header' => 'dbus-connection.h', 'Name' => 'DBusPendingCall*', 'Size' => 4, 'Tid' => '25', 'Type' => 'Pointer' }, '250' => { 'BaseType' => { 'Tid' => '112' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Name' => 'JobClassProperties const', 'Size' => '32', 'Tid' => '250', 'Type' => 'Const' }, '252' => { 'Header' => 'dbus_interface.h', 'Line' => '279', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '1' => { 'algn' => '4', 'name' => 'methods', 'type' => '344' }, '2' => { 'algn' => '4', 'name' => 'signals', 'type' => '392' }, '3' => { 'algn' => '4', 'name' => 'properties', 'type' => '446' } }, 'Name' => 'nih_dbus_interface', 'Size' => '16', 'Tid' => '252', 'Type' => 'Struct' }, '2523' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '32', 'Name' => 'UpstartGetJobByNameReply', 'Size' => 4, 'Tid' => '2523', 'Type' => 'Typedef' }, '2571' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '30', 'Name' => 'UpstartReloadConfigurationReply', 'Size' => 4, 'Tid' => '2571', 'Type' => 'Typedef' }, '276' => { 'BaseType' => { 'Tid' => '323' }, 'Header' => '', 'Name' => 'char*const*', 'Size' => 4, 'Tid' => '276', 'Type' => 'Pointer' }, '284' => { 'BaseType' => { 'Tid' => '329' }, 'Header' => 'dbus_proxy.h', 'Line' => '60', 'Name' => 'NihDBusLostHandler', 'Size' => 4, 'Tid' => '284', 'Type' => 'Typedef' }, '287' => { 'Name' => 'void(*)(void*,NihDBusMessage*,char const*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' }, '2' => { 'type' => '296' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '287', 'Type' => 'FuncPtr' }, '290' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '58', 'Name' => 'JobClassGetVersionReply', 'Size' => 4, 'Tid' => '290', 'Type' => 'Typedef' }, '296' => { 'BaseType' => { 'Tid' => '342' }, 'Header' => '', 'Name' => 'char const*', 'Size' => 4, 'Tid' => '296', 'Type' => 'Pointer' }, '299' => { 'BaseType' => { 'Tid' => '346' }, 'Header' => 'dbus_interface.h', 'Line' => '263', 'Name' => 'NihDBusProperty', 'Size' => '20', 'Tid' => '299', 'Type' => 'Typedef' }, '32' => { 'BaseType' => { 'Tid' => '50' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusProxy*', 'Size' => 4, 'Tid' => '32', 'Type' => 'Pointer' }, '323' => { 'BaseType' => { 'Tid' => '131' }, 'Header' => '', 'Name' => 'char*const', 'Size' => 4, 'Tid' => '323', 'Type' => 'Const' }, '329' => { 'Name' => 'void(*)(void*,NihDBusProxy*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '32' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '329', 'Type' => 'FuncPtr' }, '335' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '56', 'Name' => 'JobClassGetAuthorReply', 'Size' => 4, 'Tid' => '335', 'Type' => 'Typedef' }, '34' => { 'BaseType' => { 'Tid' => '55' }, 'Header' => '', 'Name' => 'void const', 'Tid' => '34', 'Type' => 'Const' }, '340' => { 'BaseType' => { 'Tid' => '440' }, 'Header' => 'dbus-message.h', 'Name' => 'DBusMessage*', 'Size' => 4, 'Tid' => '340', 'Type' => 'Pointer' }, '342' => { 'BaseType' => { 'Tid' => '166' }, 'Header' => '', 'Name' => 'char const', 'Size' => '1', 'Tid' => '342', 'Type' => 'Const' }, '344' => { 'BaseType' => { 'Tid' => '390' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusMethod const*', 'Size' => 4, 'Tid' => '344', 'Type' => 'Pointer' }, '346' => { 'Header' => 'dbus_interface.h', 'Line' => '257', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '1' => { 'algn' => '4', 'name' => 'type', 'type' => '296' }, '2' => { 'algn' => '4', 'name' => 'access', 'type' => '396' }, '3' => { 'algn' => '4', 'name' => 'getter', 'type' => '583' }, '4' => { 'algn' => '4', 'name' => 'setter', 'type' => '650' } }, 'Name' => 'nih_dbus_property', 'Size' => '20', 'Tid' => '346', 'Type' => 'Struct' }, '372' => { 'BaseType' => { 'Tid' => '423' }, 'Header' => '', 'Name' => 'char**const*', 'Size' => 4, 'Tid' => '372', 'Type' => 'Pointer' }, '383' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '54', 'Name' => 'JobClassGetDescriptionReply', 'Size' => 4, 'Tid' => '383', 'Type' => 'Typedef' }, '390' => { 'BaseType' => { 'Tid' => '505' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusMethod const', 'Size' => '12', 'Tid' => '390', 'Type' => 'Const' }, '392' => { 'BaseType' => { 'Tid' => '445' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusSignal const*', 'Size' => 4, 'Tid' => '392', 'Type' => 'Pointer' }, '396' => { 'BaseType' => { 'Tid' => '450' }, 'Header' => 'dbus_interface.h', 'Line' => '232', 'Name' => 'NihDBusAccess', 'Size' => '4', 'Tid' => '396', 'Type' => 'Typedef' }, '406' => { 'BaseType' => { 'Tid' => '466' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '57', 'Name' => 'JobGetAllReply', 'Size' => 4, 'Tid' => '406', 'Type' => 'Typedef' }, '408' => { 'BaseType' => { 'Tid' => '469' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProperties**', 'Size' => 4, 'Tid' => '408', 'Type' => 'Pointer' }, '412' => { 'Header' => 'dbus-shared.h', 'Line' => '71', 'Memb' => { '0' => { 'name' => 'DBUS_HANDLER_RESULT_HANDLED', 'value' => '0' }, '1' => { 'name' => 'DBUS_HANDLER_RESULT_NOT_YET_HANDLED', 'value' => '1' }, '2' => { 'name' => 'DBUS_HANDLER_RESULT_NEED_MEMORY', 'value' => '2' } }, 'Name' => 'DBusHandlerResult', 'Size' => '4', 'Tid' => '412', 'Type' => 'Enum' }, '423' => { 'BaseType' => { 'Tid' => '126' }, 'Header' => '', 'Name' => 'char**const', 'Size' => 4, 'Tid' => '423', 'Type' => 'Const' }, '432' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '52', 'Name' => 'JobClassGetNameReply', 'Size' => 4, 'Tid' => '432', 'Type' => 'Typedef' }, '440' => { 'Header' => 'dbus-message.h', 'Line' => '44', 'Name' => 'DBusMessage', 'Tid' => '440', 'Type' => 'Struct' }, '442' => { 'Header' => 'dbus_interface.h', 'Line' => '191', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '1' => { 'algn' => '4', 'name' => 'args', 'type' => '576' }, '2' => { 'algn' => '4', 'name' => 'handler', 'type' => '642' } }, 'Name' => 'nih_dbus_method', 'Size' => '12', 'Tid' => '442', 'Type' => 'Struct' }, '445' => { 'BaseType' => { 'Tid' => '579' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusSignal const', 'Size' => '12', 'Tid' => '445', 'Type' => 'Const' }, '446' => { 'BaseType' => { 'Tid' => '512' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusProperty const*', 'Size' => 4, 'Tid' => '446', 'Type' => 'Pointer' }, '450' => { 'Header' => 'dbus_interface.h', 'Line' => '228', 'Memb' => { '0' => { 'name' => 'NIH_DBUS_READ', 'value' => '0' }, '1' => { 'name' => 'NIH_DBUS_WRITE', 'value' => '1' }, '2' => { 'name' => 'NIH_DBUS_READWRITE', 'value' => '2' } }, 'Name' => 'nih_dbus_access', 'Size' => '4', 'Tid' => '450', 'Type' => 'Enum' }, '466' => { 'Name' => 'void(*)(void*,NihDBusMessage*,JobProperties const*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' }, '2' => { 'type' => '731' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '466', 'Type' => 'FuncPtr' }, '469' => { 'BaseType' => { 'Tid' => '537' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProperties*', 'Size' => 4, 'Tid' => '469', 'Type' => 'Pointer' }, '492' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '50', 'Name' => 'JobClassInstanceRemovedHandler', 'Size' => 4, 'Tid' => '492', 'Type' => 'Typedef' }, '495' => { 'Header' => '', 'Name' => 'unsigned int', 'Size' => '4', 'Tid' => '495', 'Type' => 'Intrinsic' }, '50' => { 'BaseType' => { 'Tid' => '71' }, 'Header' => 'dbus_interface.h', 'Line' => '32', 'Name' => 'NihDBusProxy', 'Size' => '28', 'Tid' => '50', 'Type' => 'Typedef' }, '505' => { 'BaseType' => { 'Tid' => '442' }, 'Header' => 'dbus_interface.h', 'Line' => '195', 'Name' => 'NihDBusMethod', 'Size' => '12', 'Tid' => '505', 'Type' => 'Typedef' }, '509' => { 'Header' => 'dbus_interface.h', 'Line' => '216', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '1' => { 'algn' => '4', 'name' => 'args', 'type' => '576' }, '2' => { 'algn' => '4', 'name' => 'filter', 'type' => '710' } }, 'Name' => 'nih_dbus_signal', 'Size' => '12', 'Tid' => '509', 'Type' => 'Struct' }, '512' => { 'BaseType' => { 'Tid' => '299' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusProperty const', 'Size' => '20', 'Tid' => '512', 'Type' => 'Const' }, '52' => { 'BaseType' => { 'Tid' => '76' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '68', 'Name' => 'JobClassGetAllReply', 'Size' => 4, 'Tid' => '52', 'Type' => 'Typedef' }, '530' => { 'BaseType' => { 'Tid' => '596' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '55', 'Name' => 'JobGetProcessesReply', 'Size' => 4, 'Tid' => '530', 'Type' => 'Typedef' }, '532' => { 'BaseType' => { 'Tid' => '599' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement***', 'Size' => 4, 'Tid' => '532', 'Type' => 'Pointer' }, '537' => { 'BaseType' => { 'Tid' => '604' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '34', 'Name' => 'JobProperties', 'Size' => '16', 'Tid' => '537', 'Type' => 'Typedef' }, '55' => { 'Header' => '', 'Name' => 'void', 'Tid' => '55', 'Type' => 'Intrinsic' }, '561' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '48', 'Name' => 'JobClassInstanceAddedHandler', 'Size' => 4, 'Tid' => '561', 'Type' => 'Typedef' }, '57' => { 'BaseType' => { 'Tid' => '82' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Name' => 'JobClassProperties**', 'Size' => 4, 'Tid' => '57', 'Type' => 'Pointer' }, '576' => { 'BaseType' => { 'Tid' => '641' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusArg const*', 'Size' => 4, 'Tid' => '576', 'Type' => 'Pointer' }, '579' => { 'BaseType' => { 'Tid' => '509' }, 'Header' => 'dbus_interface.h', 'Line' => '220', 'Name' => 'NihDBusSignal', 'Size' => '12', 'Tid' => '579', 'Type' => 'Typedef' }, '583' => { 'BaseType' => { 'Tid' => '647' }, 'Header' => 'dbus_interface.h', 'Line' => '110', 'Name' => 'NihDBusPropertyGetter', 'Size' => 4, 'Tid' => '583', 'Type' => 'Typedef' }, '596' => { 'Name' => 'void(*)(void*,NihDBusMessage*,JobProcessesElement*const*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' }, '2' => { 'type' => '878' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '596', 'Type' => 'FuncPtr' }, '599' => { 'BaseType' => { 'Tid' => '663' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement**', 'Size' => 4, 'Tid' => '599', 'Type' => 'Pointer' }, '60' => { 'Header' => 'dbus-connection.h', 'Line' => '49', 'Name' => 'DBusPendingCall', 'Tid' => '60', 'Type' => 'Struct' }, '604' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '29', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'name', 'type' => '131' }, '1' => { 'algn' => '4', 'name' => 'goal', 'type' => '131' }, '2' => { 'algn' => '4', 'name' => 'state', 'type' => '131' }, '3' => { 'algn' => '4', 'name' => 'processes', 'type' => '599' } }, 'Name' => 'job_properties', 'Size' => '16', 'Tid' => '604', 'Type' => 'Struct' }, '624' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '46', 'Name' => 'JobClassRestartReply', 'Size' => 4, 'Tid' => '624', 'Type' => 'Typedef' }, '639' => { 'BaseType' => { 'Tid' => '700' }, 'Header' => 'dbus_interface.h', 'Line' => '170', 'Name' => 'NihDBusArg', 'Size' => '12', 'Tid' => '639', 'Type' => 'Typedef' }, '641' => { 'BaseType' => { 'Tid' => '639' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusArg const', 'Size' => '12', 'Tid' => '641', 'Type' => 'Const' }, '642' => { 'BaseType' => { 'Tid' => '706' }, 'Header' => 'dbus_interface.h', 'Line' => '57', 'Name' => 'NihDBusMethodHandler', 'Size' => 4, 'Tid' => '642', 'Type' => 'Typedef' }, '647' => { 'Name' => 'int(*)(NihDBusObject*,NihDBusMessage*,DBusMessageIter*)', 'Param' => { '0' => { 'type' => '787' }, '1' => { 'type' => '171' }, '2' => { 'type' => '951' } }, 'Return' => '10', 'Size' => 4, 'Tid' => '647', 'Type' => 'FuncPtr' }, '650' => { 'BaseType' => { 'Tid' => '647' }, 'Header' => 'dbus_interface.h', 'Line' => '138', 'Name' => 'NihDBusPropertySetter', 'Size' => 4, 'Tid' => '650', 'Type' => 'Typedef' }, '659' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '53', 'Name' => 'JobGetStateReply', 'Size' => 4, 'Tid' => '659', 'Type' => 'Typedef' }, '663' => { 'BaseType' => { 'Tid' => '727' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement*', 'Size' => 4, 'Tid' => '663', 'Type' => 'Pointer' }, '685' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '44', 'Name' => 'JobClassStopReply', 'Size' => 4, 'Tid' => '685', 'Type' => 'Typedef' }, '700' => { 'Header' => 'dbus_interface.h', 'Line' => '166', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'name', 'type' => '296' }, '1' => { 'algn' => '4', 'name' => 'type', 'type' => '296' }, '2' => { 'algn' => '4', 'name' => 'dir', 'type' => '778' } }, 'Name' => 'nih_dbus_arg', 'Size' => '12', 'Tid' => '700', 'Type' => 'Struct' }, '706' => { 'Name' => 'DBusHandlerResult(*)(NihDBusObject*,NihDBusMessage*)', 'Param' => { '0' => { 'type' => '787' }, '1' => { 'type' => '171' } }, 'Return' => '412', 'Size' => 4, 'Tid' => '706', 'Type' => 'FuncPtr' }, '71' => { 'Header' => 'dbus_proxy.h', 'Line' => '106', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'connection', 'type' => '101' }, '1' => { 'algn' => '4', 'name' => 'name', 'type' => '131' }, '2' => { 'algn' => '4', 'name' => 'owner', 'type' => '131' }, '3' => { 'algn' => '4', 'name' => 'path', 'type' => '131' }, '4' => { 'algn' => '4', 'name' => 'auto_start', 'type' => '10' }, '5' => { 'algn' => '4', 'name' => 'lost_handler', 'type' => '284' }, '6' => { 'algn' => '4', 'name' => 'data', 'type' => '110' } }, 'Name' => 'nih_dbus_proxy', 'Size' => '28', 'Tid' => '71', 'Type' => 'Struct' }, '710' => { 'BaseType' => { 'Tid' => '783' }, 'Header' => 'dbus_interface.h', 'Line' => '82', 'Name' => 'NihDBusSignalFilter', 'Size' => 4, 'Tid' => '710', 'Type' => 'Typedef' }, '727' => { 'BaseType' => { 'Tid' => '800' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '27', 'Name' => 'JobProcessesElement', 'Size' => '8', 'Tid' => '727', 'Type' => 'Typedef' }, '729' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '51', 'Name' => 'JobGetGoalReply', 'Size' => 4, 'Tid' => '729', 'Type' => 'Typedef' }, '731' => { 'BaseType' => { 'Tid' => '806' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProperties const*', 'Size' => 4, 'Tid' => '731', 'Type' => 'Pointer' }, '752' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '42', 'Name' => 'JobClassStartReply', 'Size' => 4, 'Tid' => '752', 'Type' => 'Typedef' }, '76' => { 'Name' => 'void(*)(void*,NihDBusMessage*,JobClassProperties const*)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' }, '2' => { 'type' => '210' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '76', 'Type' => 'FuncPtr' }, '778' => { 'BaseType' => { 'Tid' => '857' }, 'Header' => 'dbus_interface.h', 'Line' => '151', 'Name' => 'NihDBusArgDir', 'Size' => '4', 'Tid' => '778', 'Type' => 'Typedef' }, '783' => { 'Name' => 'DBusHandlerResult(*)(DBusConnection*,DBusMessage*,NihDBusProxySignal*)', 'Param' => { '0' => { 'type' => '101' }, '1' => { 'type' => '340' }, '2' => { 'type' => '1100' } }, 'Return' => '412', 'Size' => 4, 'Tid' => '783', 'Type' => 'FuncPtr' }, '787' => { 'BaseType' => { 'Tid' => '162' }, 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusObject*', 'Size' => 4, 'Tid' => '787', 'Type' => 'Pointer' }, '79' => { 'BaseType' => { 'Tid' => '107' }, 'Header' => 'dbus_pending_data.h', 'Line' => '75', 'Name' => 'NihDBusErrorHandler', 'Size' => 4, 'Tid' => '79', 'Type' => 'Typedef' }, '800' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '24', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'item0', 'type' => '131' }, '1' => { 'algn' => '4', 'name' => 'item1', 'type' => '964' } }, 'Name' => 'job_processes_element', 'Size' => '8', 'Tid' => '800', 'Type' => 'Struct' }, '804' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '49', 'Name' => 'JobGetNameReply', 'Size' => 4, 'Tid' => '804', 'Type' => 'Typedef' }, '806' => { 'BaseType' => { 'Tid' => '537' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProperties const', 'Size' => '16', 'Tid' => '806', 'Type' => 'Const' }, '82' => { 'BaseType' => { 'Tid' => '112' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Name' => 'JobClassProperties*', 'Size' => 4, 'Tid' => '82', 'Type' => 'Pointer' }, '827' => { 'BaseType' => { 'Tid' => '123' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '40', 'Name' => 'JobClassGetAllInstancesReply', 'Size' => 4, 'Tid' => '827', 'Type' => 'Typedef' }, '834' => { 'BaseType' => { 'Tid' => '495' }, 'Header' => 'dbus-arch-deps.h', 'Line' => '49', 'Name' => 'dbus_uint32_t', 'Size' => '4', 'Tid' => '834', 'Type' => 'Typedef' }, '857' => { 'Header' => 'dbus_interface.h', 'Line' => '148', 'Memb' => { '0' => { 'name' => 'NIH_DBUS_ARG_IN', 'value' => '0' }, '1' => { 'name' => 'NIH_DBUS_ARG_OUT', 'value' => '1' } }, 'Name' => 'nih_dbus_arg_dir', 'Size' => '4', 'Tid' => '857', 'Type' => 'Enum' }, '863' => { 'BaseType' => { 'Tid' => '946' }, 'Header' => 'dbus_interface.h', 'Line' => '33', 'Name' => 'NihDBusProxySignal', 'Size' => '20', 'Tid' => '863', 'Type' => 'Typedef' }, '878' => { 'BaseType' => { 'Tid' => '962' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement*const*', 'Size' => 4, 'Tid' => '878', 'Type' => 'Pointer' }, '882' => { 'BaseType' => { 'Tid' => '966' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '47', 'Name' => 'JobFailedHandler', 'Size' => 4, 'Tid' => '882', 'Type' => 'Typedef' }, '906' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '38', 'Name' => 'JobClassGetInstanceByNameReply', 'Size' => 4, 'Tid' => '906', 'Type' => 'Typedef' }, '94' => { 'BaseType' => { 'Tid' => '123' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '66', 'Name' => 'JobClassGetEmitsReply', 'Size' => 4, 'Tid' => '94', 'Type' => 'Typedef' }, '946' => { 'Header' => 'dbus_proxy.h', 'Line' => '133', 'Memb' => { '0' => { 'algn' => '4', 'name' => 'proxy', 'type' => '32' }, '1' => { 'algn' => '4', 'name' => 'interface', 'type' => '1098' }, '2' => { 'algn' => '4', 'name' => 'signal', 'type' => '392' }, '3' => { 'algn' => '4', 'name' => 'handler', 'type' => '1264' }, '4' => { 'algn' => '4', 'name' => 'data', 'type' => '110' } }, 'Name' => 'nih_dbus_proxy_signal', 'Size' => '20', 'Tid' => '946', 'Type' => 'Struct' }, '951' => { 'BaseType' => { 'Tid' => '1102' }, 'Header' => 'dbus-message.h', 'Name' => 'DBusMessageIter*', 'Size' => 4, 'Tid' => '951', 'Type' => 'Pointer' }, '962' => { 'BaseType' => { 'Tid' => '663' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement*const', 'Size' => 4, 'Tid' => '962', 'Type' => 'Const' }, '964' => { 'BaseType' => { 'Tid' => '10' }, 'Header' => 'stdint.h', 'Line' => '10', 'Name' => 'int32_t', 'Size' => '4', 'Tid' => '964', 'Type' => 'Typedef' }, '966' => { 'Name' => 'void(*)(void*,NihDBusMessage*,int32_t)', 'Param' => { '0' => { 'type' => '110' }, '1' => { 'type' => '171' }, '2' => { 'type' => '964' } }, 'Return' => '55', 'Size' => 4, 'Tid' => '966', 'Type' => 'FuncPtr' }, '969' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '45', 'Name' => 'JobStateChangedHandler', 'Size' => 4, 'Tid' => '969', 'Type' => 'Typedef' }, '97' => { 'BaseType' => { 'Tid' => '126' }, 'Header' => '', 'Name' => 'char***', 'Size' => 4, 'Tid' => '97', 'Type' => 'Pointer' }, '993' => { 'BaseType' => { 'Tid' => '287' }, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '36', 'Name' => 'JobClassGetInstanceReply', 'Size' => 4, 'Tid' => '993', 'Type' => 'Typedef' } }, 'WordSize' => 4 }; upstart-1.13.2/lib/abi/x86_64-linux-gnu/0000775000175000017500000000000012373101356014467 500000000000000upstart-1.13.2/lib/abi/x86_64-linux-gnu/libupstart_1.0.0.abi0000664000175000017500000201222312373101356017773 00000000000000$VAR1 = { 'ABI_COMPLIANCE_CHECKER_VERSION' => '1.99.8.5', 'ABI_DUMP_VERSION' => '3.2', 'Arch' => 'x86_64', 'Constants' => { 'DBUS_ADDRESS_UPSTART' => { 'Header' => 'upstart-dbus.h', 'Value' => '"unix:abstract=/com/ubuntu/upstart"' }, 'DBUS_INTERFACE_UPSTART' => { 'Header' => 'upstart-dbus.h', 'Value' => '"com.ubuntu.Upstart0_6"' }, 'DBUS_INTERFACE_UPSTART_INSTANCE' => { 'Header' => 'upstart-dbus.h', 'Value' => '"com.ubuntu.Upstart0_6.Instance"' }, 'DBUS_INTERFACE_UPSTART_JOB' => { 'Header' => 'upstart-dbus.h', 'Value' => '"com.ubuntu.Upstart0_6.Job"' }, 'DBUS_PATH_UPSTART' => { 'Header' => 'upstart-dbus.h', 'Value' => '"/com/ubuntu/Upstart"' }, 'DBUS_SERVICE_UPSTART' => { 'Header' => 'upstart-dbus.h', 'Value' => '"com.ubuntu.Upstart"' } }, 'DepSymbols' => { 'libc-2.17.so' => { '_Exit@@GLIBC_2.16' => 1, '_IO_2_1_stderr_@@GLIBC_2.16' => -160, '_IO_2_1_stdin_@@GLIBC_2.16' => -160, '_IO_2_1_stdout_@@GLIBC_2.16' => -160, '_IO_adjust_column@@GLIBC_2.16' => 1, '_IO_adjust_wcolumn@@GLIBC_2.16' => 1, '_IO_default_doallocate@@GLIBC_2.16' => 1, '_IO_default_finish@@GLIBC_2.16' => 1, '_IO_default_pbackfail@@GLIBC_2.16' => 1, '_IO_default_uflow@@GLIBC_2.16' => 1, '_IO_default_xsgetn@@GLIBC_2.16' => 1, '_IO_default_xsputn@@GLIBC_2.16' => 1, '_IO_do_write@@GLIBC_2.16' => 1, '_IO_doallocbuf@@GLIBC_2.16' => 1, '_IO_fclose@@GLIBC_2.16' => 1, '_IO_fdopen@@GLIBC_2.16' => 1, '_IO_feof@@GLIBC_2.16' => 1, '_IO_ferror@@GLIBC_2.16' => 1, '_IO_fflush@@GLIBC_2.16' => 1, '_IO_fgetpos64@@GLIBC_2.16' => 1, '_IO_fgetpos@@GLIBC_2.16' => 1, '_IO_fgets@@GLIBC_2.16' => 1, '_IO_file_attach@@GLIBC_2.16' => 1, '_IO_file_close@@GLIBC_2.16' => 1, '_IO_file_close_it@@GLIBC_2.16' => 1, '_IO_file_doallocate@@GLIBC_2.16' => 1, '_IO_file_finish@@GLIBC_2.16' => 1, '_IO_file_fopen@@GLIBC_2.16' => 1, '_IO_file_init@@GLIBC_2.16' => 1, '_IO_file_jumps@@GLIBC_2.16' => -84, '_IO_file_open@@GLIBC_2.16' => 1, '_IO_file_overflow@@GLIBC_2.16' => 1, '_IO_file_read@@GLIBC_2.16' => 1, '_IO_file_seek@@GLIBC_2.16' => 1, '_IO_file_seekoff@@GLIBC_2.16' => 1, '_IO_file_setbuf@@GLIBC_2.16' => 1, '_IO_file_stat@@GLIBC_2.16' => 1, '_IO_file_sync@@GLIBC_2.16' => 1, '_IO_file_underflow@@GLIBC_2.16' => 1, '_IO_file_write@@GLIBC_2.16' => 1, '_IO_file_xsputn@@GLIBC_2.16' => 1, '_IO_flockfile@@GLIBC_2.16' => 1, '_IO_flush_all@@GLIBC_2.16' => 1, '_IO_flush_all_linebuffered@@GLIBC_2.16' => 1, '_IO_fopen@@GLIBC_2.16' => 1, '_IO_fprintf@@GLIBC_2.16' => 1, '_IO_fputs@@GLIBC_2.16' => 1, '_IO_fread@@GLIBC_2.16' => 1, '_IO_free_backup_area@@GLIBC_2.16' => 1, '_IO_free_wbackup_area@@GLIBC_2.16' => 1, '_IO_fsetpos64@@GLIBC_2.16' => 1, '_IO_fsetpos@@GLIBC_2.16' => 1, '_IO_ftell@@GLIBC_2.16' => 1, '_IO_ftrylockfile@@GLIBC_2.16' => 1, '_IO_funlockfile@@GLIBC_2.16' => 1, '_IO_fwrite@@GLIBC_2.16' => 1, '_IO_getc@@GLIBC_2.16' => 1, '_IO_getline@@GLIBC_2.16' => 1, '_IO_getline_info@@GLIBC_2.16' => 1, '_IO_gets@@GLIBC_2.16' => 1, '_IO_init@@GLIBC_2.16' => 1, '_IO_init_marker@@GLIBC_2.16' => 1, '_IO_init_wmarker@@GLIBC_2.16' => 1, '_IO_iter_begin@@GLIBC_2.16' => 1, '_IO_iter_end@@GLIBC_2.16' => 1, '_IO_iter_file@@GLIBC_2.16' => 1, '_IO_iter_next@@GLIBC_2.16' => 1, '_IO_least_wmarker@@GLIBC_2.16' => 1, '_IO_link_in@@GLIBC_2.16' => 1, '_IO_list_all@@GLIBC_2.16' => -4, '_IO_list_lock@@GLIBC_2.16' => 1, '_IO_list_resetlock@@GLIBC_2.16' => 1, '_IO_list_unlock@@GLIBC_2.16' => 1, '_IO_marker_delta@@GLIBC_2.16' => 1, '_IO_marker_difference@@GLIBC_2.16' => 1, '_IO_padn@@GLIBC_2.16' => 1, '_IO_peekc_locked@@GLIBC_2.16' => 1, '_IO_popen@@GLIBC_2.16' => 1, '_IO_printf@@GLIBC_2.16' => 1, '_IO_proc_close@@GLIBC_2.16' => 1, '_IO_proc_open@@GLIBC_2.16' => 1, '_IO_putc@@GLIBC_2.16' => 1, '_IO_puts@@GLIBC_2.16' => 1, '_IO_remove_marker@@GLIBC_2.16' => 1, '_IO_seekmark@@GLIBC_2.16' => 1, '_IO_seekoff@@GLIBC_2.16' => 1, '_IO_seekpos@@GLIBC_2.16' => 1, '_IO_seekwmark@@GLIBC_2.16' => 1, '_IO_setb@@GLIBC_2.16' => 1, '_IO_setbuffer@@GLIBC_2.16' => 1, '_IO_setvbuf@@GLIBC_2.16' => 1, '_IO_sgetn@@GLIBC_2.16' => 1, '_IO_sprintf@@GLIBC_2.16' => 1, '_IO_sputbackc@@GLIBC_2.16' => 1, '_IO_sputbackwc@@GLIBC_2.16' => 1, '_IO_sscanf@@GLIBC_2.16' => 1, '_IO_str_init_readonly@@GLIBC_2.16' => 1, '_IO_str_init_static@@GLIBC_2.16' => 1, '_IO_str_overflow@@GLIBC_2.16' => 1, '_IO_str_pbackfail@@GLIBC_2.16' => 1, '_IO_str_seekoff@@GLIBC_2.16' => 1, '_IO_str_underflow@@GLIBC_2.16' => 1, '_IO_sungetc@@GLIBC_2.16' => 1, '_IO_sungetwc@@GLIBC_2.16' => 1, '_IO_switch_to_get_mode@@GLIBC_2.16' => 1, '_IO_switch_to_main_wget_area@@GLIBC_2.16' => 1, '_IO_switch_to_wbackup_area@@GLIBC_2.16' => 1, '_IO_switch_to_wget_mode@@GLIBC_2.16' => 1, '_IO_un_link@@GLIBC_2.16' => 1, '_IO_ungetc@@GLIBC_2.16' => 1, '_IO_unsave_markers@@GLIBC_2.16' => 1, '_IO_unsave_wmarkers@@GLIBC_2.16' => 1, '_IO_vfprintf@@GLIBC_2.16' => 1, '_IO_vfscanf@@GLIBC_2.16' => 1, '_IO_vsprintf@@GLIBC_2.16' => 1, '_IO_wdefault_doallocate@@GLIBC_2.16' => 1, '_IO_wdefault_finish@@GLIBC_2.16' => 1, '_IO_wdefault_pbackfail@@GLIBC_2.16' => 1, '_IO_wdefault_uflow@@GLIBC_2.16' => 1, '_IO_wdefault_xsgetn@@GLIBC_2.16' => 1, '_IO_wdefault_xsputn@@GLIBC_2.16' => 1, '_IO_wdo_write@@GLIBC_2.16' => 1, '_IO_wdoallocbuf@@GLIBC_2.16' => 1, '_IO_wfile_jumps@@GLIBC_2.16' => -84, '_IO_wfile_overflow@@GLIBC_2.16' => 1, '_IO_wfile_seekoff@@GLIBC_2.16' => 1, '_IO_wfile_sync@@GLIBC_2.16' => 1, '_IO_wfile_underflow@@GLIBC_2.16' => 1, '_IO_wfile_xsputn@@GLIBC_2.16' => 1, '_IO_wmarker_delta@@GLIBC_2.16' => 1, '_IO_wsetb@@GLIBC_2.16' => 1, '__abort_msg@@GLIBC_PRIVATE' => -4, '__adjtimex@@GLIBC_2.16' => 1, '__after_morecore_hook@@GLIBC_2.16' => -4, '__arch_prctl@@GLIBC_2.16' => 1, '__argz_count@@GLIBC_2.16' => 1, '__argz_next@@GLIBC_2.16' => 1, '__argz_stringify@@GLIBC_2.16' => 1, '__asprintf@@GLIBC_2.16' => 1, '__asprintf_chk@@GLIBC_2.16' => 1, '__assert@@GLIBC_2.16' => 1, '__assert_fail@@GLIBC_2.16' => 1, '__assert_perror_fail@@GLIBC_2.16' => 1, '__backtrace@@GLIBC_2.16' => 1, '__backtrace_symbols@@GLIBC_2.16' => 1, '__backtrace_symbols_fd@@GLIBC_2.16' => 1, '__bsd_getpgrp@@GLIBC_2.16' => 1, '__bzero@@GLIBC_2.16' => 1, '__check_rhosts_file@@GLIBC_2.16' => -4, '__chk_fail@@GLIBC_2.16' => 1, '__clock_getcpuclockid@@GLIBC_PRIVATE' => 1, '__clock_getres@@GLIBC_PRIVATE' => 1, '__clock_gettime@@GLIBC_PRIVATE' => 1, '__clock_nanosleep@@GLIBC_PRIVATE' => 1, '__clock_settime@@GLIBC_PRIVATE' => 1, '__clone@@GLIBC_2.16' => 1, '__close@@GLIBC_2.16' => 1, '__cmsg_nxthdr@@GLIBC_2.16' => 1, '__confstr_chk@@GLIBC_2.16' => 1, '__connect@@GLIBC_2.16' => 1, '__ctype_b_loc@@GLIBC_2.16' => 1, '__ctype_get_mb_cur_max@@GLIBC_2.16' => 1, '__ctype_init@@GLIBC_PRIVATE' => 1, '__ctype_tolower_loc@@GLIBC_2.16' => 1, '__ctype_toupper_loc@@GLIBC_2.16' => 1, '__curbrk@@GLIBC_2.16' => -4, '__cxa_at_quick_exit@@GLIBC_2.16' => 1, '__cxa_atexit@@GLIBC_2.16' => 1, '__cxa_finalize@@GLIBC_2.16' => 1, '__cyg_profile_func_enter@@GLIBC_2.16' => 1, '__cyg_profile_func_exit@@GLIBC_2.16' => 1, '__daylight@@GLIBC_2.16' => -4, '__dcgettext@@GLIBC_2.16' => 1, '__default_morecore@@GLIBC_2.16' => 1, '__dgettext@@GLIBC_2.16' => 1, '__dprintf_chk@@GLIBC_2.16' => 1, '__dup2@@GLIBC_2.16' => 1, '__duplocale@@GLIBC_2.16' => 1, '__endmntent@@GLIBC_2.16' => 1, '__environ@@GLIBC_2.16' => -4, '__errno_location@@GLIBC_2.16' => 1, '__fbufsize@@GLIBC_2.16' => 1, '__fcntl@@GLIBC_2.16' => 1, '__fdelt_chk@@GLIBC_2.16' => 1, '__fdelt_warn@@GLIBC_2.16' => 1, '__fentry__@@GLIBC_2.16' => 1, '__ffs@@GLIBC_2.16' => 1, '__fgets_chk@@GLIBC_2.16' => 1, '__fgets_unlocked_chk@@GLIBC_2.16' => 1, '__fgetws_chk@@GLIBC_2.16' => 1, '__fgetws_unlocked_chk@@GLIBC_2.16' => 1, '__finite@@GLIBC_2.16' => 1, '__finitef@@GLIBC_2.16' => 1, '__finitel@@GLIBC_2.16' => 1, '__flbf@@GLIBC_2.16' => 1, '__fork@@GLIBC_2.16' => 1, '__fortify_fail@@GLIBC_PRIVATE' => 1, '__fpending@@GLIBC_2.16' => 1, '__fprintf_chk@@GLIBC_2.16' => 1, '__fpu_control@@GLIBC_2.16' => -2, '__fpurge@@GLIBC_2.16' => 1, '__fread_chk@@GLIBC_2.16' => 1, '__fread_unlocked_chk@@GLIBC_2.16' => 1, '__freadable@@GLIBC_2.16' => 1, '__freading@@GLIBC_2.16' => 1, '__free_hook@@GLIBC_2.16' => -4, '__freelocale@@GLIBC_2.16' => 1, '__fsetlocking@@GLIBC_2.16' => 1, '__fwprintf_chk@@GLIBC_2.16' => 1, '__fwritable@@GLIBC_2.16' => 1, '__fwriting@@GLIBC_2.16' => 1, '__fxstat64@@GLIBC_2.16' => 1, '__fxstat@@GLIBC_2.16' => 1, '__fxstatat64@@GLIBC_2.16' => 1, '__fxstatat@@GLIBC_2.16' => 1, '__gai_sigqueue@@GLIBC_PRIVATE' => 1, '__gconv_get_alias_db@@GLIBC_PRIVATE' => 1, '__gconv_get_cache@@GLIBC_PRIVATE' => 1, '__gconv_get_modules_db@@GLIBC_PRIVATE' => 1, '__get_cpu_features@@GLIBC_PRIVATE' => 1, '__getauxval@@GLIBC_2.16' => 1, '__getcwd_chk@@GLIBC_2.16' => 1, '__getdelim@@GLIBC_2.16' => 1, '__getdomainname_chk@@GLIBC_2.16' => 1, '__getgroups_chk@@GLIBC_2.16' => 1, '__gethostname_chk@@GLIBC_2.16' => 1, '__getlogin_r_chk@@GLIBC_2.16' => 1, '__getmntent_r@@GLIBC_2.16' => 1, '__getpagesize@@GLIBC_2.16' => 1, '__getpgid@@GLIBC_2.16' => 1, '__getpid@@GLIBC_2.16' => 1, '__gets_chk@@GLIBC_2.16' => 1, '__gettimeofday@@GLIBC_2.16' => 1, '__getwd_chk@@GLIBC_2.16' => 1, '__gmtime_r@@GLIBC_2.16' => 1, '__h_errno_location@@GLIBC_2.16' => 1, '__internal_endnetgrent@@GLIBC_PRIVATE' => 1, '__internal_getnetgrent_r@@GLIBC_PRIVATE' => 1, '__internal_setnetgrent@@GLIBC_PRIVATE' => 1, '__isalnum_l@@GLIBC_2.16' => 1, '__isalpha_l@@GLIBC_2.16' => 1, '__isascii_l@@GLIBC_2.16' => 1, '__isblank_l@@GLIBC_2.16' => 1, '__iscntrl_l@@GLIBC_2.16' => 1, '__isctype@@GLIBC_2.16' => 1, '__isdigit_l@@GLIBC_2.16' => 1, '__isgraph_l@@GLIBC_2.16' => 1, '__isinf@@GLIBC_2.16' => 1, '__isinff@@GLIBC_2.16' => 1, '__isinfl@@GLIBC_2.16' => 1, '__islower_l@@GLIBC_2.16' => 1, '__isnan@@GLIBC_2.16' => 1, '__isnanf@@GLIBC_2.16' => 1, '__isnanl@@GLIBC_2.16' => 1, '__isoc99_fscanf@@GLIBC_2.16' => 1, '__isoc99_fwscanf@@GLIBC_2.16' => 1, '__isoc99_scanf@@GLIBC_2.16' => 1, '__isoc99_sscanf@@GLIBC_2.16' => 1, '__isoc99_swscanf@@GLIBC_2.16' => 1, '__isoc99_vfscanf@@GLIBC_2.16' => 1, '__isoc99_vfwscanf@@GLIBC_2.16' => 1, '__isoc99_vscanf@@GLIBC_2.16' => 1, '__isoc99_vsscanf@@GLIBC_2.16' => 1, '__isoc99_vswscanf@@GLIBC_2.16' => 1, '__isoc99_vwscanf@@GLIBC_2.16' => 1, '__isoc99_wscanf@@GLIBC_2.16' => 1, '__isprint_l@@GLIBC_2.16' => 1, '__ispunct_l@@GLIBC_2.16' => 1, '__isspace_l@@GLIBC_2.16' => 1, '__isupper_l@@GLIBC_2.16' => 1, '__iswalnum_l@@GLIBC_2.16' => 1, '__iswalpha_l@@GLIBC_2.16' => 1, '__iswblank_l@@GLIBC_2.16' => 1, '__iswcntrl_l@@GLIBC_2.16' => 1, '__iswctype@@GLIBC_2.16' => 1, '__iswctype_l@@GLIBC_2.16' => 1, '__iswdigit_l@@GLIBC_2.16' => 1, '__iswgraph_l@@GLIBC_2.16' => 1, '__iswlower_l@@GLIBC_2.16' => 1, '__iswprint_l@@GLIBC_2.16' => 1, '__iswpunct_l@@GLIBC_2.16' => 1, '__iswspace_l@@GLIBC_2.16' => 1, '__iswupper_l@@GLIBC_2.16' => 1, '__iswxdigit_l@@GLIBC_2.16' => 1, '__isxdigit_l@@GLIBC_2.16' => 1, '__ivaliduser@@GLIBC_2.16' => 1, '__key_decryptsession_pk_LOCAL@@GLIBC_2.16' => -4, '__key_encryptsession_pk_LOCAL@@GLIBC_2.16' => -4, '__key_gendes_LOCAL@@GLIBC_2.16' => -4, '__libc_alloca_cutoff@@GLIBC_PRIVATE' => 1, '__libc_allocate_rtsig@@GLIBC_2.16' => 1, '__libc_allocate_rtsig_private@@GLIBC_PRIVATE' => 1, '__libc_calloc@@GLIBC_2.16' => 1, '__libc_clntudp_bufcreate@@GLIBC_PRIVATE' => 1, '__libc_current_sigrtmax@@GLIBC_2.16' => 1, '__libc_current_sigrtmax_private@@GLIBC_PRIVATE' => 1, '__libc_current_sigrtmin@@GLIBC_2.16' => 1, '__libc_current_sigrtmin_private@@GLIBC_PRIVATE' => 1, '__libc_dl_error_tsd@@GLIBC_PRIVATE' => 1, '__libc_dlclose@@GLIBC_PRIVATE' => 1, '__libc_dlopen_mode@@GLIBC_PRIVATE' => 1, '__libc_dlsym@@GLIBC_PRIVATE' => 1, '__libc_fatal@@GLIBC_PRIVATE' => 1, '__libc_fork@@GLIBC_PRIVATE' => 1, '__libc_free@@GLIBC_2.16' => 1, '__libc_freeres@@GLIBC_2.16' => 1, '__libc_ifunc_impl_list@@GLIBC_PRIVATE' => 1, '__libc_init_first@@GLIBC_2.16' => 1, '__libc_longjmp@@GLIBC_PRIVATE' => 1, '__libc_mallinfo@@GLIBC_2.16' => 1, '__libc_malloc@@GLIBC_2.16' => 1, '__libc_mallopt@@GLIBC_2.16' => 1, '__libc_memalign@@GLIBC_2.16' => 1, '__libc_pthread_init@@GLIBC_PRIVATE' => 1, '__libc_pvalloc@@GLIBC_2.16' => 1, '__libc_pwrite@@GLIBC_PRIVATE' => 1, '__libc_realloc@@GLIBC_2.16' => 1, '__libc_rpc_getport@@GLIBC_PRIVATE' => 1, '__libc_sa_len@@GLIBC_2.16' => 1, '__libc_secure_getenv@@GLIBC_PRIVATE' => 1, '__libc_siglongjmp@@GLIBC_PRIVATE' => 1, '__libc_start_main@@GLIBC_2.16' => 1, '__libc_system@@GLIBC_PRIVATE' => 1, '__libc_thread_freeres@@GLIBC_PRIVATE' => 1, '__libc_valloc@@GLIBC_2.16' => 1, '__longjmp_chk@@GLIBC_2.16' => 1, '__lseek@@GLIBC_2.16' => 1, '__lxstat64@@GLIBC_2.16' => 1, '__lxstat@@GLIBC_2.16' => 1, '__madvise@@GLIBC_PRIVATE' => 1, '__malloc_hook@@GLIBC_2.16' => -4, '__malloc_initialize_hook@@GLIBC_2.16' => -4, '__mbrlen@@GLIBC_2.16' => 1, '__mbrtowc@@GLIBC_2.16' => 1, '__mbsnrtowcs_chk@@GLIBC_2.16' => 1, '__mbsrtowcs_chk@@GLIBC_2.16' => 1, '__mbstowcs_chk@@GLIBC_2.16' => 1, '__memalign_hook@@GLIBC_2.16' => -4, '__memcpy_chk@@GLIBC_2.16' => 1, '__memmove_chk@@GLIBC_2.16' => 1, '__mempcpy@@GLIBC_2.16' => 1, '__mempcpy_chk@@GLIBC_2.16' => 1, '__mempcpy_small@@GLIBC_2.16' => 1, '__memset_chk@@GLIBC_2.16' => 1, '__monstartup@@GLIBC_2.16' => 1, '__morecore@@GLIBC_2.16' => -4, '__nanosleep@@GLIBC_2.16' => 1, '__newlocale@@GLIBC_2.16' => 1, '__nl_langinfo_l@@GLIBC_2.16' => 1, '__nss_configure_lookup@@GLIBC_2.16' => 1, '__nss_database_lookup@@GLIBC_2.16' => 1, '__nss_disable_nscd@@GLIBC_PRIVATE' => 1, '__nss_group_lookup2@@GLIBC_PRIVATE' => 1, '__nss_group_lookup@@GLIBC_2.16' => 1, '__nss_hostname_digits_dots@@GLIBC_2.16' => 1, '__nss_hosts_lookup2@@GLIBC_PRIVATE' => 1, '__nss_hosts_lookup@@GLIBC_2.16' => 1, '__nss_lookup@@GLIBC_PRIVATE' => 1, '__nss_lookup_function@@GLIBC_PRIVATE' => 1, '__nss_next2@@GLIBC_PRIVATE' => 1, '__nss_next@@GLIBC_2.16' => 1, '__nss_passwd_lookup2@@GLIBC_PRIVATE' => 1, '__nss_passwd_lookup@@GLIBC_2.16' => 1, '__nss_services_lookup2@@GLIBC_PRIVATE' => 1, '__obstack_printf_chk@@GLIBC_2.16' => 1, '__obstack_vprintf_chk@@GLIBC_2.16' => 1, '__open64@@GLIBC_2.16' => 1, '__open64_2@@GLIBC_2.16' => 1, '__open@@GLIBC_2.16' => 1, '__open_2@@GLIBC_2.16' => 1, '__open_catalog@@GLIBC_PRIVATE' => 1, '__openat64_2@@GLIBC_2.16' => 1, '__openat_2@@GLIBC_2.16' => 1, '__overflow@@GLIBC_2.16' => 1, '__pipe@@GLIBC_2.16' => 1, '__poll@@GLIBC_2.16' => 1, '__poll_chk@@GLIBC_2.16' => 1, '__posix_getopt@@GLIBC_2.16' => 1, '__ppoll_chk@@GLIBC_2.16' => 1, '__pread64@@GLIBC_2.16' => 1, '__pread64_chk@@GLIBC_2.16' => 1, '__pread_chk@@GLIBC_2.16' => 1, '__printf_chk@@GLIBC_2.16' => 1, '__printf_fp@@GLIBC_2.16' => 1, '__profile_frequency@@GLIBC_2.16' => 1, '__progname@@GLIBC_2.16' => -4, '__progname_full@@GLIBC_2.16' => -4, '__ptsname_r_chk@@GLIBC_2.16' => 1, '__pwrite64@@GLIBC_2.16' => 1, '__rawmemchr@@GLIBC_2.16' => 1, '__rcmd_errstr@@GLIBC_2.16' => -4, '__read@@GLIBC_2.16' => 1, '__read_chk@@GLIBC_2.16' => 1, '__readlink_chk@@GLIBC_2.16' => 1, '__readlinkat_chk@@GLIBC_2.16' => 1, '__realloc_hook@@GLIBC_2.16' => -4, '__realpath_chk@@GLIBC_2.16' => 1, '__recv_chk@@GLIBC_2.16' => 1, '__recvfrom_chk@@GLIBC_2.16' => 1, '__register_atfork@@GLIBC_2.16' => 1, '__res_iclose@@GLIBC_PRIVATE' => 1, '__res_init@@GLIBC_2.16' => 1, '__res_maybe_init@@GLIBC_PRIVATE' => 1, '__res_nclose@@GLIBC_2.16' => 1, '__res_ninit@@GLIBC_2.16' => 1, '__res_randomid@@GLIBC_2.16' => 1, '__res_state@@GLIBC_2.16' => 1, '__rpc_thread_createerr@@GLIBC_2.16' => 1, '__rpc_thread_svc_fdset@@GLIBC_2.16' => 1, '__rpc_thread_svc_max_pollfd@@GLIBC_2.16' => 1, '__rpc_thread_svc_pollfd@@GLIBC_2.16' => 1, '__sbrk@@GLIBC_2.16' => 1, '__sched_cpualloc@@GLIBC_2.16' => 1, '__sched_cpucount@@GLIBC_2.16' => 1, '__sched_cpufree@@GLIBC_2.16' => 1, '__sched_get_priority_max@@GLIBC_2.16' => 1, '__sched_get_priority_min@@GLIBC_2.16' => 1, '__sched_getparam@@GLIBC_2.16' => 1, '__sched_getscheduler@@GLIBC_2.16' => 1, '__sched_setscheduler@@GLIBC_2.16' => 1, '__sched_yield@@GLIBC_2.16' => 1, '__secure_getenv@GLIBC_2.16' => 1, '__select@@GLIBC_2.16' => 1, '__send@@GLIBC_2.16' => 1, '__sendmmsg@@GLIBC_PRIVATE' => 1, '__setmntent@@GLIBC_2.16' => 1, '__setpgid@@GLIBC_2.16' => 1, '__sigaction@@GLIBC_2.16' => 1, '__sigaddset@@GLIBC_2.16' => 1, '__sigdelset@@GLIBC_2.16' => 1, '__sigismember@@GLIBC_2.16' => 1, '__signbit@@GLIBC_2.16' => 1, '__signbitf@@GLIBC_2.16' => 1, '__signbitl@@GLIBC_2.16' => 1, '__sigpause@@GLIBC_2.16' => 1, '__sigsetjmp@@GLIBC_2.16' => 1, '__sigsuspend@@GLIBC_2.16' => 1, '__snprintf_chk@@GLIBC_2.16' => 1, '__sprintf_chk@@GLIBC_2.16' => 1, '__stack_chk_fail@@GLIBC_2.16' => 1, '__statfs@@GLIBC_2.16' => 1, '__stpcpy@@GLIBC_2.16' => 1, '__stpcpy_chk@@GLIBC_2.16' => 1, '__stpcpy_small@@GLIBC_2.16' => 1, '__stpncpy@@GLIBC_2.16' => 1, '__stpncpy_chk@@GLIBC_2.16' => 1, '__strcasecmp@@GLIBC_2.16' => 1, '__strcasecmp_l@@GLIBC_2.16' => 1, '__strcasestr@@GLIBC_2.16' => 1, '__strcat_chk@@GLIBC_2.16' => 1, '__strcoll_l@@GLIBC_2.16' => 1, '__strcpy_chk@@GLIBC_2.16' => 1, '__strcpy_small@@GLIBC_2.16' => 1, '__strcspn_c1@@GLIBC_2.16' => 1, '__strcspn_c2@@GLIBC_2.16' => 1, '__strcspn_c3@@GLIBC_2.16' => 1, '__strdup@@GLIBC_2.16' => 1, '__strerror_r@@GLIBC_2.16' => 1, '__strfmon_l@@GLIBC_2.16' => 1, '__strftime_l@@GLIBC_2.16' => 1, '__strncasecmp_l@@GLIBC_2.16' => 1, '__strncat_chk@@GLIBC_2.16' => 1, '__strncpy_chk@@GLIBC_2.16' => 1, '__strndup@@GLIBC_2.16' => 1, '__strpbrk_c2@@GLIBC_2.16' => 1, '__strpbrk_c3@@GLIBC_2.16' => 1, '__strsep_1c@@GLIBC_2.16' => 1, '__strsep_2c@@GLIBC_2.16' => 1, '__strsep_3c@@GLIBC_2.16' => 1, '__strsep_g@@GLIBC_2.16' => 1, '__strspn_c1@@GLIBC_2.16' => 1, '__strspn_c2@@GLIBC_2.16' => 1, '__strspn_c3@@GLIBC_2.16' => 1, '__strtod_internal@@GLIBC_2.16' => 1, '__strtod_l@@GLIBC_2.16' => 1, '__strtof_internal@@GLIBC_2.16' => 1, '__strtof_l@@GLIBC_2.16' => 1, '__strtok_r@@GLIBC_2.16' => 1, '__strtok_r_1c@@GLIBC_2.16' => 1, '__strtol_internal@@GLIBC_2.16' => 1, '__strtol_l@@GLIBC_2.16' => 1, '__strtold_internal@@GLIBC_2.16' => 1, '__strtold_l@@GLIBC_2.16' => 1, '__strtoll_internal@@GLIBC_2.16' => 1, '__strtoll_l@@GLIBC_2.16' => 1, '__strtoul_internal@@GLIBC_2.16' => 1, '__strtoul_l@@GLIBC_2.16' => 1, '__strtoull_internal@@GLIBC_2.16' => 1, '__strtoull_l@@GLIBC_2.16' => 1, '__strverscmp@@GLIBC_2.16' => 1, '__strxfrm_l@@GLIBC_2.16' => 1, '__swprintf_chk@@GLIBC_2.16' => 1, '__sysconf@@GLIBC_2.16' => 1, '__syslog_chk@@GLIBC_2.16' => 1, '__sysv_signal@@GLIBC_2.16' => 1, '__timezone@@GLIBC_2.16' => -4, '__toascii_l@@GLIBC_2.16' => 1, '__tolower_l@@GLIBC_2.16' => 1, '__toupper_l@@GLIBC_2.16' => 1, '__towctrans@@GLIBC_2.16' => 1, '__towctrans_l@@GLIBC_2.16' => 1, '__towlower_l@@GLIBC_2.16' => 1, '__towupper_l@@GLIBC_2.16' => 1, '__ttyname_r_chk@@GLIBC_2.16' => 1, '__tzname@@GLIBC_2.16' => -8, '__uflow@@GLIBC_2.16' => 1, '__underflow@@GLIBC_2.16' => 1, '__uselocale@@GLIBC_2.16' => 1, '__vasprintf_chk@@GLIBC_2.16' => 1, '__vdprintf_chk@@GLIBC_2.16' => 1, '__vdso_clock_gettime@@GLIBC_PRIVATE' => -4, '__vfork@@GLIBC_2.16' => 1, '__vfprintf_chk@@GLIBC_2.16' => 1, '__vfscanf@@GLIBC_2.16' => 1, '__vfwprintf_chk@@GLIBC_2.16' => 1, '__vprintf_chk@@GLIBC_2.16' => 1, '__vsnprintf@@GLIBC_2.16' => 1, '__vsnprintf_chk@@GLIBC_2.16' => 1, '__vsprintf_chk@@GLIBC_2.16' => 1, '__vsscanf@@GLIBC_2.16' => 1, '__vswprintf_chk@@GLIBC_2.16' => 1, '__vsyslog_chk@@GLIBC_2.16' => 1, '__vwprintf_chk@@GLIBC_2.16' => 1, '__wait@@GLIBC_2.16' => 1, '__waitpid@@GLIBC_2.16' => 1, '__wcpcpy_chk@@GLIBC_2.16' => 1, '__wcpncpy_chk@@GLIBC_2.16' => 1, '__wcrtomb_chk@@GLIBC_2.16' => 1, '__wcscasecmp_l@@GLIBC_2.16' => 1, '__wcscat_chk@@GLIBC_2.16' => 1, '__wcscoll_l@@GLIBC_2.16' => 1, '__wcscpy_chk@@GLIBC_2.16' => 1, '__wcsftime_l@@GLIBC_2.16' => 1, '__wcsncasecmp_l@@GLIBC_2.16' => 1, '__wcsncat_chk@@GLIBC_2.16' => 1, '__wcsncpy_chk@@GLIBC_2.16' => 1, '__wcsnrtombs_chk@@GLIBC_2.16' => 1, '__wcsrtombs_chk@@GLIBC_2.16' => 1, '__wcstod_internal@@GLIBC_2.16' => 1, '__wcstod_l@@GLIBC_2.16' => 1, '__wcstof_internal@@GLIBC_2.16' => 1, '__wcstof_l@@GLIBC_2.16' => 1, '__wcstol_internal@@GLIBC_2.16' => 1, '__wcstol_l@@GLIBC_2.16' => 1, '__wcstold_internal@@GLIBC_2.16' => 1, '__wcstold_l@@GLIBC_2.16' => 1, '__wcstoll_internal@@GLIBC_2.16' => 1, '__wcstoll_l@@GLIBC_2.16' => 1, '__wcstombs_chk@@GLIBC_2.16' => 1, '__wcstoul_internal@@GLIBC_2.16' => 1, '__wcstoul_l@@GLIBC_2.16' => 1, '__wcstoull_internal@@GLIBC_2.16' => 1, '__wcstoull_l@@GLIBC_2.16' => 1, '__wcsxfrm_l@@GLIBC_2.16' => 1, '__wctomb_chk@@GLIBC_2.16' => 1, '__wctrans_l@@GLIBC_2.16' => 1, '__wctype_l@@GLIBC_2.16' => 1, '__wmemcpy_chk@@GLIBC_2.16' => 1, '__wmemmove_chk@@GLIBC_2.16' => 1, '__wmempcpy_chk@@GLIBC_2.16' => 1, '__wmemset_chk@@GLIBC_2.16' => 1, '__woverflow@@GLIBC_2.16' => 1, '__wprintf_chk@@GLIBC_2.16' => 1, '__write@@GLIBC_2.16' => 1, '__wuflow@@GLIBC_2.16' => 1, '__wunderflow@@GLIBC_2.16' => 1, '__xmknod@@GLIBC_2.16' => 1, '__xmknodat@@GLIBC_2.16' => 1, '__xpg_basename@@GLIBC_2.16' => 1, '__xpg_sigpause@@GLIBC_2.16' => 1, '__xpg_strerror_r@@GLIBC_2.16' => 1, '__xstat64@@GLIBC_2.16' => 1, '__xstat@@GLIBC_2.16' => 1, '_authenticate@@GLIBC_2.16' => 1, '_dl_addr@@GLIBC_PRIVATE' => 1, '_dl_mcount_wrapper@@GLIBC_2.16' => 1, '_dl_mcount_wrapper_check@@GLIBC_2.16' => 1, '_dl_open_hook@@GLIBC_PRIVATE' => -4, '_dl_sym@@GLIBC_PRIVATE' => 1, '_dl_vsym@@GLIBC_PRIVATE' => 1, '_environ@@GLIBC_2.16' => -4, '_exit@@GLIBC_2.16' => 1, '_flushlbf@@GLIBC_2.16' => 1, '_itoa_lower_digits@@GLIBC_PRIVATE' => -36, '_libc_intl_domainname@@GLIBC_2.16' => -5, '_longjmp@@GLIBC_2.16' => 1, '_mcleanup@@GLIBC_2.16' => 1, '_mcount@@GLIBC_2.16' => 1, '_nl_default_dirname@@GLIBC_2.16' => -18, '_nl_domain_bindings@@GLIBC_2.16' => -4, '_nl_msg_cat_cntr@@GLIBC_2.16' => -4, '_nss_files_parse_grent@@GLIBC_PRIVATE' => 1, '_nss_files_parse_pwent@@GLIBC_PRIVATE' => 1, '_nss_files_parse_sgent@@GLIBC_PRIVATE' => 1, '_nss_files_parse_spent@@GLIBC_PRIVATE' => 1, '_null_auth@@GLIBC_2.16' => -12, '_obstack_allocated_p@@GLIBC_2.16' => 1, '_obstack_begin@@GLIBC_2.16' => 1, '_obstack_begin_1@@GLIBC_2.16' => 1, '_obstack_free@@GLIBC_2.16' => 1, '_obstack_memory_used@@GLIBC_2.16' => 1, '_obstack_newchunk@@GLIBC_2.16' => 1, '_res@GLIBC_2.16' => -512, '_res_hconf@@GLIBC_2.16' => -48, '_rpc_dtablesize@@GLIBC_2.16' => 1, '_seterr_reply@@GLIBC_2.16' => 1, '_setjmp@@GLIBC_2.16' => 1, '_sys_errlist@@GLIBC_2.16' => -540, '_sys_nerr@@GLIBC_2.16' => -4, '_sys_siglist@@GLIBC_2.16' => -260, '_tolower@@GLIBC_2.16' => 1, '_toupper@@GLIBC_2.16' => 1, 'a64l@@GLIBC_2.16' => 1, 'abort@@GLIBC_2.16' => 1, 'abs@@GLIBC_2.16' => 1, 'accept4@@GLIBC_2.16' => 1, 'accept@@GLIBC_2.16' => 1, 'access@@GLIBC_2.16' => 1, 'acct@@GLIBC_2.16' => 1, 'addmntent@@GLIBC_2.16' => 1, 'addseverity@@GLIBC_2.16' => 1, 'adjtime@@GLIBC_2.16' => 1, 'adjtimex@@GLIBC_2.16' => 1, 'advance@@GLIBC_2.16' => 1, 'alarm@@GLIBC_2.16' => 1, 'aligned_alloc@@GLIBC_2.16' => 1, 'alphasort64@@GLIBC_2.16' => 1, 'alphasort@@GLIBC_2.16' => 1, 'arch_prctl@@GLIBC_2.16' => 1, 'argp_err_exit_status@@GLIBC_2.16' => -4, 'argp_error@@GLIBC_2.16' => 1, 'argp_failure@@GLIBC_2.16' => 1, 'argp_help@@GLIBC_2.16' => 1, 'argp_parse@@GLIBC_2.16' => 1, 'argp_program_bug_address@@GLIBC_2.16' => -4, 'argp_program_version@@GLIBC_2.16' => -4, 'argp_program_version_hook@@GLIBC_2.16' => -4, 'argp_state_help@@GLIBC_2.16' => 1, 'argp_usage@@GLIBC_2.16' => 1, 'argz_add@@GLIBC_2.16' => 1, 'argz_add_sep@@GLIBC_2.16' => 1, 'argz_append@@GLIBC_2.16' => 1, 'argz_count@@GLIBC_2.16' => 1, 'argz_create@@GLIBC_2.16' => 1, 'argz_create_sep@@GLIBC_2.16' => 1, 'argz_delete@@GLIBC_2.16' => 1, 'argz_extract@@GLIBC_2.16' => 1, 'argz_insert@@GLIBC_2.16' => 1, 'argz_next@@GLIBC_2.16' => 1, 'argz_replace@@GLIBC_2.16' => 1, 'argz_stringify@@GLIBC_2.16' => 1, 'asctime@@GLIBC_2.16' => 1, 'asctime_r@@GLIBC_2.16' => 1, 'asprintf@@GLIBC_2.16' => 1, 'atof@@GLIBC_2.16' => 1, 'atoi@@GLIBC_2.16' => 1, 'atol@@GLIBC_2.16' => 1, 'atoll@@GLIBC_2.16' => 1, 'authdes_create@@GLIBC_2.16' => 1, 'authdes_getucred@@GLIBC_2.16' => 1, 'authdes_pk_create@@GLIBC_2.16' => 1, 'authnone_create@@GLIBC_2.16' => 1, 'authunix_create@@GLIBC_2.16' => 1, 'authunix_create_default@@GLIBC_2.16' => 1, 'backtrace@@GLIBC_2.16' => 1, 'backtrace_symbols@@GLIBC_2.16' => 1, 'backtrace_symbols_fd@@GLIBC_2.16' => 1, 'basename@@GLIBC_2.16' => 1, 'bcmp@@GLIBC_2.16' => 1, 'bcopy@@GLIBC_2.16' => 1, 'bdflush@@GLIBC_2.16' => 1, 'bind@@GLIBC_2.16' => 1, 'bind_textdomain_codeset@@GLIBC_2.16' => 1, 'bindresvport@@GLIBC_2.16' => 1, 'bindtextdomain@@GLIBC_2.16' => 1, 'brk@@GLIBC_2.16' => 1, 'bsd_signal@@GLIBC_2.16' => 1, 'bsearch@@GLIBC_2.16' => 1, 'btowc@@GLIBC_2.16' => 1, 'bzero@@GLIBC_2.16' => 1, 'c16rtomb@@GLIBC_2.16' => 1, 'c32rtomb@@GLIBC_2.16' => 1, 'calloc@@GLIBC_2.16' => 1, 'callrpc@@GLIBC_2.16' => 1, 'canonicalize_file_name@@GLIBC_2.16' => 1, 'capget@@GLIBC_2.16' => 1, 'capset@@GLIBC_2.16' => 1, 'catclose@@GLIBC_2.16' => 1, 'catgets@@GLIBC_2.16' => 1, 'catopen@@GLIBC_2.16' => 1, 'cbc_crypt@@GLIBC_2.16' => 1, 'cfgetispeed@@GLIBC_2.16' => 1, 'cfgetospeed@@GLIBC_2.16' => 1, 'cfmakeraw@@GLIBC_2.16' => 1, 'cfree@@GLIBC_2.16' => 1, 'cfsetispeed@@GLIBC_2.16' => 1, 'cfsetospeed@@GLIBC_2.16' => 1, 'cfsetspeed@@GLIBC_2.16' => 1, 'chdir@@GLIBC_2.16' => 1, 'chflags@@GLIBC_2.16' => 1, 'chmod@@GLIBC_2.16' => 1, 'chown@@GLIBC_2.16' => 1, 'chroot@@GLIBC_2.16' => 1, 'clearenv@@GLIBC_2.16' => 1, 'clearerr@@GLIBC_2.16' => 1, 'clearerr_unlocked@@GLIBC_2.16' => 1, 'clnt_broadcast@@GLIBC_2.16' => 1, 'clnt_create@@GLIBC_2.16' => 1, 'clnt_pcreateerror@@GLIBC_2.16' => 1, 'clnt_perrno@@GLIBC_2.16' => 1, 'clnt_perror@@GLIBC_2.16' => 1, 'clnt_spcreateerror@@GLIBC_2.16' => 1, 'clnt_sperrno@@GLIBC_2.16' => 1, 'clnt_sperror@@GLIBC_2.16' => 1, 'clntraw_create@@GLIBC_2.16' => 1, 'clnttcp_create@@GLIBC_2.16' => 1, 'clntudp_bufcreate@@GLIBC_2.16' => 1, 'clntudp_create@@GLIBC_2.16' => 1, 'clntunix_create@@GLIBC_2.16' => 1, 'clock@@GLIBC_2.16' => 1, 'clock_adjtime@@GLIBC_2.16' => 1, 'clock_getcpuclockid@@GLIBC_2.17' => 1, 'clock_getres@@GLIBC_2.17' => 1, 'clock_gettime@@GLIBC_2.17' => 1, 'clock_nanosleep@@GLIBC_2.17' => 1, 'clock_settime@@GLIBC_2.17' => 1, 'clone@@GLIBC_2.16' => 1, 'close@@GLIBC_2.16' => 1, 'closedir@@GLIBC_2.16' => 1, 'closelog@@GLIBC_2.16' => 1, 'confstr@@GLIBC_2.16' => 1, 'connect@@GLIBC_2.16' => 1, 'copysign@@GLIBC_2.16' => 1, 'copysignf@@GLIBC_2.16' => 1, 'copysignl@@GLIBC_2.16' => 1, 'creat64@@GLIBC_2.16' => 1, 'creat@@GLIBC_2.16' => 1, 'create_module@@GLIBC_2.16' => 1, 'ctermid@@GLIBC_2.16' => 1, 'ctime@@GLIBC_2.16' => 1, 'ctime_r@@GLIBC_2.16' => 1, 'cuserid@@GLIBC_2.16' => 1, 'daemon@@GLIBC_2.16' => 1, 'daylight@@GLIBC_2.16' => -4, 'dcgettext@@GLIBC_2.16' => 1, 'dcngettext@@GLIBC_2.16' => 1, 'delete_module@@GLIBC_2.16' => 1, 'des_setparity@@GLIBC_2.16' => 1, 'dgettext@@GLIBC_2.16' => 1, 'difftime@@GLIBC_2.16' => 1, 'dirfd@@GLIBC_2.16' => 1, 'dirname@@GLIBC_2.16' => 1, 'div@@GLIBC_2.16' => 1, 'dl_iterate_phdr@@GLIBC_2.16' => 1, 'dngettext@@GLIBC_2.16' => 1, 'dprintf@@GLIBC_2.16' => 1, 'drand48@@GLIBC_2.16' => 1, 'drand48_r@@GLIBC_2.16' => 1, 'dup2@@GLIBC_2.16' => 1, 'dup3@@GLIBC_2.16' => 1, 'dup@@GLIBC_2.16' => 1, 'duplocale@@GLIBC_2.16' => 1, 'dysize@@GLIBC_2.16' => 1, 'eaccess@@GLIBC_2.16' => 1, 'ecb_crypt@@GLIBC_2.16' => 1, 'ecvt@@GLIBC_2.16' => 1, 'ecvt_r@@GLIBC_2.16' => 1, 'endaliasent@@GLIBC_2.16' => 1, 'endfsent@@GLIBC_2.16' => 1, 'endgrent@@GLIBC_2.16' => 1, 'endhostent@@GLIBC_2.16' => 1, 'endmntent@@GLIBC_2.16' => 1, 'endnetent@@GLIBC_2.16' => 1, 'endnetgrent@@GLIBC_2.16' => 1, 'endprotoent@@GLIBC_2.16' => 1, 'endpwent@@GLIBC_2.16' => 1, 'endrpcent@@GLIBC_2.16' => 1, 'endservent@@GLIBC_2.16' => 1, 'endsgent@@GLIBC_2.16' => 1, 'endspent@@GLIBC_2.16' => 1, 'endttyent@@GLIBC_2.16' => 1, 'endusershell@@GLIBC_2.16' => 1, 'endutent@@GLIBC_2.16' => 1, 'endutxent@@GLIBC_2.16' => 1, 'environ@@GLIBC_2.16' => -4, 'envz_add@@GLIBC_2.16' => 1, 'envz_entry@@GLIBC_2.16' => 1, 'envz_get@@GLIBC_2.16' => 1, 'envz_merge@@GLIBC_2.16' => 1, 'envz_remove@@GLIBC_2.16' => 1, 'envz_strip@@GLIBC_2.16' => 1, 'epoll_create1@@GLIBC_2.16' => 1, 'epoll_create@@GLIBC_2.16' => 1, 'epoll_ctl@@GLIBC_2.16' => 1, 'epoll_pwait@@GLIBC_2.16' => 1, 'epoll_wait@@GLIBC_2.16' => 1, 'erand48@@GLIBC_2.16' => 1, 'erand48_r@@GLIBC_2.16' => 1, 'err@@GLIBC_2.16' => 1, 'error@@GLIBC_2.16' => 1, 'error_at_line@@GLIBC_2.16' => 1, 'error_message_count@@GLIBC_2.16' => -4, 'error_one_per_line@@GLIBC_2.16' => -4, 'error_print_progname@@GLIBC_2.16' => -4, 'errx@@GLIBC_2.16' => 1, 'ether_aton@@GLIBC_2.16' => 1, 'ether_aton_r@@GLIBC_2.16' => 1, 'ether_hostton@@GLIBC_2.16' => 1, 'ether_line@@GLIBC_2.16' => 1, 'ether_ntoa@@GLIBC_2.16' => 1, 'ether_ntoa_r@@GLIBC_2.16' => 1, 'ether_ntohost@@GLIBC_2.16' => 1, 'euidaccess@@GLIBC_2.16' => 1, 'eventfd@@GLIBC_2.16' => 1, 'eventfd_read@@GLIBC_2.16' => 1, 'eventfd_write@@GLIBC_2.16' => 1, 'execl@@GLIBC_2.16' => 1, 'execle@@GLIBC_2.16' => 1, 'execlp@@GLIBC_2.16' => 1, 'execv@@GLIBC_2.16' => 1, 'execve@@GLIBC_2.16' => 1, 'execvp@@GLIBC_2.16' => 1, 'execvpe@@GLIBC_2.16' => 1, 'exit@@GLIBC_2.16' => 1, 'faccessat@@GLIBC_2.16' => 1, 'fallocate64@@GLIBC_2.16' => 1, 'fallocate@@GLIBC_2.16' => 1, 'fanotify_init@@GLIBC_2.16' => 1, 'fanotify_mark@@GLIBC_2.16' => 1, 'fattach@@GLIBC_2.16' => 1, 'fchdir@@GLIBC_2.16' => 1, 'fchflags@@GLIBC_2.16' => 1, 'fchmod@@GLIBC_2.16' => 1, 'fchmodat@@GLIBC_2.16' => 1, 'fchown@@GLIBC_2.16' => 1, 'fchownat@@GLIBC_2.16' => 1, 'fclose@@GLIBC_2.16' => 1, 'fcloseall@@GLIBC_2.16' => 1, 'fcntl@@GLIBC_2.16' => 1, 'fcvt@@GLIBC_2.16' => 1, 'fcvt_r@@GLIBC_2.16' => 1, 'fdatasync@@GLIBC_2.16' => 1, 'fdetach@@GLIBC_2.16' => 1, 'fdopen@@GLIBC_2.16' => 1, 'fdopendir@@GLIBC_2.16' => 1, 'feof@@GLIBC_2.16' => 1, 'feof_unlocked@@GLIBC_2.16' => 1, 'ferror@@GLIBC_2.16' => 1, 'ferror_unlocked@@GLIBC_2.16' => 1, 'fexecve@@GLIBC_2.16' => 1, 'fflush@@GLIBC_2.16' => 1, 'fflush_unlocked@@GLIBC_2.16' => 1, 'ffs@@GLIBC_2.16' => 1, 'ffsl@@GLIBC_2.16' => 1, 'ffsll@@GLIBC_2.16' => 1, 'fgetc@@GLIBC_2.16' => 1, 'fgetc_unlocked@@GLIBC_2.16' => 1, 'fgetgrent@@GLIBC_2.16' => 1, 'fgetgrent_r@@GLIBC_2.16' => 1, 'fgetpos64@@GLIBC_2.16' => 1, 'fgetpos@@GLIBC_2.16' => 1, 'fgetpwent@@GLIBC_2.16' => 1, 'fgetpwent_r@@GLIBC_2.16' => 1, 'fgets@@GLIBC_2.16' => 1, 'fgets_unlocked@@GLIBC_2.16' => 1, 'fgetsgent@@GLIBC_2.16' => 1, 'fgetsgent_r@@GLIBC_2.16' => 1, 'fgetspent@@GLIBC_2.16' => 1, 'fgetspent_r@@GLIBC_2.16' => 1, 'fgetwc@@GLIBC_2.16' => 1, 'fgetwc_unlocked@@GLIBC_2.16' => 1, 'fgetws@@GLIBC_2.16' => 1, 'fgetws_unlocked@@GLIBC_2.16' => 1, 'fgetxattr@@GLIBC_2.16' => 1, 'fileno@@GLIBC_2.16' => 1, 'fileno_unlocked@@GLIBC_2.16' => 1, 'finite@@GLIBC_2.16' => 1, 'finitef@@GLIBC_2.16' => 1, 'finitel@@GLIBC_2.16' => 1, 'flistxattr@@GLIBC_2.16' => 1, 'flock@@GLIBC_2.16' => 1, 'flockfile@@GLIBC_2.16' => 1, 'fmemopen@@GLIBC_2.16' => 1, 'fmtmsg@@GLIBC_2.16' => 1, 'fnmatch@@GLIBC_2.16' => 1, 'fopen64@@GLIBC_2.16' => 1, 'fopen@@GLIBC_2.16' => 1, 'fopencookie@@GLIBC_2.16' => 1, 'fork@@GLIBC_2.16' => 1, 'fpathconf@@GLIBC_2.16' => 1, 'fprintf@@GLIBC_2.16' => 1, 'fputc@@GLIBC_2.16' => 1, 'fputc_unlocked@@GLIBC_2.16' => 1, 'fputs@@GLIBC_2.16' => 1, 'fputs_unlocked@@GLIBC_2.16' => 1, 'fputwc@@GLIBC_2.16' => 1, 'fputwc_unlocked@@GLIBC_2.16' => 1, 'fputws@@GLIBC_2.16' => 1, 'fputws_unlocked@@GLIBC_2.16' => 1, 'fread@@GLIBC_2.16' => 1, 'fread_unlocked@@GLIBC_2.16' => 1, 'free@@GLIBC_2.16' => 1, 'freeaddrinfo@@GLIBC_2.16' => 1, 'freeifaddrs@@GLIBC_2.16' => 1, 'freelocale@@GLIBC_2.16' => 1, 'fremovexattr@@GLIBC_2.16' => 1, 'freopen64@@GLIBC_2.16' => 1, 'freopen@@GLIBC_2.16' => 1, 'frexp@@GLIBC_2.16' => 1, 'frexpf@@GLIBC_2.16' => 1, 'frexpl@@GLIBC_2.16' => 1, 'fscanf@@GLIBC_2.16' => 1, 'fseek@@GLIBC_2.16' => 1, 'fseeko64@@GLIBC_2.16' => 1, 'fseeko@@GLIBC_2.16' => 1, 'fsetpos64@@GLIBC_2.16' => 1, 'fsetpos@@GLIBC_2.16' => 1, 'fsetxattr@@GLIBC_2.16' => 1, 'fstatfs64@@GLIBC_2.16' => 1, 'fstatfs@@GLIBC_2.16' => 1, 'fstatvfs64@@GLIBC_2.16' => 1, 'fstatvfs@@GLIBC_2.16' => 1, 'fsync@@GLIBC_2.16' => 1, 'ftell@@GLIBC_2.16' => 1, 'ftello64@@GLIBC_2.16' => 1, 'ftello@@GLIBC_2.16' => 1, 'ftime@@GLIBC_2.16' => 1, 'ftok@@GLIBC_2.16' => 1, 'ftruncate64@@GLIBC_2.16' => 1, 'ftruncate@@GLIBC_2.16' => 1, 'ftrylockfile@@GLIBC_2.16' => 1, 'fts_children@@GLIBC_2.16' => 1, 'fts_close@@GLIBC_2.16' => 1, 'fts_open@@GLIBC_2.16' => 1, 'fts_read@@GLIBC_2.16' => 1, 'fts_set@@GLIBC_2.16' => 1, 'ftw64@@GLIBC_2.16' => 1, 'ftw@@GLIBC_2.16' => 1, 'funlockfile@@GLIBC_2.16' => 1, 'futimens@@GLIBC_2.16' => 1, 'futimes@@GLIBC_2.16' => 1, 'futimesat@@GLIBC_2.16' => 1, 'fwide@@GLIBC_2.16' => 1, 'fwprintf@@GLIBC_2.16' => 1, 'fwrite@@GLIBC_2.16' => 1, 'fwrite_unlocked@@GLIBC_2.16' => 1, 'fwscanf@@GLIBC_2.16' => 1, 'gai_strerror@@GLIBC_2.16' => 1, 'gcvt@@GLIBC_2.16' => 1, 'get_avphys_pages@@GLIBC_2.16' => 1, 'get_current_dir_name@@GLIBC_2.16' => 1, 'get_kernel_syms@@GLIBC_2.16' => 1, 'get_myaddress@@GLIBC_2.16' => 1, 'get_nprocs@@GLIBC_2.16' => 1, 'get_nprocs_conf@@GLIBC_2.16' => 1, 'get_phys_pages@@GLIBC_2.16' => 1, 'getaddrinfo@@GLIBC_2.16' => 1, 'getaliasbyname@@GLIBC_2.16' => 1, 'getaliasbyname_r@@GLIBC_2.16' => 1, 'getaliasent@@GLIBC_2.16' => 1, 'getaliasent_r@@GLIBC_2.16' => 1, 'getauxval@@GLIBC_2.16' => 1, 'getc@@GLIBC_2.16' => 1, 'getc_unlocked@@GLIBC_2.16' => 1, 'getchar@@GLIBC_2.16' => 1, 'getchar_unlocked@@GLIBC_2.16' => 1, 'getcontext@@GLIBC_2.16' => 1, 'getcwd@@GLIBC_2.16' => 1, 'getdate@@GLIBC_2.16' => 1, 'getdate_err@@GLIBC_2.16' => -4, 'getdate_r@@GLIBC_2.16' => 1, 'getdelim@@GLIBC_2.16' => 1, 'getdirentries64@@GLIBC_2.16' => 1, 'getdirentries@@GLIBC_2.16' => 1, 'getdomainname@@GLIBC_2.16' => 1, 'getdtablesize@@GLIBC_2.16' => 1, 'getegid@@GLIBC_2.16' => 1, 'getenv@@GLIBC_2.16' => 1, 'geteuid@@GLIBC_2.16' => 1, 'getfsent@@GLIBC_2.16' => 1, 'getfsfile@@GLIBC_2.16' => 1, 'getfsspec@@GLIBC_2.16' => 1, 'getgid@@GLIBC_2.16' => 1, 'getgrent@@GLIBC_2.16' => 1, 'getgrent_r@@GLIBC_2.16' => 1, 'getgrgid@@GLIBC_2.16' => 1, 'getgrgid_r@@GLIBC_2.16' => 1, 'getgrnam@@GLIBC_2.16' => 1, 'getgrnam_r@@GLIBC_2.16' => 1, 'getgrouplist@@GLIBC_2.16' => 1, 'getgroups@@GLIBC_2.16' => 1, 'gethostbyaddr@@GLIBC_2.16' => 1, 'gethostbyaddr_r@@GLIBC_2.16' => 1, 'gethostbyname2@@GLIBC_2.16' => 1, 'gethostbyname2_r@@GLIBC_2.16' => 1, 'gethostbyname@@GLIBC_2.16' => 1, 'gethostbyname_r@@GLIBC_2.16' => 1, 'gethostent@@GLIBC_2.16' => 1, 'gethostent_r@@GLIBC_2.16' => 1, 'gethostid@@GLIBC_2.16' => 1, 'gethostname@@GLIBC_2.16' => 1, 'getifaddrs@@GLIBC_2.16' => 1, 'getipv4sourcefilter@@GLIBC_2.16' => 1, 'getitimer@@GLIBC_2.16' => 1, 'getline@@GLIBC_2.16' => 1, 'getloadavg@@GLIBC_2.16' => 1, 'getlogin@@GLIBC_2.16' => 1, 'getlogin_r@@GLIBC_2.16' => 1, 'getmntent@@GLIBC_2.16' => 1, 'getmntent_r@@GLIBC_2.16' => 1, 'getmsg@@GLIBC_2.16' => 1, 'getnameinfo@@GLIBC_2.16' => 1, 'getnetbyaddr@@GLIBC_2.16' => 1, 'getnetbyaddr_r@@GLIBC_2.16' => 1, 'getnetbyname@@GLIBC_2.16' => 1, 'getnetbyname_r@@GLIBC_2.16' => 1, 'getnetent@@GLIBC_2.16' => 1, 'getnetent_r@@GLIBC_2.16' => 1, 'getnetgrent@@GLIBC_2.16' => 1, 'getnetgrent_r@@GLIBC_2.16' => 1, 'getnetname@@GLIBC_2.16' => 1, 'getopt@@GLIBC_2.16' => 1, 'getopt_long@@GLIBC_2.16' => 1, 'getopt_long_only@@GLIBC_2.16' => 1, 'getpagesize@@GLIBC_2.16' => 1, 'getpass@@GLIBC_2.16' => 1, 'getpeername@@GLIBC_2.16' => 1, 'getpgid@@GLIBC_2.16' => 1, 'getpgrp@@GLIBC_2.16' => 1, 'getpid@@GLIBC_2.16' => 1, 'getpmsg@@GLIBC_2.16' => 1, 'getppid@@GLIBC_2.16' => 1, 'getpriority@@GLIBC_2.16' => 1, 'getprotobyname@@GLIBC_2.16' => 1, 'getprotobyname_r@@GLIBC_2.16' => 1, 'getprotobynumber@@GLIBC_2.16' => 1, 'getprotobynumber_r@@GLIBC_2.16' => 1, 'getprotoent@@GLIBC_2.16' => 1, 'getprotoent_r@@GLIBC_2.16' => 1, 'getpt@@GLIBC_2.16' => 1, 'getpublickey@@GLIBC_2.16' => 1, 'getpw@@GLIBC_2.16' => 1, 'getpwent@@GLIBC_2.16' => 1, 'getpwent_r@@GLIBC_2.16' => 1, 'getpwnam@@GLIBC_2.16' => 1, 'getpwnam_r@@GLIBC_2.16' => 1, 'getpwuid@@GLIBC_2.16' => 1, 'getpwuid_r@@GLIBC_2.16' => 1, 'getresgid@@GLIBC_2.16' => 1, 'getresuid@@GLIBC_2.16' => 1, 'getrlimit64@@GLIBC_2.16' => 1, 'getrlimit@@GLIBC_2.16' => 1, 'getrpcbyname@@GLIBC_2.16' => 1, 'getrpcbyname_r@@GLIBC_2.16' => 1, 'getrpcbynumber@@GLIBC_2.16' => 1, 'getrpcbynumber_r@@GLIBC_2.16' => 1, 'getrpcent@@GLIBC_2.16' => 1, 'getrpcent_r@@GLIBC_2.16' => 1, 'getrpcport@@GLIBC_2.16' => 1, 'getrusage@@GLIBC_2.16' => 1, 'gets@@GLIBC_2.16' => 1, 'getsecretkey@@GLIBC_2.16' => 1, 'getservbyname@@GLIBC_2.16' => 1, 'getservbyname_r@@GLIBC_2.16' => 1, 'getservbyport@@GLIBC_2.16' => 1, 'getservbyport_r@@GLIBC_2.16' => 1, 'getservent@@GLIBC_2.16' => 1, 'getservent_r@@GLIBC_2.16' => 1, 'getsgent@@GLIBC_2.16' => 1, 'getsgent_r@@GLIBC_2.16' => 1, 'getsgnam@@GLIBC_2.16' => 1, 'getsgnam_r@@GLIBC_2.16' => 1, 'getsid@@GLIBC_2.16' => 1, 'getsockname@@GLIBC_2.16' => 1, 'getsockopt@@GLIBC_2.16' => 1, 'getsourcefilter@@GLIBC_2.16' => 1, 'getspent@@GLIBC_2.16' => 1, 'getspent_r@@GLIBC_2.16' => 1, 'getspnam@@GLIBC_2.16' => 1, 'getspnam_r@@GLIBC_2.16' => 1, 'getsubopt@@GLIBC_2.16' => 1, 'gettext@@GLIBC_2.16' => 1, 'gettimeofday@@GLIBC_2.16' => 1, 'getttyent@@GLIBC_2.16' => 1, 'getttynam@@GLIBC_2.16' => 1, 'getuid@@GLIBC_2.16' => 1, 'getusershell@@GLIBC_2.16' => 1, 'getutent@@GLIBC_2.16' => 1, 'getutent_r@@GLIBC_2.16' => 1, 'getutid@@GLIBC_2.16' => 1, 'getutid_r@@GLIBC_2.16' => 1, 'getutline@@GLIBC_2.16' => 1, 'getutline_r@@GLIBC_2.16' => 1, 'getutmp@@GLIBC_2.16' => 1, 'getutmpx@@GLIBC_2.16' => 1, 'getutxent@@GLIBC_2.16' => 1, 'getutxid@@GLIBC_2.16' => 1, 'getutxline@@GLIBC_2.16' => 1, 'getw@@GLIBC_2.16' => 1, 'getwc@@GLIBC_2.16' => 1, 'getwc_unlocked@@GLIBC_2.16' => 1, 'getwchar@@GLIBC_2.16' => 1, 'getwchar_unlocked@@GLIBC_2.16' => 1, 'getwd@@GLIBC_2.16' => 1, 'getxattr@@GLIBC_2.16' => 1, 'glob64@@GLIBC_2.16' => 1, 'glob@@GLIBC_2.16' => 1, 'glob_pattern_p@@GLIBC_2.16' => 1, 'globfree64@@GLIBC_2.16' => 1, 'globfree@@GLIBC_2.16' => 1, 'gmtime@@GLIBC_2.16' => 1, 'gmtime_r@@GLIBC_2.16' => 1, 'gnu_dev_major@@GLIBC_2.16' => 1, 'gnu_dev_makedev@@GLIBC_2.16' => 1, 'gnu_dev_minor@@GLIBC_2.16' => 1, 'gnu_get_libc_release@@GLIBC_2.16' => 1, 'gnu_get_libc_version@@GLIBC_2.16' => 1, 'grantpt@@GLIBC_2.16' => 1, 'group_member@@GLIBC_2.16' => 1, 'gsignal@@GLIBC_2.16' => 1, 'gtty@@GLIBC_2.16' => 1, 'h_errlist@@GLIBC_2.16' => -20, 'h_nerr@@GLIBC_2.16' => -4, 'hasmntopt@@GLIBC_2.16' => 1, 'hcreate@@GLIBC_2.16' => 1, 'hcreate_r@@GLIBC_2.16' => 1, 'hdestroy@@GLIBC_2.16' => 1, 'hdestroy_r@@GLIBC_2.16' => 1, 'herror@@GLIBC_2.16' => 1, 'host2netname@@GLIBC_2.16' => 1, 'hsearch@@GLIBC_2.16' => 1, 'hsearch_r@@GLIBC_2.16' => 1, 'hstrerror@@GLIBC_2.16' => 1, 'htonl@@GLIBC_2.16' => 1, 'htons@@GLIBC_2.16' => 1, 'iconv@@GLIBC_2.16' => 1, 'iconv_close@@GLIBC_2.16' => 1, 'iconv_open@@GLIBC_2.16' => 1, 'if_freenameindex@@GLIBC_2.16' => 1, 'if_indextoname@@GLIBC_2.16' => 1, 'if_nameindex@@GLIBC_2.16' => 1, 'if_nametoindex@@GLIBC_2.16' => 1, 'imaxabs@@GLIBC_2.16' => 1, 'imaxdiv@@GLIBC_2.16' => 1, 'in6addr_any@@GLIBC_2.16' => -16, 'in6addr_loopback@@GLIBC_2.16' => -16, 'index@@GLIBC_2.16' => 1, 'inet6_opt_append@@GLIBC_2.16' => 1, 'inet6_opt_find@@GLIBC_2.16' => 1, 'inet6_opt_finish@@GLIBC_2.16' => 1, 'inet6_opt_get_val@@GLIBC_2.16' => 1, 'inet6_opt_init@@GLIBC_2.16' => 1, 'inet6_opt_next@@GLIBC_2.16' => 1, 'inet6_opt_set_val@@GLIBC_2.16' => 1, 'inet6_option_alloc@@GLIBC_2.16' => 1, 'inet6_option_append@@GLIBC_2.16' => 1, 'inet6_option_find@@GLIBC_2.16' => 1, 'inet6_option_init@@GLIBC_2.16' => 1, 'inet6_option_next@@GLIBC_2.16' => 1, 'inet6_option_space@@GLIBC_2.16' => 1, 'inet6_rth_add@@GLIBC_2.16' => 1, 'inet6_rth_getaddr@@GLIBC_2.16' => 1, 'inet6_rth_init@@GLIBC_2.16' => 1, 'inet6_rth_reverse@@GLIBC_2.16' => 1, 'inet6_rth_segments@@GLIBC_2.16' => 1, 'inet6_rth_space@@GLIBC_2.16' => 1, 'inet_addr@@GLIBC_2.16' => 1, 'inet_aton@@GLIBC_2.16' => 1, 'inet_lnaof@@GLIBC_2.16' => 1, 'inet_makeaddr@@GLIBC_2.16' => 1, 'inet_netof@@GLIBC_2.16' => 1, 'inet_network@@GLIBC_2.16' => 1, 'inet_nsap_addr@@GLIBC_2.16' => 1, 'inet_nsap_ntoa@@GLIBC_2.16' => 1, 'inet_ntoa@@GLIBC_2.16' => 1, 'inet_ntop@@GLIBC_2.16' => 1, 'inet_pton@@GLIBC_2.16' => 1, 'init_module@@GLIBC_2.16' => 1, 'initgroups@@GLIBC_2.16' => 1, 'initstate@@GLIBC_2.16' => 1, 'initstate_r@@GLIBC_2.16' => 1, 'innetgr@@GLIBC_2.16' => 1, 'inotify_add_watch@@GLIBC_2.16' => 1, 'inotify_init1@@GLIBC_2.16' => 1, 'inotify_init@@GLIBC_2.16' => 1, 'inotify_rm_watch@@GLIBC_2.16' => 1, 'insque@@GLIBC_2.16' => 1, 'ioctl@@GLIBC_2.16' => 1, 'ioperm@@GLIBC_2.16' => 1, 'iopl@@GLIBC_2.16' => 1, 'iruserok@@GLIBC_2.16' => 1, 'iruserok_af@@GLIBC_2.16' => 1, 'isalnum@@GLIBC_2.16' => 1, 'isalnum_l@@GLIBC_2.16' => 1, 'isalpha@@GLIBC_2.16' => 1, 'isalpha_l@@GLIBC_2.16' => 1, 'isascii@@GLIBC_2.16' => 1, 'isastream@@GLIBC_2.16' => 1, 'isatty@@GLIBC_2.16' => 1, 'isblank@@GLIBC_2.16' => 1, 'isblank_l@@GLIBC_2.16' => 1, 'iscntrl@@GLIBC_2.16' => 1, 'iscntrl_l@@GLIBC_2.16' => 1, 'isctype@@GLIBC_2.16' => 1, 'isdigit@@GLIBC_2.16' => 1, 'isdigit_l@@GLIBC_2.16' => 1, 'isfdtype@@GLIBC_2.16' => 1, 'isgraph@@GLIBC_2.16' => 1, 'isgraph_l@@GLIBC_2.16' => 1, 'isinf@@GLIBC_2.16' => 1, 'isinff@@GLIBC_2.16' => 1, 'isinfl@@GLIBC_2.16' => 1, 'islower@@GLIBC_2.16' => 1, 'islower_l@@GLIBC_2.16' => 1, 'isnan@@GLIBC_2.16' => 1, 'isnanf@@GLIBC_2.16' => 1, 'isnanl@@GLIBC_2.16' => 1, 'isprint@@GLIBC_2.16' => 1, 'isprint_l@@GLIBC_2.16' => 1, 'ispunct@@GLIBC_2.16' => 1, 'ispunct_l@@GLIBC_2.16' => 1, 'isspace@@GLIBC_2.16' => 1, 'isspace_l@@GLIBC_2.16' => 1, 'isupper@@GLIBC_2.16' => 1, 'isupper_l@@GLIBC_2.16' => 1, 'iswalnum@@GLIBC_2.16' => 1, 'iswalnum_l@@GLIBC_2.16' => 1, 'iswalpha@@GLIBC_2.16' => 1, 'iswalpha_l@@GLIBC_2.16' => 1, 'iswblank@@GLIBC_2.16' => 1, 'iswblank_l@@GLIBC_2.16' => 1, 'iswcntrl@@GLIBC_2.16' => 1, 'iswcntrl_l@@GLIBC_2.16' => 1, 'iswctype@@GLIBC_2.16' => 1, 'iswctype_l@@GLIBC_2.16' => 1, 'iswdigit@@GLIBC_2.16' => 1, 'iswdigit_l@@GLIBC_2.16' => 1, 'iswgraph@@GLIBC_2.16' => 1, 'iswgraph_l@@GLIBC_2.16' => 1, 'iswlower@@GLIBC_2.16' => 1, 'iswlower_l@@GLIBC_2.16' => 1, 'iswprint@@GLIBC_2.16' => 1, 'iswprint_l@@GLIBC_2.16' => 1, 'iswpunct@@GLIBC_2.16' => 1, 'iswpunct_l@@GLIBC_2.16' => 1, 'iswspace@@GLIBC_2.16' => 1, 'iswspace_l@@GLIBC_2.16' => 1, 'iswupper@@GLIBC_2.16' => 1, 'iswupper_l@@GLIBC_2.16' => 1, 'iswxdigit@@GLIBC_2.16' => 1, 'iswxdigit_l@@GLIBC_2.16' => 1, 'isxdigit@@GLIBC_2.16' => 1, 'isxdigit_l@@GLIBC_2.16' => 1, 'jrand48@@GLIBC_2.16' => 1, 'jrand48_r@@GLIBC_2.16' => 1, 'key_decryptsession@@GLIBC_2.16' => 1, 'key_decryptsession_pk@@GLIBC_2.16' => 1, 'key_encryptsession@@GLIBC_2.16' => 1, 'key_encryptsession_pk@@GLIBC_2.16' => 1, 'key_gendes@@GLIBC_2.16' => 1, 'key_get_conv@@GLIBC_2.16' => 1, 'key_secretkey_is_set@@GLIBC_2.16' => 1, 'key_setnet@@GLIBC_2.16' => 1, 'key_setsecret@@GLIBC_2.16' => 1, 'kill@@GLIBC_2.16' => 1, 'killpg@@GLIBC_2.16' => 1, 'klogctl@@GLIBC_2.16' => 1, 'l64a@@GLIBC_2.16' => 1, 'labs@@GLIBC_2.16' => 1, 'lchmod@@GLIBC_2.16' => 1, 'lchown@@GLIBC_2.16' => 1, 'lckpwdf@@GLIBC_2.16' => 1, 'lcong48@@GLIBC_2.16' => 1, 'lcong48_r@@GLIBC_2.16' => 1, 'ldexp@@GLIBC_2.16' => 1, 'ldexpf@@GLIBC_2.16' => 1, 'ldexpl@@GLIBC_2.16' => 1, 'ldiv@@GLIBC_2.16' => 1, 'lfind@@GLIBC_2.16' => 1, 'lgetxattr@@GLIBC_2.16' => 1, 'link@@GLIBC_2.16' => 1, 'linkat@@GLIBC_2.16' => 1, 'listen@@GLIBC_2.16' => 1, 'listxattr@@GLIBC_2.16' => 1, 'llabs@@GLIBC_2.16' => 1, 'lldiv@@GLIBC_2.16' => 1, 'llistxattr@@GLIBC_2.16' => 1, 'loc1@@GLIBC_2.16' => -4, 'loc2@@GLIBC_2.16' => -4, 'localeconv@@GLIBC_2.16' => 1, 'localtime@@GLIBC_2.16' => 1, 'localtime_r@@GLIBC_2.16' => 1, 'lockf64@@GLIBC_2.16' => 1, 'lockf@@GLIBC_2.16' => 1, 'locs@@GLIBC_2.16' => -4, 'longjmp@@GLIBC_2.16' => 1, 'lrand48@@GLIBC_2.16' => 1, 'lrand48_r@@GLIBC_2.16' => 1, 'lremovexattr@@GLIBC_2.16' => 1, 'lsearch@@GLIBC_2.16' => 1, 'lseek64@@GLIBC_2.16' => 1, 'lseek@@GLIBC_2.16' => 1, 'lsetxattr@@GLIBC_2.16' => 1, 'lutimes@@GLIBC_2.16' => 1, 'madvise@@GLIBC_2.16' => 1, 'makecontext@@GLIBC_2.16' => 1, 'mallinfo@@GLIBC_2.16' => 1, 'malloc@@GLIBC_2.16' => 1, 'malloc_get_state@@GLIBC_2.16' => 1, 'malloc_info@@GLIBC_2.16' => 1, 'malloc_set_state@@GLIBC_2.16' => 1, 'malloc_stats@@GLIBC_2.16' => 1, 'malloc_trim@@GLIBC_2.16' => 1, 'malloc_usable_size@@GLIBC_2.16' => 1, 'mallopt@@GLIBC_2.16' => 1, 'mallwatch@@GLIBC_2.16' => -4, 'mblen@@GLIBC_2.16' => 1, 'mbrlen@@GLIBC_2.16' => 1, 'mbrtoc16@@GLIBC_2.16' => 1, 'mbrtoc32@@GLIBC_2.16' => 1, 'mbrtowc@@GLIBC_2.16' => 1, 'mbsinit@@GLIBC_2.16' => 1, 'mbsnrtowcs@@GLIBC_2.16' => 1, 'mbsrtowcs@@GLIBC_2.16' => 1, 'mbstowcs@@GLIBC_2.16' => 1, 'mbtowc@@GLIBC_2.16' => 1, 'mcheck@@GLIBC_2.16' => 1, 'mcheck_check_all@@GLIBC_2.16' => 1, 'mcheck_pedantic@@GLIBC_2.16' => 1, 'mcount@@GLIBC_2.16' => 1, 'memalign@@GLIBC_2.16' => 1, 'memccpy@@GLIBC_2.16' => 1, 'memchr@@GLIBC_2.16' => 1, 'memcmp@@GLIBC_2.16' => 1, 'memcpy@@GLIBC_2.16' => 1, 'memfrob@@GLIBC_2.16' => 1, 'memmem@@GLIBC_2.16' => 1, 'memmove@@GLIBC_2.16' => 1, 'mempcpy@@GLIBC_2.16' => 1, 'memrchr@@GLIBC_2.16' => 1, 'memset@@GLIBC_2.16' => 1, 'mincore@@GLIBC_2.16' => 1, 'mkdir@@GLIBC_2.16' => 1, 'mkdirat@@GLIBC_2.16' => 1, 'mkdtemp@@GLIBC_2.16' => 1, 'mkfifo@@GLIBC_2.16' => 1, 'mkfifoat@@GLIBC_2.16' => 1, 'mkostemp64@@GLIBC_2.16' => 1, 'mkostemp@@GLIBC_2.16' => 1, 'mkostemps64@@GLIBC_2.16' => 1, 'mkostemps@@GLIBC_2.16' => 1, 'mkstemp64@@GLIBC_2.16' => 1, 'mkstemp@@GLIBC_2.16' => 1, 'mkstemps64@@GLIBC_2.16' => 1, 'mkstemps@@GLIBC_2.16' => 1, 'mktemp@@GLIBC_2.16' => 1, 'mktime@@GLIBC_2.16' => 1, 'mlock@@GLIBC_2.16' => 1, 'mlockall@@GLIBC_2.16' => 1, 'mmap64@@GLIBC_2.16' => 1, 'mmap@@GLIBC_2.16' => 1, 'modf@@GLIBC_2.16' => 1, 'modff@@GLIBC_2.16' => 1, 'modfl@@GLIBC_2.16' => 1, 'modify_ldt@@GLIBC_2.16' => 1, 'moncontrol@@GLIBC_2.16' => 1, 'monstartup@@GLIBC_2.16' => 1, 'mount@@GLIBC_2.16' => 1, 'mprobe@@GLIBC_2.16' => 1, 'mprotect@@GLIBC_2.16' => 1, 'mrand48@@GLIBC_2.16' => 1, 'mrand48_r@@GLIBC_2.16' => 1, 'mremap@@GLIBC_2.16' => 1, 'msgctl@@GLIBC_2.16' => 1, 'msgget@@GLIBC_2.16' => 1, 'msgrcv@@GLIBC_2.16' => 1, 'msgsnd@@GLIBC_2.16' => 1, 'msync@@GLIBC_2.16' => 1, 'mtrace@@GLIBC_2.16' => 1, 'munlock@@GLIBC_2.16' => 1, 'munlockall@@GLIBC_2.16' => 1, 'munmap@@GLIBC_2.16' => 1, 'muntrace@@GLIBC_2.16' => 1, 'name_to_handle_at@@GLIBC_2.16' => 1, 'nanosleep@@GLIBC_2.16' => 1, 'netname2host@@GLIBC_2.16' => 1, 'netname2user@@GLIBC_2.16' => 1, 'newlocale@@GLIBC_2.16' => 1, 'nfsservctl@@GLIBC_2.16' => 1, 'nftw64@@GLIBC_2.16' => 1, 'nftw@@GLIBC_2.16' => 1, 'ngettext@@GLIBC_2.16' => 1, 'nice@@GLIBC_2.16' => 1, 'nl_langinfo@@GLIBC_2.16' => 1, 'nl_langinfo_l@@GLIBC_2.16' => 1, 'nrand48@@GLIBC_2.16' => 1, 'nrand48_r@@GLIBC_2.16' => 1, 'ntohl@@GLIBC_2.16' => 1, 'ntohs@@GLIBC_2.16' => 1, 'ntp_adjtime@@GLIBC_2.16' => 1, 'ntp_gettime@@GLIBC_2.16' => 1, 'ntp_gettimex@@GLIBC_2.16' => 1, 'obstack_alloc_failed_handler@@GLIBC_2.16' => -4, 'obstack_exit_failure@@GLIBC_2.16' => -4, 'obstack_free@@GLIBC_2.16' => 1, 'obstack_printf@@GLIBC_2.16' => 1, 'obstack_vprintf@@GLIBC_2.16' => 1, 'on_exit@@GLIBC_2.16' => 1, 'open64@@GLIBC_2.16' => 1, 'open@@GLIBC_2.16' => 1, 'open_by_handle_at@@GLIBC_2.16' => 1, 'open_memstream@@GLIBC_2.16' => 1, 'open_wmemstream@@GLIBC_2.16' => 1, 'openat64@@GLIBC_2.16' => 1, 'openat@@GLIBC_2.16' => 1, 'opendir@@GLIBC_2.16' => 1, 'openlog@@GLIBC_2.16' => 1, 'optarg@@GLIBC_2.16' => -4, 'opterr@@GLIBC_2.16' => -4, 'optind@@GLIBC_2.16' => -4, 'optopt@@GLIBC_2.16' => -4, 'parse_printf_format@@GLIBC_2.16' => 1, 'passwd2des@@GLIBC_2.16' => 1, 'pathconf@@GLIBC_2.16' => 1, 'pause@@GLIBC_2.16' => 1, 'pclose@@GLIBC_2.16' => 1, 'perror@@GLIBC_2.16' => 1, 'personality@@GLIBC_2.16' => 1, 'pipe2@@GLIBC_2.16' => 1, 'pipe@@GLIBC_2.16' => 1, 'pivot_root@@GLIBC_2.16' => 1, 'pmap_getmaps@@GLIBC_2.16' => 1, 'pmap_getport@@GLIBC_2.16' => 1, 'pmap_rmtcall@@GLIBC_2.16' => 1, 'pmap_set@@GLIBC_2.16' => 1, 'pmap_unset@@GLIBC_2.16' => 1, 'poll@@GLIBC_2.16' => 1, 'popen@@GLIBC_2.16' => 1, 'posix_fadvise64@@GLIBC_2.16' => 1, 'posix_fadvise@@GLIBC_2.16' => 1, 'posix_fallocate64@@GLIBC_2.16' => 1, 'posix_fallocate@@GLIBC_2.16' => 1, 'posix_madvise@@GLIBC_2.16' => 1, 'posix_memalign@@GLIBC_2.16' => 1, 'posix_openpt@@GLIBC_2.16' => 1, 'posix_spawn@@GLIBC_2.16' => 1, 'posix_spawn_file_actions_addclose@@GLIBC_2.16' => 1, 'posix_spawn_file_actions_adddup2@@GLIBC_2.16' => 1, 'posix_spawn_file_actions_addopen@@GLIBC_2.16' => 1, 'posix_spawn_file_actions_destroy@@GLIBC_2.16' => 1, 'posix_spawn_file_actions_init@@GLIBC_2.16' => 1, 'posix_spawnattr_destroy@@GLIBC_2.16' => 1, 'posix_spawnattr_getflags@@GLIBC_2.16' => 1, 'posix_spawnattr_getpgroup@@GLIBC_2.16' => 1, 'posix_spawnattr_getschedparam@@GLIBC_2.16' => 1, 'posix_spawnattr_getschedpolicy@@GLIBC_2.16' => 1, 'posix_spawnattr_getsigdefault@@GLIBC_2.16' => 1, 'posix_spawnattr_getsigmask@@GLIBC_2.16' => 1, 'posix_spawnattr_init@@GLIBC_2.16' => 1, 'posix_spawnattr_setflags@@GLIBC_2.16' => 1, 'posix_spawnattr_setpgroup@@GLIBC_2.16' => 1, 'posix_spawnattr_setschedparam@@GLIBC_2.16' => 1, 'posix_spawnattr_setschedpolicy@@GLIBC_2.16' => 1, 'posix_spawnattr_setsigdefault@@GLIBC_2.16' => 1, 'posix_spawnattr_setsigmask@@GLIBC_2.16' => 1, 'posix_spawnp@@GLIBC_2.16' => 1, 'ppoll@@GLIBC_2.16' => 1, 'prctl@@GLIBC_2.16' => 1, 'pread64@@GLIBC_2.16' => 1, 'pread@@GLIBC_2.16' => 1, 'preadv64@@GLIBC_2.16' => 1, 'preadv@@GLIBC_2.16' => 1, 'printf@@GLIBC_2.16' => 1, 'printf_size@@GLIBC_2.16' => 1, 'printf_size_info@@GLIBC_2.16' => 1, 'prlimit64@@GLIBC_2.16' => 1, 'prlimit@@GLIBC_2.16' => 1, 'process_vm_readv@@GLIBC_2.16' => 1, 'process_vm_writev@@GLIBC_2.16' => 1, 'profil@@GLIBC_2.16' => 1, 'program_invocation_name@@GLIBC_2.16' => -4, 'program_invocation_short_name@@GLIBC_2.16' => -4, 'pselect@@GLIBC_2.16' => 1, 'psiginfo@@GLIBC_2.16' => 1, 'psignal@@GLIBC_2.16' => 1, 'pthread_attr_destroy@@GLIBC_2.16' => 1, 'pthread_attr_getdetachstate@@GLIBC_2.16' => 1, 'pthread_attr_getinheritsched@@GLIBC_2.16' => 1, 'pthread_attr_getschedparam@@GLIBC_2.16' => 1, 'pthread_attr_getschedpolicy@@GLIBC_2.16' => 1, 'pthread_attr_getscope@@GLIBC_2.16' => 1, 'pthread_attr_init@@GLIBC_2.16' => 1, 'pthread_attr_setdetachstate@@GLIBC_2.16' => 1, 'pthread_attr_setinheritsched@@GLIBC_2.16' => 1, 'pthread_attr_setschedparam@@GLIBC_2.16' => 1, 'pthread_attr_setschedpolicy@@GLIBC_2.16' => 1, 'pthread_attr_setscope@@GLIBC_2.16' => 1, 'pthread_cond_broadcast@@GLIBC_2.16' => 1, 'pthread_cond_destroy@@GLIBC_2.16' => 1, 'pthread_cond_init@@GLIBC_2.16' => 1, 'pthread_cond_signal@@GLIBC_2.16' => 1, 'pthread_cond_timedwait@@GLIBC_2.16' => 1, 'pthread_cond_wait@@GLIBC_2.16' => 1, 'pthread_condattr_destroy@@GLIBC_2.16' => 1, 'pthread_condattr_init@@GLIBC_2.16' => 1, 'pthread_equal@@GLIBC_2.16' => 1, 'pthread_exit@@GLIBC_2.16' => 1, 'pthread_getschedparam@@GLIBC_2.16' => 1, 'pthread_mutex_destroy@@GLIBC_2.16' => 1, 'pthread_mutex_init@@GLIBC_2.16' => 1, 'pthread_mutex_lock@@GLIBC_2.16' => 1, 'pthread_mutex_unlock@@GLIBC_2.16' => 1, 'pthread_self@@GLIBC_2.16' => 1, 'pthread_setcancelstate@@GLIBC_2.16' => 1, 'pthread_setcanceltype@@GLIBC_2.16' => 1, 'pthread_setschedparam@@GLIBC_2.16' => 1, 'ptrace@@GLIBC_2.16' => 1, 'ptsname@@GLIBC_2.16' => 1, 'ptsname_r@@GLIBC_2.16' => 1, 'putc@@GLIBC_2.16' => 1, 'putc_unlocked@@GLIBC_2.16' => 1, 'putchar@@GLIBC_2.16' => 1, 'putchar_unlocked@@GLIBC_2.16' => 1, 'putenv@@GLIBC_2.16' => 1, 'putgrent@@GLIBC_2.16' => 1, 'putmsg@@GLIBC_2.16' => 1, 'putpmsg@@GLIBC_2.16' => 1, 'putpwent@@GLIBC_2.16' => 1, 'puts@@GLIBC_2.16' => 1, 'putsgent@@GLIBC_2.16' => 1, 'putspent@@GLIBC_2.16' => 1, 'pututline@@GLIBC_2.16' => 1, 'pututxline@@GLIBC_2.16' => 1, 'putw@@GLIBC_2.16' => 1, 'putwc@@GLIBC_2.16' => 1, 'putwc_unlocked@@GLIBC_2.16' => 1, 'putwchar@@GLIBC_2.16' => 1, 'putwchar_unlocked@@GLIBC_2.16' => 1, 'pvalloc@@GLIBC_2.16' => 1, 'pwrite64@@GLIBC_2.16' => 1, 'pwrite@@GLIBC_2.16' => 1, 'pwritev64@@GLIBC_2.16' => 1, 'pwritev@@GLIBC_2.16' => 1, 'qecvt@@GLIBC_2.16' => 1, 'qecvt_r@@GLIBC_2.16' => 1, 'qfcvt@@GLIBC_2.16' => 1, 'qfcvt_r@@GLIBC_2.16' => 1, 'qgcvt@@GLIBC_2.16' => 1, 'qsort@@GLIBC_2.16' => 1, 'qsort_r@@GLIBC_2.16' => 1, 'query_module@@GLIBC_2.16' => 1, 'quick_exit@@GLIBC_2.16' => 1, 'quotactl@@GLIBC_2.16' => 1, 'raise@@GLIBC_2.16' => 1, 'rand@@GLIBC_2.16' => 1, 'rand_r@@GLIBC_2.16' => 1, 'random@@GLIBC_2.16' => 1, 'random_r@@GLIBC_2.16' => 1, 'rawmemchr@@GLIBC_2.16' => 1, 'rcmd@@GLIBC_2.16' => 1, 'rcmd_af@@GLIBC_2.16' => 1, 're_comp@@GLIBC_2.16' => 1, 're_compile_fastmap@@GLIBC_2.16' => 1, 're_compile_pattern@@GLIBC_2.16' => 1, 're_exec@@GLIBC_2.16' => 1, 're_match@@GLIBC_2.16' => 1, 're_match_2@@GLIBC_2.16' => 1, 're_search@@GLIBC_2.16' => 1, 're_search_2@@GLIBC_2.16' => 1, 're_set_registers@@GLIBC_2.16' => 1, 're_set_syntax@@GLIBC_2.16' => 1, 're_syntax_options@@GLIBC_2.16' => -4, 'read@@GLIBC_2.16' => 1, 'readahead@@GLIBC_2.16' => 1, 'readdir64@@GLIBC_2.16' => 1, 'readdir64_r@@GLIBC_2.16' => 1, 'readdir@@GLIBC_2.16' => 1, 'readdir_r@@GLIBC_2.16' => 1, 'readlink@@GLIBC_2.16' => 1, 'readlinkat@@GLIBC_2.16' => 1, 'readv@@GLIBC_2.16' => 1, 'realloc@@GLIBC_2.16' => 1, 'realpath@@GLIBC_2.16' => 1, 'reboot@@GLIBC_2.16' => 1, 'recv@@GLIBC_2.16' => 1, 'recvfrom@@GLIBC_2.16' => 1, 'recvmmsg@@GLIBC_2.16' => 1, 'recvmsg@@GLIBC_2.16' => 1, 'regcomp@@GLIBC_2.16' => 1, 'regerror@@GLIBC_2.16' => 1, 'regexec@@GLIBC_2.16' => 1, 'regfree@@GLIBC_2.16' => 1, 'register_printf_function@@GLIBC_2.16' => 1, 'register_printf_modifier@@GLIBC_2.16' => 1, 'register_printf_specifier@@GLIBC_2.16' => 1, 'register_printf_type@@GLIBC_2.16' => 1, 'registerrpc@@GLIBC_2.16' => 1, 'remap_file_pages@@GLIBC_2.16' => 1, 'remove@@GLIBC_2.16' => 1, 'removexattr@@GLIBC_2.16' => 1, 'remque@@GLIBC_2.16' => 1, 'rename@@GLIBC_2.16' => 1, 'renameat@@GLIBC_2.16' => 1, 'revoke@@GLIBC_2.16' => 1, 'rewind@@GLIBC_2.16' => 1, 'rewinddir@@GLIBC_2.16' => 1, 'rexec@@GLIBC_2.16' => 1, 'rexec_af@@GLIBC_2.16' => 1, 'rexecoptions@@GLIBC_2.16' => -4, 'rindex@@GLIBC_2.16' => 1, 'rmdir@@GLIBC_2.16' => 1, 'rpc_createerr@@GLIBC_2.16' => -16, 'rpmatch@@GLIBC_2.16' => 1, 'rresvport@@GLIBC_2.16' => 1, 'rresvport_af@@GLIBC_2.16' => 1, 'rtime@@GLIBC_2.16' => 1, 'ruserok@@GLIBC_2.16' => 1, 'ruserok_af@@GLIBC_2.16' => 1, 'ruserpass@@GLIBC_2.16' => 1, 'sbrk@@GLIBC_2.16' => 1, 'scalbn@@GLIBC_2.16' => 1, 'scalbnf@@GLIBC_2.16' => 1, 'scalbnl@@GLIBC_2.16' => 1, 'scandir64@@GLIBC_2.16' => 1, 'scandir@@GLIBC_2.16' => 1, 'scandirat64@@GLIBC_2.16' => 1, 'scandirat@@GLIBC_2.16' => 1, 'scanf@@GLIBC_2.16' => 1, 'sched_get_priority_max@@GLIBC_2.16' => 1, 'sched_get_priority_min@@GLIBC_2.16' => 1, 'sched_getaffinity@@GLIBC_2.16' => 1, 'sched_getcpu@@GLIBC_2.16' => 1, 'sched_getparam@@GLIBC_2.16' => 1, 'sched_getscheduler@@GLIBC_2.16' => 1, 'sched_rr_get_interval@@GLIBC_2.16' => 1, 'sched_setaffinity@@GLIBC_2.16' => 1, 'sched_setparam@@GLIBC_2.16' => 1, 'sched_setscheduler@@GLIBC_2.16' => 1, 'sched_yield@@GLIBC_2.16' => 1, 'secure_getenv@@GLIBC_2.17' => 1, 'seed48@@GLIBC_2.16' => 1, 'seed48_r@@GLIBC_2.16' => 1, 'seekdir@@GLIBC_2.16' => 1, 'select@@GLIBC_2.16' => 1, 'semctl@@GLIBC_2.16' => 1, 'semget@@GLIBC_2.16' => 1, 'semop@@GLIBC_2.16' => 1, 'semtimedop@@GLIBC_2.16' => 1, 'send@@GLIBC_2.16' => 1, 'sendfile64@@GLIBC_2.16' => 1, 'sendfile@@GLIBC_2.16' => 1, 'sendmmsg@@GLIBC_2.16' => 1, 'sendmsg@@GLIBC_2.16' => 1, 'sendto@@GLIBC_2.16' => 1, 'setaliasent@@GLIBC_2.16' => 1, 'setbuf@@GLIBC_2.16' => 1, 'setbuffer@@GLIBC_2.16' => 1, 'setcontext@@GLIBC_2.16' => 1, 'setdomainname@@GLIBC_2.16' => 1, 'setegid@@GLIBC_2.16' => 1, 'setenv@@GLIBC_2.16' => 1, 'seteuid@@GLIBC_2.16' => 1, 'setfsent@@GLIBC_2.16' => 1, 'setfsgid@@GLIBC_2.16' => 1, 'setfsuid@@GLIBC_2.16' => 1, 'setgid@@GLIBC_2.16' => 1, 'setgrent@@GLIBC_2.16' => 1, 'setgroups@@GLIBC_2.16' => 1, 'sethostent@@GLIBC_2.16' => 1, 'sethostid@@GLIBC_2.16' => 1, 'sethostname@@GLIBC_2.16' => 1, 'setipv4sourcefilter@@GLIBC_2.16' => 1, 'setitimer@@GLIBC_2.16' => 1, 'setjmp@@GLIBC_2.16' => 1, 'setlinebuf@@GLIBC_2.16' => 1, 'setlocale@@GLIBC_2.16' => 1, 'setlogin@@GLIBC_2.16' => 1, 'setlogmask@@GLIBC_2.16' => 1, 'setmntent@@GLIBC_2.16' => 1, 'setnetent@@GLIBC_2.16' => 1, 'setnetgrent@@GLIBC_2.16' => 1, 'setns@@GLIBC_2.16' => 1, 'setpgid@@GLIBC_2.16' => 1, 'setpgrp@@GLIBC_2.16' => 1, 'setpriority@@GLIBC_2.16' => 1, 'setprotoent@@GLIBC_2.16' => 1, 'setpwent@@GLIBC_2.16' => 1, 'setregid@@GLIBC_2.16' => 1, 'setresgid@@GLIBC_2.16' => 1, 'setresuid@@GLIBC_2.16' => 1, 'setreuid@@GLIBC_2.16' => 1, 'setrlimit64@@GLIBC_2.16' => 1, 'setrlimit@@GLIBC_2.16' => 1, 'setrpcent@@GLIBC_2.16' => 1, 'setservent@@GLIBC_2.16' => 1, 'setsgent@@GLIBC_2.16' => 1, 'setsid@@GLIBC_2.16' => 1, 'setsockopt@@GLIBC_2.16' => 1, 'setsourcefilter@@GLIBC_2.16' => 1, 'setspent@@GLIBC_2.16' => 1, 'setstate@@GLIBC_2.16' => 1, 'setstate_r@@GLIBC_2.16' => 1, 'settimeofday@@GLIBC_2.16' => 1, 'setttyent@@GLIBC_2.16' => 1, 'setuid@@GLIBC_2.16' => 1, 'setusershell@@GLIBC_2.16' => 1, 'setutent@@GLIBC_2.16' => 1, 'setutxent@@GLIBC_2.16' => 1, 'setvbuf@@GLIBC_2.16' => 1, 'setxattr@@GLIBC_2.16' => 1, 'sgetsgent@@GLIBC_2.16' => 1, 'sgetsgent_r@@GLIBC_2.16' => 1, 'sgetspent@@GLIBC_2.16' => 1, 'sgetspent_r@@GLIBC_2.16' => 1, 'shmat@@GLIBC_2.16' => 1, 'shmctl@@GLIBC_2.16' => 1, 'shmdt@@GLIBC_2.16' => 1, 'shmget@@GLIBC_2.16' => 1, 'shutdown@@GLIBC_2.16' => 1, 'sigaction@@GLIBC_2.16' => 1, 'sigaddset@@GLIBC_2.16' => 1, 'sigaltstack@@GLIBC_2.16' => 1, 'sigandset@@GLIBC_2.16' => 1, 'sigblock@@GLIBC_2.16' => 1, 'sigdelset@@GLIBC_2.16' => 1, 'sigemptyset@@GLIBC_2.16' => 1, 'sigfillset@@GLIBC_2.16' => 1, 'siggetmask@@GLIBC_2.16' => 1, 'sighold@@GLIBC_2.16' => 1, 'sigignore@@GLIBC_2.16' => 1, 'siginterrupt@@GLIBC_2.16' => 1, 'sigisemptyset@@GLIBC_2.16' => 1, 'sigismember@@GLIBC_2.16' => 1, 'siglongjmp@@GLIBC_2.16' => 1, 'signal@@GLIBC_2.16' => 1, 'signalfd@@GLIBC_2.16' => 1, 'sigorset@@GLIBC_2.16' => 1, 'sigpause@@GLIBC_2.16' => 1, 'sigpending@@GLIBC_2.16' => 1, 'sigprocmask@@GLIBC_2.16' => 1, 'sigqueue@@GLIBC_2.16' => 1, 'sigrelse@@GLIBC_2.16' => 1, 'sigreturn@@GLIBC_2.16' => 1, 'sigset@@GLIBC_2.16' => 1, 'sigsetmask@@GLIBC_2.16' => 1, 'sigstack@@GLIBC_2.16' => 1, 'sigsuspend@@GLIBC_2.16' => 1, 'sigtimedwait@@GLIBC_2.16' => 1, 'sigvec@@GLIBC_2.16' => 1, 'sigwait@@GLIBC_2.16' => 1, 'sigwaitinfo@@GLIBC_2.16' => 1, 'sleep@@GLIBC_2.16' => 1, 'snprintf@@GLIBC_2.16' => 1, 'sockatmark@@GLIBC_2.16' => 1, 'socket@@GLIBC_2.16' => 1, 'socketpair@@GLIBC_2.16' => 1, 'splice@@GLIBC_2.16' => 1, 'sprintf@@GLIBC_2.16' => 1, 'sprofil@@GLIBC_2.16' => 1, 'srand48@@GLIBC_2.16' => 1, 'srand48_r@@GLIBC_2.16' => 1, 'srand@@GLIBC_2.16' => 1, 'srandom@@GLIBC_2.16' => 1, 'srandom_r@@GLIBC_2.16' => 1, 'sscanf@@GLIBC_2.16' => 1, 'ssignal@@GLIBC_2.16' => 1, 'sstk@@GLIBC_2.16' => 1, 'statfs64@@GLIBC_2.16' => 1, 'statfs@@GLIBC_2.16' => 1, 'statvfs64@@GLIBC_2.16' => 1, 'statvfs@@GLIBC_2.16' => 1, 'stderr@@GLIBC_2.16' => -4, 'stdin@@GLIBC_2.16' => -4, 'stdout@@GLIBC_2.16' => -4, 'step@@GLIBC_2.16' => 1, 'stime@@GLIBC_2.16' => 1, 'stpcpy@@GLIBC_2.16' => 1, 'stpncpy@@GLIBC_2.16' => 1, 'strcasecmp@@GLIBC_2.16' => 1, 'strcasecmp_l@@GLIBC_2.16' => 1, 'strcasestr@@GLIBC_2.16' => 1, 'strcat@@GLIBC_2.16' => 1, 'strchr@@GLIBC_2.16' => 1, 'strchrnul@@GLIBC_2.16' => 1, 'strcmp@@GLIBC_2.16' => 1, 'strcoll@@GLIBC_2.16' => 1, 'strcoll_l@@GLIBC_2.16' => 1, 'strcpy@@GLIBC_2.16' => 1, 'strcspn@@GLIBC_2.16' => 1, 'strdup@@GLIBC_2.16' => 1, 'strerror@@GLIBC_2.16' => 1, 'strerror_l@@GLIBC_2.16' => 1, 'strerror_r@@GLIBC_2.16' => 1, 'strfmon@@GLIBC_2.16' => 1, 'strfmon_l@@GLIBC_2.16' => 1, 'strfry@@GLIBC_2.16' => 1, 'strftime@@GLIBC_2.16' => 1, 'strftime_l@@GLIBC_2.16' => 1, 'strlen@@GLIBC_2.16' => 1, 'strncasecmp@@GLIBC_2.16' => 1, 'strncasecmp_l@@GLIBC_2.16' => 1, 'strncat@@GLIBC_2.16' => 1, 'strncmp@@GLIBC_2.16' => 1, 'strncpy@@GLIBC_2.16' => 1, 'strndup@@GLIBC_2.16' => 1, 'strnlen@@GLIBC_2.16' => 1, 'strpbrk@@GLIBC_2.16' => 1, 'strptime@@GLIBC_2.16' => 1, 'strptime_l@@GLIBC_2.16' => 1, 'strrchr@@GLIBC_2.16' => 1, 'strsep@@GLIBC_2.16' => 1, 'strsignal@@GLIBC_2.16' => 1, 'strspn@@GLIBC_2.16' => 1, 'strstr@@GLIBC_2.16' => 1, 'strtod@@GLIBC_2.16' => 1, 'strtod_l@@GLIBC_2.16' => 1, 'strtof@@GLIBC_2.16' => 1, 'strtof_l@@GLIBC_2.16' => 1, 'strtoimax@@GLIBC_2.16' => 1, 'strtok@@GLIBC_2.16' => 1, 'strtok_r@@GLIBC_2.16' => 1, 'strtol@@GLIBC_2.16' => 1, 'strtol_l@@GLIBC_2.16' => 1, 'strtold@@GLIBC_2.16' => 1, 'strtold_l@@GLIBC_2.16' => 1, 'strtoll@@GLIBC_2.16' => 1, 'strtoll_l@@GLIBC_2.16' => 1, 'strtoq@@GLIBC_2.16' => 1, 'strtoul@@GLIBC_2.16' => 1, 'strtoul_l@@GLIBC_2.16' => 1, 'strtoull@@GLIBC_2.16' => 1, 'strtoull_l@@GLIBC_2.16' => 1, 'strtoumax@@GLIBC_2.16' => 1, 'strtouq@@GLIBC_2.16' => 1, 'strverscmp@@GLIBC_2.16' => 1, 'strxfrm@@GLIBC_2.16' => 1, 'strxfrm_l@@GLIBC_2.16' => 1, 'stty@@GLIBC_2.16' => 1, 'svc_exit@@GLIBC_2.16' => 1, 'svc_fdset@@GLIBC_2.16' => -128, 'svc_getreq@@GLIBC_2.16' => 1, 'svc_getreq_common@@GLIBC_2.16' => 1, 'svc_getreq_poll@@GLIBC_2.16' => 1, 'svc_getreqset@@GLIBC_2.16' => 1, 'svc_max_pollfd@@GLIBC_2.16' => -4, 'svc_pollfd@@GLIBC_2.16' => -4, 'svc_register@@GLIBC_2.16' => 1, 'svc_run@@GLIBC_2.16' => 1, 'svc_sendreply@@GLIBC_2.16' => 1, 'svc_unregister@@GLIBC_2.16' => 1, 'svcauthdes_stats@@GLIBC_2.16' => -12, 'svcerr_auth@@GLIBC_2.16' => 1, 'svcerr_decode@@GLIBC_2.16' => 1, 'svcerr_noproc@@GLIBC_2.16' => 1, 'svcerr_noprog@@GLIBC_2.16' => 1, 'svcerr_progvers@@GLIBC_2.16' => 1, 'svcerr_systemerr@@GLIBC_2.16' => 1, 'svcerr_weakauth@@GLIBC_2.16' => 1, 'svcfd_create@@GLIBC_2.16' => 1, 'svcraw_create@@GLIBC_2.16' => 1, 'svctcp_create@@GLIBC_2.16' => 1, 'svcudp_bufcreate@@GLIBC_2.16' => 1, 'svcudp_create@@GLIBC_2.16' => 1, 'svcudp_enablecache@@GLIBC_2.16' => 1, 'svcunix_create@@GLIBC_2.16' => 1, 'svcunixfd_create@@GLIBC_2.16' => 1, 'swab@@GLIBC_2.16' => 1, 'swapcontext@@GLIBC_2.16' => 1, 'swapoff@@GLIBC_2.16' => 1, 'swapon@@GLIBC_2.16' => 1, 'swprintf@@GLIBC_2.16' => 1, 'swscanf@@GLIBC_2.16' => 1, 'symlink@@GLIBC_2.16' => 1, 'symlinkat@@GLIBC_2.16' => 1, 'sync@@GLIBC_2.16' => 1, 'sync_file_range@@GLIBC_2.16' => 1, 'syncfs@@GLIBC_2.16' => 1, 'sys_errlist@@GLIBC_2.16' => -540, 'sys_nerr@@GLIBC_2.16' => -4, 'sys_sigabbrev@@GLIBC_2.16' => -260, 'sys_siglist@@GLIBC_2.16' => -260, 'syscall@@GLIBC_2.16' => 1, 'sysconf@@GLIBC_2.16' => 1, 'sysinfo@@GLIBC_2.16' => 1, 'syslog@@GLIBC_2.16' => 1, 'system@@GLIBC_2.16' => 1, 'sysv_signal@@GLIBC_2.16' => 1, 'tcdrain@@GLIBC_2.16' => 1, 'tcflow@@GLIBC_2.16' => 1, 'tcflush@@GLIBC_2.16' => 1, 'tcgetattr@@GLIBC_2.16' => 1, 'tcgetpgrp@@GLIBC_2.16' => 1, 'tcgetsid@@GLIBC_2.16' => 1, 'tcsendbreak@@GLIBC_2.16' => 1, 'tcsetattr@@GLIBC_2.16' => 1, 'tcsetpgrp@@GLIBC_2.16' => 1, 'tdelete@@GLIBC_2.16' => 1, 'tdestroy@@GLIBC_2.16' => 1, 'tee@@GLIBC_2.16' => 1, 'telldir@@GLIBC_2.16' => 1, 'tempnam@@GLIBC_2.16' => 1, 'textdomain@@GLIBC_2.16' => 1, 'tfind@@GLIBC_2.16' => 1, 'time@@GLIBC_2.16' => 1, 'timegm@@GLIBC_2.16' => 1, 'timelocal@@GLIBC_2.16' => 1, 'timerfd_create@@GLIBC_2.16' => 1, 'timerfd_gettime@@GLIBC_2.16' => 1, 'timerfd_settime@@GLIBC_2.16' => 1, 'times@@GLIBC_2.16' => 1, 'timespec_get@@GLIBC_2.16' => 1, 'timezone@@GLIBC_2.16' => -4, 'tmpfile64@@GLIBC_2.16' => 1, 'tmpfile@@GLIBC_2.16' => 1, 'tmpnam@@GLIBC_2.16' => 1, 'tmpnam_r@@GLIBC_2.16' => 1, 'toascii@@GLIBC_2.16' => 1, 'tolower@@GLIBC_2.16' => 1, 'tolower_l@@GLIBC_2.16' => 1, 'toupper@@GLIBC_2.16' => 1, 'toupper_l@@GLIBC_2.16' => 1, 'towctrans@@GLIBC_2.16' => 1, 'towctrans_l@@GLIBC_2.16' => 1, 'towlower@@GLIBC_2.16' => 1, 'towlower_l@@GLIBC_2.16' => 1, 'towupper@@GLIBC_2.16' => 1, 'towupper_l@@GLIBC_2.16' => 1, 'tr_break@@GLIBC_2.16' => 1, 'truncate64@@GLIBC_2.16' => 1, 'truncate@@GLIBC_2.16' => 1, 'tsearch@@GLIBC_2.16' => 1, 'ttyname@@GLIBC_2.16' => 1, 'ttyname_r@@GLIBC_2.16' => 1, 'ttyslot@@GLIBC_2.16' => 1, 'twalk@@GLIBC_2.16' => 1, 'tzname@@GLIBC_2.16' => -8, 'tzset@@GLIBC_2.16' => 1, 'ualarm@@GLIBC_2.16' => 1, 'ulckpwdf@@GLIBC_2.16' => 1, 'ulimit@@GLIBC_2.16' => 1, 'umask@@GLIBC_2.16' => 1, 'umount2@@GLIBC_2.16' => 1, 'umount@@GLIBC_2.16' => 1, 'uname@@GLIBC_2.16' => 1, 'ungetc@@GLIBC_2.16' => 1, 'ungetwc@@GLIBC_2.16' => 1, 'unlink@@GLIBC_2.16' => 1, 'unlinkat@@GLIBC_2.16' => 1, 'unlockpt@@GLIBC_2.16' => 1, 'unsetenv@@GLIBC_2.16' => 1, 'unshare@@GLIBC_2.16' => 1, 'updwtmp@@GLIBC_2.16' => 1, 'updwtmpx@@GLIBC_2.16' => 1, 'uselib@@GLIBC_2.16' => 1, 'uselocale@@GLIBC_2.16' => 1, 'user2netname@@GLIBC_2.16' => 1, 'usleep@@GLIBC_2.16' => 1, 'ustat@@GLIBC_2.16' => 1, 'utime@@GLIBC_2.16' => 1, 'utimensat@@GLIBC_2.16' => 1, 'utimes@@GLIBC_2.16' => 1, 'utmpname@@GLIBC_2.16' => 1, 'utmpxname@@GLIBC_2.16' => 1, 'valloc@@GLIBC_2.16' => 1, 'vasprintf@@GLIBC_2.16' => 1, 'vdprintf@@GLIBC_2.16' => 1, 'verr@@GLIBC_2.16' => 1, 'verrx@@GLIBC_2.16' => 1, 'versionsort64@@GLIBC_2.16' => 1, 'versionsort@@GLIBC_2.16' => 1, 'vfork@@GLIBC_2.16' => 1, 'vfprintf@@GLIBC_2.16' => 1, 'vfscanf@@GLIBC_2.16' => 1, 'vfwprintf@@GLIBC_2.16' => 1, 'vfwscanf@@GLIBC_2.16' => 1, 'vhangup@@GLIBC_2.16' => 1, 'vlimit@@GLIBC_2.16' => 1, 'vmsplice@@GLIBC_2.16' => 1, 'vprintf@@GLIBC_2.16' => 1, 'vscanf@@GLIBC_2.16' => 1, 'vsnprintf@@GLIBC_2.16' => 1, 'vsprintf@@GLIBC_2.16' => 1, 'vsscanf@@GLIBC_2.16' => 1, 'vswprintf@@GLIBC_2.16' => 1, 'vswscanf@@GLIBC_2.16' => 1, 'vsyslog@@GLIBC_2.16' => 1, 'vtimes@@GLIBC_2.16' => 1, 'vwarn@@GLIBC_2.16' => 1, 'vwarnx@@GLIBC_2.16' => 1, 'vwprintf@@GLIBC_2.16' => 1, 'vwscanf@@GLIBC_2.16' => 1, 'wait3@@GLIBC_2.16' => 1, 'wait4@@GLIBC_2.16' => 1, 'wait@@GLIBC_2.16' => 1, 'waitid@@GLIBC_2.16' => 1, 'waitpid@@GLIBC_2.16' => 1, 'warn@@GLIBC_2.16' => 1, 'warnx@@GLIBC_2.16' => 1, 'wcpcpy@@GLIBC_2.16' => 1, 'wcpncpy@@GLIBC_2.16' => 1, 'wcrtomb@@GLIBC_2.16' => 1, 'wcscasecmp@@GLIBC_2.16' => 1, 'wcscasecmp_l@@GLIBC_2.16' => 1, 'wcscat@@GLIBC_2.16' => 1, 'wcschr@@GLIBC_2.16' => 1, 'wcschrnul@@GLIBC_2.16' => 1, 'wcscmp@@GLIBC_2.16' => 1, 'wcscoll@@GLIBC_2.16' => 1, 'wcscoll_l@@GLIBC_2.16' => 1, 'wcscpy@@GLIBC_2.16' => 1, 'wcscspn@@GLIBC_2.16' => 1, 'wcsdup@@GLIBC_2.16' => 1, 'wcsftime@@GLIBC_2.16' => 1, 'wcsftime_l@@GLIBC_2.16' => 1, 'wcslen@@GLIBC_2.16' => 1, 'wcsncasecmp@@GLIBC_2.16' => 1, 'wcsncasecmp_l@@GLIBC_2.16' => 1, 'wcsncat@@GLIBC_2.16' => 1, 'wcsncmp@@GLIBC_2.16' => 1, 'wcsncpy@@GLIBC_2.16' => 1, 'wcsnlen@@GLIBC_2.16' => 1, 'wcsnrtombs@@GLIBC_2.16' => 1, 'wcspbrk@@GLIBC_2.16' => 1, 'wcsrchr@@GLIBC_2.16' => 1, 'wcsrtombs@@GLIBC_2.16' => 1, 'wcsspn@@GLIBC_2.16' => 1, 'wcsstr@@GLIBC_2.16' => 1, 'wcstod@@GLIBC_2.16' => 1, 'wcstod_l@@GLIBC_2.16' => 1, 'wcstof@@GLIBC_2.16' => 1, 'wcstof_l@@GLIBC_2.16' => 1, 'wcstoimax@@GLIBC_2.16' => 1, 'wcstok@@GLIBC_2.16' => 1, 'wcstol@@GLIBC_2.16' => 1, 'wcstol_l@@GLIBC_2.16' => 1, 'wcstold@@GLIBC_2.16' => 1, 'wcstold_l@@GLIBC_2.16' => 1, 'wcstoll@@GLIBC_2.16' => 1, 'wcstoll_l@@GLIBC_2.16' => 1, 'wcstombs@@GLIBC_2.16' => 1, 'wcstoq@@GLIBC_2.16' => 1, 'wcstoul@@GLIBC_2.16' => 1, 'wcstoul_l@@GLIBC_2.16' => 1, 'wcstoull@@GLIBC_2.16' => 1, 'wcstoull_l@@GLIBC_2.16' => 1, 'wcstoumax@@GLIBC_2.16' => 1, 'wcstouq@@GLIBC_2.16' => 1, 'wcswcs@@GLIBC_2.16' => 1, 'wcswidth@@GLIBC_2.16' => 1, 'wcsxfrm@@GLIBC_2.16' => 1, 'wcsxfrm_l@@GLIBC_2.16' => 1, 'wctob@@GLIBC_2.16' => 1, 'wctomb@@GLIBC_2.16' => 1, 'wctrans@@GLIBC_2.16' => 1, 'wctrans_l@@GLIBC_2.16' => 1, 'wctype@@GLIBC_2.16' => 1, 'wctype_l@@GLIBC_2.16' => 1, 'wcwidth@@GLIBC_2.16' => 1, 'wmemchr@@GLIBC_2.16' => 1, 'wmemcmp@@GLIBC_2.16' => 1, 'wmemcpy@@GLIBC_2.16' => 1, 'wmemmove@@GLIBC_2.16' => 1, 'wmempcpy@@GLIBC_2.16' => 1, 'wmemset@@GLIBC_2.16' => 1, 'wordexp@@GLIBC_2.16' => 1, 'wordfree@@GLIBC_2.16' => 1, 'wprintf@@GLIBC_2.16' => 1, 'write@@GLIBC_2.16' => 1, 'writev@@GLIBC_2.16' => 1, 'wscanf@@GLIBC_2.16' => 1, 'xdecrypt@@GLIBC_2.16' => 1, 'xdr_accepted_reply@@GLIBC_2.16' => 1, 'xdr_array@@GLIBC_2.16' => 1, 'xdr_authdes_cred@@GLIBC_2.16' => 1, 'xdr_authdes_verf@@GLIBC_2.16' => 1, 'xdr_authunix_parms@@GLIBC_2.16' => 1, 'xdr_bool@@GLIBC_2.16' => 1, 'xdr_bytes@@GLIBC_2.16' => 1, 'xdr_callhdr@@GLIBC_2.16' => 1, 'xdr_callmsg@@GLIBC_2.16' => 1, 'xdr_char@@GLIBC_2.16' => 1, 'xdr_cryptkeyarg2@@GLIBC_2.16' => 1, 'xdr_cryptkeyarg@@GLIBC_2.16' => 1, 'xdr_cryptkeyres@@GLIBC_2.16' => 1, 'xdr_des_block@@GLIBC_2.16' => 1, 'xdr_double@@GLIBC_2.16' => 1, 'xdr_enum@@GLIBC_2.16' => 1, 'xdr_float@@GLIBC_2.16' => 1, 'xdr_free@@GLIBC_2.16' => 1, 'xdr_getcredres@@GLIBC_2.16' => 1, 'xdr_hyper@@GLIBC_2.16' => 1, 'xdr_int16_t@@GLIBC_2.16' => 1, 'xdr_int32_t@@GLIBC_2.16' => 1, 'xdr_int64_t@@GLIBC_2.16' => 1, 'xdr_int8_t@@GLIBC_2.16' => 1, 'xdr_int@@GLIBC_2.16' => 1, 'xdr_key_netstarg@@GLIBC_2.16' => 1, 'xdr_key_netstres@@GLIBC_2.16' => 1, 'xdr_keybuf@@GLIBC_2.16' => 1, 'xdr_keystatus@@GLIBC_2.16' => 1, 'xdr_long@@GLIBC_2.16' => 1, 'xdr_longlong_t@@GLIBC_2.16' => 1, 'xdr_netnamestr@@GLIBC_2.16' => 1, 'xdr_netobj@@GLIBC_2.16' => 1, 'xdr_opaque@@GLIBC_2.16' => 1, 'xdr_opaque_auth@@GLIBC_2.16' => 1, 'xdr_pmap@@GLIBC_2.16' => 1, 'xdr_pmaplist@@GLIBC_2.16' => 1, 'xdr_pointer@@GLIBC_2.16' => 1, 'xdr_quad_t@@GLIBC_2.16' => 1, 'xdr_reference@@GLIBC_2.16' => 1, 'xdr_rejected_reply@@GLIBC_2.16' => 1, 'xdr_replymsg@@GLIBC_2.16' => 1, 'xdr_rmtcall_args@@GLIBC_2.16' => 1, 'xdr_rmtcallres@@GLIBC_2.16' => 1, 'xdr_short@@GLIBC_2.16' => 1, 'xdr_sizeof@@GLIBC_2.16' => 1, 'xdr_string@@GLIBC_2.16' => 1, 'xdr_u_char@@GLIBC_2.16' => 1, 'xdr_u_hyper@@GLIBC_2.16' => 1, 'xdr_u_int@@GLIBC_2.16' => 1, 'xdr_u_long@@GLIBC_2.16' => 1, 'xdr_u_longlong_t@@GLIBC_2.16' => 1, 'xdr_u_quad_t@@GLIBC_2.16' => 1, 'xdr_u_short@@GLIBC_2.16' => 1, 'xdr_uint16_t@@GLIBC_2.16' => 1, 'xdr_uint32_t@@GLIBC_2.16' => 1, 'xdr_uint64_t@@GLIBC_2.16' => 1, 'xdr_uint8_t@@GLIBC_2.16' => 1, 'xdr_union@@GLIBC_2.16' => 1, 'xdr_unixcred@@GLIBC_2.16' => 1, 'xdr_vector@@GLIBC_2.16' => 1, 'xdr_void@@GLIBC_2.16' => 1, 'xdr_wrapstring@@GLIBC_2.16' => 1, 'xdrmem_create@@GLIBC_2.16' => 1, 'xdrrec_create@@GLIBC_2.16' => 1, 'xdrrec_endofrecord@@GLIBC_2.16' => 1, 'xdrrec_eof@@GLIBC_2.16' => 1, 'xdrrec_skiprecord@@GLIBC_2.16' => 1, 'xdrstdio_create@@GLIBC_2.16' => 1, 'xencrypt@@GLIBC_2.16' => 1, 'xprt_register@@GLIBC_2.16' => 1, 'xprt_unregister@@GLIBC_2.16' => 1 }, 'libdbus-1.so.3.7.4' => { 'dbus_address_entries_free' => 1, 'dbus_address_entry_get_method' => 1, 'dbus_address_entry_get_value' => 1, 'dbus_address_escape_value' => 1, 'dbus_address_unescape_value' => 1, 'dbus_bus_add_match' => 1, 'dbus_bus_get' => 1, 'dbus_bus_get_id' => 1, 'dbus_bus_get_private' => 1, 'dbus_bus_get_unique_name' => 1, 'dbus_bus_get_unix_user' => 1, 'dbus_bus_name_has_owner' => 1, 'dbus_bus_register' => 1, 'dbus_bus_release_name' => 1, 'dbus_bus_remove_match' => 1, 'dbus_bus_request_name' => 1, 'dbus_bus_set_unique_name' => 1, 'dbus_bus_start_service_by_name' => 1, 'dbus_connection_add_filter' => 1, 'dbus_connection_allocate_data_slot' => 1, 'dbus_connection_borrow_message' => 1, 'dbus_connection_can_send_type' => 1, 'dbus_connection_close' => 1, 'dbus_connection_dispatch' => 1, 'dbus_connection_flush' => 1, 'dbus_connection_free_data_slot' => 1, 'dbus_connection_free_preallocated_send' => 1, 'dbus_connection_get_adt_audit_session_data' => 1, 'dbus_connection_get_data' => 1, 'dbus_connection_get_dispatch_status' => 1, 'dbus_connection_get_is_anonymous' => 1, 'dbus_connection_get_is_authenticated' => 1, 'dbus_connection_get_is_connected' => 1, 'dbus_connection_get_max_message_size' => 1, 'dbus_connection_get_max_message_unix_fds' => 1, 'dbus_connection_get_max_received_size' => 1, 'dbus_connection_get_max_received_unix_fds' => 1, 'dbus_connection_get_object_path_data' => 1, 'dbus_connection_get_outgoing_size' => 1, 'dbus_connection_get_outgoing_unix_fds' => 1, 'dbus_connection_get_server_id' => 1, 'dbus_connection_get_socket' => 1, 'dbus_connection_get_unix_fd' => 1, 'dbus_connection_get_unix_process_id' => 1, 'dbus_connection_get_unix_user' => 1, 'dbus_connection_get_windows_user' => 1, 'dbus_connection_has_messages_to_send' => 1, 'dbus_connection_list_registered' => 1, 'dbus_connection_open' => 1, 'dbus_connection_open_private' => 1, 'dbus_connection_pop_message' => 1, 'dbus_connection_preallocate_send' => 1, 'dbus_connection_read_write' => 1, 'dbus_connection_read_write_dispatch' => 1, 'dbus_connection_ref' => 1, 'dbus_connection_register_fallback' => 1, 'dbus_connection_register_object_path' => 1, 'dbus_connection_remove_filter' => 1, 'dbus_connection_return_message' => 1, 'dbus_connection_send' => 1, 'dbus_connection_send_preallocated' => 1, 'dbus_connection_send_with_reply' => 1, 'dbus_connection_send_with_reply_and_block' => 1, 'dbus_connection_set_allow_anonymous' => 1, 'dbus_connection_set_change_sigpipe' => 1, 'dbus_connection_set_data' => 1, 'dbus_connection_set_dispatch_status_function' => 1, 'dbus_connection_set_exit_on_disconnect' => 1, 'dbus_connection_set_max_message_size' => 1, 'dbus_connection_set_max_message_unix_fds' => 1, 'dbus_connection_set_max_received_size' => 1, 'dbus_connection_set_max_received_unix_fds' => 1, 'dbus_connection_set_route_peer_messages' => 1, 'dbus_connection_set_timeout_functions' => 1, 'dbus_connection_set_unix_user_function' => 1, 'dbus_connection_set_wakeup_main_function' => 1, 'dbus_connection_set_watch_functions' => 1, 'dbus_connection_set_windows_user_function' => 1, 'dbus_connection_steal_borrowed_message' => 1, 'dbus_connection_try_register_fallback' => 1, 'dbus_connection_try_register_object_path' => 1, 'dbus_connection_unref' => 1, 'dbus_connection_unregister_object_path' => 1, 'dbus_error_free' => 1, 'dbus_error_has_name' => 1, 'dbus_error_init' => 1, 'dbus_error_is_set' => 1, 'dbus_free' => 1, 'dbus_free_string_array' => 1, 'dbus_get_local_machine_id' => 1, 'dbus_get_version' => 1, 'dbus_internal_do_not_use_create_uuid' => 1, 'dbus_internal_do_not_use_get_uuid' => 1, 'dbus_malloc' => 1, 'dbus_malloc0' => 1, 'dbus_message_allocate_data_slot' => 1, 'dbus_message_append_args' => 1, 'dbus_message_append_args_valist' => 1, 'dbus_message_contains_unix_fds' => 1, 'dbus_message_copy' => 1, 'dbus_message_demarshal' => 1, 'dbus_message_demarshal_bytes_needed' => 1, 'dbus_message_free_data_slot' => 1, 'dbus_message_get_args' => 1, 'dbus_message_get_args_valist' => 1, 'dbus_message_get_auto_start' => 1, 'dbus_message_get_data' => 1, 'dbus_message_get_destination' => 1, 'dbus_message_get_error_name' => 1, 'dbus_message_get_interface' => 1, 'dbus_message_get_member' => 1, 'dbus_message_get_no_reply' => 1, 'dbus_message_get_path' => 1, 'dbus_message_get_path_decomposed' => 1, 'dbus_message_get_reply_serial' => 1, 'dbus_message_get_sender' => 1, 'dbus_message_get_serial' => 1, 'dbus_message_get_signature' => 1, 'dbus_message_get_type' => 1, 'dbus_message_has_destination' => 1, 'dbus_message_has_interface' => 1, 'dbus_message_has_member' => 1, 'dbus_message_has_path' => 1, 'dbus_message_has_sender' => 1, 'dbus_message_has_signature' => 1, 'dbus_message_is_error' => 1, 'dbus_message_is_method_call' => 1, 'dbus_message_is_signal' => 1, 'dbus_message_iter_abandon_container' => 1, 'dbus_message_iter_append_basic' => 1, 'dbus_message_iter_append_fixed_array' => 1, 'dbus_message_iter_close_container' => 1, 'dbus_message_iter_get_arg_type' => 1, 'dbus_message_iter_get_array_len' => 1, 'dbus_message_iter_get_basic' => 1, 'dbus_message_iter_get_element_type' => 1, 'dbus_message_iter_get_fixed_array' => 1, 'dbus_message_iter_get_signature' => 1, 'dbus_message_iter_has_next' => 1, 'dbus_message_iter_init' => 1, 'dbus_message_iter_init_append' => 1, 'dbus_message_iter_next' => 1, 'dbus_message_iter_open_container' => 1, 'dbus_message_iter_recurse' => 1, 'dbus_message_lock' => 1, 'dbus_message_marshal' => 1, 'dbus_message_new' => 1, 'dbus_message_new_error' => 1, 'dbus_message_new_error_printf' => 1, 'dbus_message_new_method_call' => 1, 'dbus_message_new_method_return' => 1, 'dbus_message_new_signal' => 1, 'dbus_message_ref' => 1, 'dbus_message_set_auto_start' => 1, 'dbus_message_set_data' => 1, 'dbus_message_set_destination' => 1, 'dbus_message_set_error_name' => 1, 'dbus_message_set_interface' => 1, 'dbus_message_set_member' => 1, 'dbus_message_set_no_reply' => 1, 'dbus_message_set_path' => 1, 'dbus_message_set_reply_serial' => 1, 'dbus_message_set_sender' => 1, 'dbus_message_set_serial' => 1, 'dbus_message_type_from_string' => 1, 'dbus_message_type_to_string' => 1, 'dbus_message_unref' => 1, 'dbus_move_error' => 1, 'dbus_parse_address' => 1, 'dbus_pending_call_allocate_data_slot' => 1, 'dbus_pending_call_block' => 1, 'dbus_pending_call_cancel' => 1, 'dbus_pending_call_free_data_slot' => 1, 'dbus_pending_call_get_completed' => 1, 'dbus_pending_call_get_data' => 1, 'dbus_pending_call_ref' => 1, 'dbus_pending_call_set_data' => 1, 'dbus_pending_call_set_notify' => 1, 'dbus_pending_call_steal_reply' => 1, 'dbus_pending_call_unref' => 1, 'dbus_realloc' => 1, 'dbus_server_allocate_data_slot' => 1, 'dbus_server_disconnect' => 1, 'dbus_server_free_data_slot' => 1, 'dbus_server_get_address' => 1, 'dbus_server_get_data' => 1, 'dbus_server_get_id' => 1, 'dbus_server_get_is_connected' => 1, 'dbus_server_listen' => 1, 'dbus_server_ref' => 1, 'dbus_server_set_auth_mechanisms' => 1, 'dbus_server_set_data' => 1, 'dbus_server_set_new_connection_function' => 1, 'dbus_server_set_timeout_functions' => 1, 'dbus_server_set_watch_functions' => 1, 'dbus_server_unref' => 1, 'dbus_set_error' => 1, 'dbus_set_error_const' => 1, 'dbus_set_error_from_message' => 1, 'dbus_shutdown' => 1, 'dbus_signature_iter_get_current_type' => 1, 'dbus_signature_iter_get_element_type' => 1, 'dbus_signature_iter_get_signature' => 1, 'dbus_signature_iter_init' => 1, 'dbus_signature_iter_next' => 1, 'dbus_signature_iter_recurse' => 1, 'dbus_signature_validate' => 1, 'dbus_signature_validate_single' => 1, 'dbus_threads_init' => 1, 'dbus_threads_init_default' => 1, 'dbus_timeout_get_data' => 1, 'dbus_timeout_get_enabled' => 1, 'dbus_timeout_get_interval' => 1, 'dbus_timeout_handle' => 1, 'dbus_timeout_set_data' => 1, 'dbus_type_is_basic' => 1, 'dbus_type_is_container' => 1, 'dbus_type_is_fixed' => 1, 'dbus_type_is_valid' => 1, 'dbus_validate_bus_name' => 1, 'dbus_validate_error_name' => 1, 'dbus_validate_interface' => 1, 'dbus_validate_member' => 1, 'dbus_validate_path' => 1, 'dbus_validate_utf8' => 1, 'dbus_watch_get_data' => 1, 'dbus_watch_get_enabled' => 1, 'dbus_watch_get_fd' => 1, 'dbus_watch_get_flags' => 1, 'dbus_watch_get_socket' => 1, 'dbus_watch_get_unix_fd' => 1, 'dbus_watch_handle' => 1, 'dbus_watch_set_data' => 1 }, 'libnih-dbus.so.1.0.0' => { 'nih_dbus_bus@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_connect@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_error_raise@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_error_raise_printf@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_message_error@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_message_new@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_object_new@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_path@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_pending_data_new@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_proxy_connect@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_proxy_new@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_server@@LIBNIH_DBUS_1_0' => 1, 'nih_dbus_setup@@LIBNIH_DBUS_1_0' => 1 }, 'libnih.so.1.0.0' => { '__nih_abort_msg@@LIBNIH_1.0.1' => -8, '__nih_free@@LIBNIH_1.0.1' => -8, '__nih_malloc@@LIBNIH_1.0.1' => -8, '__nih_realloc@@LIBNIH_1.0.1' => -8, '_nih_discard_local@@LIBNIH_1_0' => 1, '_nih_error_raise@@LIBNIH_1_0' => 1, '_nih_error_raise_error@@LIBNIH_1_0' => 1, '_nih_error_raise_printf@@LIBNIH_1_0' => 1, '_nih_error_raise_system@@LIBNIH_1_0' => 1, 'nih_alloc@@LIBNIH_1_0' => 1, 'nih_alloc_parent@@LIBNIH_1_0' => 1, 'nih_alloc_real_set_destructor@@LIBNIH_1_0' => 1, 'nih_alloc_size@@LIBNIH_1_0' => 1, 'nih_child_add_watch@@LIBNIH_1_0' => 1, 'nih_child_init@@LIBNIH_1_0' => 1, 'nih_child_poll@@LIBNIH_1_0' => 1, 'nih_child_watches@@LIBNIH_1_0' => -8, 'nih_command_join@@LIBNIH_1_0' => 1, 'nih_command_parser@@LIBNIH_1_0' => 1, 'nih_config_has_token@@LIBNIH_1_0' => 1, 'nih_config_next_arg@@LIBNIH_1_0' => 1, 'nih_config_next_line@@LIBNIH_1_0' => 1, 'nih_config_next_token@@LIBNIH_1_0' => 1, 'nih_config_parse@@LIBNIH_1_0' => 1, 'nih_config_parse_args@@LIBNIH_1_0' => 1, 'nih_config_parse_block@@LIBNIH_1_0' => 1, 'nih_config_parse_command@@LIBNIH_1_0' => 1, 'nih_config_parse_file@@LIBNIH_1_0' => 1, 'nih_config_parse_stanza@@LIBNIH_1_0' => 1, 'nih_config_skip_block@@LIBNIH_1_0' => 1, 'nih_config_skip_comment@@LIBNIH_1_0' => 1, 'nih_config_skip_whitespace@@LIBNIH_1_0' => 1, 'nih_config_token@@LIBNIH_1_0' => 1, 'nih_dir_walk@@LIBNIH_1_0' => 1, 'nih_discard@@LIBNIH_1_0' => 1, 'nih_error_get@@LIBNIH_1_0' => 1, 'nih_error_init@@LIBNIH_1_0' => 1, 'nih_error_pop_context@@LIBNIH_1_0' => 1, 'nih_error_push_context@@LIBNIH_1_0' => 1, 'nih_error_steal@@LIBNIH_1_0' => 1, 'nih_file_ignore@@LIBNIH_1_0' => 1, 'nih_file_is_backup@@LIBNIH_1_0' => 1, 'nih_file_is_hidden@@LIBNIH_1_0' => 1, 'nih_file_is_packaging@@LIBNIH_1_0' => 1, 'nih_file_is_rcs@@LIBNIH_1_0' => 1, 'nih_file_is_swap@@LIBNIH_1_0' => 1, 'nih_file_map@@LIBNIH_1_0' => 1, 'nih_file_read@@LIBNIH_1_0' => 1, 'nih_file_unmap@@LIBNIH_1_0' => 1, 'nih_free@@LIBNIH_1_0' => 1, 'nih_hash_add@@LIBNIH_1_0' => 1, 'nih_hash_add_unique@@LIBNIH_1_0' => 1, 'nih_hash_lookup@@LIBNIH_1_0' => 1, 'nih_hash_new@@LIBNIH_1_0' => 1, 'nih_hash_replace@@LIBNIH_1_0' => 1, 'nih_hash_search@@LIBNIH_1_0' => 1, 'nih_hash_string_cmp@@LIBNIH_1_0' => 1, 'nih_hash_string_hash@@LIBNIH_1_0' => 1, 'nih_hash_string_key@@LIBNIH_1_0' => 1, 'nih_io_add_watch@@LIBNIH_1_0' => 1, 'nih_io_buffer_new@@LIBNIH_1_0' => 1, 'nih_io_buffer_pop@@LIBNIH_1_0' => 1, 'nih_io_buffer_push@@LIBNIH_1_0' => 1, 'nih_io_buffer_resize@@LIBNIH_1_0' => 1, 'nih_io_buffer_shrink@@LIBNIH_1_0' => 1, 'nih_io_destroy@@LIBNIH_1_0' => 1, 'nih_io_get@@LIBNIH_1_0' => 1, 'nih_io_get_family@@LIBNIH_1_0' => 1, 'nih_io_handle_fds@@LIBNIH_1_0' => 1, 'nih_io_init@@LIBNIH_1_0' => 1, 'nih_io_message_add_control@@LIBNIH_1_0' => 1, 'nih_io_message_new@@LIBNIH_1_0' => 1, 'nih_io_message_recv@@LIBNIH_1_0' => 1, 'nih_io_message_send@@LIBNIH_1_0' => 1, 'nih_io_printf@@LIBNIH_1_0' => 1, 'nih_io_read@@LIBNIH_1_0' => 1, 'nih_io_read_message@@LIBNIH_1_0' => 1, 'nih_io_reopen@@LIBNIH_1_0' => 1, 'nih_io_select_fds@@LIBNIH_1_0' => 1, 'nih_io_send_message@@LIBNIH_1_0' => 1, 'nih_io_set_cloexec@@LIBNIH_1_0' => 1, 'nih_io_set_nonblock@@LIBNIH_1_0' => 1, 'nih_io_shutdown@@LIBNIH_1_0' => 1, 'nih_io_watches@@LIBNIH_1_0' => -8, 'nih_io_write@@LIBNIH_1_0' => 1, 'nih_list_add@@LIBNIH_1_0' => 1, 'nih_list_add_after@@LIBNIH_1_0' => 1, 'nih_list_destroy@@LIBNIH_1_0' => 1, 'nih_list_entry_new@@LIBNIH_1_0' => 1, 'nih_list_init@@LIBNIH_1_0' => 1, 'nih_list_new@@LIBNIH_1_0' => 1, 'nih_list_remove@@LIBNIH_1_0' => 1, 'nih_log_init@@LIBNIH_1_0' => 1, 'nih_log_message@@LIBNIH_1_0' => 1, 'nih_log_priority@@LIBNIH_1_0' => -4, 'nih_log_set_logger@@LIBNIH_1_0' => 1, 'nih_log_set_priority@@LIBNIH_1_0' => 1, 'nih_logger_printf@@LIBNIH_1_0' => 1, 'nih_logger_syslog@@LIBNIH_1_0' => 1, 'nih_main_daemonise@@LIBNIH_1_0' => 1, 'nih_main_get_pidfile@@LIBNIH_1_0' => 1, 'nih_main_init_full@@LIBNIH_1_0' => 1, 'nih_main_loop@@LIBNIH_1_0' => 1, 'nih_main_loop_add_func@@LIBNIH_1_0' => 1, 'nih_main_loop_exit@@LIBNIH_1_0' => 1, 'nih_main_loop_functions@@LIBNIH_1_0' => -8, 'nih_main_loop_init@@LIBNIH_1_0' => 1, 'nih_main_loop_interrupt@@LIBNIH_1_0' => 1, 'nih_main_read_pidfile@@LIBNIH_1_0' => 1, 'nih_main_set_pidfile@@LIBNIH_1_0' => 1, 'nih_main_suggest_help@@LIBNIH_1_0' => 1, 'nih_main_term_signal@@LIBNIH_1_0' => 1, 'nih_main_unlink_pidfile@@LIBNIH_1_0' => 1, 'nih_main_version@@LIBNIH_1_0' => 1, 'nih_main_write_pidfile@@LIBNIH_1_0' => 1, 'nih_option_count@@LIBNIH_1_0' => 1, 'nih_option_debug@@LIBNIH_1_0' => 1, 'nih_option_int@@LIBNIH_1_0' => 1, 'nih_option_join@@LIBNIH_1_0' => 1, 'nih_option_parser@@LIBNIH_1_0' => 1, 'nih_option_quiet@@LIBNIH_1_0' => 1, 'nih_option_set_footer@@LIBNIH_1_0' => 1, 'nih_option_set_help@@LIBNIH_1_0' => 1, 'nih_option_set_synopsis@@LIBNIH_1_0' => 1, 'nih_option_set_usage@@LIBNIH_1_0' => 1, 'nih_option_set_usage_stem@@LIBNIH_1_0' => 1, 'nih_option_verbose@@LIBNIH_1_0' => 1, 'nih_realloc@@LIBNIH_1_0' => 1, 'nih_ref@@LIBNIH_1_0' => 1, 'nih_signal_add_handler@@LIBNIH_1_0' => 1, 'nih_signal_from_name@@LIBNIH_1_0' => 1, 'nih_signal_handler@@LIBNIH_1_0' => 1, 'nih_signal_init@@LIBNIH_1_0' => 1, 'nih_signal_poll@@LIBNIH_1_0' => 1, 'nih_signal_reset@@LIBNIH_1_0' => 1, 'nih_signal_set_default@@LIBNIH_1_0' => 1, 'nih_signal_set_handler@@LIBNIH_1_0' => 1, 'nih_signal_set_ignore@@LIBNIH_1_0' => 1, 'nih_signal_to_name@@LIBNIH_1_0' => 1, 'nih_signals@@LIBNIH_1_0' => -8, 'nih_sprintf@@LIBNIH_1_0' => 1, 'nih_str_array_add@@LIBNIH_1_0' => 1, 'nih_str_array_addn@@LIBNIH_1_0' => 1, 'nih_str_array_addp@@LIBNIH_1_0' => 1, 'nih_str_array_append@@LIBNIH_1_0' => 1, 'nih_str_array_copy@@LIBNIH_1_0' => 1, 'nih_str_array_new@@LIBNIH_1_0' => 1, 'nih_str_screen_width@@LIBNIH_1_0' => 1, 'nih_str_screen_wrap@@LIBNIH_1_0' => 1, 'nih_str_split@@LIBNIH_1_0' => 1, 'nih_str_wrap@@LIBNIH_1_0' => 1, 'nih_strcat@@LIBNIH_1_0' => 1, 'nih_strcat_sprintf@@LIBNIH_1_0' => 1, 'nih_strcat_vsprintf@@LIBNIH_1_0' => 1, 'nih_strdup@@LIBNIH_1_0' => 1, 'nih_strncat@@LIBNIH_1_0' => 1, 'nih_strndup@@LIBNIH_1_0' => 1, 'nih_timer_add_periodic@@LIBNIH_1_0' => 1, 'nih_timer_add_scheduled@@LIBNIH_1_0' => 1, 'nih_timer_add_timeout@@LIBNIH_1_0' => 1, 'nih_timer_init@@LIBNIH_1_0' => 1, 'nih_timer_next_due@@LIBNIH_1_0' => 1, 'nih_timer_poll@@LIBNIH_1_0' => 1, 'nih_timers@@LIBNIH_1_0' => -8, 'nih_tree_add@@LIBNIH_1_0' => 1, 'nih_tree_destroy@@LIBNIH_1_0' => 1, 'nih_tree_entry_new@@LIBNIH_1_0' => 1, 'nih_tree_init@@LIBNIH_1_0' => 1, 'nih_tree_new@@LIBNIH_1_0' => 1, 'nih_tree_next_full@@LIBNIH_1_0' => 1, 'nih_tree_next_post_full@@LIBNIH_1_0' => 1, 'nih_tree_next_pre_full@@LIBNIH_1_0' => 1, 'nih_tree_prev_full@@LIBNIH_1_0' => 1, 'nih_tree_prev_post_full@@LIBNIH_1_0' => 1, 'nih_tree_prev_pre_full@@LIBNIH_1_0' => 1, 'nih_tree_remove@@LIBNIH_1_0' => 1, 'nih_tree_unlink@@LIBNIH_1_0' => 1, 'nih_unref@@LIBNIH_1_0' => 1, 'nih_vsprintf@@LIBNIH_1_0' => 1, 'nih_watch_add@@LIBNIH_1_0' => 1, 'nih_watch_destroy@@LIBNIH_1_0' => 1, 'nih_watch_new@@LIBNIH_1_0' => 1, 'package_bugreport@@LIBNIH_1_0' => -8, 'package_copyright@@LIBNIH_1_0' => -8, 'package_name@@LIBNIH_1_0' => -8, 'package_string@@LIBNIH_1_0' => -8, 'package_version@@LIBNIH_1_0' => -8, 'program_name@@LIBNIH_1_0' => -8 } }, 'GccConstants' => { '_GNU_SOURCE' => '1' }, 'GccVersion' => '4.8', 'Headers' => { 'com.ubuntu.Upstart.Instance.h' => 2, 'com.ubuntu.Upstart.Job.h' => 3, 'com.ubuntu.Upstart.h' => 1, 'upstart-dbus.h' => 4, 'upstart.h' => 0 }, 'Language' => 'C', 'LibraryName' => 'libupstart', 'LibraryVersion' => '1.0.0-build', 'NameSpaces' => {}, 'SkipHeaders' => {}, 'SkipNameSpaces' => {}, 'SkipSymbols' => {}, 'SkipTypes' => {}, 'SymbolInfo' => { '1047' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '76', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '1214' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_restart' }, '1060' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '153', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '297' } }, 'Return' => '10', 'ShortName' => 'upstart_set_log_priority_sync' }, '1071' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '89', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '3' => { 'algn' => '8', 'name' => 'handler', 'type' => '754' }, '4' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '5' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_start' }, '1124' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '74', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'job_stop_sync' }, '1139' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '151', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'value', 'type' => '297' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '1467' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_set_log_priority' }, '1153' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '87', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'instances', 'type' => '98' } }, 'Return' => '10', 'ShortName' => 'job_class_get_all_instances_sync' }, '120' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '121', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '208' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_start_on' }, '1204' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '72', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '1295' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_stop' }, '1221' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '149', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'upstart_get_log_priority_sync' }, '1239' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '85', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '833' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_all_instances' }, '1286' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '70', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'job_start_sync' }, '1301' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '147', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '1548' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_get_log_priority' }, '1323' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '83', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '3' => { 'algn' => '8', 'name' => 'instance', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_class_get_instance_by_name_sync' }, '1362' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '68', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '1376' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_start' }, '1382' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '145', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'upstart_get_version_sync' }, '14' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '131', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '98' } }, 'Return' => '10', 'ShortName' => 'job_class_get_emits_sync' }, '1405' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '81', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '916' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_instance_by_name' }, '1446' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '65', 'Return' => '1525', 'ShortName' => 'job_interfaces' }, '1463' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '143', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '1627' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_get_version' }, '1491' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '79', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '3' => { 'algn' => '8', 'name' => 'instance', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_class_get_instance_sync' }, '1526' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '64', 'Return' => '1192', 'ShortName' => 'job_com_ubuntu_Upstart0_6_Instance' }, '154' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '119', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_class_get_usage_sync' }, '1545' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '141', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' } }, 'Return' => '10', 'ShortName' => 'upstart_end_session_sync' }, '1573' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '77', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '1004' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_instance' }, '1620' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '139', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '1842' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_end_session' }, '1647' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '74', 'Return' => '1525', 'ShortName' => 'job_class_interfaces' }, '1696' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '137', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'address', 'type' => '297' } }, 'Return' => '10', 'ShortName' => 'upstart_notify_dbus_address_sync' }, '1725' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '73', 'Return' => '1192', 'ShortName' => 'job_class_com_ubuntu_Upstart0_6_Job' }, '1767' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '135', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'address', 'type' => '297' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '2022' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_notify_dbus_address' }, '1839' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '133', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' } }, 'Return' => '10', 'ShortName' => 'upstart_notify_disk_writeable_sync' }, '188' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '117', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '245' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_usage' }, '1905' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '131', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '2074' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_notify_disk_writeable' }, '1962' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '129', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '3' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '4' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '5' => { 'algn' => '4', 'name' => 'file', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'upstart_emit_event_with_file_sync' }, '2019' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '127', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '2' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '4' => { 'algn' => '4', 'name' => 'file', 'type' => '10' }, '5' => { 'algn' => '8', 'name' => 'handler', 'type' => '2129' }, '6' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '7' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '8' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_emit_event_with_file' }, '2071' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '125', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '3' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '4' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'upstart_emit_event_sync' }, '2122' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '123', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '2' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '4' => { 'algn' => '8', 'name' => 'handler', 'type' => '2181' }, '5' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '6' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '7' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_emit_event' }, '2174' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '121', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' } }, 'Return' => '10', 'ShortName' => 'upstart_reset_env_sync' }, '218' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '102', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'properties', 'type' => '409' } }, 'Return' => '10', 'ShortName' => 'job_get_all_sync' }, '2224' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '119', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '2231' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_reset_env' }, '2279' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '117', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' }, '3' => { 'algn' => '8', 'name' => 'env', 'type' => '98' } }, 'Return' => '10', 'ShortName' => 'upstart_list_env_sync' }, '229' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '115', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_class_get_version_sync' }, '2337' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '115', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '2287' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_list_env' }, '2395' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '113', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' }, '3' => { 'algn' => '8', 'name' => 'name', 'type' => '297' } }, 'Return' => '10', 'ShortName' => 'upstart_unset_env_sync' }, '2449' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '111', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' }, '2' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '3' => { 'algn' => '8', 'name' => 'handler', 'type' => '2346' }, '4' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '5' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_unset_env' }, '2502' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '109', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' }, '3' => { 'algn' => '8', 'name' => 'var', 'type' => '297' }, '4' => { 'algn' => '4', 'name' => 'replace', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'upstart_set_env_sync' }, '2554' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '107', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' }, '2' => { 'algn' => '8', 'name' => 'var', 'type' => '297' }, '3' => { 'algn' => '4', 'name' => 'replace', 'type' => '10' }, '4' => { 'algn' => '8', 'name' => 'handler', 'type' => '2403' }, '5' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '6' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '7' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_set_env' }, '260' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '100', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '407' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_get_all' }, '2600' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '105', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' }, '3' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '4' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'upstart_get_env_sync' }, '2646' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '103', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'job_details', 'type' => '277' }, '2' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '3' => { 'algn' => '8', 'name' => 'handler', 'type' => '2457' }, '4' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '5' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_get_env' }, '2691' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '101', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' } }, 'Return' => '10', 'ShortName' => 'upstart_restart_sync' }, '271' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '113', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '291' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_version' }, '2736' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '99', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '2511' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_restart' }, '2784' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '97', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'state', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'upstart_get_state_sync' }, '2837' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '95', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '2562' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_get_state' }, '2893' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '93', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'jobs', 'type' => '98' } }, 'Return' => '10', 'ShortName' => 'upstart_get_all_jobs_sync' }, '2954' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '91', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '2607' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_get_all_jobs' }, '30' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '129', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '95' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_emits' }, '3014' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '89', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '3' => { 'algn' => '8', 'name' => 'job', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'upstart_get_job_by_name_sync' }, '305' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '98', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '533' } }, 'Return' => '10', 'ShortName' => 'job_get_processes_sync' }, '3063' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '87', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '2653' }, '3' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '5' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_get_job_by_name' }, '3106' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '85', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' } }, 'Return' => '10', 'ShortName' => 'upstart_reload_configuration_sync' }, '3141' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '83', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '2698' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_reload_configuration' }, '3174' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '80', 'Return' => '1525', 'ShortName' => 'upstart_interfaces' }, '318' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '111', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_class_get_author_sync' }, '3211' => { 'Data' => 1, 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '79', 'Return' => '1192', 'ShortName' => 'upstart_com_ubuntu_Upstart0_6' }, '356' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '96', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '531' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_get_processes' }, '368' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '109', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '336' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_author' }, '4' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '135', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'properties', 'type' => '58' } }, 'Return' => '10', 'ShortName' => 'job_class_get_all_sync' }, '404' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '94', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_get_state_sync' }, '419' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '107', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_class_get_description_sync' }, '462' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '92', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '660' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_get_state' }, '48' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '127', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '159' } }, 'Return' => '10', 'ShortName' => 'job_class_get_stop_on_sync' }, '481' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '105', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '384' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_description' }, '528' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '90', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_get_goal_sync' }, '550' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '103', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_class_get_name_sync' }, '593' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '88', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '731' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_get_goal' }, '616' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '101', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '433' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_name' }, '657' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '86', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_get_name_sync' }, '67' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '125', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '157' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_stop_on' }, '677' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '99', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '4' => { 'algn' => '8', 'name' => 'instance', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_class_restart_sync' }, '7' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '133', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '53' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_get_all' }, '723' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '84', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '810' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_get_name' }, '746' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '97', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '3' => { 'algn' => '8', 'name' => 'handler', 'type' => '625' }, '4' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '5' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_restart' }, '800' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '82', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' } }, 'Return' => '10', 'ShortName' => 'job_reload_sync' }, '826' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '95', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'job_class_stop_sync' }, '883' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '80', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '1127' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_reload' }, '895' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '157', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'properties', 'type' => '1226' } }, 'Return' => '10', 'ShortName' => 'upstart_get_all_sync' }, '909' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '93', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '3' => { 'algn' => '8', 'name' => 'handler', 'type' => '686' }, '4' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '5' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '6' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'job_class_stop' }, '92' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '123', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'value', 'type' => '159' } }, 'Return' => '10', 'ShortName' => 'job_class_get_start_on_sync' }, '968' => { 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Lang' => 'C', 'Line' => '78', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' } }, 'Return' => '10', 'ShortName' => 'job_restart_sync' }, '984' => { 'Header' => 'com.ubuntu.Upstart.h', 'Lang' => 'C', 'Line' => '155', 'Param' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'handler', 'type' => '1224' }, '2' => { 'algn' => '8', 'name' => 'error_handler', 'type' => '80' }, '3' => { 'algn' => '8', 'name' => 'data', 'type' => '111' }, '4' => { 'algn' => '4', 'name' => 'timeout', 'type' => '10' } }, 'Return' => '26', 'ShortName' => 'upstart_get_all' }, '996' => { 'Header' => 'com.ubuntu.Upstart.Job.h', 'Lang' => 'C', 'Line' => '91', 'Param' => { '0' => { 'algn' => '8', 'name' => 'parent', 'type' => '17' }, '1' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '2' => { 'algn' => '8', 'name' => 'env', 'type' => '277' }, '3' => { 'algn' => '4', 'name' => 'wait', 'type' => '10' }, '4' => { 'algn' => '8', 'name' => 'instance', 'type' => '127' } }, 'Return' => '10', 'ShortName' => 'job_class_start_sync' } }, 'SymbolVersion' => { 'job_class_com_ubuntu_Upstart0_6_Job' => 'job_class_com_ubuntu_Upstart0_6_Job@@LIBUPSTART_1.0.0', 'job_class_get_all' => 'job_class_get_all@@LIBUPSTART_1.0.0', 'job_class_get_all_instances' => 'job_class_get_all_instances@@LIBUPSTART_1.0.0', 'job_class_get_all_instances_sync' => 'job_class_get_all_instances_sync@@LIBUPSTART_1.0.0', 'job_class_get_all_sync' => 'job_class_get_all_sync@@LIBUPSTART_1.0.0', 'job_class_get_author' => 'job_class_get_author@@LIBUPSTART_1.0.0', 'job_class_get_author_sync' => 'job_class_get_author_sync@@LIBUPSTART_1.0.0', 'job_class_get_description' => 'job_class_get_description@@LIBUPSTART_1.0.0', 'job_class_get_description_sync' => 'job_class_get_description_sync@@LIBUPSTART_1.0.0', 'job_class_get_emits' => 'job_class_get_emits@@LIBUPSTART_1.0.0', 'job_class_get_emits_sync' => 'job_class_get_emits_sync@@LIBUPSTART_1.0.0', 'job_class_get_instance' => 'job_class_get_instance@@LIBUPSTART_1.0.0', 'job_class_get_instance_by_name' => 'job_class_get_instance_by_name@@LIBUPSTART_1.0.0', 'job_class_get_instance_by_name_sync' => 'job_class_get_instance_by_name_sync@@LIBUPSTART_1.0.0', 'job_class_get_instance_sync' => 'job_class_get_instance_sync@@LIBUPSTART_1.0.0', 'job_class_get_name' => 'job_class_get_name@@LIBUPSTART_1.0.0', 'job_class_get_name_sync' => 'job_class_get_name_sync@@LIBUPSTART_1.0.0', 'job_class_get_start_on' => 'job_class_get_start_on@@LIBUPSTART_1.0.0', 'job_class_get_start_on_sync' => 'job_class_get_start_on_sync@@LIBUPSTART_1.0.0', 'job_class_get_stop_on' => 'job_class_get_stop_on@@LIBUPSTART_1.0.0', 'job_class_get_stop_on_sync' => 'job_class_get_stop_on_sync@@LIBUPSTART_1.0.0', 'job_class_get_usage' => 'job_class_get_usage@@LIBUPSTART_1.0.0', 'job_class_get_usage_sync' => 'job_class_get_usage_sync@@LIBUPSTART_1.0.0', 'job_class_get_version' => 'job_class_get_version@@LIBUPSTART_1.0.0', 'job_class_get_version_sync' => 'job_class_get_version_sync@@LIBUPSTART_1.0.0', 'job_class_interfaces' => 'job_class_interfaces@@LIBUPSTART_1.0.0', 'job_class_restart' => 'job_class_restart@@LIBUPSTART_1.0.0', 'job_class_restart_sync' => 'job_class_restart_sync@@LIBUPSTART_1.0.0', 'job_class_start' => 'job_class_start@@LIBUPSTART_1.0.0', 'job_class_start_sync' => 'job_class_start_sync@@LIBUPSTART_1.0.0', 'job_class_stop' => 'job_class_stop@@LIBUPSTART_1.0.0', 'job_class_stop_sync' => 'job_class_stop_sync@@LIBUPSTART_1.0.0', 'job_com_ubuntu_Upstart0_6_Instance' => 'job_com_ubuntu_Upstart0_6_Instance@@LIBUPSTART_1.0.0', 'job_get_all' => 'job_get_all@@LIBUPSTART_1.0.0', 'job_get_all_sync' => 'job_get_all_sync@@LIBUPSTART_1.0.0', 'job_get_goal' => 'job_get_goal@@LIBUPSTART_1.0.0', 'job_get_goal_sync' => 'job_get_goal_sync@@LIBUPSTART_1.0.0', 'job_get_name' => 'job_get_name@@LIBUPSTART_1.0.0', 'job_get_name_sync' => 'job_get_name_sync@@LIBUPSTART_1.0.0', 'job_get_processes' => 'job_get_processes@@LIBUPSTART_1.0.0', 'job_get_processes_sync' => 'job_get_processes_sync@@LIBUPSTART_1.0.0', 'job_get_state' => 'job_get_state@@LIBUPSTART_1.0.0', 'job_get_state_sync' => 'job_get_state_sync@@LIBUPSTART_1.0.0', 'job_interfaces' => 'job_interfaces@@LIBUPSTART_1.0.0', 'job_reload' => 'job_reload@@LIBUPSTART_1.0.0', 'job_reload_sync' => 'job_reload_sync@@LIBUPSTART_1.0.0', 'job_restart' => 'job_restart@@LIBUPSTART_1.0.0', 'job_restart_sync' => 'job_restart_sync@@LIBUPSTART_1.0.0', 'job_start' => 'job_start@@LIBUPSTART_1.0.0', 'job_start_sync' => 'job_start_sync@@LIBUPSTART_1.0.0', 'job_stop' => 'job_stop@@LIBUPSTART_1.0.0', 'job_stop_sync' => 'job_stop_sync@@LIBUPSTART_1.0.0', 'upstart_com_ubuntu_Upstart0_6' => 'upstart_com_ubuntu_Upstart0_6@@LIBUPSTART_1.0.0', 'upstart_emit_event' => 'upstart_emit_event@@LIBUPSTART_1.0.0', 'upstart_emit_event_sync' => 'upstart_emit_event_sync@@LIBUPSTART_1.0.0', 'upstart_emit_event_with_file' => 'upstart_emit_event_with_file@@LIBUPSTART_1.0.0', 'upstart_emit_event_with_file_sync' => 'upstart_emit_event_with_file_sync@@LIBUPSTART_1.0.0', 'upstart_end_session' => 'upstart_end_session@@LIBUPSTART_1.0.0', 'upstart_end_session_sync' => 'upstart_end_session_sync@@LIBUPSTART_1.0.0', 'upstart_get_all' => 'upstart_get_all@@LIBUPSTART_1.0.0', 'upstart_get_all_jobs' => 'upstart_get_all_jobs@@LIBUPSTART_1.0.0', 'upstart_get_all_jobs_sync' => 'upstart_get_all_jobs_sync@@LIBUPSTART_1.0.0', 'upstart_get_all_sync' => 'upstart_get_all_sync@@LIBUPSTART_1.0.0', 'upstart_get_env' => 'upstart_get_env@@LIBUPSTART_1.0.0', 'upstart_get_env_sync' => 'upstart_get_env_sync@@LIBUPSTART_1.0.0', 'upstart_get_job_by_name' => 'upstart_get_job_by_name@@LIBUPSTART_1.0.0', 'upstart_get_job_by_name_sync' => 'upstart_get_job_by_name_sync@@LIBUPSTART_1.0.0', 'upstart_get_log_priority' => 'upstart_get_log_priority@@LIBUPSTART_1.0.0', 'upstart_get_log_priority_sync' => 'upstart_get_log_priority_sync@@LIBUPSTART_1.0.0', 'upstart_get_state' => 'upstart_get_state@@LIBUPSTART_1.0.0', 'upstart_get_state_sync' => 'upstart_get_state_sync@@LIBUPSTART_1.0.0', 'upstart_get_version' => 'upstart_get_version@@LIBUPSTART_1.0.0', 'upstart_get_version_sync' => 'upstart_get_version_sync@@LIBUPSTART_1.0.0', 'upstart_interfaces' => 'upstart_interfaces@@LIBUPSTART_1.0.0', 'upstart_list_env' => 'upstart_list_env@@LIBUPSTART_1.0.0', 'upstart_list_env_sync' => 'upstart_list_env_sync@@LIBUPSTART_1.0.0', 'upstart_notify_dbus_address' => 'upstart_notify_dbus_address@@LIBUPSTART_1.0.0', 'upstart_notify_dbus_address_sync' => 'upstart_notify_dbus_address_sync@@LIBUPSTART_1.0.0', 'upstart_notify_disk_writeable' => 'upstart_notify_disk_writeable@@LIBUPSTART_1.0.0', 'upstart_notify_disk_writeable_sync' => 'upstart_notify_disk_writeable_sync@@LIBUPSTART_1.0.0', 'upstart_reload_configuration' => 'upstart_reload_configuration@@LIBUPSTART_1.0.0', 'upstart_reload_configuration_sync' => 'upstart_reload_configuration_sync@@LIBUPSTART_1.0.0', 'upstart_reset_env' => 'upstart_reset_env@@LIBUPSTART_1.0.0', 'upstart_reset_env_sync' => 'upstart_reset_env_sync@@LIBUPSTART_1.0.0', 'upstart_restart' => 'upstart_restart@@LIBUPSTART_1.0.0', 'upstart_restart_sync' => 'upstart_restart_sync@@LIBUPSTART_1.0.0', 'upstart_set_env' => 'upstart_set_env@@LIBUPSTART_1.0.0', 'upstart_set_env_sync' => 'upstart_set_env_sync@@LIBUPSTART_1.0.0', 'upstart_set_log_priority' => 'upstart_set_log_priority@@LIBUPSTART_1.0.0', 'upstart_set_log_priority_sync' => 'upstart_set_log_priority_sync@@LIBUPSTART_1.0.0', 'upstart_unset_env' => 'upstart_unset_env@@LIBUPSTART_1.0.0', 'upstart_unset_env_sync' => 'upstart_unset_env_sync@@LIBUPSTART_1.0.0' }, 'Symbols' => { 'libupstart.so.1.0.0' => { 'job_class_com_ubuntu_Upstart0_6_Job@@LIBUPSTART_1.0.0' => -32, 'job_class_get_all@@LIBUPSTART_1.0.0' => 1, 'job_class_get_all_instances@@LIBUPSTART_1.0.0' => 1, 'job_class_get_all_instances_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_all_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_author@@LIBUPSTART_1.0.0' => 1, 'job_class_get_author_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_description@@LIBUPSTART_1.0.0' => 1, 'job_class_get_description_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_emits@@LIBUPSTART_1.0.0' => 1, 'job_class_get_emits_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_instance@@LIBUPSTART_1.0.0' => 1, 'job_class_get_instance_by_name@@LIBUPSTART_1.0.0' => 1, 'job_class_get_instance_by_name_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_instance_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_name@@LIBUPSTART_1.0.0' => 1, 'job_class_get_name_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_start_on@@LIBUPSTART_1.0.0' => 1, 'job_class_get_start_on_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_stop_on@@LIBUPSTART_1.0.0' => 1, 'job_class_get_stop_on_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_usage@@LIBUPSTART_1.0.0' => 1, 'job_class_get_usage_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_get_version@@LIBUPSTART_1.0.0' => 1, 'job_class_get_version_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_interfaces@@LIBUPSTART_1.0.0' => -16, 'job_class_restart@@LIBUPSTART_1.0.0' => 1, 'job_class_restart_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_start@@LIBUPSTART_1.0.0' => 1, 'job_class_start_sync@@LIBUPSTART_1.0.0' => 1, 'job_class_stop@@LIBUPSTART_1.0.0' => 1, 'job_class_stop_sync@@LIBUPSTART_1.0.0' => 1, 'job_com_ubuntu_Upstart0_6_Instance@@LIBUPSTART_1.0.0' => -32, 'job_get_all@@LIBUPSTART_1.0.0' => 1, 'job_get_all_sync@@LIBUPSTART_1.0.0' => 1, 'job_get_goal@@LIBUPSTART_1.0.0' => 1, 'job_get_goal_sync@@LIBUPSTART_1.0.0' => 1, 'job_get_name@@LIBUPSTART_1.0.0' => 1, 'job_get_name_sync@@LIBUPSTART_1.0.0' => 1, 'job_get_processes@@LIBUPSTART_1.0.0' => 1, 'job_get_processes_sync@@LIBUPSTART_1.0.0' => 1, 'job_get_state@@LIBUPSTART_1.0.0' => 1, 'job_get_state_sync@@LIBUPSTART_1.0.0' => 1, 'job_interfaces@@LIBUPSTART_1.0.0' => -16, 'job_reload@@LIBUPSTART_1.0.0' => 1, 'job_reload_sync@@LIBUPSTART_1.0.0' => 1, 'job_restart@@LIBUPSTART_1.0.0' => 1, 'job_restart_sync@@LIBUPSTART_1.0.0' => 1, 'job_start@@LIBUPSTART_1.0.0' => 1, 'job_start_sync@@LIBUPSTART_1.0.0' => 1, 'job_stop@@LIBUPSTART_1.0.0' => 1, 'job_stop_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_com_ubuntu_Upstart0_6@@LIBUPSTART_1.0.0' => -32, 'upstart_emit_event@@LIBUPSTART_1.0.0' => 1, 'upstart_emit_event_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_emit_event_with_file@@LIBUPSTART_1.0.0' => 1, 'upstart_emit_event_with_file_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_end_session@@LIBUPSTART_1.0.0' => 1, 'upstart_end_session_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_all@@LIBUPSTART_1.0.0' => 1, 'upstart_get_all_jobs@@LIBUPSTART_1.0.0' => 1, 'upstart_get_all_jobs_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_all_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_env@@LIBUPSTART_1.0.0' => 1, 'upstart_get_env_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_job_by_name@@LIBUPSTART_1.0.0' => 1, 'upstart_get_job_by_name_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_log_priority@@LIBUPSTART_1.0.0' => 1, 'upstart_get_log_priority_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_state@@LIBUPSTART_1.0.0' => 1, 'upstart_get_state_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_get_version@@LIBUPSTART_1.0.0' => 1, 'upstart_get_version_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_interfaces@@LIBUPSTART_1.0.0' => -16, 'upstart_list_env@@LIBUPSTART_1.0.0' => 1, 'upstart_list_env_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_notify_dbus_address@@LIBUPSTART_1.0.0' => 1, 'upstart_notify_dbus_address_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_notify_disk_writeable@@LIBUPSTART_1.0.0' => 1, 'upstart_notify_disk_writeable_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_reload_configuration@@LIBUPSTART_1.0.0' => 1, 'upstart_reload_configuration_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_reset_env@@LIBUPSTART_1.0.0' => 1, 'upstart_reset_env_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_restart@@LIBUPSTART_1.0.0' => 1, 'upstart_restart_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_set_env@@LIBUPSTART_1.0.0' => 1, 'upstart_set_env_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_set_log_priority@@LIBUPSTART_1.0.0' => 1, 'upstart_set_log_priority_sync@@LIBUPSTART_1.0.0' => 1, 'upstart_unset_env@@LIBUPSTART_1.0.0' => 1, 'upstart_unset_env_sync@@LIBUPSTART_1.0.0' => 1 } }, 'Target' => 'linux', 'TypeInfo' => { '10' => { 'Algn' => 4, 'Name' => 'int', 'Size' => '4', 'Type' => 'Intrinsic' }, '1004' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '36', 'Name' => 'JobClassGetInstanceReply', 'Size' => '8', 'Type' => 'Typedef' }, '102' => { 'Algn' => '8', 'BaseType' => '130', 'Header' => 'dbus-connection.h', 'Name' => 'DBusConnection*', 'Size' => '8', 'Type' => 'Pointer' }, '1040' => { 'Algn' => '8', 'BaseType' => '1115', 'Header' => 'dbus-message.h', 'Line' => '46', 'Name' => 'DBusMessageIter', 'Size' => '72', 'Type' => 'Typedef' }, '1052' => { 'Algn' => '8', 'Artificial' => 1, 'BaseType' => '806', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '24', 'Name' => 'job_processes_element', 'Size' => '16', 'Type' => 'Typedef' }, '1055' => { 'Algn' => '8', 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '45', 'Name' => 'JobGoalChangedHandler', 'Size' => '8', 'Type' => 'Typedef' }, '111' => { 'Algn' => 8, 'BaseType' => '56', 'Name' => 'void*', 'Size' => '8', 'Type' => 'Pointer' }, '1111' => { 'Algn' => '8', 'BaseType' => '1192', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusInterface const*', 'Size' => '8', 'Type' => 'Pointer' }, '1113' => { 'Algn' => '8', 'BaseType' => '873', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusProxySignal*', 'Size' => '8', 'Type' => 'Pointer' }, '1115' => { 'Algn' => '8', 'Header' => 'dbus-message.h', 'Line' => '51', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'dummy1', 'type' => '111' }, '1' => { 'algn' => '8', 'name' => 'dummy2', 'type' => '111' }, '10' => { 'algn' => '4', 'name' => 'dummy11', 'type' => '10' }, '11' => { 'algn' => '4', 'name' => 'pad1', 'type' => '10' }, '12' => { 'algn' => '4', 'name' => 'pad2', 'type' => '10' }, '13' => { 'algn' => '8', 'name' => 'pad3', 'type' => '111' }, '2' => { 'algn' => '4', 'name' => 'dummy3', 'type' => '840' }, '3' => { 'algn' => '4', 'name' => 'dummy4', 'type' => '10' }, '4' => { 'algn' => '4', 'name' => 'dummy5', 'type' => '10' }, '5' => { 'algn' => '4', 'name' => 'dummy6', 'type' => '10' }, '6' => { 'algn' => '4', 'name' => 'dummy7', 'type' => '10' }, '7' => { 'algn' => '4', 'name' => 'dummy8', 'type' => '10' }, '8' => { 'algn' => '4', 'name' => 'dummy9', 'type' => '10' }, '9' => { 'algn' => '4', 'name' => 'dummy10', 'type' => '10' } }, 'Name' => 'struct DBusMessageIter', 'Size' => '72', 'Type' => 'Struct' }, '1127' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '43', 'Name' => 'JobReloadReply', 'Size' => '8', 'Type' => 'Typedef' }, '113' => { 'Algn' => '8', 'BaseType' => '142', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '33', 'Name' => 'JobClassProperties', 'Size' => '64', 'Type' => 'Typedef' }, '1192' => { 'Algn' => 8, 'BaseType' => '215', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusInterface const', 'Size' => '32', 'Type' => 'Const' }, '1214' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '41', 'Name' => 'JobRestartReply', 'Size' => '8', 'Type' => 'Typedef' }, '1224' => { 'Algn' => 8, 'BaseType' => '1306', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '74', 'Name' => 'UpstartGetAllReply', 'Size' => '8', 'Type' => 'Typedef' }, '1226' => { 'Algn' => 8, 'BaseType' => '1309', 'Header' => 'com.ubuntu.Upstart.h', 'Name' => 'UpstartProperties**', 'Size' => '8', 'Type' => 'Pointer' }, '124' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*,char*const*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' }, '2' => { 'type' => '277' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '127' => { 'Algn' => 8, 'BaseType' => '132', 'Name' => 'char**', 'Size' => '8', 'Type' => 'Pointer' }, '1277' => { 'Algn' => '8', 'BaseType' => '212', 'Header' => 'dbus_proxy.h', 'Line' => '72', 'Name' => 'NihDBusSignalHandler', 'Size' => '8', 'Type' => 'Typedef' }, '1295' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '39', 'Name' => 'JobStopReply', 'Size' => '8', 'Type' => 'Typedef' }, '130' => { 'Algn' => '1', 'BaseType' => '166', 'Header' => 'dbus-connection.h', 'Line' => '51', 'Name' => 'DBusConnection', 'Type' => 'Typedef' }, '1306' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*,UpstartProperties const*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' }, '2' => { 'type' => '1629' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '1309' => { 'Algn' => '8', 'BaseType' => '1390', 'Header' => 'com.ubuntu.Upstart.h', 'Name' => 'UpstartProperties*', 'Size' => '8', 'Type' => 'Pointer' }, '132' => { 'Algn' => '8', 'BaseType' => '167', 'Name' => 'char*', 'Size' => '8', 'Type' => 'Pointer' }, '1376' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '37', 'Name' => 'JobStartReply', 'Size' => '8', 'Type' => 'Typedef' }, '1390' => { 'Algn' => '8', 'BaseType' => '1473', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '27', 'Name' => 'UpstartProperties', 'Size' => '16', 'Type' => 'Typedef' }, '142' => { 'Algn' => '8', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '24', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'name', 'type' => '132' }, '1' => { 'algn' => '8', 'name' => 'description', 'type' => '132' }, '2' => { 'algn' => '8', 'name' => 'author', 'type' => '132' }, '3' => { 'algn' => '8', 'name' => 'version', 'type' => '132' }, '4' => { 'algn' => '8', 'name' => 'usage', 'type' => '132' }, '5' => { 'algn' => '8', 'name' => 'start_on', 'type' => '98' }, '6' => { 'algn' => '8', 'name' => 'stop_on', 'type' => '98' }, '7' => { 'algn' => '8', 'name' => 'emits', 'type' => '127' } }, 'Name' => 'struct job_class_properties', 'Size' => '64', 'Type' => 'Struct' }, '1467' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '72', 'Name' => 'UpstartSetLogPriorityReply', 'Size' => '8', 'Type' => 'Typedef' }, '1473' => { 'Algn' => '8', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '24', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'version', 'type' => '132' }, '1' => { 'algn' => '8', 'name' => 'log_priority', 'type' => '132' } }, 'Name' => 'struct upstart_properties', 'Size' => '16', 'Type' => 'Struct' }, '1525' => { 'Algn' => 8, 'BaseType' => '1111', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusInterface const*[]', 'Size' => '8', 'Type' => 'Array' }, '1548' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '70', 'Name' => 'UpstartGetLogPriorityReply', 'Size' => '8', 'Type' => 'Typedef' }, '157' => { 'Algn' => 8, 'BaseType' => '192', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '64', 'Name' => 'JobClassGetStopOnReply', 'Size' => '8', 'Type' => 'Typedef' }, '159' => { 'Algn' => 8, 'BaseType' => '98', 'Name' => 'char****', 'Size' => '8', 'Type' => 'Pointer' }, '1627' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '68', 'Name' => 'UpstartGetVersionReply', 'Size' => '8', 'Type' => 'Typedef' }, '1629' => { 'Algn' => '8', 'BaseType' => '1704', 'Header' => 'com.ubuntu.Upstart.h', 'Name' => 'UpstartProperties const*', 'Size' => '8', 'Type' => 'Pointer' }, '163' => { 'Algn' => '1', 'BaseType' => '196', 'Header' => 'dbus_interface.h', 'Line' => '31', 'Name' => 'NihDBusObject', 'Type' => 'Typedef' }, '166' => { 'Algn' => '1', 'Header' => 'dbus-connection.h', 'Line' => '51', 'Name' => 'struct DBusConnection', 'Type' => 'Struct' }, '167' => { 'Algn' => '1', 'Name' => 'char', 'Size' => '1', 'Type' => 'Intrinsic' }, '17' => { 'Algn' => 8, 'BaseType' => '35', 'Name' => 'void const*', 'Size' => '8', 'Type' => 'Pointer' }, '1702' => { 'Algn' => '8', 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '66', 'Name' => 'UpstartRestartedHandler', 'Size' => '8', 'Type' => 'Typedef' }, '1704' => { 'Algn' => '8', 'BaseType' => '1390', 'Header' => 'com.ubuntu.Upstart.h', 'Name' => 'UpstartProperties const', 'Size' => '16', 'Type' => 'Const' }, '1709' => { 'Algn' => '8', 'Artificial' => 1, 'BaseType' => '1473', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '24', 'Name' => 'upstart_properties', 'Size' => '16', 'Type' => 'Typedef' }, '172' => { 'Algn' => '8', 'BaseType' => '210', 'Header' => 'dbus_message.h', 'Name' => 'NihDBusMessage*', 'Size' => '8', 'Type' => 'Pointer' }, '1772' => { 'Algn' => '8', 'BaseType' => '1845', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '64', 'Name' => 'UpstartEventEmittedHandler', 'Size' => '8', 'Type' => 'Typedef' }, '1842' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '58', 'Name' => 'UpstartEndSessionReply', 'Size' => '8', 'Type' => 'Typedef' }, '1845' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*,char const*,char*const*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' }, '2' => { 'type' => '297' }, '3' => { 'type' => '277' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '1848' => { 'Algn' => '8', 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '62', 'Name' => 'UpstartJobRemovedHandler', 'Size' => '8', 'Type' => 'Typedef' }, '1913' => { 'Algn' => '8', 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '60', 'Name' => 'UpstartJobAddedHandler', 'Size' => '8', 'Type' => 'Typedef' }, '192' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*,char**const*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' }, '2' => { 'type' => '373' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '196' => { 'Algn' => '1', 'Header' => 'dbus_interface.h', 'Line' => '31', 'Name' => 'struct nih_dbus_object', 'Type' => 'Struct' }, '2022' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '56', 'Name' => 'UpstartNotifyDbusAddressReply', 'Size' => '8', 'Type' => 'Typedef' }, '2074' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '54', 'Name' => 'UpstartNotifyDiskWriteableReply', 'Size' => '8', 'Type' => 'Typedef' }, '208' => { 'Algn' => 8, 'BaseType' => '192', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '62', 'Name' => 'JobClassGetStartOnReply', 'Size' => '8', 'Type' => 'Typedef' }, '210' => { 'Algn' => '8', 'BaseType' => '248', 'Header' => 'dbus_message.h', 'Line' => '58', 'Name' => 'NihDBusMessage', 'Size' => '16', 'Type' => 'Typedef' }, '211' => { 'Algn' => '8', 'BaseType' => '251', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Name' => 'JobClassProperties const*', 'Size' => '8', 'Type' => 'Pointer' }, '212' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '2129' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '52', 'Name' => 'UpstartEmitEventWithFileReply', 'Size' => '8', 'Type' => 'Typedef' }, '215' => { 'Algn' => '8', 'BaseType' => '253', 'Header' => 'dbus_interface.h', 'Line' => '284', 'Name' => 'NihDBusInterface', 'Size' => '32', 'Type' => 'Typedef' }, '2181' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '50', 'Name' => 'UpstartEmitEventReply', 'Size' => '8', 'Type' => 'Typedef' }, '2231' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '48', 'Name' => 'UpstartResetEnvReply', 'Size' => '8', 'Type' => 'Typedef' }, '2287' => { 'Algn' => 8, 'BaseType' => '124', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '46', 'Name' => 'UpstartListEnvReply', 'Size' => '8', 'Type' => 'Typedef' }, '2346' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '44', 'Name' => 'UpstartUnsetEnvReply', 'Size' => '8', 'Type' => 'Typedef' }, '2403' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '42', 'Name' => 'UpstartSetEnvReply', 'Size' => '8', 'Type' => 'Typedef' }, '245' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '60', 'Name' => 'JobClassGetUsageReply', 'Size' => '8', 'Type' => 'Typedef' }, '2457' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '40', 'Name' => 'UpstartGetEnvReply', 'Size' => '8', 'Type' => 'Typedef' }, '248' => { 'Algn' => '8', 'Header' => 'dbus_message.h', 'Line' => '55', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'connection', 'type' => '102' }, '1' => { 'algn' => '8', 'name' => 'message', 'type' => '341' } }, 'Name' => 'struct nih_dbus_message', 'Size' => '16', 'Type' => 'Struct' }, '251' => { 'Algn' => '8', 'BaseType' => '113', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Name' => 'JobClassProperties const', 'Size' => '64', 'Type' => 'Const' }, '2511' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '38', 'Name' => 'UpstartRestartReply', 'Size' => '8', 'Type' => 'Typedef' }, '253' => { 'Algn' => '8', 'Header' => 'dbus_interface.h', 'Line' => '279', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '1' => { 'algn' => '8', 'name' => 'methods', 'type' => '345' }, '2' => { 'algn' => '8', 'name' => 'signals', 'type' => '393' }, '3' => { 'algn' => '8', 'name' => 'properties', 'type' => '447' } }, 'Name' => 'struct nih_dbus_interface', 'Size' => '32', 'Type' => 'Struct' }, '2562' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '36', 'Name' => 'UpstartGetStateReply', 'Size' => '8', 'Type' => 'Typedef' }, '26' => { 'Algn' => 8, 'BaseType' => '43', 'Header' => 'dbus-connection.h', 'Name' => 'DBusPendingCall*', 'Size' => '8', 'Type' => 'Pointer' }, '2607' => { 'Algn' => 8, 'BaseType' => '124', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '34', 'Name' => 'UpstartGetAllJobsReply', 'Size' => '8', 'Type' => 'Typedef' }, '2653' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '32', 'Name' => 'UpstartGetJobByNameReply', 'Size' => '8', 'Type' => 'Typedef' }, '2698' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.h', 'Line' => '30', 'Name' => 'UpstartReloadConfigurationReply', 'Size' => '8', 'Type' => 'Typedef' }, '277' => { 'Algn' => 8, 'BaseType' => '324', 'Name' => 'char*const*', 'Size' => '8', 'Type' => 'Pointer' }, '285' => { 'Algn' => '8', 'BaseType' => '330', 'Header' => 'dbus_proxy.h', 'Line' => '60', 'Name' => 'NihDBusLostHandler', 'Size' => '8', 'Type' => 'Typedef' }, '288' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*,char const*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' }, '2' => { 'type' => '297' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '291' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '58', 'Name' => 'JobClassGetVersionReply', 'Size' => '8', 'Type' => 'Typedef' }, '297' => { 'Algn' => 8, 'BaseType' => '343', 'Name' => 'char const*', 'Size' => '8', 'Type' => 'Pointer' }, '300' => { 'Algn' => '8', 'BaseType' => '347', 'Header' => 'dbus_interface.h', 'Line' => '263', 'Name' => 'NihDBusProperty', 'Size' => '40', 'Type' => 'Typedef' }, '324' => { 'Algn' => '8', 'BaseType' => '132', 'Name' => 'char*const', 'Size' => '8', 'Type' => 'Const' }, '33' => { 'Algn' => 8, 'BaseType' => '51', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusProxy*', 'Size' => '8', 'Type' => 'Pointer' }, '330' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusProxy*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '33' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '336' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '56', 'Name' => 'JobClassGetAuthorReply', 'Size' => '8', 'Type' => 'Typedef' }, '341' => { 'Algn' => '8', 'BaseType' => '389', 'Header' => 'dbus-message.h', 'Name' => 'DBusMessage*', 'Size' => '8', 'Type' => 'Pointer' }, '343' => { 'Algn' => '1', 'BaseType' => '167', 'Name' => 'char const', 'Size' => '1', 'Type' => 'Const' }, '345' => { 'Algn' => '8', 'BaseType' => '391', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusMethod const*', 'Size' => '8', 'Type' => 'Pointer' }, '347' => { 'Algn' => '8', 'Header' => 'dbus_interface.h', 'Line' => '257', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '1' => { 'algn' => '8', 'name' => 'type', 'type' => '297' }, '2' => { 'algn' => '4', 'name' => 'access', 'type' => '397' }, '3' => { 'algn' => '8', 'name' => 'getter', 'type' => '584' }, '4' => { 'algn' => '8', 'name' => 'setter', 'type' => '651' } }, 'Name' => 'struct nih_dbus_property', 'Size' => '40', 'Type' => 'Struct' }, '35' => { 'Algn' => '1', 'BaseType' => '56', 'Name' => 'void const', 'Type' => 'Const' }, '373' => { 'Algn' => '8', 'BaseType' => '424', 'Name' => 'char**const*', 'Size' => '8', 'Type' => 'Pointer' }, '384' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '54', 'Name' => 'JobClassGetDescriptionReply', 'Size' => '8', 'Type' => 'Typedef' }, '389' => { 'Algn' => '1', 'BaseType' => '441', 'Header' => 'dbus-message.h', 'Line' => '44', 'Name' => 'DBusMessage', 'Type' => 'Typedef' }, '391' => { 'Algn' => '8', 'BaseType' => '506', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusMethod const', 'Size' => '24', 'Type' => 'Const' }, '393' => { 'Algn' => '8', 'BaseType' => '446', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusSignal const*', 'Size' => '8', 'Type' => 'Pointer' }, '397' => { 'Algn' => '4', 'BaseType' => '451', 'Header' => 'dbus_interface.h', 'Line' => '232', 'Name' => 'NihDBusAccess', 'Size' => '4', 'Type' => 'Typedef' }, '407' => { 'Algn' => 8, 'BaseType' => '467', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '59', 'Name' => 'JobGetAllReply', 'Size' => '8', 'Type' => 'Typedef' }, '409' => { 'Algn' => 8, 'BaseType' => '470', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProperties**', 'Size' => '8', 'Type' => 'Pointer' }, '413' => { 'Algn' => '4', 'Header' => 'dbus-shared.h', 'Line' => '71', 'Memb' => { '0' => { 'name' => 'DBUS_HANDLER_RESULT_HANDLED', 'value' => '0' }, '1' => { 'name' => 'DBUS_HANDLER_RESULT_NOT_YET_HANDLED', 'value' => '1' }, '2' => { 'name' => 'DBUS_HANDLER_RESULT_NEED_MEMORY', 'value' => '2' } }, 'Name' => 'enum DBusHandlerResult', 'Size' => '4', 'Type' => 'Enum' }, '424' => { 'Algn' => '8', 'BaseType' => '127', 'Name' => 'char**const', 'Size' => '8', 'Type' => 'Const' }, '43' => { 'Algn' => '1', 'BaseType' => '61', 'Header' => 'dbus-connection.h', 'Line' => '49', 'Name' => 'DBusPendingCall', 'Type' => 'Typedef' }, '433' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '52', 'Name' => 'JobClassGetNameReply', 'Size' => '8', 'Type' => 'Typedef' }, '441' => { 'Algn' => '1', 'Header' => 'dbus-message.h', 'Line' => '44', 'Name' => 'struct DBusMessage', 'Type' => 'Struct' }, '443' => { 'Algn' => '8', 'Header' => 'dbus_interface.h', 'Line' => '191', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '1' => { 'algn' => '8', 'name' => 'args', 'type' => '577' }, '2' => { 'algn' => '8', 'name' => 'handler', 'type' => '643' } }, 'Name' => 'struct nih_dbus_method', 'Size' => '24', 'Type' => 'Struct' }, '446' => { 'Algn' => '8', 'BaseType' => '580', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusSignal const', 'Size' => '24', 'Type' => 'Const' }, '447' => { 'Algn' => '8', 'BaseType' => '513', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusProperty const*', 'Size' => '8', 'Type' => 'Pointer' }, '451' => { 'Algn' => '4', 'Header' => 'dbus_interface.h', 'Line' => '228', 'Memb' => { '0' => { 'name' => 'NIH_DBUS_READ', 'value' => '0' }, '1' => { 'name' => 'NIH_DBUS_WRITE', 'value' => '1' }, '2' => { 'name' => 'NIH_DBUS_READWRITE', 'value' => '2' } }, 'Name' => 'enum nih_dbus_access', 'Size' => '4', 'Type' => 'Enum' }, '467' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*,JobProperties const*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' }, '2' => { 'type' => '733' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '470' => { 'Algn' => '8', 'BaseType' => '538', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProperties*', 'Size' => '8', 'Type' => 'Pointer' }, '493' => { 'Algn' => '8', 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '50', 'Name' => 'JobClassInstanceRemovedHandler', 'Size' => '8', 'Type' => 'Typedef' }, '496' => { 'Algn' => '4', 'Name' => 'unsigned int', 'Size' => '4', 'Type' => 'Intrinsic' }, '506' => { 'Algn' => '8', 'BaseType' => '443', 'Header' => 'dbus_interface.h', 'Line' => '195', 'Name' => 'NihDBusMethod', 'Size' => '24', 'Type' => 'Typedef' }, '51' => { 'Algn' => '8', 'BaseType' => '72', 'Header' => 'dbus_interface.h', 'Line' => '32', 'Name' => 'NihDBusProxy', 'Size' => '56', 'Type' => 'Typedef' }, '510' => { 'Algn' => '8', 'Header' => 'dbus_interface.h', 'Line' => '216', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '1' => { 'algn' => '8', 'name' => 'args', 'type' => '577' }, '2' => { 'algn' => '8', 'name' => 'filter', 'type' => '712' } }, 'Name' => 'struct nih_dbus_signal', 'Size' => '24', 'Type' => 'Struct' }, '513' => { 'Algn' => '8', 'BaseType' => '300', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusProperty const', 'Size' => '40', 'Type' => 'Const' }, '53' => { 'Algn' => 8, 'BaseType' => '77', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '68', 'Name' => 'JobClassGetAllReply', 'Size' => '8', 'Type' => 'Typedef' }, '531' => { 'Algn' => 8, 'BaseType' => '597', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '57', 'Name' => 'JobGetProcessesReply', 'Size' => '8', 'Type' => 'Typedef' }, '533' => { 'Algn' => 8, 'BaseType' => '600', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement***', 'Size' => '8', 'Type' => 'Pointer' }, '538' => { 'Algn' => '8', 'BaseType' => '605', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '34', 'Name' => 'JobProperties', 'Size' => '32', 'Type' => 'Typedef' }, '56' => { 'Algn' => '1', 'Name' => 'void', 'Type' => 'Intrinsic' }, '562' => { 'Algn' => '8', 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '48', 'Name' => 'JobClassInstanceAddedHandler', 'Size' => '8', 'Type' => 'Typedef' }, '577' => { 'Algn' => '8', 'BaseType' => '642', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusArg const*', 'Size' => '8', 'Type' => 'Pointer' }, '58' => { 'Algn' => 8, 'BaseType' => '83', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Name' => 'JobClassProperties**', 'Size' => '8', 'Type' => 'Pointer' }, '580' => { 'Algn' => '8', 'BaseType' => '510', 'Header' => 'dbus_interface.h', 'Line' => '220', 'Name' => 'NihDBusSignal', 'Size' => '24', 'Type' => 'Typedef' }, '584' => { 'Algn' => '8', 'BaseType' => '648', 'Header' => 'dbus_interface.h', 'Line' => '110', 'Name' => 'NihDBusPropertyGetter', 'Size' => '8', 'Type' => 'Typedef' }, '597' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*,JobProcessesElement*const*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' }, '2' => { 'type' => '888' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '600' => { 'Algn' => '8', 'BaseType' => '664', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement**', 'Size' => '8', 'Type' => 'Pointer' }, '605' => { 'Algn' => '8', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '29', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'name', 'type' => '132' }, '1' => { 'algn' => '8', 'name' => 'goal', 'type' => '132' }, '2' => { 'algn' => '8', 'name' => 'state', 'type' => '132' }, '3' => { 'algn' => '8', 'name' => 'processes', 'type' => '600' } }, 'Name' => 'struct job_properties', 'Size' => '32', 'Type' => 'Struct' }, '608' => { 'Algn' => '8', 'Artificial' => 1, 'BaseType' => '142', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '24', 'Name' => 'job_class_properties', 'Size' => '64', 'Type' => 'Typedef' }, '61' => { 'Algn' => '1', 'Header' => 'dbus-connection.h', 'Line' => '49', 'Name' => 'struct DBusPendingCall', 'Type' => 'Struct' }, '625' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '46', 'Name' => 'JobClassRestartReply', 'Size' => '8', 'Type' => 'Typedef' }, '640' => { 'Algn' => '8', 'BaseType' => '702', 'Header' => 'dbus_interface.h', 'Line' => '170', 'Name' => 'NihDBusArg', 'Size' => '24', 'Type' => 'Typedef' }, '642' => { 'Algn' => '8', 'BaseType' => '640', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusArg const', 'Size' => '24', 'Type' => 'Const' }, '643' => { 'Algn' => '8', 'BaseType' => '708', 'Header' => 'dbus_interface.h', 'Line' => '57', 'Name' => 'NihDBusMethodHandler', 'Size' => '8', 'Type' => 'Typedef' }, '648' => { 'Algn' => '8', 'Name' => 'int(*)(NihDBusObject*,NihDBusMessage*,DBusMessageIter*)', 'Param' => { '0' => { 'type' => '793' }, '1' => { 'type' => '172' }, '2' => { 'type' => '962' } }, 'Return' => '10', 'Size' => '8', 'Type' => 'FuncPtr' }, '651' => { 'Algn' => '8', 'BaseType' => '648', 'Header' => 'dbus_interface.h', 'Line' => '138', 'Name' => 'NihDBusPropertySetter', 'Size' => '8', 'Type' => 'Typedef' }, '660' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '55', 'Name' => 'JobGetStateReply', 'Size' => '8', 'Type' => 'Typedef' }, '664' => { 'Algn' => '8', 'BaseType' => '729', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement*', 'Size' => '8', 'Type' => 'Pointer' }, '686' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '44', 'Name' => 'JobClassStopReply', 'Size' => '8', 'Type' => 'Typedef' }, '702' => { 'Algn' => '8', 'Header' => 'dbus_interface.h', 'Line' => '166', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'name', 'type' => '297' }, '1' => { 'algn' => '8', 'name' => 'type', 'type' => '297' }, '2' => { 'algn' => '4', 'name' => 'dir', 'type' => '784' } }, 'Name' => 'struct nih_dbus_arg', 'Size' => '24', 'Type' => 'Struct' }, '708' => { 'Algn' => '8', 'Name' => 'enum DBusHandlerResult(*)(NihDBusObject*,NihDBusMessage*)', 'Param' => { '0' => { 'type' => '793' }, '1' => { 'type' => '172' } }, 'Return' => '413', 'Size' => '8', 'Type' => 'FuncPtr' }, '712' => { 'Algn' => '8', 'BaseType' => '789', 'Header' => 'dbus_interface.h', 'Line' => '82', 'Name' => 'NihDBusSignalFilter', 'Size' => '8', 'Type' => 'Typedef' }, '72' => { 'Algn' => '8', 'Header' => 'dbus_proxy.h', 'Line' => '106', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'connection', 'type' => '102' }, '1' => { 'algn' => '8', 'name' => 'name', 'type' => '132' }, '2' => { 'algn' => '8', 'name' => 'owner', 'type' => '132' }, '3' => { 'algn' => '8', 'name' => 'path', 'type' => '132' }, '4' => { 'algn' => '4', 'name' => 'auto_start', 'type' => '10' }, '5' => { 'algn' => '8', 'name' => 'lost_handler', 'type' => '285' }, '6' => { 'algn' => '8', 'name' => 'data', 'type' => '111' } }, 'Name' => 'struct nih_dbus_proxy', 'Size' => '56', 'Type' => 'Struct' }, '729' => { 'Algn' => '8', 'BaseType' => '806', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '27', 'Name' => 'JobProcessesElement', 'Size' => '16', 'Type' => 'Typedef' }, '731' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '53', 'Name' => 'JobGetGoalReply', 'Size' => '8', 'Type' => 'Typedef' }, '733' => { 'Algn' => '8', 'BaseType' => '812', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProperties const*', 'Size' => '8', 'Type' => 'Pointer' }, '754' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '42', 'Name' => 'JobClassStartReply', 'Size' => '8', 'Type' => 'Typedef' }, '77' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*,JobClassProperties const*)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' }, '2' => { 'type' => '211' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '784' => { 'Algn' => '4', 'BaseType' => '867', 'Header' => 'dbus_interface.h', 'Line' => '151', 'Name' => 'NihDBusArgDir', 'Size' => '4', 'Type' => 'Typedef' }, '789' => { 'Algn' => '8', 'Name' => 'enum DBusHandlerResult(*)(DBusConnection*,DBusMessage*,NihDBusProxySignal*)', 'Param' => { '0' => { 'type' => '102' }, '1' => { 'type' => '341' }, '2' => { 'type' => '1113' } }, 'Return' => '413', 'Size' => '8', 'Type' => 'FuncPtr' }, '793' => { 'Algn' => '8', 'BaseType' => '163', 'Header' => 'dbus_interface.h', 'Name' => 'NihDBusObject*', 'Size' => '8', 'Type' => 'Pointer' }, '80' => { 'Algn' => 8, 'BaseType' => '212', 'Header' => 'dbus_pending_data.h', 'Line' => '75', 'Name' => 'NihDBusErrorHandler', 'Size' => '8', 'Type' => 'Typedef' }, '806' => { 'Algn' => '8', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '24', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'item0', 'type' => '132' }, '1' => { 'algn' => '4', 'name' => 'item1', 'type' => '975' } }, 'Name' => 'struct job_processes_element', 'Size' => '16', 'Type' => 'Struct' }, '810' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '51', 'Name' => 'JobGetNameReply', 'Size' => '8', 'Type' => 'Typedef' }, '812' => { 'Algn' => '8', 'BaseType' => '538', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProperties const', 'Size' => '32', 'Type' => 'Const' }, '83' => { 'Algn' => '8', 'BaseType' => '113', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Name' => 'JobClassProperties*', 'Size' => '8', 'Type' => 'Pointer' }, '833' => { 'Algn' => 8, 'BaseType' => '124', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '40', 'Name' => 'JobClassGetAllInstancesReply', 'Size' => '8', 'Type' => 'Typedef' }, '840' => { 'Algn' => '4', 'BaseType' => '496', 'Header' => 'dbus-arch-deps.h', 'Line' => '49', 'Name' => 'dbus_uint32_t', 'Size' => '4', 'Type' => 'Typedef' }, '867' => { 'Algn' => '4', 'Header' => 'dbus_interface.h', 'Line' => '148', 'Memb' => { '0' => { 'name' => 'NIH_DBUS_ARG_IN', 'value' => '0' }, '1' => { 'name' => 'NIH_DBUS_ARG_OUT', 'value' => '1' } }, 'Name' => 'enum nih_dbus_arg_dir', 'Size' => '4', 'Type' => 'Enum' }, '873' => { 'Algn' => '8', 'BaseType' => '957', 'Header' => 'dbus_interface.h', 'Line' => '33', 'Name' => 'NihDBusProxySignal', 'Size' => '40', 'Type' => 'Typedef' }, '888' => { 'Algn' => '8', 'BaseType' => '973', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement*const*', 'Size' => '8', 'Type' => 'Pointer' }, '892' => { 'Algn' => '8', 'BaseType' => '977', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '49', 'Name' => 'JobFailedHandler', 'Size' => '8', 'Type' => 'Typedef' }, '916' => { 'Algn' => 8, 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '38', 'Name' => 'JobClassGetInstanceByNameReply', 'Size' => '8', 'Type' => 'Typedef' }, '95' => { 'Algn' => 8, 'BaseType' => '124', 'Header' => 'com.ubuntu.Upstart.Job.h', 'Line' => '66', 'Name' => 'JobClassGetEmitsReply', 'Size' => '8', 'Type' => 'Typedef' }, '957' => { 'Algn' => '8', 'Header' => 'dbus_proxy.h', 'Line' => '133', 'Memb' => { '0' => { 'algn' => '8', 'name' => 'proxy', 'type' => '33' }, '1' => { 'algn' => '8', 'name' => 'interface', 'type' => '1111' }, '2' => { 'algn' => '8', 'name' => 'signal', 'type' => '393' }, '3' => { 'algn' => '8', 'name' => 'handler', 'type' => '1277' }, '4' => { 'algn' => '8', 'name' => 'data', 'type' => '111' } }, 'Name' => 'struct nih_dbus_proxy_signal', 'Size' => '40', 'Type' => 'Struct' }, '962' => { 'Algn' => '8', 'BaseType' => '1040', 'Header' => 'dbus-message.h', 'Name' => 'DBusMessageIter*', 'Size' => '8', 'Type' => 'Pointer' }, '973' => { 'Algn' => '8', 'BaseType' => '664', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Name' => 'JobProcessesElement*const', 'Size' => '8', 'Type' => 'Const' }, '975' => { 'Algn' => '4', 'BaseType' => '10', 'Header' => 'stdint.h', 'Line' => '38', 'Name' => 'int32_t', 'Size' => '4', 'Type' => 'Typedef' }, '977' => { 'Algn' => '8', 'Name' => 'void(*)(void*,NihDBusMessage*,int32_t)', 'Param' => { '0' => { 'type' => '111' }, '1' => { 'type' => '172' }, '2' => { 'type' => '975' } }, 'Return' => '56', 'Size' => '8', 'Type' => 'FuncPtr' }, '98' => { 'Algn' => 8, 'BaseType' => '127', 'Name' => 'char***', 'Size' => '8', 'Type' => 'Pointer' }, '980' => { 'Algn' => '8', 'BaseType' => '288', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '47', 'Name' => 'JobStateChangedHandler', 'Size' => '8', 'Type' => 'Typedef' }, '986' => { 'Algn' => '8', 'Artificial' => 1, 'BaseType' => '605', 'Header' => 'com.ubuntu.Upstart.Instance.h', 'Line' => '29', 'Name' => 'job_properties', 'Size' => '32', 'Type' => 'Typedef' } }, 'WordSize' => '8' }; upstart-1.13.2/lib/libupstart-abi.xml.in0000664000175000017500000000220012373101356015035 00000000000000 @libupstart_version@-build @abs_builddir@ @abs_builddir@ /usr/include upstart-1.13.2/lib/upstart/0000775000175000017500000000000012402042416012546 500000000000000upstart-1.13.2/lib/upstart/com.ubuntu.Upstart.Instance.h0000664000175000017500000001153312402042412020141 00000000000000/* upstart * * Copyright (C) 2010 Scott James Remnant . * * This file was automatically generated; see the source for copying * conditions. */ #ifndef UPSTART_UPSTART_COM_UBUNTU_UPSTART_INSTANCE_H #define UPSTART_UPSTART_COM_UBUNTU_UPSTART_INSTANCE_H #include #include #include #include #include #include #include typedef struct job_processes_element { char * item0; int32_t item1; } JobProcessesElement; typedef struct job_properties { char * name; char * goal; char * state; JobProcessesElement **processes; } JobProperties; typedef void (*JobStartReply) (void *data, NihDBusMessage *message); typedef void (*JobStopReply) (void *data, NihDBusMessage *message); typedef void (*JobRestartReply) (void *data, NihDBusMessage *message); typedef void (*JobReloadReply) (void *data, NihDBusMessage *message); typedef void (*JobGoalChangedHandler) (void *data, NihDBusMessage *message, const char *goal); typedef void (*JobStateChangedHandler) (void *data, NihDBusMessage *message, const char *state); typedef void (*JobFailedHandler) (void *data, NihDBusMessage *message, int32_t status); typedef void (*JobGetNameReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*JobGetGoalReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*JobGetStateReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*JobGetProcessesReply) (void *data, NihDBusMessage *message, JobProcessesElement * const *value); typedef void (*JobGetAllReply) (void *data, NihDBusMessage *message, const JobProperties *properties); NIH_BEGIN_EXTERN extern const NihDBusInterface job_com_ubuntu_Upstart0_6_Instance; extern const NihDBusInterface *job_interfaces[]; DBusPendingCall *job_start (NihDBusProxy *proxy, int wait, JobStartReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_start_sync (const void *parent, NihDBusProxy *proxy, int wait) __attribute__ ((warn_unused_result)); DBusPendingCall *job_stop (NihDBusProxy *proxy, int wait, JobStopReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_stop_sync (const void *parent, NihDBusProxy *proxy, int wait) __attribute__ ((warn_unused_result)); DBusPendingCall *job_restart (NihDBusProxy *proxy, int wait, JobRestartReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_restart_sync (const void *parent, NihDBusProxy *proxy, int wait) __attribute__ ((warn_unused_result)); DBusPendingCall *job_reload (NihDBusProxy *proxy, JobReloadReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_reload_sync (const void *parent, NihDBusProxy *proxy) __attribute__ ((warn_unused_result)); DBusPendingCall *job_get_name (NihDBusProxy *proxy, JobGetNameReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_get_name_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_get_goal (NihDBusProxy *proxy, JobGetGoalReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_get_goal_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_get_state (NihDBusProxy *proxy, JobGetStateReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_get_state_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_get_processes (NihDBusProxy *proxy, JobGetProcessesReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_get_processes_sync (const void *parent, NihDBusProxy *proxy, JobProcessesElement ***value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_get_all (NihDBusProxy *proxy, JobGetAllReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_get_all_sync (const void *parent, NihDBusProxy *proxy, JobProperties **properties) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* UPSTART_UPSTART_COM_UBUNTU_UPSTART_INSTANCE_H */ upstart-1.13.2/lib/upstart/com.ubuntu.Upstart.Job.h0000664000175000017500000002002312402042412017101 00000000000000/* upstart * * Copyright (C) 2010 Scott James Remnant . * * This file was automatically generated; see the source for copying * conditions. */ #ifndef UPSTART_UPSTART_COM_UBUNTU_UPSTART_JOB_H #define UPSTART_UPSTART_COM_UBUNTU_UPSTART_JOB_H #include #include #include #include #include #include #include typedef struct job_class_properties { char * name; char * description; char * author; char * version; char * usage; char ***start_on; char ***stop_on; char ** emits; } JobClassProperties; typedef void (*JobClassGetInstanceReply) (void *data, NihDBusMessage *message, const char *instance); typedef void (*JobClassGetInstanceByNameReply) (void *data, NihDBusMessage *message, const char *instance); typedef void (*JobClassGetAllInstancesReply) (void *data, NihDBusMessage *message, char * const *instances); typedef void (*JobClassStartReply) (void *data, NihDBusMessage *message, const char *instance); typedef void (*JobClassStopReply) (void *data, NihDBusMessage *message); typedef void (*JobClassRestartReply) (void *data, NihDBusMessage *message, const char *instance); typedef void (*JobClassInstanceAddedHandler) (void *data, NihDBusMessage *message, const char *instance); typedef void (*JobClassInstanceRemovedHandler) (void *data, NihDBusMessage *message, const char *instance); typedef void (*JobClassGetNameReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*JobClassGetDescriptionReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*JobClassGetAuthorReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*JobClassGetVersionReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*JobClassGetUsageReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*JobClassGetStartOnReply) (void *data, NihDBusMessage *message, char ** const *value); typedef void (*JobClassGetStopOnReply) (void *data, NihDBusMessage *message, char ** const *value); typedef void (*JobClassGetEmitsReply) (void *data, NihDBusMessage *message, char * const *value); typedef void (*JobClassGetAllReply) (void *data, NihDBusMessage *message, const JobClassProperties *properties); NIH_BEGIN_EXTERN extern const NihDBusInterface job_class_com_ubuntu_Upstart0_6_Job; extern const NihDBusInterface *job_class_interfaces[]; DBusPendingCall *job_class_get_instance (NihDBusProxy *proxy, char * const *env, JobClassGetInstanceReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_instance_sync (const void *parent, NihDBusProxy *proxy, char * const *env, char **instance) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_instance_by_name (NihDBusProxy *proxy, const char *name, JobClassGetInstanceByNameReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_instance_by_name_sync (const void *parent, NihDBusProxy *proxy, const char *name, char **instance) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_all_instances (NihDBusProxy *proxy, JobClassGetAllInstancesReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_all_instances_sync (const void *parent, NihDBusProxy *proxy, char ***instances) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_start (NihDBusProxy *proxy, char * const *env, int wait, JobClassStartReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_start_sync (const void *parent, NihDBusProxy *proxy, char * const *env, int wait, char **instance) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_stop (NihDBusProxy *proxy, char * const *env, int wait, JobClassStopReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_stop_sync (const void *parent, NihDBusProxy *proxy, char * const *env, int wait) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_restart (NihDBusProxy *proxy, char * const *env, int wait, JobClassRestartReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_restart_sync (const void *parent, NihDBusProxy *proxy, char * const *env, int wait, char **instance) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_name (NihDBusProxy *proxy, JobClassGetNameReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_name_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_description (NihDBusProxy *proxy, JobClassGetDescriptionReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_description_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_author (NihDBusProxy *proxy, JobClassGetAuthorReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_author_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_version (NihDBusProxy *proxy, JobClassGetVersionReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_version_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_usage (NihDBusProxy *proxy, JobClassGetUsageReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_usage_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_start_on (NihDBusProxy *proxy, JobClassGetStartOnReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_start_on_sync (const void *parent, NihDBusProxy *proxy, char ****value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_stop_on (NihDBusProxy *proxy, JobClassGetStopOnReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_stop_on_sync (const void *parent, NihDBusProxy *proxy, char ****value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_emits (NihDBusProxy *proxy, JobClassGetEmitsReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_emits_sync (const void *parent, NihDBusProxy *proxy, char ***value) __attribute__ ((warn_unused_result)); DBusPendingCall *job_class_get_all (NihDBusProxy *proxy, JobClassGetAllReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int job_class_get_all_sync (const void *parent, NihDBusProxy *proxy, JobClassProperties **properties) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* UPSTART_UPSTART_COM_UBUNTU_UPSTART_JOB_H */ upstart-1.13.2/lib/upstart/com.ubuntu.Upstart.h0000664000175000017500000002741512402042412016404 00000000000000/* upstart * * Copyright (C) 2010 Scott James Remnant . * * This file was automatically generated; see the source for copying * conditions. */ #ifndef UPSTART_UPSTART_COM_UBUNTU_UPSTART_H #define UPSTART_UPSTART_COM_UBUNTU_UPSTART_H #include #include #include #include #include #include #include typedef struct upstart_properties { char *version; char *log_priority; } UpstartProperties; typedef void (*UpstartReloadConfigurationReply) (void *data, NihDBusMessage *message); typedef void (*UpstartGetJobByNameReply) (void *data, NihDBusMessage *message, const char *job); typedef void (*UpstartGetAllJobsReply) (void *data, NihDBusMessage *message, char * const *jobs); typedef void (*UpstartGetStateReply) (void *data, NihDBusMessage *message, const char *state); typedef void (*UpstartRestartReply) (void *data, NihDBusMessage *message); typedef void (*UpstartGetEnvReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*UpstartSetEnvReply) (void *data, NihDBusMessage *message); typedef void (*UpstartSetEnvListReply) (void *data, NihDBusMessage *message); typedef void (*UpstartUnsetEnvReply) (void *data, NihDBusMessage *message); typedef void (*UpstartUnsetEnvListReply) (void *data, NihDBusMessage *message); typedef void (*UpstartListEnvReply) (void *data, NihDBusMessage *message, char * const *env); typedef void (*UpstartResetEnvReply) (void *data, NihDBusMessage *message); typedef void (*UpstartEmitEventReply) (void *data, NihDBusMessage *message); typedef void (*UpstartEmitEventWithFileReply) (void *data, NihDBusMessage *message); typedef void (*UpstartNotifyDiskWriteableReply) (void *data, NihDBusMessage *message); typedef void (*UpstartNotifyDbusAddressReply) (void *data, NihDBusMessage *message); typedef void (*UpstartNotifyCgroupManagerAddressReply) (void *data, NihDBusMessage *message); typedef void (*UpstartEndSessionReply) (void *data, NihDBusMessage *message); typedef void (*UpstartJobAddedHandler) (void *data, NihDBusMessage *message, const char *job); typedef void (*UpstartJobRemovedHandler) (void *data, NihDBusMessage *message, const char *job); typedef void (*UpstartEventEmittedHandler) (void *data, NihDBusMessage *message, const char *name, char * const *env); typedef void (*UpstartRestartedHandler) (void *data, NihDBusMessage *message); typedef void (*UpstartGetVersionReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*UpstartGetLogPriorityReply) (void *data, NihDBusMessage *message, const char *value); typedef void (*UpstartSetLogPriorityReply) (void *data, NihDBusMessage *message); typedef void (*UpstartGetAllReply) (void *data, NihDBusMessage *message, const UpstartProperties *properties); NIH_BEGIN_EXTERN extern const NihDBusInterface upstart_com_ubuntu_Upstart0_6; extern const NihDBusInterface *upstart_interfaces[]; DBusPendingCall *upstart_reload_configuration (NihDBusProxy *proxy, UpstartReloadConfigurationReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_reload_configuration_sync (const void *parent, NihDBusProxy *proxy) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_get_job_by_name (NihDBusProxy *proxy, const char *name, UpstartGetJobByNameReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_get_job_by_name_sync (const void *parent, NihDBusProxy *proxy, const char *name, char **job) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_get_all_jobs (NihDBusProxy *proxy, UpstartGetAllJobsReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_get_all_jobs_sync (const void *parent, NihDBusProxy *proxy, char ***jobs) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_get_state (NihDBusProxy *proxy, UpstartGetStateReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_get_state_sync (const void *parent, NihDBusProxy *proxy, char **state) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_restart (NihDBusProxy *proxy, UpstartRestartReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_restart_sync (const void *parent, NihDBusProxy *proxy) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_get_env (NihDBusProxy *proxy, char * const *job_details, const char *name, UpstartGetEnvReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_get_env_sync (const void *parent, NihDBusProxy *proxy, char * const *job_details, const char *name, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_set_env (NihDBusProxy *proxy, char * const *job_details, const char *var, int replace, UpstartSetEnvReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_set_env_sync (const void *parent, NihDBusProxy *proxy, char * const *job_details, const char *var, int replace) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_set_env_list (NihDBusProxy *proxy, char * const *job_details, char * const *vars, int replace, UpstartSetEnvListReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_set_env_list_sync (const void *parent, NihDBusProxy *proxy, char * const *job_details, char * const *vars, int replace) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_unset_env (NihDBusProxy *proxy, char * const *job_details, const char *name, UpstartUnsetEnvReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_unset_env_sync (const void *parent, NihDBusProxy *proxy, char * const *job_details, const char *name) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_unset_env_list (NihDBusProxy *proxy, char * const *job_details, char * const *name, UpstartUnsetEnvListReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_unset_env_list_sync (const void *parent, NihDBusProxy *proxy, char * const *job_details, char * const *name) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_list_env (NihDBusProxy *proxy, char * const *job_details, UpstartListEnvReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_list_env_sync (const void *parent, NihDBusProxy *proxy, char * const *job_details, char ***env) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_reset_env (NihDBusProxy *proxy, char * const *job_details, UpstartResetEnvReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_reset_env_sync (const void *parent, NihDBusProxy *proxy, char * const *job_details) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_emit_event (NihDBusProxy *proxy, const char *name, char * const *env, int wait, UpstartEmitEventReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_emit_event_sync (const void *parent, NihDBusProxy *proxy, const char *name, char * const *env, int wait) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_emit_event_with_file (NihDBusProxy *proxy, const char *name, char * const *env, int wait, int file, UpstartEmitEventWithFileReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_emit_event_with_file_sync (const void *parent, NihDBusProxy *proxy, const char *name, char * const *env, int wait, int file) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_notify_disk_writeable (NihDBusProxy *proxy, UpstartNotifyDiskWriteableReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_notify_disk_writeable_sync (const void *parent, NihDBusProxy *proxy) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_notify_dbus_address (NihDBusProxy *proxy, const char *address, UpstartNotifyDbusAddressReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_notify_dbus_address_sync (const void *parent, NihDBusProxy *proxy, const char *address) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_notify_cgroup_manager_address (NihDBusProxy *proxy, const char *address, UpstartNotifyCgroupManagerAddressReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_notify_cgroup_manager_address_sync (const void *parent, NihDBusProxy *proxy, const char *address) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_end_session (NihDBusProxy *proxy, UpstartEndSessionReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_end_session_sync (const void *parent, NihDBusProxy *proxy) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_get_version (NihDBusProxy *proxy, UpstartGetVersionReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_get_version_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_get_log_priority (NihDBusProxy *proxy, UpstartGetLogPriorityReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_get_log_priority_sync (const void *parent, NihDBusProxy *proxy, char **value) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_set_log_priority (NihDBusProxy *proxy, const char *value, UpstartSetLogPriorityReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_set_log_priority_sync (const void *parent, NihDBusProxy *proxy, const char *value) __attribute__ ((warn_unused_result)); DBusPendingCall *upstart_get_all (NihDBusProxy *proxy, UpstartGetAllReply handler, NihDBusErrorHandler error_handler, void *data, int timeout) __attribute__ ((warn_unused_result)); int upstart_get_all_sync (const void *parent, NihDBusProxy *proxy, UpstartProperties **properties) __attribute__ ((warn_unused_result)); NIH_END_EXTERN #endif /* UPSTART_UPSTART_COM_UBUNTU_UPSTART_H */ upstart-1.13.2/lib/upstart/upstart-dbus.h0000664000175000017500000000403512402042412015272 00000000000000/* upstart * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef DBUS_UPSTART_H #define DBUS_UPSTART_H /** * DBUS_SERVICE_UPSTART: * * The well-known name used by Upstart on the system bus. **/ #ifndef DBUS_SERVICE_UPSTART # ifdef DEBUG # define DBUS_SERVICE_UPSTART "com.ubuntu.TestUpstart" # else # define DBUS_SERVICE_UPSTART "com.ubuntu.Upstart" # endif #endif /** * DBUS_PATH_UPSTART: * * The object path used by the manager object, and used as the root path * for all other objects. **/ #define DBUS_PATH_UPSTART "/com/ubuntu/Upstart" /** * DBUS_INTERFACE_UPSTART: * * The interface exported by the manager object. **/ #define DBUS_INTERFACE_UPSTART "com.ubuntu.Upstart0_6" /** * DBUS_INTERFACE_UPSTART_JOB: * * The interface exported by job objects. **/ #define DBUS_INTERFACE_UPSTART_JOB "com.ubuntu.Upstart0_6.Job" /** * DBUS_INTERFACE_UPSTART_INSTANCE: * * The interface exported by instance objects. **/ #define DBUS_INTERFACE_UPSTART_INSTANCE "com.ubuntu.Upstart0_6.Instance" /** * DBUS_ADDRESS_UPSTART: * * The address where the private D-Bus server inside Upstart can be * found. **/ #ifndef DBUS_ADDRESS_UPSTART # ifdef DEBUG # define DBUS_ADDRESS_UPSTART "unix:abstract=/com/ubuntu/test_upstart" # else # define DBUS_ADDRESS_UPSTART "unix:abstract=/com/ubuntu/upstart" # endif #endif #endif /* DBUS_UPSTART_H */ upstart-1.13.2/lib/run_abi_checker.sh.in0000664000175000017500000000540112373101356015036 00000000000000#!/bin/sh -e #--------------------------------------------------------------------- # Script to run abi-compliance-checker to ensure ABI not broken. #--------------------------------------------------------------------- # Copyright (C) 2013 Canonical Ltd. # # Author: James Hunt # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # #--------------------------------------------------------------------- die() { msg="$*" echo "ERROR: $msg" >&2 exit 1 } build_dir="@abs_builddir@" source_dir="@abs_srcdir@" acc="@abi_compliance_checker@" acc_descriptor="@abi_build_XML@" libupstart_libtool="@libupstart@" lib_prefix="${libupstart_libtool%.la}" libupstart_lt_version="@libupstart_version@" old_abi="@abi_official@" # convert libtool(1) version to dotted form dotted_version=$(echo "$libupstart_lt_version"|tr ':' '.') libupstart_path="$build_dir/$libupstart_libtool" echo "Checking ABI for $lib_prefix" echo for file in "$libupstart_path" "$old_abi" do [ -f "$file" ] || die "file $file not found" done # Install the library to a temporary location since we need the # full path to the shared library to pass to abi-compliance-checker. install_dir=$(mktemp -d --tmpdir="$build_dir") [ -z "$install_dir" ] && \ die "failed to create temporary install directory" libtool --mode=install install \ "$libupstart_libtool" "$install_dir" >/dev/null 2>&1 abi_dump_dir=$(mktemp -d --tmpdir="$build_dir") [ -z "$abi_dump_dir" ] && \ die "failed to create temporary dump directory" abi_dump_path="$abi_dump_dir/${lib_prefix}_${dotted_version}.abi.tar.gz" installed_so="$install_dir/$(echo "$lib_prefix"|cut -d\. -f1).so" [ -f "$installed_so" ] || die "cannot find $installed_so" # generate a descriptor for the newly-built library version "$acc" -library "$lib_prefix" -dump "$acc_descriptor" -dump-path "$abi_dump_path" new_abi="$abi_dump_dir/${lib_prefix}_${dotted_version}.abi.tar.gz" [ -f "$new_abi" ] || die "cannot find $new_abi" # run the ABI checker "$acc" -library "$lib_prefix" -old "$old_abi" -new "$new_abi" # clean up libtool --mode=uninstall \ rm "$install_dir/$libupstart_libtool" >/dev/null 2>&1 rm -rf "$abi_dump_dir" "$build_dir/logs" "$install_dir" # HTML report generated by $acc rm -rf compat_reports/ upstart-1.13.2/lib/libupstart.la0000664000175000017500000000172712402042416013502 00000000000000# libupstart.la - a libtool library file # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='libupstart.so.1' # Names of this library. library_names='libupstart.so.1.0.0 libupstart.so.1 libupstart.so' # The name of the static archive. old_library='libupstart.a' # Linker flags that can not go in dependency_libs. inherited_linker_flags='' # Libraries that this one depends upon. dependency_libs=' -lnih -lnih-dbus -ldbus-1 -lrt' # Names of additional weak libraries provided by this library weak_library_names='' # Version information for libupstart. current=1 age=0 revision=0 # Is this an already installed library? installed=no # Should we warn about portability when linking against -modules? shouldnotlink=no # Files to dlopen/dlpreopen dlopen='' dlpreopen='' # Directory that this library needs to be installed in: libdir='//lib' upstart-1.13.2/install-sh0000755000175000017500000003325512373101367012240 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: upstart-1.13.2/aclocal.m40000664000175000017500000013037112402042373012065 00000000000000# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for 'mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl FIXME we are no longer going to remove this! adjust warning dnl FIXME message accordingly. AC_DIAGNOSE([obsolete], [$0: this macro is deprecated, and will soon be removed. You should use the Autoconf-provided 'AC][_PROG_MKDIR_P' macro instead, and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.]) dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/gettext.m4]) m4_include([m4/iconv.m4]) m4_include([m4/intlmacosx.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/libnih.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/nls.m4]) m4_include([m4/pkg.m4]) m4_include([m4/po.m4]) m4_include([m4/progtest.m4]) upstart-1.13.2/TODO0000664000175000017500000001176112373101356010722 000000000000001.x series: * going into runlevel S from !S, need to stty console * going into 6, 0 or 1, need to stty console * reset console before S process * we should mark fds and sockets close-on-exec when we create them, rather than later * the fork() pipe should be close-on-exec rather than closing it in the child * init needs to grow "utmp XXX", which maintains INIT_PROCESS and DEAD_PROCESS entries for the given ut_id (3 chars max), used for getty For that we'll probably need to support ${..#...} so that we can do utmp ${TTY#tty} * There's a lot of complicated code that's pretty much duplicated between event_pending_handle_jobs(), job_class_start(), job_class_stop(), job_class_restart(), job_class_get_instance() and to a lesser extent, job_start(), job_stop() and job_restart(). We should make an effort to reduce this to common functions, which may become easier as we rationalise the behaviour anyway. * It may be useful to not just have failed=TRUE/FALSE for job_finished() but a more detailed reason about why the job is being unblocked, so the command could exit saying "ok", "failed", "stopped by event", etc. * It would also be nice, in the case of a job having failed, to be able to include the event-like information in the error. This should be possible, it just needs a marshalling function? (Maybe we should be able to generate those) * Information about what caused a job to stop (failed information or event) should be available to other jobs, and to the job's post-stop script. * I'm still not convinced that just clearing blocking is the right approach, and still think we need some kind of next_blocking list of things that will still be blocked next time around. Restores some of the older behaviour in that "start" will block until stopped, and fail with the fact it was stopped. * Need to add dependencies to jobs, which are files that must exist before the job can be started (because Debian/Ubuntu like to litter config files like jobs) * Resources, "uses cpu 1.0" -- where cpu has a defined max (default 1.0); which state do we keep it in while it's waiting? Later: * Restore serialisation of state between upstart processes, I guess we'll use a D-Bus API to do this. Most sense would be a peer-to-peer D-Bus connection so don't need the bus (think initramfs), but we also need to pass over the bus connection so we don't drop that. - Pass the Event queue first since Jobs refer to it - Register each ConfSource, ConfFile, JobClass and Job, setting the status of each - Join up the Event queue and Job structures - What about commends blocked on event emissions or jobs? Anytime: * Iterating through every Job's start and stop events is messy; we should have some kind of match lookup table to make it easier. * Likewise iterating through all the Jobs to find a pid is messy; we should have a lookup table for these too. Ideally we'd have a JobProcess structure combining type, pid and a link to the job -- then all the job_process_* functions would just accept those * system_setup_console is due for an overhaul as well; especially if we want to be able to pass file descriptors in. Am somewhat tempted to add a magic CONSOLE_DEFAULT option which tries fd, logging, null, etc. * We always want /dev/fd/NNN to be /dev/fd/3, we should have some way to instruct process_spawn to do that. * We may need to KILL scripts, e.g. post-start; especially when the goal changes. Or perhaps just after a timeout? * May need a way to force ignoring of the KILL signal, and assuming that a job that won't die really has. * Get the LANG environment variable somehow. Future Features: * Roles; services define roles that they can perform ("web server") and can be found by their role. Other jobs could require that a role be performed for them to start (creeping into deps here). Use affinity tags to work out which of many services to start. * Per-user services; will need to use PAM to set up the session. We want to do this for "root-user services" but not for jobs/tasks * Passing of file descriptors from event over control socket. * Register jobs over the control socket, ideal way is to register some kind of automatic source and attach them to that. * Temporal events ("15m after startup") * Scheduled times ("every day at 3:00") * Load average checking, maybe have separate CPU, Network and I/O stats? See also resources. * Actions: "reload" and optional replacements for "stop", "start", etc. This is mostly just a matter of deciding policy for when they can be run, and adding "user processes" onto the end of the job->process array. * Alternative script interpreters; "start script python". Would be done by making script a char *, and putting the interpreter into command? * Watershed jobs (this actually might apply to events, since you might want to try starting again if a particular event has come in since you were last started) upstart-1.13.2/dbus/0000775000175000017500000000000012402042411011226 500000000000000upstart-1.13.2/dbus/Makefile.in0000664000175000017500000003662112402042374013233 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = dbus DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_dbus1system_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libnih.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(dbus1systemdir)" DATA = $(dist_dbus1system_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABI_COMPLIANCE_CHECKER = @ABI_COMPLIANCE_CHECKER@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGMANAGER_CFLAGS = @CGMANAGER_CFLAGS@ CGMANAGER_LIBS = @CGMANAGER_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DCONF_CFLAGS = @DCONF_CFLAGS@ DCONF_LIBS = @DCONF_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GIO_CFLAGS = @GIO_CFLAGS@ GIO_LIBS = @GIO_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ JSON_CFLAGS = @JSON_CFLAGS@ JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NIH_CFLAGS = @NIH_CFLAGS@ NIH_DBUS_CFLAGS = @NIH_DBUS_CFLAGS@ NIH_DBUS_LIBS = @NIH_DBUS_LIBS@ NIH_DBUS_TOOL = @NIH_DBUS_TOOL@ NIH_LIBS = @NIH_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_COPYRIGHT = @PACKAGE_COPYRIGHT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ dbus1systemdir = $(sysconfdir)/dbus-1/system.d dist_dbus1system_DATA = \ Upstart.conf EXTRA_DIST = \ upstart.h \ com.ubuntu.Upstart.xml \ com.ubuntu.Upstart.Job.xml \ com.ubuntu.Upstart.Instance.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu dbus/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu dbus/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_dbus1systemDATA: $(dist_dbus1system_DATA) @$(NORMAL_INSTALL) @list='$(dist_dbus1system_DATA)'; test -n "$(dbus1systemdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dbus1systemdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dbus1systemdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbus1systemdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dbus1systemdir)" || exit $$?; \ done uninstall-dist_dbus1systemDATA: @$(NORMAL_UNINSTALL) @list='$(dist_dbus1system_DATA)'; test -n "$(dbus1systemdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(dbus1systemdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(dbus1systemdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_dbus1systemDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_dbus1systemDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_dbus1systemDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_dbus1systemDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: upstart-1.13.2/dbus/Makefile.am0000664000175000017500000000041112373101356013211 00000000000000## Process this file with automake to produce Makefile.in dbus1systemdir = $(sysconfdir)/dbus-1/system.d dist_dbus1system_DATA = \ Upstart.conf EXTRA_DIST = \ upstart.h \ com.ubuntu.Upstart.xml \ com.ubuntu.Upstart.Job.xml \ com.ubuntu.Upstart.Instance.xml upstart-1.13.2/dbus/com.ubuntu.Upstart.Job.xml0000664000175000017500000000564212373101356016163 00000000000000 upstart-1.13.2/dbus/Upstart.conf0000664000175000017500000000450112373101356013472 00000000000000 upstart-1.13.2/dbus/com.ubuntu.Upstart.xml0000664000175000017500000001026512373101356015447 00000000000000 upstart-1.13.2/dbus/upstart.h0000664000175000017500000000403512373101356013036 00000000000000/* upstart * * Copyright © 2010 Canonical Ltd. * Author: Scott James Remnant . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef DBUS_UPSTART_H #define DBUS_UPSTART_H /** * DBUS_SERVICE_UPSTART: * * The well-known name used by Upstart on the system bus. **/ #ifndef DBUS_SERVICE_UPSTART # ifdef DEBUG # define DBUS_SERVICE_UPSTART "com.ubuntu.TestUpstart" # else # define DBUS_SERVICE_UPSTART "com.ubuntu.Upstart" # endif #endif /** * DBUS_PATH_UPSTART: * * The object path used by the manager object, and used as the root path * for all other objects. **/ #define DBUS_PATH_UPSTART "/com/ubuntu/Upstart" /** * DBUS_INTERFACE_UPSTART: * * The interface exported by the manager object. **/ #define DBUS_INTERFACE_UPSTART "com.ubuntu.Upstart0_6" /** * DBUS_INTERFACE_UPSTART_JOB: * * The interface exported by job objects. **/ #define DBUS_INTERFACE_UPSTART_JOB "com.ubuntu.Upstart0_6.Job" /** * DBUS_INTERFACE_UPSTART_INSTANCE: * * The interface exported by instance objects. **/ #define DBUS_INTERFACE_UPSTART_INSTANCE "com.ubuntu.Upstart0_6.Instance" /** * DBUS_ADDRESS_UPSTART: * * The address where the private D-Bus server inside Upstart can be * found. **/ #ifndef DBUS_ADDRESS_UPSTART # ifdef DEBUG # define DBUS_ADDRESS_UPSTART "unix:abstract=/com/ubuntu/test_upstart" # else # define DBUS_ADDRESS_UPSTART "unix:abstract=/com/ubuntu/upstart" # endif #endif #endif /* DBUS_UPSTART_H */ upstart-1.13.2/dbus/com.ubuntu.Upstart.Instance.xml0000664000175000017500000000375412373101356017217 00000000000000 upstart-1.13.2/config.guess0000755000175000017500000012355012373101367012552 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: upstart-1.13.2/AUTHORS0000664000175000017500000000103112373101356011267 00000000000000upstart was written by Scott James Remnant . The following people provided invaluable help with the design, better ideas or just listened attentively at the right time: Colin Watson Erik Troan Johan Kiviniemi Jerry Haltom The upstart logo was designed by: Alexandre Vassalotti A complete list of contributors to the code can be obtained from the ChangeLog file. Many thanks to them all.